mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
synced 2025-01-18 06:15:12 +00:00
platform-drivers-x86 for v6.7-3
Highlights: - asus-wmi: Solve i8042 filter resource handling, input, and suspend issues - wmi: Skip zero instance WMI blocks to avoid issues with some laptops - mlxbf-bootctl: Differentiate dev/production keys - platform/surface: Correct serdev related return value to avoid leaking errno into userspace - Error checking fixes The following is an automated shortlog grouped by driver: asus-wmi: - Change q500a_i8042_filter() into a generic i8042-filter - disable USB0 hub on ROG Ally before suspend - Filter Volume key presses if also reported via atkbd - Move i8042 filter install to shared asus-wmi code mellanox: - Add null pointer checks for devm_kasprintf() - Check devm_hwmon_device_register_with_groups() return value mlxbf-bootctl: - correctly identify secure boot with development keys surface: aggregator: - fix recv_buf() return value wmi: - Skip blocks with zero instances -----BEGIN PGP SIGNATURE----- iHUEABYIAB0WIQSCSUwRdwTNL2MhaBlZrE9hU+XOMQUCZXC60QAKCRBZrE9hU+XO McbwAPwIlGYIdYzUXGVGCrCBq7wtBR8ADfFqIa42hUlkDyZ4tAEA8LgrZutAFwhq 35kVk6FSwrUGuIhX5TkxTxnp814nzwE= =iiB1 -----END PGP SIGNATURE----- Merge tag 'platform-drivers-x86-v6.7-3' into pdx86/for-next Back merge pdx86 fixes into pdx86/for-next for further WMI work depending on some of the fixes. platform-drivers-x86 for v6.7-3 Highlights: - asus-wmi: Solve i8042 filter resource handling, input, and suspend issues - wmi: Skip zero instance WMI blocks to avoid issues with some laptops - mlxbf-bootctl: Differentiate dev/production keys - platform/surface: Correct serdev related return value to avoid leaking errno into userspace - Error checking fixes The following is an automated shortlog grouped by driver: asus-wmi: - Change q500a_i8042_filter() into a generic i8042-filter - disable USB0 hub on ROG Ally before suspend - Filter Volume key presses if also reported via atkbd - Move i8042 filter install to shared asus-wmi code mellanox: - Add null pointer checks for devm_kasprintf() - Check devm_hwmon_device_register_with_groups() return value mlxbf-bootctl: - correctly identify secure boot with development keys surface: aggregator: - fix recv_buf() return value wmi: - Skip blocks with zero instances
This commit is contained in:
commit
23e652467d
@ -11025,7 +11025,6 @@ F: drivers/net/wireless/intel/iwlwifi/
|
||||
|
||||
INTEL WMI SLIM BOOTLOADER (SBL) FIRMWARE UPDATE DRIVER
|
||||
M: Jithu Joseph <jithu.joseph@intel.com>
|
||||
R: Maurice Ma <maurice.ma@intel.com>
|
||||
S: Maintained
|
||||
W: https://slimbootloader.github.io/security/firmware-update.html
|
||||
F: drivers/platform/x86/intel/wmi/sbl-fw-update.c
|
||||
@ -13779,7 +13778,6 @@ F: drivers/net/ethernet/mellanox/mlxfw/
|
||||
MELLANOX HARDWARE PLATFORM SUPPORT
|
||||
M: Hans de Goede <hdegoede@redhat.com>
|
||||
M: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
|
||||
M: Mark Gross <markgross@kernel.org>
|
||||
M: Vadim Pasternak <vadimp@nvidia.com>
|
||||
L: platform-driver-x86@vger.kernel.org
|
||||
S: Supported
|
||||
@ -14388,7 +14386,6 @@ F: drivers/platform/surface/surface_gpe.c
|
||||
MICROSOFT SURFACE HARDWARE PLATFORM SUPPORT
|
||||
M: Hans de Goede <hdegoede@redhat.com>
|
||||
M: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
|
||||
M: Mark Gross <markgross@kernel.org>
|
||||
M: Maximilian Luz <luzmaximilian@gmail.com>
|
||||
L: platform-driver-x86@vger.kernel.org
|
||||
S: Maintained
|
||||
@ -23654,7 +23651,6 @@ F: drivers/platform/x86/x86-android-tablets/
|
||||
X86 PLATFORM DRIVERS
|
||||
M: Hans de Goede <hdegoede@redhat.com>
|
||||
M: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
|
||||
M: Mark Gross <markgross@kernel.org>
|
||||
L: platform-driver-x86@vger.kernel.org
|
||||
S: Maintained
|
||||
Q: https://patchwork.kernel.org/project/platform-driver-x86/list/
|
||||
|
@ -20,6 +20,7 @@
|
||||
|
||||
#define MLXBF_BOOTCTL_SB_SECURE_MASK 0x03
|
||||
#define MLXBF_BOOTCTL_SB_TEST_MASK 0x0c
|
||||
#define MLXBF_BOOTCTL_SB_DEV_MASK BIT(4)
|
||||
|
||||
#define MLXBF_SB_KEY_NUM 4
|
||||
|
||||
@ -40,11 +41,18 @@ static struct mlxbf_bootctl_name boot_names[] = {
|
||||
{ MLXBF_BOOTCTL_NONE, "none" },
|
||||
};
|
||||
|
||||
enum {
|
||||
MLXBF_BOOTCTL_SB_LIFECYCLE_PRODUCTION = 0,
|
||||
MLXBF_BOOTCTL_SB_LIFECYCLE_GA_SECURE = 1,
|
||||
MLXBF_BOOTCTL_SB_LIFECYCLE_GA_NON_SECURE = 2,
|
||||
MLXBF_BOOTCTL_SB_LIFECYCLE_RMA = 3
|
||||
};
|
||||
|
||||
static const char * const mlxbf_bootctl_lifecycle_states[] = {
|
||||
[0] = "Production",
|
||||
[1] = "GA Secured",
|
||||
[2] = "GA Non-Secured",
|
||||
[3] = "RMA",
|
||||
[MLXBF_BOOTCTL_SB_LIFECYCLE_PRODUCTION] = "Production",
|
||||
[MLXBF_BOOTCTL_SB_LIFECYCLE_GA_SECURE] = "GA Secured",
|
||||
[MLXBF_BOOTCTL_SB_LIFECYCLE_GA_NON_SECURE] = "GA Non-Secured",
|
||||
[MLXBF_BOOTCTL_SB_LIFECYCLE_RMA] = "RMA",
|
||||
};
|
||||
|
||||
/* Log header format. */
|
||||
@ -247,25 +255,30 @@ static ssize_t second_reset_action_store(struct device *dev,
|
||||
static ssize_t lifecycle_state_show(struct device *dev,
|
||||
struct device_attribute *attr, char *buf)
|
||||
{
|
||||
int status_bits;
|
||||
int use_dev_key;
|
||||
int test_state;
|
||||
int lc_state;
|
||||
|
||||
lc_state = mlxbf_bootctl_smc(MLXBF_BOOTCTL_GET_TBB_FUSE_STATUS,
|
||||
MLXBF_BOOTCTL_FUSE_STATUS_LIFECYCLE);
|
||||
if (lc_state < 0)
|
||||
return lc_state;
|
||||
status_bits = mlxbf_bootctl_smc(MLXBF_BOOTCTL_GET_TBB_FUSE_STATUS,
|
||||
MLXBF_BOOTCTL_FUSE_STATUS_LIFECYCLE);
|
||||
if (status_bits < 0)
|
||||
return status_bits;
|
||||
|
||||
lc_state &=
|
||||
MLXBF_BOOTCTL_SB_TEST_MASK | MLXBF_BOOTCTL_SB_SECURE_MASK;
|
||||
use_dev_key = status_bits & MLXBF_BOOTCTL_SB_DEV_MASK;
|
||||
test_state = status_bits & MLXBF_BOOTCTL_SB_TEST_MASK;
|
||||
lc_state = status_bits & MLXBF_BOOTCTL_SB_SECURE_MASK;
|
||||
|
||||
/*
|
||||
* If the test bits are set, we specify that the current state may be
|
||||
* due to using the test bits.
|
||||
*/
|
||||
if (lc_state & MLXBF_BOOTCTL_SB_TEST_MASK) {
|
||||
lc_state &= MLXBF_BOOTCTL_SB_SECURE_MASK;
|
||||
|
||||
if (test_state) {
|
||||
return sprintf(buf, "%s(test)\n",
|
||||
mlxbf_bootctl_lifecycle_states[lc_state]);
|
||||
} else if (use_dev_key &&
|
||||
(lc_state == MLXBF_BOOTCTL_SB_LIFECYCLE_GA_SECURE)) {
|
||||
return sprintf(buf, "Secured (development)\n");
|
||||
}
|
||||
|
||||
return sprintf(buf, "%s\n", mlxbf_bootctl_lifecycle_states[lc_state]);
|
||||
|
@ -1771,6 +1771,8 @@ static int mlxbf_pmc_init_perftype_counter(struct device *dev, int blk_num)
|
||||
attr->dev_attr.show = mlxbf_pmc_event_list_show;
|
||||
attr->nr = blk_num;
|
||||
attr->dev_attr.attr.name = devm_kasprintf(dev, GFP_KERNEL, "event_list");
|
||||
if (!attr->dev_attr.attr.name)
|
||||
return -ENOMEM;
|
||||
pmc->block[blk_num].block_attr[i] = &attr->dev_attr.attr;
|
||||
attr = NULL;
|
||||
|
||||
@ -1784,6 +1786,8 @@ static int mlxbf_pmc_init_perftype_counter(struct device *dev, int blk_num)
|
||||
attr->nr = blk_num;
|
||||
attr->dev_attr.attr.name = devm_kasprintf(dev, GFP_KERNEL,
|
||||
"enable");
|
||||
if (!attr->dev_attr.attr.name)
|
||||
return -ENOMEM;
|
||||
pmc->block[blk_num].block_attr[++i] = &attr->dev_attr.attr;
|
||||
attr = NULL;
|
||||
}
|
||||
@ -1810,6 +1814,8 @@ static int mlxbf_pmc_init_perftype_counter(struct device *dev, int blk_num)
|
||||
attr->nr = blk_num;
|
||||
attr->dev_attr.attr.name = devm_kasprintf(dev, GFP_KERNEL,
|
||||
"counter%d", j);
|
||||
if (!attr->dev_attr.attr.name)
|
||||
return -ENOMEM;
|
||||
pmc->block[blk_num].block_attr[++i] = &attr->dev_attr.attr;
|
||||
attr = NULL;
|
||||
|
||||
@ -1821,6 +1827,8 @@ static int mlxbf_pmc_init_perftype_counter(struct device *dev, int blk_num)
|
||||
attr->nr = blk_num;
|
||||
attr->dev_attr.attr.name = devm_kasprintf(dev, GFP_KERNEL,
|
||||
"event%d", j);
|
||||
if (!attr->dev_attr.attr.name)
|
||||
return -ENOMEM;
|
||||
pmc->block[blk_num].block_attr[++i] = &attr->dev_attr.attr;
|
||||
attr = NULL;
|
||||
}
|
||||
@ -1853,6 +1861,8 @@ static int mlxbf_pmc_init_perftype_reg(struct device *dev, int blk_num)
|
||||
attr->nr = blk_num;
|
||||
attr->dev_attr.attr.name = devm_kasprintf(dev, GFP_KERNEL,
|
||||
events[j].evt_name);
|
||||
if (!attr->dev_attr.attr.name)
|
||||
return -ENOMEM;
|
||||
pmc->block[blk_num].block_attr[i] = &attr->dev_attr.attr;
|
||||
attr = NULL;
|
||||
i++;
|
||||
@ -1882,6 +1892,8 @@ static int mlxbf_pmc_create_groups(struct device *dev, int blk_num)
|
||||
pmc->block[blk_num].block_attr_grp.attrs = pmc->block[blk_num].block_attr;
|
||||
pmc->block[blk_num].block_attr_grp.name = devm_kasprintf(
|
||||
dev, GFP_KERNEL, pmc->block_name[blk_num]);
|
||||
if (!pmc->block[blk_num].block_attr_grp.name)
|
||||
return -ENOMEM;
|
||||
pmc->groups[pmc->group_num] = &pmc->block[blk_num].block_attr_grp;
|
||||
pmc->group_num++;
|
||||
|
||||
@ -2063,6 +2075,8 @@ static int mlxbf_pmc_probe(struct platform_device *pdev)
|
||||
|
||||
pmc->hwmon_dev = devm_hwmon_device_register_with_groups(
|
||||
dev, "bfperf", pmc, pmc->groups);
|
||||
if (IS_ERR(pmc->hwmon_dev))
|
||||
return PTR_ERR(pmc->hwmon_dev);
|
||||
platform_set_drvdata(pdev, pmc);
|
||||
|
||||
return 0;
|
||||
|
@ -231,9 +231,12 @@ static int ssam_receive_buf(struct serdev_device *dev, const unsigned char *buf,
|
||||
size_t n)
|
||||
{
|
||||
struct ssam_controller *ctrl;
|
||||
int ret;
|
||||
|
||||
ctrl = serdev_device_get_drvdata(dev);
|
||||
return ssam_controller_receive_buf(ctrl, buf, n);
|
||||
ret = ssam_controller_receive_buf(ctrl, buf, n);
|
||||
|
||||
return ret < 0 ? 0 : ret;
|
||||
}
|
||||
|
||||
static void ssam_write_wakeup(struct serdev_device *dev)
|
||||
|
@ -265,6 +265,7 @@ config ASUS_WMI
|
||||
depends on RFKILL || RFKILL = n
|
||||
depends on HOTPLUG_PCI
|
||||
depends on ACPI_VIDEO || ACPI_VIDEO = n
|
||||
depends on SERIO_I8042 || SERIO_I8042 = n
|
||||
select INPUT_SPARSEKMAP
|
||||
select LEDS_CLASS
|
||||
select NEW_LEDS
|
||||
@ -281,7 +282,6 @@ config ASUS_WMI
|
||||
config ASUS_NB_WMI
|
||||
tristate "Asus Notebook WMI Driver"
|
||||
depends on ASUS_WMI
|
||||
depends on SERIO_I8042 || SERIO_I8042 = n
|
||||
help
|
||||
This is a driver for newer Asus notebooks. It adds extra features
|
||||
like wireless radio and bluetooth control, leds, hotkeys, backlight...
|
||||
|
@ -964,33 +964,6 @@ static const struct pci_device_id pmc_pci_ids[] = {
|
||||
{ }
|
||||
};
|
||||
|
||||
static int amd_pmc_get_dram_size(struct amd_pmc_dev *dev)
|
||||
{
|
||||
int ret;
|
||||
|
||||
switch (dev->cpu_id) {
|
||||
case AMD_CPU_ID_YC:
|
||||
if (!(dev->major > 90 || (dev->major == 90 && dev->minor > 39))) {
|
||||
ret = -EINVAL;
|
||||
goto err_dram_size;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
ret = -EINVAL;
|
||||
goto err_dram_size;
|
||||
}
|
||||
|
||||
ret = amd_pmc_send_cmd(dev, S2D_DRAM_SIZE, &dev->dram_size, dev->s2d_msg_id, true);
|
||||
if (ret || !dev->dram_size)
|
||||
goto err_dram_size;
|
||||
|
||||
return 0;
|
||||
|
||||
err_dram_size:
|
||||
dev_err(dev->dev, "DRAM size command not supported for this platform\n");
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int amd_pmc_s2d_init(struct amd_pmc_dev *dev)
|
||||
{
|
||||
u32 phys_addr_low, phys_addr_hi;
|
||||
@ -1009,8 +982,8 @@ static int amd_pmc_s2d_init(struct amd_pmc_dev *dev)
|
||||
return -EIO;
|
||||
|
||||
/* Get DRAM size */
|
||||
ret = amd_pmc_get_dram_size(dev);
|
||||
if (ret)
|
||||
ret = amd_pmc_send_cmd(dev, S2D_DRAM_SIZE, &dev->dram_size, dev->s2d_msg_id, true);
|
||||
if (ret || !dev->dram_size)
|
||||
dev->dram_size = S2D_TELEMETRY_DRAMBYTES_MAX;
|
||||
|
||||
/* Get STB DRAM address */
|
||||
|
@ -48,25 +48,43 @@ module_param(tablet_mode_sw, uint, 0444);
|
||||
MODULE_PARM_DESC(tablet_mode_sw, "Tablet mode detect: -1:auto 0:disable 1:kbd-dock 2:lid-flip 3:lid-flip-rog");
|
||||
|
||||
static struct quirk_entry *quirks;
|
||||
static bool atkbd_reports_vol_keys;
|
||||
|
||||
static bool asus_q500a_i8042_filter(unsigned char data, unsigned char str,
|
||||
struct serio *port)
|
||||
static bool asus_i8042_filter(unsigned char data, unsigned char str, struct serio *port)
|
||||
{
|
||||
static bool extended;
|
||||
bool ret = false;
|
||||
static bool extended_e0;
|
||||
static bool extended_e1;
|
||||
|
||||
if (str & I8042_STR_AUXDATA)
|
||||
return false;
|
||||
|
||||
if (unlikely(data == 0xe1)) {
|
||||
extended = true;
|
||||
ret = true;
|
||||
} else if (unlikely(extended)) {
|
||||
extended = false;
|
||||
ret = true;
|
||||
if (quirks->filter_i8042_e1_extended_codes) {
|
||||
if (data == 0xe1) {
|
||||
extended_e1 = true;
|
||||
return true;
|
||||
}
|
||||
|
||||
if (extended_e1) {
|
||||
extended_e1 = false;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return ret;
|
||||
if (data == 0xe0) {
|
||||
extended_e0 = true;
|
||||
} else if (extended_e0) {
|
||||
extended_e0 = false;
|
||||
|
||||
switch (data & 0x7f) {
|
||||
case 0x20: /* e0 20 / e0 a0, Volume Mute press / release */
|
||||
case 0x2e: /* e0 2e / e0 ae, Volume Down press / release */
|
||||
case 0x30: /* e0 30 / e0 b0, Volume Up press / release */
|
||||
atkbd_reports_vol_keys = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
static struct quirk_entry quirk_asus_unknown = {
|
||||
@ -75,7 +93,7 @@ static struct quirk_entry quirk_asus_unknown = {
|
||||
};
|
||||
|
||||
static struct quirk_entry quirk_asus_q500a = {
|
||||
.i8042_filter = asus_q500a_i8042_filter,
|
||||
.filter_i8042_e1_extended_codes = true,
|
||||
.wmi_backlight_set_devstate = true,
|
||||
};
|
||||
|
||||
@ -503,8 +521,6 @@ static const struct dmi_system_id asus_quirks[] = {
|
||||
|
||||
static void asus_nb_wmi_quirks(struct asus_wmi_driver *driver)
|
||||
{
|
||||
int ret;
|
||||
|
||||
quirks = &quirk_asus_unknown;
|
||||
dmi_check_system(asus_quirks);
|
||||
|
||||
@ -519,15 +535,6 @@ static void asus_nb_wmi_quirks(struct asus_wmi_driver *driver)
|
||||
|
||||
if (tablet_mode_sw != -1)
|
||||
quirks->tablet_switch_mode = tablet_mode_sw;
|
||||
|
||||
if (quirks->i8042_filter) {
|
||||
ret = i8042_install_filter(quirks->i8042_filter);
|
||||
if (ret) {
|
||||
pr_warn("Unable to install key filter\n");
|
||||
return;
|
||||
}
|
||||
pr_info("Using i8042 filter function for receiving events\n");
|
||||
}
|
||||
}
|
||||
|
||||
static const struct key_entry asus_nb_wmi_keymap[] = {
|
||||
@ -617,6 +624,13 @@ static void asus_nb_wmi_key_filter(struct asus_wmi_driver *asus_wmi, int *code,
|
||||
if (acpi_video_handles_brightness_key_presses())
|
||||
*code = ASUS_WMI_KEY_IGNORE;
|
||||
|
||||
break;
|
||||
case 0x30: /* Volume Up */
|
||||
case 0x31: /* Volume Down */
|
||||
case 0x32: /* Volume Mute */
|
||||
if (atkbd_reports_vol_keys)
|
||||
*code = ASUS_WMI_KEY_IGNORE;
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -630,6 +644,7 @@ static struct asus_wmi_driver asus_nb_wmi_driver = {
|
||||
.input_phys = ASUS_NB_WMI_FILE "/input0",
|
||||
.detect_quirks = asus_nb_wmi_quirks,
|
||||
.key_filter = asus_nb_wmi_key_filter,
|
||||
.i8042_filter = asus_i8042_filter,
|
||||
};
|
||||
|
||||
|
||||
|
@ -16,6 +16,7 @@
|
||||
#include <linux/acpi.h>
|
||||
#include <linux/backlight.h>
|
||||
#include <linux/debugfs.h>
|
||||
#include <linux/delay.h>
|
||||
#include <linux/dmi.h>
|
||||
#include <linux/fb.h>
|
||||
#include <linux/hwmon.h>
|
||||
@ -132,6 +133,11 @@ module_param(fnlock_default, bool, 0444);
|
||||
#define ASUS_SCREENPAD_BRIGHT_MAX 255
|
||||
#define ASUS_SCREENPAD_BRIGHT_DEFAULT 60
|
||||
|
||||
/* Controls the power state of the USB0 hub on ROG Ally which input is on */
|
||||
#define ASUS_USB0_PWR_EC0_CSEE "\\_SB.PCI0.SBRG.EC0.CSEE"
|
||||
/* 300ms so far seems to produce a reliable result on AC and battery */
|
||||
#define ASUS_USB0_PWR_EC0_CSEE_WAIT 300
|
||||
|
||||
static const char * const ashs_ids[] = { "ATK4001", "ATK4002", NULL };
|
||||
|
||||
static int throttle_thermal_policy_write(struct asus_wmi *);
|
||||
@ -300,6 +306,9 @@ struct asus_wmi {
|
||||
|
||||
bool fnlock_locked;
|
||||
|
||||
/* The ROG Ally device requires the MCU USB device be disconnected before suspend */
|
||||
bool ally_mcu_usb_switch;
|
||||
|
||||
struct asus_wmi_debug debug;
|
||||
|
||||
struct asus_wmi_driver *driver;
|
||||
@ -4488,6 +4497,8 @@ static int asus_wmi_add(struct platform_device *pdev)
|
||||
asus->nv_temp_tgt_available = asus_wmi_dev_is_present(asus, ASUS_WMI_DEVID_NV_THERM_TARGET);
|
||||
asus->panel_overdrive_available = asus_wmi_dev_is_present(asus, ASUS_WMI_DEVID_PANEL_OD);
|
||||
asus->mini_led_mode_available = asus_wmi_dev_is_present(asus, ASUS_WMI_DEVID_MINI_LED_MODE);
|
||||
asus->ally_mcu_usb_switch = acpi_has_method(NULL, ASUS_USB0_PWR_EC0_CSEE)
|
||||
&& dmi_match(DMI_BOARD_NAME, "RC71L");
|
||||
|
||||
err = fan_boost_mode_check_present(asus);
|
||||
if (err)
|
||||
@ -4567,6 +4578,12 @@ static int asus_wmi_add(struct platform_device *pdev)
|
||||
goto fail_wmi_handler;
|
||||
}
|
||||
|
||||
if (asus->driver->i8042_filter) {
|
||||
err = i8042_install_filter(asus->driver->i8042_filter);
|
||||
if (err)
|
||||
pr_warn("Unable to install key filter - %d\n", err);
|
||||
}
|
||||
|
||||
asus_wmi_battery_init(asus);
|
||||
|
||||
asus_wmi_debugfs_init(asus);
|
||||
@ -4603,6 +4620,8 @@ static void asus_wmi_remove(struct platform_device *device)
|
||||
struct asus_wmi *asus;
|
||||
|
||||
asus = platform_get_drvdata(device);
|
||||
if (asus->driver->i8042_filter)
|
||||
i8042_remove_filter(asus->driver->i8042_filter);
|
||||
wmi_remove_notify_handler(asus->driver->event_guid);
|
||||
asus_wmi_backlight_exit(asus);
|
||||
asus_screenpad_exit(asus);
|
||||
@ -4653,6 +4672,43 @@ static int asus_hotk_resume(struct device *device)
|
||||
asus_wmi_fnlock_update(asus);
|
||||
|
||||
asus_wmi_tablet_mode_get_state(asus);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int asus_hotk_resume_early(struct device *device)
|
||||
{
|
||||
struct asus_wmi *asus = dev_get_drvdata(device);
|
||||
|
||||
if (asus->ally_mcu_usb_switch) {
|
||||
if (ACPI_FAILURE(acpi_execute_simple_method(NULL, ASUS_USB0_PWR_EC0_CSEE, 0xB8)))
|
||||
dev_err(device, "ROG Ally MCU failed to connect USB dev\n");
|
||||
else
|
||||
msleep(ASUS_USB0_PWR_EC0_CSEE_WAIT);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int asus_hotk_prepare(struct device *device)
|
||||
{
|
||||
struct asus_wmi *asus = dev_get_drvdata(device);
|
||||
int result, err;
|
||||
|
||||
if (asus->ally_mcu_usb_switch) {
|
||||
/* When powersave is enabled it causes many issues with resume of USB hub */
|
||||
result = asus_wmi_get_devstate_simple(asus, ASUS_WMI_DEVID_MCU_POWERSAVE);
|
||||
if (result == 1) {
|
||||
dev_warn(device, "MCU powersave enabled, disabling to prevent resume issues");
|
||||
err = asus_wmi_set_devstate(ASUS_WMI_DEVID_MCU_POWERSAVE, 0, &result);
|
||||
if (err || result != 1)
|
||||
dev_err(device, "Failed to set MCU powersave mode: %d\n", err);
|
||||
}
|
||||
/* sleep required to ensure USB0 is disabled before sleep continues */
|
||||
if (ACPI_FAILURE(acpi_execute_simple_method(NULL, ASUS_USB0_PWR_EC0_CSEE, 0xB7)))
|
||||
dev_err(device, "ROG Ally MCU failed to disconnect USB dev\n");
|
||||
else
|
||||
msleep(ASUS_USB0_PWR_EC0_CSEE_WAIT);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -4700,6 +4756,8 @@ static const struct dev_pm_ops asus_pm_ops = {
|
||||
.thaw = asus_hotk_thaw,
|
||||
.restore = asus_hotk_restore,
|
||||
.resume = asus_hotk_resume,
|
||||
.resume_early = asus_hotk_resume_early,
|
||||
.prepare = asus_hotk_prepare,
|
||||
};
|
||||
|
||||
/* Registration ***************************************************************/
|
||||
|
@ -39,6 +39,7 @@ struct quirk_entry {
|
||||
bool wmi_backlight_set_devstate;
|
||||
bool wmi_force_als_set;
|
||||
bool wmi_ignore_fan;
|
||||
bool filter_i8042_e1_extended_codes;
|
||||
enum asus_wmi_tablet_switch_mode tablet_switch_mode;
|
||||
int wapf;
|
||||
/*
|
||||
@ -49,9 +50,6 @@ struct quirk_entry {
|
||||
*/
|
||||
int no_display_toggle;
|
||||
u32 xusb2pr;
|
||||
|
||||
bool (*i8042_filter)(unsigned char data, unsigned char str,
|
||||
struct serio *serio);
|
||||
};
|
||||
|
||||
struct asus_wmi_driver {
|
||||
@ -73,6 +71,9 @@ struct asus_wmi_driver {
|
||||
* Return ASUS_WMI_KEY_IGNORE in code if event should be ignored. */
|
||||
void (*key_filter) (struct asus_wmi_driver *driver, int *code,
|
||||
unsigned int *value, bool *autorelease);
|
||||
/* Optional standard i8042 filter */
|
||||
bool (*i8042_filter)(unsigned char data, unsigned char str,
|
||||
struct serio *serio);
|
||||
|
||||
int (*probe) (struct platform_device *device);
|
||||
void (*detect_quirks) (struct asus_wmi_driver *driver);
|
||||
|
@ -588,17 +588,14 @@ static void release_attributes_data(void)
|
||||
static int hp_add_other_attributes(int attr_type)
|
||||
{
|
||||
struct kobject *attr_name_kobj;
|
||||
union acpi_object *obj = NULL;
|
||||
int ret;
|
||||
char *attr_name;
|
||||
|
||||
mutex_lock(&bioscfg_drv.mutex);
|
||||
|
||||
attr_name_kobj = kzalloc(sizeof(*attr_name_kobj), GFP_KERNEL);
|
||||
if (!attr_name_kobj) {
|
||||
ret = -ENOMEM;
|
||||
goto err_other_attr_init;
|
||||
}
|
||||
if (!attr_name_kobj)
|
||||
return -ENOMEM;
|
||||
|
||||
mutex_lock(&bioscfg_drv.mutex);
|
||||
|
||||
/* Check if attribute type is supported */
|
||||
switch (attr_type) {
|
||||
@ -615,14 +612,14 @@ static int hp_add_other_attributes(int attr_type)
|
||||
default:
|
||||
pr_err("Error: Unknown attr_type: %d\n", attr_type);
|
||||
ret = -EINVAL;
|
||||
goto err_other_attr_init;
|
||||
kfree(attr_name_kobj);
|
||||
goto unlock_drv_mutex;
|
||||
}
|
||||
|
||||
ret = kobject_init_and_add(attr_name_kobj, &attr_name_ktype,
|
||||
NULL, "%s", attr_name);
|
||||
if (ret) {
|
||||
pr_err("Error encountered [%d]\n", ret);
|
||||
kobject_put(attr_name_kobj);
|
||||
goto err_other_attr_init;
|
||||
}
|
||||
|
||||
@ -630,27 +627,26 @@ static int hp_add_other_attributes(int attr_type)
|
||||
switch (attr_type) {
|
||||
case HPWMI_SECURE_PLATFORM_TYPE:
|
||||
ret = hp_populate_secure_platform_data(attr_name_kobj);
|
||||
if (ret)
|
||||
goto err_other_attr_init;
|
||||
break;
|
||||
|
||||
case HPWMI_SURE_START_TYPE:
|
||||
ret = hp_populate_sure_start_data(attr_name_kobj);
|
||||
if (ret)
|
||||
goto err_other_attr_init;
|
||||
break;
|
||||
|
||||
default:
|
||||
ret = -EINVAL;
|
||||
goto err_other_attr_init;
|
||||
}
|
||||
|
||||
if (ret)
|
||||
goto err_other_attr_init;
|
||||
|
||||
mutex_unlock(&bioscfg_drv.mutex);
|
||||
return 0;
|
||||
|
||||
err_other_attr_init:
|
||||
kobject_put(attr_name_kobj);
|
||||
unlock_drv_mutex:
|
||||
mutex_unlock(&bioscfg_drv.mutex);
|
||||
kfree(obj);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@ -1425,18 +1425,17 @@ static int ideapad_kbd_bl_init(struct ideapad_private *priv)
|
||||
if (WARN_ON(priv->kbd_bl.initialized))
|
||||
return -EEXIST;
|
||||
|
||||
brightness = ideapad_kbd_bl_brightness_get(priv);
|
||||
if (brightness < 0)
|
||||
return brightness;
|
||||
|
||||
priv->kbd_bl.last_brightness = brightness;
|
||||
|
||||
if (ideapad_kbd_bl_check_tristate(priv->kbd_bl.type)) {
|
||||
priv->kbd_bl.led.max_brightness = 2;
|
||||
} else {
|
||||
priv->kbd_bl.led.max_brightness = 1;
|
||||
}
|
||||
|
||||
brightness = ideapad_kbd_bl_brightness_get(priv);
|
||||
if (brightness < 0)
|
||||
return brightness;
|
||||
|
||||
priv->kbd_bl.last_brightness = brightness;
|
||||
priv->kbd_bl.led.name = "platform::" LED_FUNCTION_KBD_BACKLIGHT;
|
||||
priv->kbd_bl.led.brightness_get = ideapad_kbd_bl_led_cdev_brightness_get;
|
||||
priv->kbd_bl.led.brightness_set_blocking = ideapad_kbd_bl_led_cdev_brightness_set;
|
||||
|
@ -102,7 +102,7 @@ static const struct telemetry_core_ops telm_defpltops = {
|
||||
/**
|
||||
* telemetry_update_events() - Update telemetry Configuration
|
||||
* @pss_evtconfig: PSS related config. No change if num_evts = 0.
|
||||
* @pss_evtconfig: IOSS related config. No change if num_evts = 0.
|
||||
* @ioss_evtconfig: IOSS related config. No change if num_evts = 0.
|
||||
*
|
||||
* This API updates the IOSS & PSS Telemetry configuration. Old config
|
||||
* is overwritten. Call telemetry_reset_events when logging is over
|
||||
@ -176,7 +176,7 @@ EXPORT_SYMBOL_GPL(telemetry_reset_events);
|
||||
/**
|
||||
* telemetry_get_eventconfig() - Returns the pss and ioss events enabled
|
||||
* @pss_evtconfig: Pointer to PSS related configuration.
|
||||
* @pss_evtconfig: Pointer to IOSS related configuration.
|
||||
* @ioss_evtconfig: Pointer to IOSS related configuration.
|
||||
* @pss_len: Number of u32 elements allocated for pss_evtconfig array
|
||||
* @ioss_len: Number of u32 elements allocated for ioss_evtconfig array
|
||||
*
|
||||
|
@ -1346,6 +1346,11 @@ static int parse_wdg(struct device *wmi_bus_dev, struct platform_device *pdev)
|
||||
if (debug_dump_wdg)
|
||||
wmi_dump_wdg(&gblock[i]);
|
||||
|
||||
if (!gblock[i].instance_count) {
|
||||
dev_info(wmi_bus_dev, FW_INFO "%pUL has zero instances\n", &gblock[i].guid);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (guid_already_parsed_for_legacy(device, &gblock[i].guid))
|
||||
continue;
|
||||
|
||||
|
@ -114,6 +114,9 @@
|
||||
/* Charging mode - 1=Barrel, 2=USB */
|
||||
#define ASUS_WMI_DEVID_CHARGE_MODE 0x0012006C
|
||||
|
||||
/* MCU powersave mode */
|
||||
#define ASUS_WMI_DEVID_MCU_POWERSAVE 0x001200E2
|
||||
|
||||
/* epu is connected? 1 == true */
|
||||
#define ASUS_WMI_DEVID_EGPU_CONNECTED 0x00090018
|
||||
/* egpu on/off */
|
||||
|
Loading…
x
Reference in New Issue
Block a user