Skip to content

Commit 5624d4c

Browse files
committed
Merge tag 'platform-drivers-x86-v6.18-3' of git://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86
Pull x86 platform driver fixes from Ilpo Järvinen: "Fixes and New Hotkey Support: - input + dell-wmi-base: Electronic privacy screen on/off hotkey support - int3472: Fix unregister double free - wireless-hotkey: Fix Kconfig typo" * tag 'platform-drivers-x86-v6.18-3' of git://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86: platform: x86: Kconfig: fix minor typo in help for WIRELESS_HOTKEY platform/x86: dell-wmi-base: Handle electronic privacy screen on/off events Input: Add keycodes for electronic privacy screen on/off hotkeys MAINTAINERS: Update int3472 maintainers platform/x86: int3472: Fix double free of GPIO device during unregister
2 parents 1c353dc + bd34bf5 commit 5624d4c

File tree

6 files changed

+28
-7
lines changed

6 files changed

+28
-7
lines changed

MAINTAINERS

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12862,7 +12862,8 @@ F: tools/testing/selftests/sgx/*
1286212862
K: \bSGX_
1286312863

1286412864
INTEL SKYLAKE INT3472 ACPI DEVICE DRIVER
12865-
M: Daniel Scally <djrscally@gmail.com>
12865+
M: Daniel Scally <dan.scally@ideasonboard.com>
12866+
M: Sakari Ailus <sakari.ailus@linux.intel.com>
1286612867
S: Maintained
1286712868
F: drivers/platform/x86/intel/int3472/
1286812869
F: include/linux/platform_data/x86/int3472.h

drivers/platform/x86/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -432,7 +432,7 @@ config WIRELESS_HOTKEY
432432
depends on INPUT
433433
help
434434
This driver provides supports for the wireless buttons found on some AMD,
435-
HP, & Xioami laptops.
435+
HP, & Xiaomi laptops.
436436
On such systems the driver should load automatically (via ACPI alias).
437437

438438
To compile this driver as a module, choose M here: the module will

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

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -365,6 +365,13 @@ static const struct key_entry dell_wmi_keymap_type_0012[] = {
365365
/* Backlight brightness change event */
366366
{ KE_IGNORE, 0x0003, { KEY_RESERVED } },
367367

368+
/*
369+
* Electronic privacy screen toggled, extended data gives state,
370+
* separate entries for on/off see handling in dell_wmi_process_key().
371+
*/
372+
{ KE_KEY, 0x000c, { KEY_EPRIVACY_SCREEN_OFF } },
373+
{ KE_KEY, 0x000c, { KEY_EPRIVACY_SCREEN_ON } },
374+
368375
/* Ultra-performance mode switch request */
369376
{ KE_IGNORE, 0x000d, { KEY_RESERVED } },
370377

@@ -435,6 +442,11 @@ static int dell_wmi_process_key(struct wmi_device *wdev, int type, int code, u16
435442
"Dell tablet mode switch",
436443
SW_TABLET_MODE, !buffer[0]);
437444
return 1;
445+
} else if (type == 0x0012 && code == 0x000c && remaining > 0) {
446+
/* Eprivacy toggle, switch to "on" key entry for on events */
447+
if (buffer[0] == 2)
448+
key++;
449+
used = 1;
438450
} else if (type == 0x0012 && code == 0x000d && remaining > 0) {
439451
value = (buffer[2] == 2);
440452
used = 1;

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

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -245,15 +245,12 @@ int skl_int3472_register_regulator(struct int3472_discrete_device *int3472,
245245
if (IS_ERR(regulator->rdev))
246246
return PTR_ERR(regulator->rdev);
247247

248-
int3472->regulators[int3472->n_regulator_gpios].ena_gpio = gpio;
249248
int3472->n_regulator_gpios++;
250249
return 0;
251250
}
252251

253252
void skl_int3472_unregister_regulator(struct int3472_discrete_device *int3472)
254253
{
255-
for (int i = 0; i < int3472->n_regulator_gpios; i++) {
254+
for (int i = 0; i < int3472->n_regulator_gpios; i++)
256255
regulator_unregister(int3472->regulators[i].rdev);
257-
gpiod_put(int3472->regulators[i].ena_gpio);
258-
}
259256
}

include/linux/platform_data/x86/int3472.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,6 @@ struct int3472_gpio_regulator {
100100
struct regulator_consumer_supply supply_map[GPIO_REGULATOR_SUPPLY_MAP_COUNT * 2];
101101
char supply_name_upper[GPIO_SUPPLY_NAME_LENGTH];
102102
char regulator_name[GPIO_REGULATOR_NAME_LENGTH];
103-
struct gpio_desc *ena_gpio;
104103
struct regulator_dev *rdev;
105104
struct regulator_desc rdesc;
106105
};

include/uapi/linux/input-event-codes.h

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -631,6 +631,18 @@
631631
#define KEY_BRIGHTNESS_MIN 0x250 /* Set Brightness to Minimum */
632632
#define KEY_BRIGHTNESS_MAX 0x251 /* Set Brightness to Maximum */
633633

634+
/*
635+
* Keycodes for hotkeys toggling the electronic privacy screen found on some
636+
* laptops on/off. Note when the embedded-controller turns on/off the eprivacy
637+
* screen itself then the state should be reported through drm connecter props:
638+
* https://www.kernel.org/doc/html/latest/gpu/drm-kms.html#standard-connector-properties
639+
* Except when implementing the drm connecter properties API is not possible
640+
* because e.g. the firmware does not allow querying the presence and/or status
641+
* of the eprivacy screen at boot.
642+
*/
643+
#define KEY_EPRIVACY_SCREEN_ON 0x252
644+
#define KEY_EPRIVACY_SCREEN_OFF 0x253
645+
634646
#define KEY_KBDINPUTASSIST_PREV 0x260
635647
#define KEY_KBDINPUTASSIST_NEXT 0x261
636648
#define KEY_KBDINPUTASSIST_PREVGROUP 0x262

0 commit comments

Comments
 (0)