Skip to contentSkip to conversation

hp-wireless: new driver for hp wireless button for Windows 8

PATCH Superseded Alex Hung 2 participants 4 messages Jan 15, 2014 – Jan 16, 2014 x86 platform drivers

lore
Share & tools
lore

Alex Hung

author
#0 lore raw

PATCH 1/1 hp-wireless: new driver for hp wireless button for Windows 8

---
 drivers/platform/x86/Kconfig       |  11 +++
 drivers/platform/x86/Makefile      |   1 +
 drivers/platform/x86/hp-wireless.c | 145 +++++++++++++++++++++++++++++++++++++
 3 files changed, 157 insertions(+)
 create mode 100644 drivers/platform/x86/hp-wireless.c
drivers/platform/x86/Kconfig +11 -0
index 36a9e60..6bd5b03 100644
@@ -208,6 +208,17 @@ config HP_ACCEL
 	  To compile this driver as a module, choose M here: the module will
 	  be called hp_accel.
 
+config HP_WIRELESS
+	tristate "HP WIRELESS"
+	depends on ACPI
+	depends on INPUT
+	help
+	 This driver provides supports for new HP wireless button for Windows 8.
+	 On such systems the driver should load automatically (via ACPI alias).
+
+	 To compile this driver as a module, choose M here: the module will
+	 be called hp-wireless.
+
 config HP_WMI
 	tristate "HP WMI extras"
 	depends on ACPI_WMI
drivers/platform/x86/Makefile +1 -0
index 5dbe193..2f6c4d2 100644
@@ -16,6 +16,7 @@ obj-$(CONFIG_DELL_WMI_AIO)	+= dell-wmi-aio.o
 obj-$(CONFIG_ACER_WMI)		+= acer-wmi.o
 obj-$(CONFIG_ACERHDF)		+= acerhdf.o
 obj-$(CONFIG_HP_ACCEL)		+= hp_accel.o
+obj-$(CONFIG_HP_WIRELESS)	+= hp-wireless.o
 obj-$(CONFIG_HP_WMI)		+= hp-wmi.o
 obj-$(CONFIG_AMILO_RFKILL)	+= amilo-rfkill.o
 obj-$(CONFIG_TC1100_WMI)	+= tc1100-wmi.o
drivers/platform/x86/hp-wireless.c new file +145 -0

145 lines not on this page · raw message

Signature · 1 line
1.8.1.2
#1 lore raw

On Wed, 2014-01-15 at 14:29 +0800, Alex Hung wrote:

This looks pretty good, but:

drivers/platform/x86/hp-wireless.c line 87

Quoted 8 lines
drivers/platform/x86/hp-wireless.c new file +8 -0
+static void hpwl_notify(struct acpi_device *acpi_dev, u32 event)
+{
+	const struct key_entry *key;
+
+	if (event != 0x80) {
+		pr_info("Received unknown event (0x%x)\n", event);
+		return;
+	}

You're checking that it's 0x80, then using sparse_keymap_entry_from_scancode() to effectively check whether it's 0x80, so this is redundant. But I suspect that this is actually wrong - 0x80 is often used as a generic notification event, with a separate method for looking up the actual keycode. Do you have some ASL describing the device?

Also, could you add a description of what the device does to the commit so it shows up nicely in the changelog?

Signature · 1 line
Matthew Garrett <[email protected]>
author
#3 lore raw

Hi Matthew,

It is confirmed by manufacturer that "the primary function of this device will be to send an ACPI notify (0x80)".

I will re-send a patch with hardcode of KEY_RFKILL.

Quoted 5 lines · Matthew Garrett

Actually, just found an example - looks like I'm wrong and it's purely used for sending this event. In that case, don't bother with the keymap at all and just hardcode KEY_RFKILL.
--
Matthew Garrett <[email protected]>

Signature · 2 lines
Cheers,
Alex Hung