Skip to content

Commit 0d0833e

Browse files
committed
Merge tag 'platform-drivers-x86-v6.2-2' of git://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86
Pull x86 platform driver fixes from Hans de Goede: "A set of assorted fixes and hardware-id additions" * tag 'platform-drivers-x86-v6.2-2' of git://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86: platform/x86: thinkpad_acpi: Fix profile mode display in AMT mode platform/x86: int3472/discrete: Ensure the clk/power enable pins are in output mode platform/x86/amd: Fix refcount leak in amd_pmc_probe platform/x86: intel/pmc/core: Add Meteor Lake mobile support platform/x86: simatic-ipc: add another model platform/x86: simatic-ipc: correct name of a model platform/x86: dell-privacy: Only register SW_CAMERA_LENS_COVER if present platform/x86: dell-privacy: Fix SW_CAMERA_LENS_COVER reporting platform/x86: asus-wmi: Don't load fan curves without fan platform/x86: asus-wmi: Ignore fan on E410MA platform/x86: asus-wmi: Add quirk wmi_ignore_fan platform/x86: asus-nb-wmi: Add alternate mapping for KEY_SCREENLOCK platform/x86: asus-nb-wmi: Add alternate mapping for KEY_CAMERA platform/surface: aggregator: Add missing call to ssam_request_sync_free() platform/surface: aggregator: Ignore command messages not intended for us platform/x86: touchscreen_dmi: Add info for the CSL Panther Tab HD platform/x86: ideapad-laptop: Add Legion 5 15ARH05 DMI id to set_fn_lock_led_list[] platform/x86: sony-laptop: Don't turn off 0x153 keyboard backlight during probe
2 parents ff5ebaf + fde5f74 commit 0d0833e

File tree

16 files changed

+145
-28
lines changed

16 files changed

+145
-28
lines changed

drivers/platform/surface/aggregator/controller.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1700,8 +1700,10 @@ int ssam_request_sync(struct ssam_controller *ctrl,
17001700
return status;
17011701

17021702
status = ssam_request_sync_init(rqst, spec->flags);
1703-
if (status)
1703+
if (status) {
1704+
ssam_request_sync_free(rqst);
17041705
return status;
1706+
}
17051707

17061708
ssam_request_sync_set_resp(rqst, rsp);
17071709

drivers/platform/surface/aggregator/ssh_request_layer.c

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -916,6 +916,20 @@ static void ssh_rtl_rx_command(struct ssh_ptl *p, const struct ssam_span *data)
916916
if (sshp_parse_command(dev, data, &command, &command_data))
917917
return;
918918

919+
/*
920+
* Check if the message was intended for us. If not, drop it.
921+
*
922+
* Note: We will need to change this to handle debug messages. On newer
923+
* generation devices, these seem to be sent to tid_out=0x03. We as
924+
* host can still receive them as they can be forwarded via an override
925+
* option on SAM, but doing so does not change tid_out=0x00.
926+
*/
927+
if (command->tid_out != 0x00) {
928+
rtl_warn(rtl, "rtl: dropping message not intended for us (tid = %#04x)\n",
929+
command->tid_out);
930+
return;
931+
}
932+
919933
if (ssh_rqid_is_event(get_unaligned_le16(&command->rqid)))
920934
ssh_rtl_rx_event(rtl, command, &command_data);
921935
else

drivers/platform/x86/amd/pmc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -932,7 +932,7 @@ static int amd_pmc_probe(struct platform_device *pdev)
932932
if (enable_stb && (dev->cpu_id == AMD_CPU_ID_YC || dev->cpu_id == AMD_CPU_ID_CB)) {
933933
err = amd_pmc_s2d_init(dev);
934934
if (err)
935-
return err;
935+
goto err_pci_dev_put;
936936
}
937937

938938
platform_set_drvdata(pdev, dev);

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

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,10 @@ static struct quirk_entry quirk_asus_tablet_mode = {
121121
.tablet_switch_mode = asus_wmi_lid_flip_rog_devid,
122122
};
123123

124+
static struct quirk_entry quirk_asus_ignore_fan = {
125+
.wmi_ignore_fan = true,
126+
};
127+
124128
static int dmi_matched(const struct dmi_system_id *dmi)
125129
{
126130
pr_info("Identified laptop model '%s'\n", dmi->ident);
@@ -473,6 +477,15 @@ static const struct dmi_system_id asus_quirks[] = {
473477
},
474478
.driver_data = &quirk_asus_tablet_mode,
475479
},
480+
{
481+
.callback = dmi_matched,
482+
.ident = "ASUS VivoBook E410MA",
483+
.matches = {
484+
DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
485+
DMI_MATCH(DMI_PRODUCT_NAME, "E410MA"),
486+
},
487+
.driver_data = &quirk_asus_ignore_fan,
488+
},
476489
{},
477490
};
478491

@@ -511,6 +524,7 @@ static const struct key_entry asus_nb_wmi_keymap[] = {
511524
{ KE_KEY, 0x30, { KEY_VOLUMEUP } },
512525
{ KE_KEY, 0x31, { KEY_VOLUMEDOWN } },
513526
{ KE_KEY, 0x32, { KEY_MUTE } },
527+
{ KE_KEY, 0x33, { KEY_SCREENLOCK } },
514528
{ KE_KEY, 0x35, { KEY_SCREENLOCK } },
515529
{ KE_KEY, 0x38, { KEY_PROG3 } }, /* Armoury Crate */
516530
{ KE_KEY, 0x40, { KEY_PREVIOUSSONG } },
@@ -544,6 +558,7 @@ static const struct key_entry asus_nb_wmi_keymap[] = {
544558
{ KE_KEY, 0x7D, { KEY_BLUETOOTH } }, /* Bluetooth Enable */
545559
{ KE_KEY, 0x7E, { KEY_BLUETOOTH } }, /* Bluetooth Disable */
546560
{ KE_KEY, 0x82, { KEY_CAMERA } },
561+
{ KE_KEY, 0x85, { KEY_CAMERA } },
547562
{ KE_KEY, 0x86, { KEY_PROG1 } }, /* MyASUS Key */
548563
{ KE_KEY, 0x88, { KEY_RFKILL } }, /* Radio Toggle Key */
549564
{ KE_KEY, 0x8A, { KEY_PROG1 } }, /* Color enhancement mode */

drivers/platform/x86/asus-wmi.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2243,7 +2243,9 @@ static int asus_wmi_fan_init(struct asus_wmi *asus)
22432243
asus->fan_type = FAN_TYPE_NONE;
22442244
asus->agfn_pwm = -1;
22452245

2246-
if (asus_wmi_dev_is_present(asus, ASUS_WMI_DEVID_CPU_FAN_CTRL))
2246+
if (asus->driver->quirks->wmi_ignore_fan)
2247+
asus->fan_type = FAN_TYPE_NONE;
2248+
else if (asus_wmi_dev_is_present(asus, ASUS_WMI_DEVID_CPU_FAN_CTRL))
22472249
asus->fan_type = FAN_TYPE_SPEC83;
22482250
else if (asus_wmi_has_agfn_fan(asus))
22492251
asus->fan_type = FAN_TYPE_AGFN;
@@ -2436,6 +2438,9 @@ static int fan_curve_check_present(struct asus_wmi *asus, bool *available,
24362438

24372439
*available = false;
24382440

2441+
if (asus->fan_type == FAN_TYPE_NONE)
2442+
return 0;
2443+
24392444
err = fan_curve_get_factory_default(asus, fan_dev);
24402445
if (err) {
24412446
return 0;

drivers/platform/x86/asus-wmi.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ struct quirk_entry {
3838
bool store_backlight_power;
3939
bool wmi_backlight_set_devstate;
4040
bool wmi_force_als_set;
41+
bool wmi_ignore_fan;
4142
enum asus_wmi_tablet_switch_mode tablet_switch_mode;
4243
int wapf;
4344
/*

drivers/platform/x86/dell/dell-wmi-privacy.c

Lines changed: 31 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ static const struct key_entry dell_wmi_keymap_type_0012[] = {
6161
/* privacy mic mute */
6262
{ KE_KEY, 0x0001, { KEY_MICMUTE } },
6363
/* privacy camera mute */
64-
{ KE_SW, 0x0002, { SW_CAMERA_LENS_COVER } },
64+
{ KE_VSW, 0x0002, { SW_CAMERA_LENS_COVER } },
6565
{ KE_END, 0},
6666
};
6767

@@ -115,11 +115,15 @@ bool dell_privacy_process_event(int type, int code, int status)
115115

116116
switch (code) {
117117
case DELL_PRIVACY_AUDIO_EVENT: /* Mic mute */
118-
case DELL_PRIVACY_CAMERA_EVENT: /* Camera mute */
119118
priv->last_status = status;
120119
sparse_keymap_report_entry(priv->input_dev, key, 1, true);
121120
ret = true;
122121
break;
122+
case DELL_PRIVACY_CAMERA_EVENT: /* Camera mute */
123+
priv->last_status = status;
124+
sparse_keymap_report_entry(priv->input_dev, key, !(status & CAMERA_STATUS), false);
125+
ret = true;
126+
break;
123127
default:
124128
dev_dbg(&priv->wdev->dev, "unknown event type 0x%04x 0x%04x\n", type, code);
125129
}
@@ -292,7 +296,7 @@ static int dell_privacy_wmi_probe(struct wmi_device *wdev, const void *context)
292296
{
293297
struct privacy_wmi_data *priv;
294298
struct key_entry *keymap;
295-
int ret, i;
299+
int ret, i, j;
296300

297301
ret = wmi_has_guid(DELL_PRIVACY_GUID);
298302
if (!ret)
@@ -304,6 +308,11 @@ static int dell_privacy_wmi_probe(struct wmi_device *wdev, const void *context)
304308

305309
dev_set_drvdata(&wdev->dev, priv);
306310
priv->wdev = wdev;
311+
312+
ret = get_current_status(priv->wdev);
313+
if (ret)
314+
return ret;
315+
307316
/* create evdev passing interface */
308317
priv->input_dev = devm_input_allocate_device(&wdev->dev);
309318
if (!priv->input_dev)
@@ -318,9 +327,20 @@ static int dell_privacy_wmi_probe(struct wmi_device *wdev, const void *context)
318327
/* remap the keymap code with Dell privacy key type 0x12 as prefix
319328
* KEY_MICMUTE scancode will be reported as 0x120001
320329
*/
321-
for (i = 0; i < ARRAY_SIZE(dell_wmi_keymap_type_0012); i++) {
322-
keymap[i] = dell_wmi_keymap_type_0012[i];
323-
keymap[i].code |= (0x0012 << 16);
330+
for (i = 0, j = 0; i < ARRAY_SIZE(dell_wmi_keymap_type_0012); i++) {
331+
/*
332+
* Unlike keys where only presses matter, userspace may act
333+
* on switches in both of their positions. Only register
334+
* SW_CAMERA_LENS_COVER if it is actually there.
335+
*/
336+
if (dell_wmi_keymap_type_0012[i].type == KE_VSW &&
337+
dell_wmi_keymap_type_0012[i].sw.code == SW_CAMERA_LENS_COVER &&
338+
!(priv->features_present & BIT(DELL_PRIVACY_TYPE_CAMERA)))
339+
continue;
340+
341+
keymap[j] = dell_wmi_keymap_type_0012[i];
342+
keymap[j].code |= (0x0012 << 16);
343+
j++;
324344
}
325345
ret = sparse_keymap_setup(priv->input_dev, keymap, NULL);
326346
kfree(keymap);
@@ -331,11 +351,12 @@ static int dell_privacy_wmi_probe(struct wmi_device *wdev, const void *context)
331351
priv->input_dev->name = "Dell Privacy Driver";
332352
priv->input_dev->id.bustype = BUS_HOST;
333353

334-
ret = input_register_device(priv->input_dev);
335-
if (ret)
336-
return ret;
354+
/* Report initial camera-cover status */
355+
if (priv->features_present & BIT(DELL_PRIVACY_TYPE_CAMERA))
356+
input_report_switch(priv->input_dev, SW_CAMERA_LENS_COVER,
357+
!(priv->last_status & CAMERA_STATUS));
337358

338-
ret = get_current_status(priv->wdev);
359+
ret = input_register_device(priv->input_dev);
339360
if (ret)
340361
return ret;
341362

drivers/platform/x86/ideapad-laptop.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1621,6 +1621,12 @@ static const struct dmi_system_id set_fn_lock_led_list[] = {
16211621
DMI_MATCH(DMI_PRODUCT_VERSION, "Lenovo Legion R7000P2020H"),
16221622
}
16231623
},
1624+
{
1625+
.matches = {
1626+
DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
1627+
DMI_MATCH(DMI_PRODUCT_VERSION, "Lenovo Legion 5 15ARH05"),
1628+
}
1629+
},
16241630
{}
16251631
};
16261632

drivers/platform/x86/intel/int3472/clk_and_regulator.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,9 @@ int skl_int3472_register_regulator(struct int3472_discrete_device *int3472,
181181
return PTR_ERR(int3472->regulator.gpio);
182182
}
183183

184+
/* Ensure the pin is in output mode and non-active state */
185+
gpiod_direction_output(int3472->regulator.gpio, 0);
186+
184187
cfg.dev = &int3472->adev->dev;
185188
cfg.init_data = &init_data;
186189
cfg.ena_gpiod = int3472->regulator.gpio;

drivers/platform/x86/intel/int3472/discrete.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,13 +168,17 @@ static int skl_int3472_map_gpio_to_clk(struct int3472_discrete_device *int3472,
168168
return (PTR_ERR(gpio));
169169

170170
int3472->clock.ena_gpio = gpio;
171+
/* Ensure the pin is in output mode and non-active state */
172+
gpiod_direction_output(int3472->clock.ena_gpio, 0);
171173
break;
172174
case INT3472_GPIO_TYPE_PRIVACY_LED:
173175
gpio = acpi_get_and_request_gpiod(path, pin, "int3472,privacy-led");
174176
if (IS_ERR(gpio))
175177
return (PTR_ERR(gpio));
176178

177179
int3472->clock.led_gpio = gpio;
180+
/* Ensure the pin is in output mode and non-active state */
181+
gpiod_direction_output(int3472->clock.led_gpio, 0);
178182
break;
179183
default:
180184
dev_err(int3472->dev, "Invalid GPIO type 0x%02x for clock\n", type);

0 commit comments

Comments
 (0)