intel-hid: new hid event driver for hotkeys
PATCH 1/1 intel-hid: new hid event driver for hotkeys
This driver supports various hid events including hotkeys. Dell XPS 13 9350 requires it for wireless hotkey.
Andy Lutomirski contributed greatly to this driver.
--- MAINTAINERS | 6 + drivers/platform/x86/Kconfig | 11 ++ drivers/platform/x86/Makefile | 1 + drivers/platform/x86/intel-hid.c | 289 +++++++++++++++++++++++++++++++++++++++ 4 files changed, 307 insertions(+) create mode 100644 drivers/platform/x86/intel-hid.c
MAINTAINERS +6 -0
@@ -5502,6 +5502,12 @@ T: git git://git.code.sf.net/p/intel-sas/isci S: Supported F: drivers/scsi/isci/ +INTEL HID EVENT FILTER DRIVER +M: Alex Hung <[email protected]> +L: [email protected] +S: Maintained +F: drivers/platform/x86/intel-hid.c + INTEL IDLE DRIVER M: Len Brown <[email protected]> L: [email protected]
drivers/platform/x86/Kconfig +11 -0
@@ -731,6 +731,17 @@ config ACPI_CMPC keys as input device, backlight device, tablet and accelerometer devices. +config INTEL_HID_EVENT + tristate "INTEL HID Event Filter" + depends on ACPI + depends on INPUT + help + This driver provides supports for Intel HID event. Some laptops + require this driver for hotkey supports. + + To compile this driver as a module, choose M here: the module will + be called intel_hid. + config INTEL_SCU_IPC bool "Intel SCU IPC Support" depends on X86_INTEL_MID
drivers/platform/x86/Makefile +1 -0
@@ -41,6 +41,7 @@ obj-$(CONFIG_ACPI_TOSHIBA) += toshiba_acpi.o obj-$(CONFIG_TOSHIBA_BT_RFKILL) += toshiba_bluetooth.o obj-$(CONFIG_TOSHIBA_HAPS) += toshiba_haps.o obj-$(CONFIG_TOSHIBA_WMI) += toshiba-wmi.o +obj-$(CONFIG_INTEL_HID_EVENT) += intel-hid.o obj-$(CONFIG_INTEL_SCU_IPC) += intel_scu_ipc.o obj-$(CONFIG_INTEL_SCU_IPC_UTIL) += intel_scu_ipcutil.o obj-$(CONFIG_INTEL_MFLD_THERMAL) += intel_mid_thermal.o
drivers/platform/x86/intel-hid.c new file +289 -0
289 lines not on this page · raw message
Signature · 1 line
1.9.1
Quoted 6 lines · Alex Hung
This driver supports various hid events including hotkeys. Dell XPS 13 9350 requires it for wireless hotkey.
Andy Lutomirski contributed greatly to this driver.
Signed-off-by Alex Hung <[email protected]>
Queued for testing.
Andy, please provide your Reviewed-by if you're happy with it.
Alex, just one question maybe you can answer quickly and save me some time below:
drivers/platform/x86/intel-hid.c line 92
Quoted 11 lines
drivers/platform/x86/intel-hid.c new file +11
-0+static int intel_hid_pl_suspend_handler (struct device *device) +{ +intel_hid_set_enable (device,0 ); +return 0 ; +} + +static int intel_hid_pl_resume_handler (struct device *device) +{ +intel_hid_set_enable (device,1 ); +return 0 ; +}
Why not propagate the intel_hid_set_enable() return code? Is it because it just doesn't really impact suspend/resume, even if we do get an error?
Signature · 2 lines
Darren Hart Intel Open Source Technology Center
Quoted 11 lines · Darren Hart
Quoted 6 lines · Alex Hung
This driver supports various hid events including hotkeys. Dell XPS 13 9350 requires it for wireless hotkey.
Andy Lutomirski contributed greatly to this driver.
Signed-off-by Alex Hung <[email protected]>Queued for testing.
Andy, please provide your Reviewed-by if you're happy with it.
Minor nits, though:
+ This driver provides supports for Intel HID event. Some laptops
+ require this driver for hotkey supports.
Should that be "This driver provides support for the Intel HID Event hotkey interface. Some laptops require this driver for hotkey support."?
Also, can we remove the word "Filter" a couple lines up in the Kconfig file? I'd guess the the Windows equivalent is a "filter' driver in the Windows model, but it's not logically filtering anything, and there's nothing filter-like about the Linux driver.
(I think it's slightly sad that HID is in the name, too, but that's indeed what it seems to be called.)
Quoted 5 lines
Alex, just one question maybe you can answer quickly and save me some time below:
Quoted 14 lines
drivers/platform/x86/intel-hid.c line 92
Quoted 11 lines
drivers/platform/x86/intel-hid.c new file +11
-0+static int intel_hid_pl_suspend_handler (struct device *device) +{ +intel_hid_set_enable (device,0 ); +return 0 ; +} + +static int intel_hid_pl_resume_handler (struct device *device) +{ +intel_hid_set_enable (device,1 ); +return 0 ; +}Why not propagate the
intel_hid_set_enable()return code? Is it because it just doesn't really impact suspend/resume, even if we do get an error?
That was me, actually. I definitely don't want to cause suspect to fail if the ACPI call fails. At worst we'll report a spurious key event when we resume.
--Andy
Quoted 24 lines · Andy Lutomirski
Quoted 11 lines · Darren Hart
Quoted 6 lines · Alex Hung
This driver supports various hid events including hotkeys. Dell XPS 13 9350 requires it for wireless hotkey.
Andy Lutomirski contributed greatly to this driver.
Signed-off-by Alex Hung <[email protected]>Queued for testing.
Andy, please provide your Reviewed-by if you're happy with it.
Reviewed-and-tested-by Andy Lutomirski <[email protected]>Minor nits, though:
drivers/platform/x86/Kconfig +2
-0+ This driver provides supports for Intel HID event. Some laptops + require this driver for hotkey supports.Should that be "This driver provides support for the Intel HID Event hotkey interface. Some laptops require this driver for hotkey support."?
Quoted 7 lines
Also, can we remove the word "Filter" a couple lines up in the
Kconfigfile? I'd guess the the Windows equivalent is a "filter' driver in the Windows model, but it's not logically filtering anything, and there's nothing filter-like about the Linux driver.(I think it's slightly sad that HID is in the name, too, but that's indeed what it seems to be called.)
These are minor, but I had similar thoughts. I'd be happy to see these included and respun.
Quoted 21 lines
Quoted 6 lines
Alex, just one question maybe you can answer quickly and save me some time below:
Quoted 14 lines
drivers/platform/x86/intel-hid.c line 92
Quoted 11 lines
drivers/platform/x86/intel-hid.c new file +11
-0+static int intel_hid_pl_suspend_handler (struct device *device) +{ +intel_hid_set_enable (device,0 ); +return 0 ; +} + +static int intel_hid_pl_resume_handler (struct device *device) +{ +intel_hid_set_enable (device,1 ); +return 0 ; +}Why not propagate the
intel_hid_set_enable()return code? Is it because it just doesn't really impact suspend/resume, even if we do get an error?
Quoted 4 lines
That was me, actually. I definitely don't want to cause suspect to fail if the ACPI call fails. At worst we'll report a spurious key event when we resume.
OK, thanks for the clarification (reminder :-)
Signature · 2 lines
Darren Hart Intel Open Source Technology Center
Quoted 30 lines · Darren Hart
Quoted 29 lines · Andy Lutomirski
Quoted 11 lines · Darren Hart
Quoted 6 lines · Alex Hung
This driver supports various hid events including hotkeys. Dell XPS 13 9350 requires it for wireless hotkey.
Andy Lutomirski contributed greatly to this driver.
Signed-off-by Alex Hung <[email protected]>Queued for testing.
Andy, please provide your Reviewed-by if you're happy with it.
Reviewed-and-tested-by Andy Lutomirski <[email protected]>Minor nits, though:
drivers/platform/x86/Kconfig +2
-0+ This driver provides supports for Intel HID event. Some laptops + require this driver for hotkey supports.Should that be "This driver provides support for the Intel HID Event hotkey interface. Some laptops require this driver for hotkey support."?
Also, can we remove the word "Filter" a couple lines up in the
Kconfigfile? I'd guess the the Windows equivalent is a "filter' driver in the Windows model, but it's not logically filtering anything, and there's nothing filter-like about the Linux driver.
Quoted 5 lines
Quoted 2 lines
(I think it's slightly sad that HID is in the name, too, but that's indeed what it seems to be called.)
These are minor, but I had similar thoughts. I'd be happy to see these included and respun.
That sounds good. I am removing "filter" in various places and will resend the patch shortly.
Quoted 32 lines
Quoted 22 lines
Quoted 7 lines
Alex, just one question maybe you can answer quickly and save me some time below:
Quoted 14 lines
drivers/platform/x86/intel-hid.c line 92
Quoted 11 lines
drivers/platform/x86/intel-hid.c new file +11
-0+static int intel_hid_pl_suspend_handler (struct device *device) +{ +intel_hid_set_enable (device,0 ); +return 0 ; +} + +static int intel_hid_pl_resume_handler (struct device *device) +{ +intel_hid_set_enable (device,1 ); +return 0 ; +}Why not propagate the
intel_hid_set_enable()return code? Is it because it just doesn't really impact suspend/resume, even if we do get an error?Quoted 4 lines
That was me, actually. I definitely don't want to cause suspect to fail if the ACPI call fails. At worst we'll report a spurious key event when we resume.
OK, thanks for the clarification (reminder :-)
--
Darren Hart
Intel Open Source Technology Center
Signature · 2 lines
Cheers, Alex Hung
Quite a bit late, but still:
drivers/platform/x86/intel-hid.c line 282
Quoted 9 lines · Alex Hung
drivers/platform/x86/intel-hid.c new file +9
-0+ +static int __init intel_hid_init (void ) +{ +acpi_walk_namespace (ACPI_TYPE_DEVICE ,ACPI_ROOT_OBJECT , +ACPI_UINT32_MAX , check_acpi_dev,NULL , + (void *)intel_hid_ids,NULL ); + +return platform_driver_register (&intel_hid_pl_driver); +}
Why do we need to walk instantiate the device ourselves instead of having ACPI core do it for us? I also see this pattern in intel-vbtn.c now.
Thanks.
Signature · 1 line
Dmitry
Quoted 16 lines · Dmitry Torokhov
Quite a bit late, but still:
drivers/platform/x86/intel-hid.c line 282
Quoted 9 lines · Alex Hung
drivers/platform/x86/intel-hid.c new file +9
-0+ +static int __init intel_hid_init (void ) +{ +acpi_walk_namespace (ACPI_TYPE_DEVICE ,ACPI_ROOT_OBJECT , +ACPI_UINT32_MAX , check_acpi_dev,NULL , + (void *)intel_hid_ids,NULL ); + +return platform_driver_register (&intel_hid_pl_driver); +}Why do we need to walk instantiate the device ourselves instead of having ACPI core do it for us? I also see this pattern in
intel-vbtn.cnow.
See the comment above check_acpi_dev():
/*
* Unfortunately, some laptops provide a _HID="INT33D5" device with
* _CID="PNP0C02". This causes the pnpacpi scan driver to claim the
* ACPI node, so no platform device will be created. The pnpacpi
* driver rejects this device in subsequent processing, so no physical
* node is created at all.
*
* As a workaround until the ACPI core figures out how to handle
* this corner case, manually ask the ACPI platform device code to
* claim the ACPI node.
*/
Quoted 5 lines
Thanks.
--
Dmitry
Signature · 2 lines
Andy Lutomirski AMA Capital Management, LLC
Quoted 21 lines · Andy Lutomirski
Quoted 16 lines · Dmitry Torokhov
Quite a bit late, but still:
drivers/platform/x86/intel-hid.c line 282
Quoted 9 lines · Alex Hung
drivers/platform/x86/intel-hid.c new file +9
-0+ +static int __init intel_hid_init (void ) +{ +acpi_walk_namespace (ACPI_TYPE_DEVICE ,ACPI_ROOT_OBJECT , +ACPI_UINT32_MAX , check_acpi_dev,NULL , + (void *)intel_hid_ids,NULL ); + +return platform_driver_register (&intel_hid_pl_driver); +}Why do we need to walk instantiate the device ourselves instead of having ACPI core do it for us? I also see this pattern in
intel-vbtn.cnow.See the comment above
check_acpi_dev():
Quoted 11 lines
/*
* Unfortunately, some laptops provide a _HID="INT33D5" device with
* _CID="PNP0C02". This causes the pnpacpi scan driver to claim the
* ACPI node, so no platform device will be created. The pnpacpi
* driver rejects this device in subsequent processing, so no physical
* node is created at all.
*
* As a workaround until the ACPI core figures out how to handle
* this corner case, manually ask the ACPI platform device code to
* claim the ACPI node.
*/
Ah, I missed that (because I originally looked at intel-vbtn). Does INT33D6 also have the same issue?
Signature · 1 line
Dmitry
Quoted 34 lines · Dmitry Torokhov
Quoted 21 lines · Andy Lutomirski
Quoted 16 lines · Dmitry Torokhov
Quite a bit late, but still:
drivers/platform/x86/intel-hid.c line 282
Quoted 9 lines · Alex Hung
drivers/platform/x86/intel-hid.c new file +9
-0+ +static int __init intel_hid_init (void ) +{ +acpi_walk_namespace (ACPI_TYPE_DEVICE ,ACPI_ROOT_OBJECT , +ACPI_UINT32_MAX , check_acpi_dev,NULL , + (void *)intel_hid_ids,NULL ); + +return platform_driver_register (&intel_hid_pl_driver); +}Why do we need to walk instantiate the device ourselves instead of having ACPI core do it for us? I also see this pattern in
intel-vbtn.cnow.See the comment above
check_acpi_dev():Quoted 11 lines
/*
* Unfortunately, some laptops provide a _HID="INT33D5" device with
* _CID="PNP0C02". This causes the pnpacpi scan driver to claim the
* ACPI node, so no platform device will be created. The pnpacpi
* driver rejects this device in subsequent processing, so no physical
* node is created at all.
*
* As a workaround until the ACPI core figures out how to handle
* this corner case, manually ask the ACPI platform device code to
* claim the ACPI node.
*/
Quoted 2 lines
Ah, I missed that (because I originally looked at intel-vbtn). Does INT33D6 also have the same issue?
I don't know, because I don't have that device at all. Alex?
--Andy