Skip to content

Commit 2a347a0

Browse files
committed
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
2 parents 339f74e + 5ad2616 commit 2a347a0

8 files changed

Lines changed: 51 additions & 21 deletions

File tree

drivers/acpi/acpi_video.c

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ module_param(device_id_scheme, bool, 0444);
7373
static int only_lcd = -1;
7474
module_param(only_lcd, int, 0444);
7575

76-
static bool has_backlight;
76+
static bool may_report_brightness_keys;
7777
static int register_count;
7878
static DEFINE_MUTEX(register_count_mutex);
7979
static DEFINE_MUTEX(video_list_lock);
@@ -1224,7 +1224,7 @@ acpi_video_bus_get_one_device(struct acpi_device *device,
12241224
acpi_video_device_find_cap(data);
12251225

12261226
if (data->cap._BCM && data->cap._BCL)
1227-
has_backlight = true;
1227+
may_report_brightness_keys = true;
12281228

12291229
mutex_lock(&video->device_list_lock);
12301230
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)
16931693
break;
16941694
}
16951695

1696+
if (keycode)
1697+
may_report_brightness_keys = true;
1698+
16961699
acpi_notifier_call_chain(device, event, 0);
16971700

16981701
if (keycode && (report_key_events & REPORT_BRIGHTNESS_KEY_EVENTS)) {
@@ -2253,7 +2256,7 @@ void acpi_video_unregister(void)
22532256
if (register_count) {
22542257
acpi_bus_unregister_driver(&acpi_video_bus);
22552258
register_count = 0;
2256-
has_backlight = false;
2259+
may_report_brightness_keys = false;
22572260
}
22582261
mutex_unlock(&register_count_mutex);
22592262
}
@@ -2275,7 +2278,7 @@ void acpi_video_unregister_backlight(void)
22752278

22762279
bool acpi_video_handles_brightness_key_presses(void)
22772280
{
2278-
return has_backlight &&
2281+
return may_report_brightness_keys &&
22792282
(report_key_events & REPORT_BRIGHTNESS_KEY_EVENTS);
22802283
}
22812284
EXPORT_SYMBOL(acpi_video_handles_brightness_key_presses);

drivers/firmware/efi/reboot.c

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
#include <linux/efi.h>
77
#include <linux/reboot.h>
88

9-
static void (*orig_pm_power_off)(void);
9+
static struct sys_off_handler *efi_sys_off_handler;
1010

1111
int efi_reboot_quirk_mode = -1;
1212

@@ -51,15 +51,11 @@ bool __weak efi_poweroff_required(void)
5151
return false;
5252
}
5353

54-
static void efi_power_off(void)
54+
static int efi_power_off(struct sys_off_data *data)
5555
{
5656
efi.reset_system(EFI_RESET_SHUTDOWN, EFI_SUCCESS, 0, NULL);
57-
/*
58-
* The above call should not return, if it does fall back to
59-
* the original power off method (typically ACPI poweroff).
60-
*/
61-
if (orig_pm_power_off)
62-
orig_pm_power_off();
57+
58+
return NOTIFY_DONE;
6359
}
6460

6561
static int __init efi_shutdown_init(void)
@@ -68,8 +64,13 @@ static int __init efi_shutdown_init(void)
6864
return -ENODEV;
6965

7066
if (efi_poweroff_required()) {
71-
orig_pm_power_off = pm_power_off;
72-
pm_power_off = efi_power_off;
67+
/* SYS_OFF_PRIO_FIRMWARE + 1 so that it runs before acpi_power_off */
68+
efi_sys_off_handler =
69+
register_sys_off_handler(SYS_OFF_MODE_POWER_OFF,
70+
SYS_OFF_PRIO_FIRMWARE + 1,
71+
efi_power_off, NULL);
72+
if (IS_ERR(efi_sys_off_handler))
73+
return PTR_ERR(efi_sys_off_handler);
7374
}
7475

7576
return 0;

drivers/platform/x86/amd-pmc.c

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,8 @@
9191
#define AMD_CPU_ID_PCO AMD_CPU_ID_RV
9292
#define AMD_CPU_ID_CZN AMD_CPU_ID_RN
9393
#define AMD_CPU_ID_YC 0x14B5
94+
#define AMD_CPU_ID_CB 0x14D8
95+
#define AMD_CPU_ID_PS 0x14E8
9496

9597
#define PMC_MSG_DELAY_MIN_US 50
9698
#define RESPONSE_REGISTER_LOOP_MAX 20000
@@ -318,6 +320,8 @@ static int amd_pmc_idlemask_read(struct amd_pmc_dev *pdev, struct device *dev,
318320
val = amd_pmc_reg_read(pdev, AMD_PMC_SCRATCH_REG_CZN);
319321
break;
320322
case AMD_CPU_ID_YC:
323+
case AMD_CPU_ID_CB:
324+
case AMD_CPU_ID_PS:
321325
val = amd_pmc_reg_read(pdev, AMD_PMC_SCRATCH_REG_YC);
322326
break;
323327
default:
@@ -491,7 +495,8 @@ static void amd_pmc_dbgfs_register(struct amd_pmc_dev *dev)
491495
&amd_pmc_idlemask_fops);
492496
/* Enable STB only when the module_param is set */
493497
if (enable_stb) {
494-
if (dev->cpu_id == AMD_CPU_ID_YC)
498+
if (dev->cpu_id == AMD_CPU_ID_YC || dev->cpu_id == AMD_CPU_ID_CB ||
499+
dev->cpu_id == AMD_CPU_ID_PS)
495500
debugfs_create_file("stb_read", 0644, dev->dbgfs_dir, dev,
496501
&amd_pmc_stb_debugfs_fops_v2);
497502
else
@@ -615,6 +620,8 @@ static int amd_pmc_get_os_hint(struct amd_pmc_dev *dev)
615620
return MSG_OS_HINT_PCO;
616621
case AMD_CPU_ID_RN:
617622
case AMD_CPU_ID_YC:
623+
case AMD_CPU_ID_CB:
624+
case AMD_CPU_ID_PS:
618625
return MSG_OS_HINT_RN;
619626
}
620627
return -EINVAL;
@@ -735,6 +742,8 @@ static struct acpi_s2idle_dev_ops amd_pmc_s2idle_dev_ops = {
735742
#endif
736743

737744
static const struct pci_device_id pmc_pci_ids[] = {
745+
{ PCI_DEVICE(PCI_VENDOR_ID_AMD, AMD_CPU_ID_PS) },
746+
{ PCI_DEVICE(PCI_VENDOR_ID_AMD, AMD_CPU_ID_CB) },
738747
{ PCI_DEVICE(PCI_VENDOR_ID_AMD, AMD_CPU_ID_YC) },
739748
{ PCI_DEVICE(PCI_VENDOR_ID_AMD, AMD_CPU_ID_CZN) },
740749
{ PCI_DEVICE(PCI_VENDOR_ID_AMD, AMD_CPU_ID_RN) },
@@ -877,7 +886,7 @@ static int amd_pmc_probe(struct platform_device *pdev)
877886

878887
mutex_init(&dev->lock);
879888

880-
if (enable_stb && dev->cpu_id == AMD_CPU_ID_YC) {
889+
if (enable_stb && (dev->cpu_id == AMD_CPU_ID_YC || dev->cpu_id == AMD_CPU_ID_CB)) {
881890
err = amd_pmc_s2d_init(dev);
882891
if (err)
883892
return err;
@@ -915,6 +924,7 @@ static const struct acpi_device_id amd_pmc_acpi_ids[] = {
915924
{"AMDI0005", 0},
916925
{"AMDI0006", 0},
917926
{"AMDI0007", 0},
927+
{"AMDI0008", 0},
918928
{"AMD0004", 0},
919929
{"AMD0005", 0},
920930
{ }

drivers/platform/x86/asus-nb-wmi.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -522,6 +522,7 @@ static const struct key_entry asus_nb_wmi_keymap[] = {
522522
{ KE_KEY, 0x31, { KEY_VOLUMEDOWN } },
523523
{ KE_KEY, 0x32, { KEY_MUTE } },
524524
{ KE_KEY, 0x35, { KEY_SCREENLOCK } },
525+
{ KE_KEY, 0x38, { KEY_PROG3 } }, /* Armoury Crate */
525526
{ KE_KEY, 0x40, { KEY_PREVIOUSSONG } },
526527
{ KE_KEY, 0x41, { KEY_NEXTSONG } },
527528
{ KE_KEY, 0x43, { KEY_STOPCD } }, /* Stop/Eject */
@@ -574,6 +575,7 @@ static const struct key_entry asus_nb_wmi_keymap[] = {
574575
{ KE_KEY, 0xA5, { KEY_SWITCHVIDEOMODE } }, /* SDSP LCD + TV + HDMI */
575576
{ KE_KEY, 0xA6, { KEY_SWITCHVIDEOMODE } }, /* SDSP CRT + TV + HDMI */
576577
{ KE_KEY, 0xA7, { KEY_SWITCHVIDEOMODE } }, /* SDSP LCD + CRT + TV + HDMI */
578+
{ KE_KEY, 0xB3, { KEY_PROG4 } }, /* AURA */
577579
{ KE_KEY, 0xB5, { KEY_CALC } },
578580
{ KE_KEY, 0xC4, { KEY_KBDILLUMUP } },
579581
{ KE_KEY, 0xC5, { KEY_KBDILLUMDOWN } },

drivers/platform/x86/gigabyte-wmi.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,7 @@ static const struct dmi_system_id gigabyte_wmi_known_working_platforms[] = {
150150
DMI_EXACT_MATCH_GIGABYTE_BOARD_NAME("B550M AORUS PRO-P"),
151151
DMI_EXACT_MATCH_GIGABYTE_BOARD_NAME("B550M DS3H"),
152152
DMI_EXACT_MATCH_GIGABYTE_BOARD_NAME("B660 GAMING X DDR4"),
153+
DMI_EXACT_MATCH_GIGABYTE_BOARD_NAME("B660I AORUS PRO DDR4"),
153154
DMI_EXACT_MATCH_GIGABYTE_BOARD_NAME("Z390 I AORUS PRO WIFI-CF"),
154155
DMI_EXACT_MATCH_GIGABYTE_BOARD_NAME("Z490 AORUS ELITE AC"),
155156
DMI_EXACT_MATCH_GIGABYTE_BOARD_NAME("X570 AORUS ELITE"),

drivers/platform/x86/intel/atomisp2/led.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,8 @@ static const struct dmi_system_id atomisp2_led_systems[] __initconst = {
5050
{
5151
.matches = {
5252
DMI_EXACT_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
53-
DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "T100TA"),
53+
/* Non exact match to also match T100TAF */
54+
DMI_MATCH(DMI_PRODUCT_NAME, "T100TA"),
5455
},
5556
.driver_data = &asus_t100ta_lookup,
5657
},

drivers/platform/x86/intel/ifs/Kconfig

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
config INTEL_IFS
22
tristate "Intel In Field Scan"
33
depends on X86 && CPU_SUP_INTEL && 64BIT && SMP
4+
# Discussion on the list has shown that the sysfs API needs a bit
5+
# more work, mark this as broken for now
6+
depends on BROKEN
47
select INTEL_IFS_DEVICE
58
help
69
Enable support for the In Field Scan capability in select

drivers/platform/x86/x86-android-tablets.c

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@
2727
#include <linux/pinctrl/machine.h>
2828
#include <linux/platform_data/lp855x.h>
2929
#include <linux/platform_device.h>
30-
#include <linux/pm.h>
3130
#include <linux/power/bq24190_charger.h>
31+
#include <linux/reboot.h>
3232
#include <linux/rmi.h>
3333
#include <linux/serdev.h>
3434
#include <linux/spi/spi.h>
@@ -889,6 +889,7 @@ static const struct pinctrl_map lenovo_yoga_tab2_830_1050_codec_pinctrl_map =
889889
"INT33FC:02", "pmu_clk2_grp", "pmu_clk");
890890

891891
static struct pinctrl *lenovo_yoga_tab2_830_1050_codec_pinctrl;
892+
static struct sys_off_handler *lenovo_yoga_tab2_830_1050_sys_off_handler;
892893

893894
static int __init lenovo_yoga_tab2_830_1050_init_codec(void)
894895
{
@@ -933,9 +934,11 @@ static int __init lenovo_yoga_tab2_830_1050_init_codec(void)
933934
* followed by a normal 3 second press to recover. Avoid this by doing an EFI
934935
* poweroff instead.
935936
*/
936-
static void lenovo_yoga_tab2_830_1050_power_off(void)
937+
static int lenovo_yoga_tab2_830_1050_power_off(struct sys_off_data *data)
937938
{
938939
efi.reset_system(EFI_RESET_SHUTDOWN, EFI_SUCCESS, 0, NULL);
940+
941+
return NOTIFY_DONE;
939942
}
940943

941944
static int __init lenovo_yoga_tab2_830_1050_init(void)
@@ -950,13 +953,19 @@ static int __init lenovo_yoga_tab2_830_1050_init(void)
950953
if (ret)
951954
return ret;
952955

953-
pm_power_off = lenovo_yoga_tab2_830_1050_power_off;
956+
/* SYS_OFF_PRIO_FIRMWARE + 1 so that it runs before acpi_power_off */
957+
lenovo_yoga_tab2_830_1050_sys_off_handler =
958+
register_sys_off_handler(SYS_OFF_MODE_POWER_OFF, SYS_OFF_PRIO_FIRMWARE + 1,
959+
lenovo_yoga_tab2_830_1050_power_off, NULL);
960+
if (IS_ERR(lenovo_yoga_tab2_830_1050_sys_off_handler))
961+
return PTR_ERR(lenovo_yoga_tab2_830_1050_sys_off_handler);
962+
954963
return 0;
955964
}
956965

957966
static void lenovo_yoga_tab2_830_1050_exit(void)
958967
{
959-
pm_power_off = NULL; /* Just turn poweroff into halt on module unload */
968+
unregister_sys_off_handler(lenovo_yoga_tab2_830_1050_sys_off_handler);
960969

961970
if (lenovo_yoga_tab2_830_1050_codec_pinctrl) {
962971
pinctrl_put(lenovo_yoga_tab2_830_1050_codec_pinctrl);

0 commit comments

Comments
 (0)