Commit 2a347a06 authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'platform-drivers-x86-v5.19-4' of...

Merge tag 'platform-drivers-x86-v5.19-4' of git://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86

Pull x86 platform driver fixes from Hans de Goede:
 "Highlights:

   - Fix brightness key events getting reported twice on some Dells.
     Regression caused by recent Panasonic hotkey fixes

   - Fix poweroff no longer working on some devices regression caused
     by recent poweroff handler rework

   - Mark new (in 5.19) Intel IFS driver as broken, because of some
     issues surrounding the userspace (sysfs) API which need to be
     cleared up

   - Some hardware-id / quirk additions"

* tag 'platform-drivers-x86-v5.19-4' of git://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86:
  ACPI: video: Fix acpi_video_handles_brightness_key_presses()
  platform/x86: intel_atomisp2_led: Also turn off the always-on camera LED on the Asus T100TAF
  platform/x86/intel/ifs: Mark as BROKEN
  platform/x86: asus-wmi: Add key mappings
  efi: Fix efi_power_off() not being run before acpi_power_off() when necessary
  platform/x86: x86-android-tablets: Fix Lenovo Yoga Tablet 2 830/1050 poweroff again
  platform/x86: gigabyte-wmi: add support for B660I AORUS PRO DDR4
  platform/x86/amd/pmc: Add new platform support
  platform/x86/amd/pmc: Add new acpi id for PMC controller
parents 339f74e3 5ad26161
...@@ -73,7 +73,7 @@ module_param(device_id_scheme, bool, 0444); ...@@ -73,7 +73,7 @@ module_param(device_id_scheme, bool, 0444);
static int only_lcd = -1; static int only_lcd = -1;
module_param(only_lcd, int, 0444); module_param(only_lcd, int, 0444);
static bool has_backlight; static bool may_report_brightness_keys;
static int register_count; static int register_count;
static DEFINE_MUTEX(register_count_mutex); static DEFINE_MUTEX(register_count_mutex);
static DEFINE_MUTEX(video_list_lock); static DEFINE_MUTEX(video_list_lock);
...@@ -1224,7 +1224,7 @@ acpi_video_bus_get_one_device(struct acpi_device *device, ...@@ -1224,7 +1224,7 @@ acpi_video_bus_get_one_device(struct acpi_device *device,
acpi_video_device_find_cap(data); acpi_video_device_find_cap(data);
if (data->cap._BCM && data->cap._BCL) if (data->cap._BCM && data->cap._BCL)
has_backlight = true; may_report_brightness_keys = true;
mutex_lock(&video->device_list_lock); mutex_lock(&video->device_list_lock);
list_add_tail(&data->entry, &video->video_device_list); list_add_tail(&data->entry, &video->video_device_list);
...@@ -1693,6 +1693,9 @@ static void acpi_video_device_notify(acpi_handle handle, u32 event, void *data) ...@@ -1693,6 +1693,9 @@ static void acpi_video_device_notify(acpi_handle handle, u32 event, void *data)
break; break;
} }
if (keycode)
may_report_brightness_keys = true;
acpi_notifier_call_chain(device, event, 0); acpi_notifier_call_chain(device, event, 0);
if (keycode && (report_key_events & REPORT_BRIGHTNESS_KEY_EVENTS)) { if (keycode && (report_key_events & REPORT_BRIGHTNESS_KEY_EVENTS)) {
...@@ -2253,7 +2256,7 @@ void acpi_video_unregister(void) ...@@ -2253,7 +2256,7 @@ void acpi_video_unregister(void)
if (register_count) { if (register_count) {
acpi_bus_unregister_driver(&acpi_video_bus); acpi_bus_unregister_driver(&acpi_video_bus);
register_count = 0; register_count = 0;
has_backlight = false; may_report_brightness_keys = false;
} }
mutex_unlock(&register_count_mutex); mutex_unlock(&register_count_mutex);
} }
...@@ -2275,7 +2278,7 @@ void acpi_video_unregister_backlight(void) ...@@ -2275,7 +2278,7 @@ void acpi_video_unregister_backlight(void)
bool acpi_video_handles_brightness_key_presses(void) bool acpi_video_handles_brightness_key_presses(void)
{ {
return has_backlight && return may_report_brightness_keys &&
(report_key_events & REPORT_BRIGHTNESS_KEY_EVENTS); (report_key_events & REPORT_BRIGHTNESS_KEY_EVENTS);
} }
EXPORT_SYMBOL(acpi_video_handles_brightness_key_presses); EXPORT_SYMBOL(acpi_video_handles_brightness_key_presses);
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
#include <linux/efi.h> #include <linux/efi.h>
#include <linux/reboot.h> #include <linux/reboot.h>
static void (*orig_pm_power_off)(void); static struct sys_off_handler *efi_sys_off_handler;
int efi_reboot_quirk_mode = -1; int efi_reboot_quirk_mode = -1;
...@@ -51,15 +51,11 @@ bool __weak efi_poweroff_required(void) ...@@ -51,15 +51,11 @@ bool __weak efi_poweroff_required(void)
return false; return false;
} }
static void efi_power_off(void) static int efi_power_off(struct sys_off_data *data)
{ {
efi.reset_system(EFI_RESET_SHUTDOWN, EFI_SUCCESS, 0, NULL); efi.reset_system(EFI_RESET_SHUTDOWN, EFI_SUCCESS, 0, NULL);
/*
* The above call should not return, if it does fall back to return NOTIFY_DONE;
* the original power off method (typically ACPI poweroff).
*/
if (orig_pm_power_off)
orig_pm_power_off();
} }
static int __init efi_shutdown_init(void) static int __init efi_shutdown_init(void)
...@@ -68,8 +64,13 @@ static int __init efi_shutdown_init(void) ...@@ -68,8 +64,13 @@ static int __init efi_shutdown_init(void)
return -ENODEV; return -ENODEV;
if (efi_poweroff_required()) { if (efi_poweroff_required()) {
orig_pm_power_off = pm_power_off; /* SYS_OFF_PRIO_FIRMWARE + 1 so that it runs before acpi_power_off */
pm_power_off = efi_power_off; efi_sys_off_handler =
register_sys_off_handler(SYS_OFF_MODE_POWER_OFF,
SYS_OFF_PRIO_FIRMWARE + 1,
efi_power_off, NULL);
if (IS_ERR(efi_sys_off_handler))
return PTR_ERR(efi_sys_off_handler);
} }
return 0; return 0;
......
...@@ -91,6 +91,8 @@ ...@@ -91,6 +91,8 @@
#define AMD_CPU_ID_PCO AMD_CPU_ID_RV #define AMD_CPU_ID_PCO AMD_CPU_ID_RV
#define AMD_CPU_ID_CZN AMD_CPU_ID_RN #define AMD_CPU_ID_CZN AMD_CPU_ID_RN
#define AMD_CPU_ID_YC 0x14B5 #define AMD_CPU_ID_YC 0x14B5
#define AMD_CPU_ID_CB 0x14D8
#define AMD_CPU_ID_PS 0x14E8
#define PMC_MSG_DELAY_MIN_US 50 #define PMC_MSG_DELAY_MIN_US 50
#define RESPONSE_REGISTER_LOOP_MAX 20000 #define RESPONSE_REGISTER_LOOP_MAX 20000
...@@ -318,6 +320,8 @@ static int amd_pmc_idlemask_read(struct amd_pmc_dev *pdev, struct device *dev, ...@@ -318,6 +320,8 @@ static int amd_pmc_idlemask_read(struct amd_pmc_dev *pdev, struct device *dev,
val = amd_pmc_reg_read(pdev, AMD_PMC_SCRATCH_REG_CZN); val = amd_pmc_reg_read(pdev, AMD_PMC_SCRATCH_REG_CZN);
break; break;
case AMD_CPU_ID_YC: case AMD_CPU_ID_YC:
case AMD_CPU_ID_CB:
case AMD_CPU_ID_PS:
val = amd_pmc_reg_read(pdev, AMD_PMC_SCRATCH_REG_YC); val = amd_pmc_reg_read(pdev, AMD_PMC_SCRATCH_REG_YC);
break; break;
default: default:
...@@ -491,7 +495,8 @@ static void amd_pmc_dbgfs_register(struct amd_pmc_dev *dev) ...@@ -491,7 +495,8 @@ static void amd_pmc_dbgfs_register(struct amd_pmc_dev *dev)
&amd_pmc_idlemask_fops); &amd_pmc_idlemask_fops);
/* Enable STB only when the module_param is set */ /* Enable STB only when the module_param is set */
if (enable_stb) { if (enable_stb) {
if (dev->cpu_id == AMD_CPU_ID_YC) if (dev->cpu_id == AMD_CPU_ID_YC || dev->cpu_id == AMD_CPU_ID_CB ||
dev->cpu_id == AMD_CPU_ID_PS)
debugfs_create_file("stb_read", 0644, dev->dbgfs_dir, dev, debugfs_create_file("stb_read", 0644, dev->dbgfs_dir, dev,
&amd_pmc_stb_debugfs_fops_v2); &amd_pmc_stb_debugfs_fops_v2);
else else
...@@ -615,6 +620,8 @@ static int amd_pmc_get_os_hint(struct amd_pmc_dev *dev) ...@@ -615,6 +620,8 @@ static int amd_pmc_get_os_hint(struct amd_pmc_dev *dev)
return MSG_OS_HINT_PCO; return MSG_OS_HINT_PCO;
case AMD_CPU_ID_RN: case AMD_CPU_ID_RN:
case AMD_CPU_ID_YC: case AMD_CPU_ID_YC:
case AMD_CPU_ID_CB:
case AMD_CPU_ID_PS:
return MSG_OS_HINT_RN; return MSG_OS_HINT_RN;
} }
return -EINVAL; return -EINVAL;
...@@ -735,6 +742,8 @@ static struct acpi_s2idle_dev_ops amd_pmc_s2idle_dev_ops = { ...@@ -735,6 +742,8 @@ static struct acpi_s2idle_dev_ops amd_pmc_s2idle_dev_ops = {
#endif #endif
static const struct pci_device_id pmc_pci_ids[] = { static const struct pci_device_id pmc_pci_ids[] = {
{ PCI_DEVICE(PCI_VENDOR_ID_AMD, AMD_CPU_ID_PS) },
{ PCI_DEVICE(PCI_VENDOR_ID_AMD, AMD_CPU_ID_CB) },
{ PCI_DEVICE(PCI_VENDOR_ID_AMD, AMD_CPU_ID_YC) }, { PCI_DEVICE(PCI_VENDOR_ID_AMD, AMD_CPU_ID_YC) },
{ PCI_DEVICE(PCI_VENDOR_ID_AMD, AMD_CPU_ID_CZN) }, { PCI_DEVICE(PCI_VENDOR_ID_AMD, AMD_CPU_ID_CZN) },
{ PCI_DEVICE(PCI_VENDOR_ID_AMD, AMD_CPU_ID_RN) }, { PCI_DEVICE(PCI_VENDOR_ID_AMD, AMD_CPU_ID_RN) },
...@@ -877,7 +886,7 @@ static int amd_pmc_probe(struct platform_device *pdev) ...@@ -877,7 +886,7 @@ static int amd_pmc_probe(struct platform_device *pdev)
mutex_init(&dev->lock); mutex_init(&dev->lock);
if (enable_stb && dev->cpu_id == AMD_CPU_ID_YC) { if (enable_stb && (dev->cpu_id == AMD_CPU_ID_YC || dev->cpu_id == AMD_CPU_ID_CB)) {
err = amd_pmc_s2d_init(dev); err = amd_pmc_s2d_init(dev);
if (err) if (err)
return err; return err;
...@@ -915,6 +924,7 @@ static const struct acpi_device_id amd_pmc_acpi_ids[] = { ...@@ -915,6 +924,7 @@ static const struct acpi_device_id amd_pmc_acpi_ids[] = {
{"AMDI0005", 0}, {"AMDI0005", 0},
{"AMDI0006", 0}, {"AMDI0006", 0},
{"AMDI0007", 0}, {"AMDI0007", 0},
{"AMDI0008", 0},
{"AMD0004", 0}, {"AMD0004", 0},
{"AMD0005", 0}, {"AMD0005", 0},
{ } { }
......
...@@ -522,6 +522,7 @@ static const struct key_entry asus_nb_wmi_keymap[] = { ...@@ -522,6 +522,7 @@ static const struct key_entry asus_nb_wmi_keymap[] = {
{ KE_KEY, 0x31, { KEY_VOLUMEDOWN } }, { KE_KEY, 0x31, { KEY_VOLUMEDOWN } },
{ KE_KEY, 0x32, { KEY_MUTE } }, { KE_KEY, 0x32, { KEY_MUTE } },
{ KE_KEY, 0x35, { KEY_SCREENLOCK } }, { KE_KEY, 0x35, { KEY_SCREENLOCK } },
{ KE_KEY, 0x38, { KEY_PROG3 } }, /* Armoury Crate */
{ KE_KEY, 0x40, { KEY_PREVIOUSSONG } }, { KE_KEY, 0x40, { KEY_PREVIOUSSONG } },
{ KE_KEY, 0x41, { KEY_NEXTSONG } }, { KE_KEY, 0x41, { KEY_NEXTSONG } },
{ KE_KEY, 0x43, { KEY_STOPCD } }, /* Stop/Eject */ { KE_KEY, 0x43, { KEY_STOPCD } }, /* Stop/Eject */
...@@ -574,6 +575,7 @@ static const struct key_entry asus_nb_wmi_keymap[] = { ...@@ -574,6 +575,7 @@ static const struct key_entry asus_nb_wmi_keymap[] = {
{ KE_KEY, 0xA5, { KEY_SWITCHVIDEOMODE } }, /* SDSP LCD + TV + HDMI */ { KE_KEY, 0xA5, { KEY_SWITCHVIDEOMODE } }, /* SDSP LCD + TV + HDMI */
{ KE_KEY, 0xA6, { KEY_SWITCHVIDEOMODE } }, /* SDSP CRT + TV + HDMI */ { KE_KEY, 0xA6, { KEY_SWITCHVIDEOMODE } }, /* SDSP CRT + TV + HDMI */
{ KE_KEY, 0xA7, { KEY_SWITCHVIDEOMODE } }, /* SDSP LCD + CRT + TV + HDMI */ { KE_KEY, 0xA7, { KEY_SWITCHVIDEOMODE } }, /* SDSP LCD + CRT + TV + HDMI */
{ KE_KEY, 0xB3, { KEY_PROG4 } }, /* AURA */
{ KE_KEY, 0xB5, { KEY_CALC } }, { KE_KEY, 0xB5, { KEY_CALC } },
{ KE_KEY, 0xC4, { KEY_KBDILLUMUP } }, { KE_KEY, 0xC4, { KEY_KBDILLUMUP } },
{ KE_KEY, 0xC5, { KEY_KBDILLUMDOWN } }, { KE_KEY, 0xC5, { KEY_KBDILLUMDOWN } },
......
...@@ -150,6 +150,7 @@ static const struct dmi_system_id gigabyte_wmi_known_working_platforms[] = { ...@@ -150,6 +150,7 @@ static const struct dmi_system_id gigabyte_wmi_known_working_platforms[] = {
DMI_EXACT_MATCH_GIGABYTE_BOARD_NAME("B550M AORUS PRO-P"), DMI_EXACT_MATCH_GIGABYTE_BOARD_NAME("B550M AORUS PRO-P"),
DMI_EXACT_MATCH_GIGABYTE_BOARD_NAME("B550M DS3H"), DMI_EXACT_MATCH_GIGABYTE_BOARD_NAME("B550M DS3H"),
DMI_EXACT_MATCH_GIGABYTE_BOARD_NAME("B660 GAMING X DDR4"), DMI_EXACT_MATCH_GIGABYTE_BOARD_NAME("B660 GAMING X DDR4"),
DMI_EXACT_MATCH_GIGABYTE_BOARD_NAME("B660I AORUS PRO DDR4"),
DMI_EXACT_MATCH_GIGABYTE_BOARD_NAME("Z390 I AORUS PRO WIFI-CF"), DMI_EXACT_MATCH_GIGABYTE_BOARD_NAME("Z390 I AORUS PRO WIFI-CF"),
DMI_EXACT_MATCH_GIGABYTE_BOARD_NAME("Z490 AORUS ELITE AC"), DMI_EXACT_MATCH_GIGABYTE_BOARD_NAME("Z490 AORUS ELITE AC"),
DMI_EXACT_MATCH_GIGABYTE_BOARD_NAME("X570 AORUS ELITE"), DMI_EXACT_MATCH_GIGABYTE_BOARD_NAME("X570 AORUS ELITE"),
......
...@@ -50,7 +50,8 @@ static const struct dmi_system_id atomisp2_led_systems[] __initconst = { ...@@ -50,7 +50,8 @@ static const struct dmi_system_id atomisp2_led_systems[] __initconst = {
{ {
.matches = { .matches = {
DMI_EXACT_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."), DMI_EXACT_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "T100TA"), /* Non exact match to also match T100TAF */
DMI_MATCH(DMI_PRODUCT_NAME, "T100TA"),
}, },
.driver_data = &asus_t100ta_lookup, .driver_data = &asus_t100ta_lookup,
}, },
......
config INTEL_IFS config INTEL_IFS
tristate "Intel In Field Scan" tristate "Intel In Field Scan"
depends on X86 && CPU_SUP_INTEL && 64BIT && SMP depends on X86 && CPU_SUP_INTEL && 64BIT && SMP
# Discussion on the list has shown that the sysfs API needs a bit
# more work, mark this as broken for now
depends on BROKEN
select INTEL_IFS_DEVICE select INTEL_IFS_DEVICE
help help
Enable support for the In Field Scan capability in select Enable support for the In Field Scan capability in select
......
...@@ -27,8 +27,8 @@ ...@@ -27,8 +27,8 @@
#include <linux/pinctrl/machine.h> #include <linux/pinctrl/machine.h>
#include <linux/platform_data/lp855x.h> #include <linux/platform_data/lp855x.h>
#include <linux/platform_device.h> #include <linux/platform_device.h>
#include <linux/pm.h>
#include <linux/power/bq24190_charger.h> #include <linux/power/bq24190_charger.h>
#include <linux/reboot.h>
#include <linux/rmi.h> #include <linux/rmi.h>
#include <linux/serdev.h> #include <linux/serdev.h>
#include <linux/spi/spi.h> #include <linux/spi/spi.h>
...@@ -889,6 +889,7 @@ static const struct pinctrl_map lenovo_yoga_tab2_830_1050_codec_pinctrl_map = ...@@ -889,6 +889,7 @@ static const struct pinctrl_map lenovo_yoga_tab2_830_1050_codec_pinctrl_map =
"INT33FC:02", "pmu_clk2_grp", "pmu_clk"); "INT33FC:02", "pmu_clk2_grp", "pmu_clk");
static struct pinctrl *lenovo_yoga_tab2_830_1050_codec_pinctrl; static struct pinctrl *lenovo_yoga_tab2_830_1050_codec_pinctrl;
static struct sys_off_handler *lenovo_yoga_tab2_830_1050_sys_off_handler;
static int __init lenovo_yoga_tab2_830_1050_init_codec(void) static int __init lenovo_yoga_tab2_830_1050_init_codec(void)
{ {
...@@ -933,9 +934,11 @@ static int __init lenovo_yoga_tab2_830_1050_init_codec(void) ...@@ -933,9 +934,11 @@ static int __init lenovo_yoga_tab2_830_1050_init_codec(void)
* followed by a normal 3 second press to recover. Avoid this by doing an EFI * followed by a normal 3 second press to recover. Avoid this by doing an EFI
* poweroff instead. * poweroff instead.
*/ */
static void lenovo_yoga_tab2_830_1050_power_off(void) static int lenovo_yoga_tab2_830_1050_power_off(struct sys_off_data *data)
{ {
efi.reset_system(EFI_RESET_SHUTDOWN, EFI_SUCCESS, 0, NULL); efi.reset_system(EFI_RESET_SHUTDOWN, EFI_SUCCESS, 0, NULL);
return NOTIFY_DONE;
} }
static int __init lenovo_yoga_tab2_830_1050_init(void) static int __init lenovo_yoga_tab2_830_1050_init(void)
...@@ -950,13 +953,19 @@ static int __init lenovo_yoga_tab2_830_1050_init(void) ...@@ -950,13 +953,19 @@ static int __init lenovo_yoga_tab2_830_1050_init(void)
if (ret) if (ret)
return ret; return ret;
pm_power_off = lenovo_yoga_tab2_830_1050_power_off; /* SYS_OFF_PRIO_FIRMWARE + 1 so that it runs before acpi_power_off */
lenovo_yoga_tab2_830_1050_sys_off_handler =
register_sys_off_handler(SYS_OFF_MODE_POWER_OFF, SYS_OFF_PRIO_FIRMWARE + 1,
lenovo_yoga_tab2_830_1050_power_off, NULL);
if (IS_ERR(lenovo_yoga_tab2_830_1050_sys_off_handler))
return PTR_ERR(lenovo_yoga_tab2_830_1050_sys_off_handler);
return 0; return 0;
} }
static void lenovo_yoga_tab2_830_1050_exit(void) static void lenovo_yoga_tab2_830_1050_exit(void)
{ {
pm_power_off = NULL; /* Just turn poweroff into halt on module unload */ unregister_sys_off_handler(lenovo_yoga_tab2_830_1050_sys_off_handler);
if (lenovo_yoga_tab2_830_1050_codec_pinctrl) { if (lenovo_yoga_tab2_830_1050_codec_pinctrl) {
pinctrl_put(lenovo_yoga_tab2_830_1050_codec_pinctrl); pinctrl_put(lenovo_yoga_tab2_830_1050_codec_pinctrl);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment