mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-27 22:24:11 +08:00
platform-drivers-x86 for v6.6-5
Highlights: - Fix spurious brightness down presses on newer Asus laptop models - Fix backlight control not working on T2 Mac Pro all-in-ones - Add Armin Wolf as new maintainer for the WMI bus driver and change its status from orphaned to maintained - A few other small fixes The following is an automated git shortlog grouped by driver: Merge tag 'platform-drivers-x86-mellanox-init-v6.6' into fixes: - Merge tag 'platform-drivers-x86-mellanox-init-v6.6' into fixes apple-gmux: - Hard Code max brightness for MMIO gmux asus-wmi: - Map 0x2a code, Ignore 0x2b and 0x2c events - Only map brightness codes when using asus-wmi backlight control - Change ASUS_WMI_BRN_DOWN code from 0x20 to 0x2e intel-uncore-freq: - Conditionally create attribute for read frequency msi-ec: - Fix the 3rd config platform: - mellanox: Fix a resource leak in an error handling path in probing flow platform/mellanox: - mlxbf-tmfifo: Fix a warning message platform/surface: - platform_profile: Propagate error if profile registration fails wmi: - Update MAINTAINERS entry -----BEGIN PGP SIGNATURE----- iQFIBAABCAAyFiEEuvA7XScYQRpenhd+kuxHeUQDJ9wFAmUzmu4UHGhkZWdvZWRl QHJlZGhhdC5jb20ACgkQkuxHeUQDJ9zJgAf+OgB6pmTQ02l39zQFcCXKIkpIitVU ibtA1whUU57BFAyK7ZOnq2YfoPoh3yqFNTISdeCUDmtqKJxeh0RdKOXvtcKkCvz9 kQXesZ10Sn+/OsqwJRZjJR96F+NW7FVKyxxnlYqE6r+ipuadEvFF9TkswzM4WYWM 9yJJ4SwBLNV9x3vtt5RR6iqpon4FVl2O4X58cHu09zK4Wv3saaUYOCQpad+WLPbm C+XnhSVqHLbedmMos8Odo0mMcWLceH92BX2v9hhNgYX37w+UBjNTTs/4Me1IXpXb /JVrExv9SkzzCPT2q21/Mmj+iUHhq1Qyd0uF6PVuqXqHs0utV95W9kv6PQ== =bvMu -----END PGP SIGNATURE----- Merge tag 'platform-drivers-x86-v6.6-5' of git://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86 Pull x86 platform driver fixes from Hans de Goede: - Fix spurious brightness down presses on newer Asus laptop models - Fix backlight control not working on T2 Mac Pro all-in-ones - Add Armin Wolf as new maintainer for the WMI bus driver and change its status from orphaned to maintained - A few other small fixes * tag 'platform-drivers-x86-v6.6-5' of git://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86: platform/mellanox: mlxbf-tmfifo: Fix a warning message apple-gmux: Hard Code max brightness for MMIO gmux platform/surface: platform_profile: Propagate error if profile registration fails platform/x86: asus-wmi: Map 0x2a code, Ignore 0x2b and 0x2c events platform/x86: asus-wmi: Only map brightness codes when using asus-wmi backlight control platform/x86: asus-wmi: Change ASUS_WMI_BRN_DOWN code from 0x20 to 0x2e platform/x86: wmi: Update MAINTAINERS entry platform/x86: msi-ec: Fix the 3rd config platform/x86: intel-uncore-freq: Conditionally create attribute for read frequency platform: mellanox: Fix a resource leak in an error handling path in probing flow
This commit is contained in:
commit
f51de61ce7
@ -378,8 +378,9 @@ F: drivers/acpi/viot.c
|
||||
F: include/linux/acpi_viot.h
|
||||
|
||||
ACPI WMI DRIVER
|
||||
M: Armin Wolf <W_Armin@gmx.de>
|
||||
L: platform-driver-x86@vger.kernel.org
|
||||
S: Orphan
|
||||
S: Maintained
|
||||
F: Documentation/driver-api/wmi.rst
|
||||
F: Documentation/wmi/
|
||||
F: drivers/platform/x86/wmi.c
|
||||
|
@ -609,24 +609,25 @@ static void mlxbf_tmfifo_rxtx_word(struct mlxbf_tmfifo_vring *vring,
|
||||
|
||||
if (vring->cur_len + sizeof(u64) <= len) {
|
||||
/* The whole word. */
|
||||
if (!IS_VRING_DROP(vring)) {
|
||||
if (is_rx)
|
||||
if (is_rx) {
|
||||
if (!IS_VRING_DROP(vring))
|
||||
memcpy(addr + vring->cur_len, &data,
|
||||
sizeof(u64));
|
||||
else
|
||||
memcpy(&data, addr + vring->cur_len,
|
||||
sizeof(u64));
|
||||
} else {
|
||||
memcpy(&data, addr + vring->cur_len,
|
||||
sizeof(u64));
|
||||
}
|
||||
vring->cur_len += sizeof(u64);
|
||||
} else {
|
||||
/* Leftover bytes. */
|
||||
if (!IS_VRING_DROP(vring)) {
|
||||
if (is_rx)
|
||||
if (is_rx) {
|
||||
if (!IS_VRING_DROP(vring))
|
||||
memcpy(addr + vring->cur_len, &data,
|
||||
len - vring->cur_len);
|
||||
else
|
||||
memcpy(&data, addr + vring->cur_len,
|
||||
len - vring->cur_len);
|
||||
} else {
|
||||
data = 0;
|
||||
memcpy(&data, addr + vring->cur_len,
|
||||
len - vring->cur_len);
|
||||
}
|
||||
vring->cur_len = len;
|
||||
}
|
||||
|
@ -159,8 +159,7 @@ static int surface_platform_profile_probe(struct ssam_device *sdev)
|
||||
set_bit(PLATFORM_PROFILE_BALANCED_PERFORMANCE, tpd->handler.choices);
|
||||
set_bit(PLATFORM_PROFILE_PERFORMANCE, tpd->handler.choices);
|
||||
|
||||
platform_profile_register(&tpd->handler);
|
||||
return 0;
|
||||
return platform_profile_register(&tpd->handler);
|
||||
}
|
||||
|
||||
static void surface_platform_profile_remove(struct ssam_device *sdev)
|
||||
|
@ -105,6 +105,8 @@ struct apple_gmux_config {
|
||||
#define GMUX_BRIGHTNESS_MASK 0x00ffffff
|
||||
#define GMUX_MAX_BRIGHTNESS GMUX_BRIGHTNESS_MASK
|
||||
|
||||
# define MMIO_GMUX_MAX_BRIGHTNESS 0xffff
|
||||
|
||||
static u8 gmux_pio_read8(struct apple_gmux_data *gmux_data, int port)
|
||||
{
|
||||
return inb(gmux_data->iostart + port);
|
||||
@ -857,7 +859,17 @@ get_version:
|
||||
|
||||
memset(&props, 0, sizeof(props));
|
||||
props.type = BACKLIGHT_PLATFORM;
|
||||
props.max_brightness = gmux_read32(gmux_data, GMUX_PORT_MAX_BRIGHTNESS);
|
||||
|
||||
/*
|
||||
* All MMIO gmux's have 0xffff as max brightness, but some iMacs incorrectly
|
||||
* report 0x03ff, despite the firmware being happy to set 0xffff as the brightness
|
||||
* at boot. Force 0xffff for all MMIO gmux's so they all have the correct brightness
|
||||
* range.
|
||||
*/
|
||||
if (type == APPLE_GMUX_TYPE_MMIO)
|
||||
props.max_brightness = MMIO_GMUX_MAX_BRIGHTNESS;
|
||||
else
|
||||
props.max_brightness = gmux_read32(gmux_data, GMUX_PORT_MAX_BRIGHTNESS);
|
||||
|
||||
#if IS_REACHABLE(CONFIG_ACPI_VIDEO)
|
||||
register_bdev = acpi_video_get_backlight_type() == acpi_backlight_apple_gmux;
|
||||
|
@ -531,6 +531,9 @@ static void asus_nb_wmi_quirks(struct asus_wmi_driver *driver)
|
||||
static const struct key_entry asus_nb_wmi_keymap[] = {
|
||||
{ KE_KEY, ASUS_WMI_BRN_DOWN, { KEY_BRIGHTNESSDOWN } },
|
||||
{ KE_KEY, ASUS_WMI_BRN_UP, { KEY_BRIGHTNESSUP } },
|
||||
{ KE_KEY, 0x2a, { KEY_SELECTIVE_SCREENSHOT } },
|
||||
{ KE_IGNORE, 0x2b, }, /* PrintScreen (also send via PS/2) on newer models */
|
||||
{ KE_IGNORE, 0x2c, }, /* CapsLock (also send via PS/2) on newer models */
|
||||
{ KE_KEY, 0x30, { KEY_VOLUMEUP } },
|
||||
{ KE_KEY, 0x31, { KEY_VOLUMEDOWN } },
|
||||
{ KE_KEY, 0x32, { KEY_MUTE } },
|
||||
|
@ -3826,7 +3826,6 @@ static void asus_wmi_handle_event_code(int code, struct asus_wmi *asus)
|
||||
{
|
||||
unsigned int key_value = 1;
|
||||
bool autorelease = 1;
|
||||
int orig_code = code;
|
||||
|
||||
if (asus->driver->key_filter) {
|
||||
asus->driver->key_filter(asus->driver, &code, &key_value,
|
||||
@ -3835,16 +3834,10 @@ static void asus_wmi_handle_event_code(int code, struct asus_wmi *asus)
|
||||
return;
|
||||
}
|
||||
|
||||
if (code >= NOTIFY_BRNUP_MIN && code <= NOTIFY_BRNUP_MAX)
|
||||
code = ASUS_WMI_BRN_UP;
|
||||
else if (code >= NOTIFY_BRNDOWN_MIN && code <= NOTIFY_BRNDOWN_MAX)
|
||||
code = ASUS_WMI_BRN_DOWN;
|
||||
|
||||
if (code == ASUS_WMI_BRN_DOWN || code == ASUS_WMI_BRN_UP) {
|
||||
if (acpi_video_get_backlight_type() == acpi_backlight_vendor) {
|
||||
asus_wmi_backlight_notify(asus, orig_code);
|
||||
return;
|
||||
}
|
||||
if (acpi_video_get_backlight_type() == acpi_backlight_vendor &&
|
||||
code >= NOTIFY_BRNUP_MIN && code <= NOTIFY_BRNDOWN_MAX) {
|
||||
asus_wmi_backlight_notify(asus, code);
|
||||
return;
|
||||
}
|
||||
|
||||
if (code == NOTIFY_KBD_BRTUP) {
|
||||
|
@ -18,7 +18,7 @@
|
||||
#include <linux/i8042.h>
|
||||
|
||||
#define ASUS_WMI_KEY_IGNORE (-1)
|
||||
#define ASUS_WMI_BRN_DOWN 0x20
|
||||
#define ASUS_WMI_BRN_DOWN 0x2e
|
||||
#define ASUS_WMI_BRN_UP 0x2f
|
||||
|
||||
struct module;
|
||||
|
@ -176,7 +176,7 @@ show_uncore_data(initial_max_freq_khz);
|
||||
|
||||
static int create_attr_group(struct uncore_data *data, char *name)
|
||||
{
|
||||
int ret, index = 0;
|
||||
int ret, freq, index = 0;
|
||||
|
||||
init_attribute_rw(max_freq_khz);
|
||||
init_attribute_rw(min_freq_khz);
|
||||
@ -197,7 +197,11 @@ static int create_attr_group(struct uncore_data *data, char *name)
|
||||
data->uncore_attrs[index++] = &data->min_freq_khz_dev_attr.attr;
|
||||
data->uncore_attrs[index++] = &data->initial_min_freq_khz_dev_attr.attr;
|
||||
data->uncore_attrs[index++] = &data->initial_max_freq_khz_dev_attr.attr;
|
||||
data->uncore_attrs[index++] = &data->current_freq_khz_dev_attr.attr;
|
||||
|
||||
ret = uncore_read_freq(data, &freq);
|
||||
if (!ret)
|
||||
data->uncore_attrs[index++] = &data->current_freq_khz_dev_attr.attr;
|
||||
|
||||
data->uncore_attrs[index] = NULL;
|
||||
|
||||
data->uncore_attr_group.name = name;
|
||||
|
@ -6514,6 +6514,7 @@ static int mlxplat_i2c_main_init(struct mlxplat_priv *priv)
|
||||
return 0;
|
||||
|
||||
fail_mlxplat_i2c_mux_topology_init:
|
||||
platform_device_unregister(priv->pdev_i2c);
|
||||
fail_platform_i2c_register:
|
||||
fail_mlxplat_mlxcpld_verify_bus_topology:
|
||||
return err;
|
||||
@ -6521,6 +6522,7 @@ fail_mlxplat_mlxcpld_verify_bus_topology:
|
||||
|
||||
static void mlxplat_i2c_main_exit(struct mlxplat_priv *priv)
|
||||
{
|
||||
mlxplat_pre_exit(priv);
|
||||
mlxplat_i2c_mux_topology_exit(priv);
|
||||
if (priv->pdev_i2c)
|
||||
platform_device_unregister(priv->pdev_i2c);
|
||||
@ -6597,7 +6599,7 @@ static int mlxplat_probe(struct platform_device *pdev)
|
||||
|
||||
fail_register_reboot_notifier:
|
||||
fail_regcache_sync:
|
||||
mlxplat_pre_exit(priv);
|
||||
mlxplat_i2c_main_exit(priv);
|
||||
fail_mlxplat_i2c_main_init:
|
||||
fail_regmap_write:
|
||||
fail_alloc:
|
||||
@ -6614,7 +6616,6 @@ static int mlxplat_remove(struct platform_device *pdev)
|
||||
pm_power_off = NULL;
|
||||
if (mlxplat_reboot_nb)
|
||||
unregister_reboot_notifier(mlxplat_reboot_nb);
|
||||
mlxplat_pre_exit(priv);
|
||||
mlxplat_i2c_main_exit(priv);
|
||||
mlxplat_post_exit();
|
||||
return 0;
|
||||
|
@ -276,14 +276,13 @@ static struct msi_ec_conf CONF2 __initdata = {
|
||||
|
||||
static const char * const ALLOWED_FW_3[] __initconst = {
|
||||
"1592EMS1.111",
|
||||
"E1592IMS.10C",
|
||||
NULL
|
||||
};
|
||||
|
||||
static struct msi_ec_conf CONF3 __initdata = {
|
||||
.allowed_fw = ALLOWED_FW_3,
|
||||
.charge_control = {
|
||||
.address = 0xef,
|
||||
.address = 0xd7,
|
||||
.offset_start = 0x8a,
|
||||
.offset_end = 0x80,
|
||||
.range_min = 0x8a,
|
||||
|
Loading…
Reference in New Issue
Block a user