Skip to contentSkip to conversation

HID: Support for CMedia CM6533 HID audio jack controls

PATCH Applied Ben Chen 2 participants 2 messages Jan 22, 2016 – Mar 2, 2016 HID

lore
Share & tools
lore

Ben Chen

author
#0 lore raw

PATCH v3 1/1 HID: Support for CMedia CM6533 HID audio jack controls

Thanks for your time.

The C-Media CM6533 is a USB audio chip featuring it's jack detection capability.The device originates an interrupt transfer via HID interface each time when a jack event occurs.
The purpose of this patch is to handle hid raw events to keep the operating system informed of user interactions.

---
Changes in v3:
- Renaming the driver to hid-cmedia.
Changes in v2:
- The return type of input_configured callback has been changed from void to be int.

 drivers/hid/Kconfig      |   6 ++
 drivers/hid/Makefile     |   1 +
 drivers/hid/hid-cmedia.c | 168 +++++++++++++++++++++++++++++++++++++++++++++++
 drivers/hid/hid-core.c   |   1 +
 drivers/hid/hid-ids.h    |   1 +
 5 files changed, 177 insertions(+)
 create mode 100644 drivers/hid/hid-cmedia.c
drivers/hid/Kconfig +6 -0
index 513a16c..4117225 100644
@@ -196,6 +196,12 @@ config HID_PRODIKEYS
 	  multimedia keyboard, but will lack support for the musical keyboard
 	  and some additional multimedia keys.
 
+config HID_CMEDIA
+	tristate "CMedia CM6533 HID audio jack controls"
+	depends on HID
+	---help---
+	Support for CMedia CM6533 HID audio jack controls.
+
 config HID_CP2112
 	tristate "Silicon Labs CP2112 HID USB-to-SMBus Bridge support"
 	depends on USB_HID && I2C && GPIOLIB
drivers/hid/Makefile +1 -0
index 00011fe..be56ab6 100644
@@ -29,6 +29,7 @@ obj-$(CONFIG_HID_BELKIN)	+= hid-belkin.o
 obj-$(CONFIG_HID_BETOP_FF)	+= hid-betopff.o
 obj-$(CONFIG_HID_CHERRY)	+= hid-cherry.o
 obj-$(CONFIG_HID_CHICONY)	+= hid-chicony.o
+obj-$(CONFIG_HID_CMEDIA)	+= hid-cmedia.o
 obj-$(CONFIG_HID_CORSAIR)	+= hid-corsair.o
 obj-$(CONFIG_HID_CP2112)	+= hid-cp2112.o
 obj-$(CONFIG_HID_CYPRESS)	+= hid-cypress.o
drivers/hid/hid-cmedia.c new file +168 -0

168 lines not on this page · raw message

drivers/hid/hid-core.c +1 -0
index 7e89288..e4e48da 100644
@@ -2051,6 +2051,7 @@ static const struct hid_device_id hid_have_special_driver[] = {
 	{ HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_NINTENDO, USB_DEVICE_ID_NINTENDO_WIIMOTE) },
 	{ HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_NINTENDO, USB_DEVICE_ID_NINTENDO_WIIMOTE2) },
 	{ HID_USB_DEVICE(USB_VENDOR_ID_RAZER, USB_DEVICE_ID_RAZER_BLADE_14) },
+	{ HID_USB_DEVICE(USB_VENDOR_ID_CMEDIA, USB_DEVICE_ID_CM6533) },
 	{ }
 };
 
drivers/hid/hid-ids.h +1 -0
index b6ff6e7..80a61c9 100644
@@ -246,6 +246,7 @@
 
 #define USB_VENDOR_ID_CMEDIA		0x0d8c
 #define USB_DEVICE_ID_CM109		0x000e
+#define USB_DEVICE_ID_CM6533		0x0022
 
 #define USB_VENDOR_ID_CODEMERCS		0x07c0
 #define USB_DEVICE_ID_CODEMERCS_IOW_FIRST	0x1500
Signature · 1 line
1.9.1
maintainer Applied
#1 lore raw
Quoted 7 lines · Ben Chen

Thanks for your time.

The C-Media CM6533 is a USB audio chip featuring it's jack detection capability.The device originates an interrupt transfer via HID interface each time when a jack event occurs.
The purpose of this patch is to handle hid raw events to keep the operating system informed of user interactions.

Applied to for-4.6/cmedia.

Signature · 2 lines
Jiri Kosina
SUSE Labs