Skip to content

Commit 7575fdd

Browse files
committed
Merge tag 'platform-drivers-x86-v5.9-2' of git://git.infradead.org/linux-platform-drivers-x86
Pull x86 platform driver fixes from Andy Shevchenko: "We have some fixes for Tablet Mode reporting in particular, that users are complaining a lot about. Summary: - Attempt #3 of enabling Tablet Mode reporting w/o regressions - Improve battery recognition code in ASUS WMI driver - Fix Kconfig dependency warning for Fujitsu and LG laptop drivers - Add fixes in Thinkpad ACPI driver for _BCL method and NVRAM polling - Fix power supply extended topology in Mellanox driver - Fix memory leak in OLPC EC driver - Avoid static struct device in Intel PMC core driver - Add support for the touchscreen found in MPMAN Converter9 2-in-1 - Update MAINTAINERS to reflect the real state of affairs" * tag 'platform-drivers-x86-v5.9-2' of git://git.infradead.org/linux-platform-drivers-x86: platform/x86: thinkpad_acpi: re-initialize ACPI buffer size when reuse MAINTAINERS: Add Mark Gross and Hans de Goede as x86 platform drivers maintainers platform/x86: intel-vbtn: Switch to an allow-list for SW_TABLET_MODE reporting platform/x86: intel-vbtn: Revert "Fix SW_TABLET_MODE always reporting 1 on the HP Pavilion 11 x360" platform/x86: intel_pmc_core: do not create a static struct device platform/x86: mlx-platform: Fix extended topology configuration for power supply units platform/x86: pcengines-apuv2: Fix typo on define of AMD_FCH_GPIO_REG_GPIO55_DEVSLP0 platform/x86: fix kconfig dependency warning for FUJITSU_LAPTOP platform/x86: fix kconfig dependency warning for LG_LAPTOP platform/x86: thinkpad_acpi: initialize tp_nvram_state variable platform/x86: intel-vbtn: Fix SW_TABLET_MODE always reporting 1 on the HP Pavilion 11 x360 platform/x86: asus-wmi: Add BATC battery name to the list of supported platform/x86: asus-nb-wmi: Revert "Do not load on Asus T100TA and T200TA" platform/x86: touchscreen_dmi: Add info for the MPMAN Converter9 2-in-1 Documentation: laptops: thinkpad-acpi: fix underline length build warning Platform: OLPC: Fix memleak in olpc_ec_probe
2 parents 165563c + 720ef73 commit 7575fdd

File tree

12 files changed

+113
-55
lines changed

12 files changed

+113
-55
lines changed

MAINTAINERS

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18890,10 +18890,10 @@ T: git git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git x86/mm
1889018890
F: arch/x86/mm/
1889118891

1889218892
X86 PLATFORM DRIVERS
18893-
M: Darren Hart <[email protected]>
18894-
M: Andy Shevchenko <[email protected]>
18893+
M: Hans de Goede <[email protected]>
18894+
M: Mark Gross <[email protected]>
1889518895
18896-
S: Odd Fixes
18896+
S: Maintained
1889718897
T: git git://git.infradead.org/linux-platform-drivers-x86.git
1889818898
F: drivers/platform/olpc/
1889918899
F: drivers/platform/x86/

drivers/platform/olpc/olpc-ec.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -439,7 +439,9 @@ static int olpc_ec_probe(struct platform_device *pdev)
439439
&config);
440440
if (IS_ERR(ec->dcon_rdev)) {
441441
dev_err(&pdev->dev, "failed to register DCON regulator\n");
442-
return PTR_ERR(ec->dcon_rdev);
442+
err = PTR_ERR(ec->dcon_rdev);
443+
kfree(ec);
444+
return err;
443445
}
444446

445447
ec->dbgfs_dir = olpc_ec_setup_debugfs();

drivers/platform/x86/Kconfig

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -469,6 +469,7 @@ config FUJITSU_LAPTOP
469469
depends on BACKLIGHT_CLASS_DEVICE
470470
depends on ACPI_VIDEO || ACPI_VIDEO = n
471471
select INPUT_SPARSEKMAP
472+
select NEW_LEDS
472473
select LEDS_CLASS
473474
help
474475
This is a driver for laptops built by Fujitsu:
@@ -1112,6 +1113,7 @@ config LG_LAPTOP
11121113
depends on ACPI_WMI
11131114
depends on INPUT
11141115
select INPUT_SPARSEKMAP
1116+
select NEW_LEDS
11151117
select LEDS_CLASS
11161118
help
11171119
This driver adds support for hotkeys as well as control of keyboard

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

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -593,33 +593,9 @@ static struct asus_wmi_driver asus_nb_wmi_driver = {
593593
.detect_quirks = asus_nb_wmi_quirks,
594594
};
595595

596-
static const struct dmi_system_id asus_nb_wmi_blacklist[] __initconst = {
597-
{
598-
/*
599-
* asus-nb-wm adds no functionality. The T100TA has a detachable
600-
* USB kbd, so no hotkeys and it has no WMI rfkill; and loading
601-
* asus-nb-wm causes the camera LED to turn and _stay_ on.
602-
*/
603-
.matches = {
604-
DMI_EXACT_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
605-
DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "T100TA"),
606-
},
607-
},
608-
{
609-
/* The Asus T200TA has the same issue as the T100TA */
610-
.matches = {
611-
DMI_EXACT_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
612-
DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "T200TA"),
613-
},
614-
},
615-
{} /* Terminating entry */
616-
};
617596

618597
static int __init asus_nb_wmi_init(void)
619598
{
620-
if (dmi_check_system(asus_nb_wmi_blacklist))
621-
return -ENODEV;
622-
623599
return asus_wmi_register_driver(&asus_nb_wmi_driver);
624600
}
625601

drivers/platform/x86/asus-wmi.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -442,6 +442,7 @@ static int asus_wmi_battery_add(struct power_supply *battery)
442442
*/
443443
if (strcmp(battery->desc->name, "BAT0") != 0 &&
444444
strcmp(battery->desc->name, "BAT1") != 0 &&
445+
strcmp(battery->desc->name, "BATC") != 0 &&
445446
strcmp(battery->desc->name, "BATT") != 0)
446447
return -ENODEV;
447448

drivers/platform/x86/intel-vbtn.c

Lines changed: 43 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -167,20 +167,54 @@ static bool intel_vbtn_has_buttons(acpi_handle handle)
167167
return ACPI_SUCCESS(status);
168168
}
169169

170+
/*
171+
* There are several laptops (non 2-in-1) models out there which support VGBS,
172+
* but simply always return 0, which we translate to SW_TABLET_MODE=1. This in
173+
* turn causes userspace (libinput) to suppress events from the builtin
174+
* keyboard and touchpad, making the laptop essentially unusable.
175+
*
176+
* Since the problem of wrongly reporting SW_TABLET_MODE=1 in combination
177+
* with libinput, leads to a non-usable system. Where as OTOH many people will
178+
* not even notice when SW_TABLET_MODE is not being reported, a DMI based allow
179+
* list is used here. This list mainly matches on the chassis-type of 2-in-1s.
180+
*
181+
* There are also some 2-in-1s which use the intel-vbtn ACPI interface to report
182+
* SW_TABLET_MODE with a chassis-type of 8 ("Portable") or 10 ("Notebook"),
183+
* these are matched on a per model basis, since many normal laptops with a
184+
* possible broken VGBS ACPI-method also use these chassis-types.
185+
*/
186+
static const struct dmi_system_id dmi_switches_allow_list[] = {
187+
{
188+
.matches = {
189+
DMI_EXACT_MATCH(DMI_CHASSIS_TYPE, "31" /* Convertible */),
190+
},
191+
},
192+
{
193+
.matches = {
194+
DMI_EXACT_MATCH(DMI_CHASSIS_TYPE, "32" /* Detachable */),
195+
},
196+
},
197+
{
198+
.matches = {
199+
DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
200+
DMI_MATCH(DMI_PRODUCT_NAME, "Venue 11 Pro 7130"),
201+
},
202+
},
203+
{
204+
.matches = {
205+
DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"),
206+
DMI_MATCH(DMI_PRODUCT_NAME, "HP Stream x360 Convertible PC 11"),
207+
},
208+
},
209+
{} /* Array terminator */
210+
};
211+
170212
static bool intel_vbtn_has_switches(acpi_handle handle)
171213
{
172-
const char *chassis_type = dmi_get_system_info(DMI_CHASSIS_TYPE);
173214
unsigned long long vgbs;
174215
acpi_status status;
175216

176-
/*
177-
* Some normal laptops have a VGBS method despite being non-convertible
178-
* and their VGBS method always returns 0, causing detect_tablet_mode()
179-
* to report SW_TABLET_MODE=1 to userspace, which causes issues.
180-
* These laptops have a DMI chassis_type of 9 ("Laptop"), do not report
181-
* switches on any devices with a DMI chassis_type of 9.
182-
*/
183-
if (chassis_type && strcmp(chassis_type, "9") == 0)
217+
if (!dmi_check_system(dmi_switches_allow_list))
184218
return false;
185219

186220
status = acpi_evaluate_integer(handle, "VGBS", NULL, &vgbs);

drivers/platform/x86/intel_pmc_core_pltdrv.c

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,10 @@
2020

2121
static void intel_pmc_core_release(struct device *dev)
2222
{
23-
/* Nothing to do. */
23+
kfree(dev);
2424
}
2525

26-
static struct platform_device pmc_core_device = {
27-
.name = "intel_pmc_core",
28-
.dev = {
29-
.release = intel_pmc_core_release,
30-
},
31-
};
26+
static struct platform_device *pmc_core_device;
3227

3328
/*
3429
* intel_pmc_core_platform_ids is the list of platforms where we want to
@@ -52,19 +47,32 @@ MODULE_DEVICE_TABLE(x86cpu, intel_pmc_core_platform_ids);
5247

5348
static int __init pmc_core_platform_init(void)
5449
{
50+
int retval;
51+
5552
/* Skip creating the platform device if ACPI already has a device */
5653
if (acpi_dev_present("INT33A1", NULL, -1))
5754
return -ENODEV;
5855

5956
if (!x86_match_cpu(intel_pmc_core_platform_ids))
6057
return -ENODEV;
6158

62-
return platform_device_register(&pmc_core_device);
59+
pmc_core_device = kzalloc(sizeof(*pmc_core_device), GFP_KERNEL);
60+
if (!pmc_core_device)
61+
return -ENOMEM;
62+
63+
pmc_core_device->name = "intel_pmc_core";
64+
pmc_core_device->dev.release = intel_pmc_core_release;
65+
66+
retval = platform_device_register(pmc_core_device);
67+
if (retval)
68+
kfree(pmc_core_device);
69+
70+
return retval;
6371
}
6472

6573
static void __exit pmc_core_platform_exit(void)
6674
{
67-
platform_device_unregister(&pmc_core_device);
75+
platform_device_unregister(pmc_core_device);
6876
}
6977

7078
module_init(pmc_core_platform_init);

drivers/platform/x86/mlx-platform.c

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,6 @@
171171
#define MLXPLAT_CPLD_NR_NONE -1
172172
#define MLXPLAT_CPLD_PSU_DEFAULT_NR 10
173173
#define MLXPLAT_CPLD_PSU_MSNXXXX_NR 4
174-
#define MLXPLAT_CPLD_PSU_MSNXXXX_NR2 3
175174
#define MLXPLAT_CPLD_FAN1_DEFAULT_NR 11
176175
#define MLXPLAT_CPLD_FAN2_DEFAULT_NR 12
177176
#define MLXPLAT_CPLD_FAN3_DEFAULT_NR 13
@@ -347,6 +346,15 @@ static struct i2c_board_info mlxplat_mlxcpld_pwr[] = {
347346
},
348347
};
349348

349+
static struct i2c_board_info mlxplat_mlxcpld_ext_pwr[] = {
350+
{
351+
I2C_BOARD_INFO("dps460", 0x5b),
352+
},
353+
{
354+
I2C_BOARD_INFO("dps460", 0x5a),
355+
},
356+
};
357+
350358
static struct i2c_board_info mlxplat_mlxcpld_fan[] = {
351359
{
352360
I2C_BOARD_INFO("24c32", 0x50),
@@ -921,15 +929,15 @@ static struct mlxreg_core_data mlxplat_mlxcpld_ext_pwr_items_data[] = {
921929
.label = "pwr3",
922930
.reg = MLXPLAT_CPLD_LPC_REG_PWR_OFFSET,
923931
.mask = BIT(2),
924-
.hpdev.brdinfo = &mlxplat_mlxcpld_pwr[0],
925-
.hpdev.nr = MLXPLAT_CPLD_PSU_MSNXXXX_NR2,
932+
.hpdev.brdinfo = &mlxplat_mlxcpld_ext_pwr[0],
933+
.hpdev.nr = MLXPLAT_CPLD_PSU_MSNXXXX_NR,
926934
},
927935
{
928936
.label = "pwr4",
929937
.reg = MLXPLAT_CPLD_LPC_REG_PWR_OFFSET,
930938
.mask = BIT(3),
931-
.hpdev.brdinfo = &mlxplat_mlxcpld_pwr[1],
932-
.hpdev.nr = MLXPLAT_CPLD_PSU_MSNXXXX_NR2,
939+
.hpdev.brdinfo = &mlxplat_mlxcpld_ext_pwr[1],
940+
.hpdev.nr = MLXPLAT_CPLD_PSU_MSNXXXX_NR,
933941
},
934942
};
935943

drivers/platform/x86/pcengines-apuv2.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
#define APU2_GPIO_REG_LED3 AMD_FCH_GPIO_REG_GPIO59_DEVSLP1
3333
#define APU2_GPIO_REG_MODESW AMD_FCH_GPIO_REG_GPIO32_GE1
3434
#define APU2_GPIO_REG_SIMSWAP AMD_FCH_GPIO_REG_GPIO33_GE2
35-
#define APU2_GPIO_REG_MPCIE2 AMD_FCH_GPIO_REG_GPIO59_DEVSLP0
35+
#define APU2_GPIO_REG_MPCIE2 AMD_FCH_GPIO_REG_GPIO55_DEVSLP0
3636
#define APU2_GPIO_REG_MPCIE3 AMD_FCH_GPIO_REG_GPIO51
3737

3838
/* Order in which the GPIO lines are defined in the register list */

drivers/platform/x86/thinkpad_acpi.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2569,7 +2569,7 @@ static void hotkey_compare_and_issue_event(struct tp_nvram_state *oldn,
25692569
*/
25702570
static int hotkey_kthread(void *data)
25712571
{
2572-
struct tp_nvram_state s[2];
2572+
struct tp_nvram_state s[2] = { 0 };
25732573
u32 poll_mask, event_mask;
25742574
unsigned int si, so;
25752575
unsigned long t;
@@ -6829,8 +6829,10 @@ static int __init tpacpi_query_bcl_levels(acpi_handle handle)
68296829
list_for_each_entry(child, &device->children, node) {
68306830
acpi_status status = acpi_evaluate_object(child->handle, "_BCL",
68316831
NULL, &buffer);
6832-
if (ACPI_FAILURE(status))
6832+
if (ACPI_FAILURE(status)) {
6833+
buffer.length = ACPI_ALLOCATE_BUFFER;
68336834
continue;
6835+
}
68346836

68356837
obj = (union acpi_object *)buffer.pointer;
68366838
if (!obj || (obj->type != ACPI_TYPE_PACKAGE)) {

0 commit comments

Comments
 (0)