Skip to contentSkip to conversation

hid-chicony: Add support for another ASUS Zen AiO keyboard

PATCH Applied Daniel Drake 3 participants 6 messages Feb 17, 2017 – Apr 26, 2017 HID

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 hid-chicony: Add support for another ASUS Zen AiO keyboard

Add support for media keys on the keyboard that comes with the Asus V221ID and ZN241IC All In One computers.

The keys to support here are WLAN, BRIGHTNESSDOWN and BRIGHTNESSUP.

This device is not visibly branded as Chicony, and the USB Vendor ID suggests that it is a JESS device. However this seems like the right place to put it: the usage codes are identical to the currently supported devices, and this driver already supports the ASUS AIO keyboard AK1D.

---
 drivers/hid/Kconfig       | 4 ++--
 drivers/hid/hid-chicony.c | 1 +
 drivers/hid/hid-core.c    | 1 +
 drivers/hid/hid-ids.h     | 1 +
 4 files changed, 5 insertions(+), 2 deletions(-)
drivers/hid/Kconfig +2 -2
index 1aeb80e..8eab320 100644
@@ -175,11 +175,11 @@ config HID_CHERRY
 	Support for Cherry Cymotion keyboard.
 
 config HID_CHICONY
-	tristate "Chicony Tactical pad"
+	tristate "Chicony devices"
 	depends on HID
 	default !EXPERT
 	---help---
-	Support for Chicony Tactical pad.
+	Support for Chicony Tactical pad and special keys on Chicony keyboards.
 
 config HID_CORSAIR
 	tristate "Corsair devices"
drivers/hid/hid-chicony.c +1 -0
index bc3cec1..f04ed9a 100644
@@ -86,6 +86,7 @@ static const struct hid_device_id ch_devices[] = {
 	{ HID_USB_DEVICE(USB_VENDOR_ID_CHICONY, USB_DEVICE_ID_CHICONY_WIRELESS2) },
 	{ HID_USB_DEVICE(USB_VENDOR_ID_CHICONY, USB_DEVICE_ID_CHICONY_AK1D) },
 	{ HID_USB_DEVICE(USB_VENDOR_ID_CHICONY, USB_DEVICE_ID_CHICONY_ACER_SWITCH12) },
+	{ HID_USB_DEVICE(USB_VENDOR_ID_JESS, USB_DEVICE_ID_JESS_ZEN_AIO_KBD) },
 	{ }
 };
 MODULE_DEVICE_TABLE(hid, ch_devices);
drivers/hid/hid-core.c +1 -0
index 538ff69..405819d 100644
@@ -1909,6 +1909,7 @@ static const struct hid_device_id hid_have_special_driver[] = {
 	{ HID_USB_DEVICE(USB_VENDOR_ID_HOLTEK_ALT, USB_DEVICE_ID_HOLTEK_ALT_MOUSE_A081) },
 	{ HID_USB_DEVICE(USB_VENDOR_ID_HOLTEK_ALT, USB_DEVICE_ID_HOLTEK_ALT_MOUSE_A0C2) },
 	{ HID_USB_DEVICE(USB_VENDOR_ID_HUION, USB_DEVICE_ID_HUION_TABLET) },
+	{ HID_USB_DEVICE(USB_VENDOR_ID_JESS, USB_DEVICE_ID_JESS_ZEN_AIO_KBD) },
 	{ HID_USB_DEVICE(USB_VENDOR_ID_JESS2, USB_DEVICE_ID_JESS2_COLOR_RUMBLE_PAD) },
 	{ HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_ION, USB_DEVICE_ID_ICADE) },
 	{ HID_USB_DEVICE(USB_VENDOR_ID_KENSINGTON, USB_DEVICE_ID_KS_SLIMBLADE) },
drivers/hid/hid-ids.h +1 -0
index 86c95d3..b3df60d 100644
@@ -557,6 +557,7 @@
 
 #define USB_VENDOR_ID_JESS		0x0c45
 #define USB_DEVICE_ID_JESS_YUREX	0x1010
+#define USB_DEVICE_ID_JESS_ZEN_AIO_KBD	0x5112
 
 #define USB_VENDOR_ID_JESS2		0x0f30
 #define USB_DEVICE_ID_JESS2_COLOR_RUMBLE_PAD 0x0111
Signature · 1 line
2.9.3
#1 lore raw
Quoted 9 lines · Daniel Drake

Add support for media keys on the keyboard that comes with the Asus V221ID and ZN241IC All In One computers.

The keys to support here are WLAN, BRIGHTNESSDOWN and BRIGHTNESSUP.

This device is not visibly branded as Chicony, and the USB Vendor ID suggests that it is a JESS device. However this seems like the right place to put it: the usage codes are identical to the currently supported devices, and this driver already supports the ASUS AIO keyboard AK1D.

Except that the AK1D is branded as Chicony. So I think it will confuse users to ask them to load hid-chicony on a Asus keyboard branded as JESS.

How about adding this one to hid-asus directly (with maybe a guard against either the PID or a quirk for it)?

Cheers,
Benjamin

Quoted 66 lines
---
 drivers/hid/Kconfig       | 4 ++--
 drivers/hid/hid-chicony.c | 1 +
 drivers/hid/hid-core.c    | 1 +
 drivers/hid/hid-ids.h     | 1 +
 4 files changed, 5 insertions(+), 2 deletions(-)
drivers/hid/Kconfig +2 -2
index 1aeb80e..8eab320 100644
@@ -175,11 +175,11 @@ config HID_CHERRY
 	Support for Cherry Cymotion keyboard.
 
 config HID_CHICONY
-	tristate "Chicony Tactical pad"
+	tristate "Chicony devices"
 	depends on HID
 	default !EXPERT
 	---help---
-	Support for Chicony Tactical pad.
+	Support for Chicony Tactical pad and special keys on Chicony keyboards.
 
 config HID_CORSAIR
 	tristate "Corsair devices"
drivers/hid/hid-chicony.c +1 -0
index bc3cec1..f04ed9a 100644
@@ -86,6 +86,7 @@ static const struct hid_device_id ch_devices[] = {
 	{ HID_USB_DEVICE(USB_VENDOR_ID_CHICONY, USB_DEVICE_ID_CHICONY_WIRELESS2) },
 	{ HID_USB_DEVICE(USB_VENDOR_ID_CHICONY, USB_DEVICE_ID_CHICONY_AK1D) },
 	{ HID_USB_DEVICE(USB_VENDOR_ID_CHICONY, USB_DEVICE_ID_CHICONY_ACER_SWITCH12) },
+	{ HID_USB_DEVICE(USB_VENDOR_ID_JESS, USB_DEVICE_ID_JESS_ZEN_AIO_KBD) },
 	{ }
 };
 MODULE_DEVICE_TABLE(hid, ch_devices);
drivers/hid/hid-core.c +1 -0
index 538ff69..405819d 100644
@@ -1909,6 +1909,7 @@ static const struct hid_device_id hid_have_special_driver[] = {
 	{ HID_USB_DEVICE(USB_VENDOR_ID_HOLTEK_ALT, USB_DEVICE_ID_HOLTEK_ALT_MOUSE_A081) },
 	{ HID_USB_DEVICE(USB_VENDOR_ID_HOLTEK_ALT, USB_DEVICE_ID_HOLTEK_ALT_MOUSE_A0C2) },
 	{ HID_USB_DEVICE(USB_VENDOR_ID_HUION, USB_DEVICE_ID_HUION_TABLET) },
+	{ HID_USB_DEVICE(USB_VENDOR_ID_JESS, USB_DEVICE_ID_JESS_ZEN_AIO_KBD) },
 	{ HID_USB_DEVICE(USB_VENDOR_ID_JESS2, USB_DEVICE_ID_JESS2_COLOR_RUMBLE_PAD) },
 	{ HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_ION, USB_DEVICE_ID_ICADE) },
 	{ HID_USB_DEVICE(USB_VENDOR_ID_KENSINGTON, USB_DEVICE_ID_KS_SLIMBLADE) },
drivers/hid/hid-ids.h +1 -0
index 86c95d3..b3df60d 100644
@@ -557,6 +557,7 @@
 
 #define USB_VENDOR_ID_JESS		0x0c45
 #define USB_DEVICE_ID_JESS_YUREX	0x1010
+#define USB_DEVICE_ID_JESS_ZEN_AIO_KBD	0x5112
 
 #define USB_VENDOR_ID_JESS2		0x0f30
 #define USB_DEVICE_ID_JESS2_COLOR_RUMBLE_PAD 0x0111
Signature · 1 line
2.9.3
#2 lore raw

Hi Benjamin,

I see this was applied by Jiri before I had a chance to update it based on your feedback.

Quoted 11 lines · Benjamin Tissoires
Quoted 9 lines · Daniel Drake

Add support for media keys on the keyboard that comes with the Asus V221ID and ZN241IC All In One computers.

The keys to support here are WLAN, BRIGHTNESSDOWN and BRIGHTNESSUP.

This device is not visibly branded as Chicony, and the USB Vendor ID suggests that it is a JESS device. However this seems like the right place to put it: the usage codes are identical to the currently supported devices, and this driver already supports the ASUS AIO keyboard AK1D.

Quoted 6 lines

Except that the AK1D is branded as Chicony. So I think it will confuse users to ask them to load hid-chicony on a Asus keyboard branded as JESS.

How about adding this one to hid-asus directly (with maybe a guard against either the PID or a quirk for it)?

Indeed the new keyboard added here is not branded as Chicony nor Jess, but only as Asus.

We additionally now have another keyboard that needs the same key handling, again only branded as Asus, but this time the USB ID is 0x062a:0x5110 suggesting manufacturer TURBOX.

I am assuming you'd prefer that we have both of these keyboards handled by hid-asus instead of hid-chicony even that would duplicate a bit of code. But is it really necessary to quirk it based on PID, can't we just check for (usage->hid & HID_USAGE_PAGE) == HID_UP_MSVENDOR like hid-chicony does?

Thanks
Daniel

maintainer
#3 lore raw
Quoted 2 lines · Daniel Drake

I see this was applied by Jiri before I had a chance to update it based on your feedback.

I got a bit lost about what is branded in which way ... but if you figure out a better driver that should be binding to the device in order to make the user experience better, just please send me a followup patch that'd move things around.

Thanks,

Signature · 2 lines
Jiri Kosina
SUSE Labs
#4 lore raw
In reply to Daniel Drake

Hi Benjamin,

Trying to pick this up again.

Quoted 22 lines · Daniel Drake
Quoted 6 lines · Benjamin Tissoires
Quoted 4 lines · Daniel Drake

This device is not visibly branded as Chicony, and the USB Vendor ID suggests that it is a JESS device. However this seems like the right place to put it: the usage codes are identical to the currently supported devices, and this driver already supports the ASUS AIO keyboard AK1D.

Quoted 6 lines

Except that the AK1D is branded as Chicony. So I think it will confuse users to ask them to load hid-chicony on a Asus keyboard branded as JESS.

How about adding this one to hid-asus directly (with maybe a guard against either the PID or a quirk for it)?

Indeed the new keyboard added here is not branded as Chicony nor Jess, but only as Asus.

We additionally now have another keyboard that needs the same key handling, again only branded as Asus, but this time the USB ID is 0x062a:0x5110 suggesting manufacturer TURBOX.

Quoted 5 lines

I am assuming you'd prefer that we have both of these keyboards handled by hid-asus instead of hid-chicony even that would duplicate a bit of code. But is it really necessary to quirk it based on PID, can't we just check for (usage->hid & HID_USAGE_PAGE) == HID_UP_MSVENDOR like hid-chicony does?

I'm going to assume that following hid-chicony here (just check the usage page) is enough.

What I'm now curious about, looking closer, is whether we should move the original hid-chicony Asus AK1D support to hid-asus too. You mentioned that this keyboard is physically branded as Chicony, but are you sure? This is not mentioned in the commit message, nor in the original bug link, nor in the patch submission discussion.
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1027789
http://www.spinics.net/lists/linux-input/msg21670.html

And google image search brings up results for both the top and bottom of this keyboard, and no sign of any Chicony branding.
https://www.google.com/search?q=asus+AK1D&source=lnms&tbm=isch

So should I move AK1D support to hid-asus too, to match the physical branding?

Thanks
Daniel

maintainer Applied
#5 lore raw
In reply to Daniel Drake
Quoted 11 lines · Daniel Drake

Add support for media keys on the keyboard that comes with the Asus V221ID and ZN241IC All In One computers.

The keys to support here are WLAN, BRIGHTNESSDOWN and BRIGHTNESSUP.

This device is not visibly branded as Chicony, and the USB Vendor ID suggests that it is a JESS device. However this seems like the right place to put it: the usage codes are identical to the currently supported devices, and this driver already supports the ASUS AIO keyboard AK1D.

Applied to for-4.11/upstream-fixes. Thanks,

Signature · 2 lines
Jiri Kosina
SUSE Labs