Skip to contentSkip to conversation

IR Toy / IR Droid USB driver

PATCH New Sean Young 1 participant 4 messages May 28, 2020

Subsystems (4)
lore
Share & tools
lore

Sean Young

author maintainer
#0 lore raw

v4 cover IR Toy / IR Droid USB driver

changes since v3:
fix embarassing compilation failure
make driver more robust against malicious fake device

changes since v2:
review comments from Oliver Neukum <[email protected]>

changes since v1:
v1 was a serio driver, this has now been re-written to be a USB driver. This requires a blacklist in the usb cdc-acm driver.

This also allows us to feed IR data to the device from the urb callback handler, which reduces the chance of unwanted gaps in the transmission.

Sean Young (3):
media: rc: add support for Infrared Toy and IR Droid devices
USB: cdc-acm: blacklist IR Droid / IR Toy device
MAINTAINERS: rc core and lirc maintainership

 MAINTAINERS                 |  13 +
 drivers/media/rc/Kconfig    |  11 +
 drivers/media/rc/Makefile   |   1 +
 drivers/media/rc/ir_toy.c   | 509 ++++++++++++++++++++++++++++++++++++
 drivers/usb/class/cdc-acm.c |   6 +
 5 files changed, 540 insertions(+)
 create mode 100644 drivers/media/rc/ir_toy.c
Signature · 1 line
2.26.2
author maintainer
#1 lore raw

PATCH v4 1/3 media: rc: add support for Infrared Toy and IR Droid devices

http://dangerousprototypes.com/docs/USB_Infrared_Toy
https://www.irdroid.com/irdroid-usb-ir-transceiver/

---
 drivers/media/rc/Kconfig  |  11 +
 drivers/media/rc/Makefile |   1 +
 drivers/media/rc/ir_toy.c | 509 ++++++++++++++++++++++++++++++++++++++
 3 files changed, 521 insertions(+)
 create mode 100644 drivers/media/rc/ir_toy.c
drivers/media/rc/Kconfig +11 -0
index c18dee648253..2c0ee2e5b446 100644
@@ -530,6 +530,17 @@ config IR_ZX
 	   To compile this driver as a module, choose M here: the
 	   module will be called zx-irdec.
 
+config IR_TOY
+	tristate "Infrared Toy and IR Droid"
+	depends on RC_CORE
+	depends on USB_ARCH_HAS_HCD
+	help
+	   Say Y here if you want to use the Infrared Toy or IR Droid, USB
+	   versions.
+
+	   To compile this driver as a module, choose M here: the module will be
+	   called ir_toy.
+
 endif #RC_DEVICES
 
 endif #RC_CORE
drivers/media/rc/Makefile +1 -0
index 48d23433b3c0..5bb2932ab119 100644
@@ -50,3 +50,4 @@ obj-$(CONFIG_IR_MTK) += mtk-cir.o
 obj-$(CONFIG_IR_ZX) += zx-irdec.o
 obj-$(CONFIG_IR_TANGO) += tango-ir.o
 obj-$(CONFIG_RC_XBOX_DVD) += xbox_remote.o
+obj-$(CONFIG_IR_TOY) += ir_toy.o
drivers/media/rc/ir_toy.c new file +509 -0

509 lines not on this page · raw message

Signature · 1 line
2.26.2
author maintainer
#2 lore raw

PATCH v4 2/3 USB: cdc-acm: blacklist IR Droid / IR Toy device

In reply to Sean Young

The IR Droid / IR Toy device used custom protocol over serial line, so it is presenting itself as CDC ACM device.

Now that we have proper in-kernel driver for it we need to black-list the device in cdc-acm driver.

http://dangerousprototypes.com/docs/USB_Infrared_Toy
https://www.irdroid.com/irdroid-usb-ir-transceiver/

---
 drivers/usb/class/cdc-acm.c | 6 ++++++
 1 file changed, 6 insertions(+)
drivers/usb/class/cdc-acm.c +6 -0
index 84d6f7df09a4..1369e3be5019 100644
@@ -1864,6 +1864,12 @@ static const struct usb_device_id acm_ids[] = {
 	},
 #endif
 
+#if IS_ENABLED(CONFIG_IR_TOY)
+	{ USB_DEVICE(0x04d8, 0xfd08),
+	.driver_info = IGNORE_DEVICE,
+	},
+#endif
+
 	/*Samsung phone in firmware update mode */
 	{ USB_DEVICE(0x04e8, 0x685d),
 	.driver_info = IGNORE_DEVICE,
Signature · 1 line
2.26.2
author maintainer
#3 lore raw

PATCH v4 3/3 MAINTAINERS: rc core and lirc maintainership

In reply to Sean Young

This has been maintained for some time, update MAINTAINERS to reflect.

---
 MAINTAINERS | 13 +++++++++++++
 1 file changed, 13 insertions(+)
MAINTAINERS +13 -0
index 791d2a862e41..73f97fea8ba8 100644
@@ -14190,6 +14190,19 @@ L:	[email protected]
 S:	Orphan
 F:	drivers/net/wireless/ray*
 
+RC CORE / LIRC FRAMEWORK
+M:	Sean Young <[email protected]>
+L:	[email protected]
+S:	Supported
+W:	http://linuxtv.org
+T:	git git://linuxtv.org/media_tree.git
+F:	Documentation/driver-api/media/rc-core.rst
+F:	Documentation/userspace-api/media/rc/
+F:	drivers/media/rc/
+F:	include/media/rc-map.h
+F:	include/media/rc-core.h
+F:	include/uapi/linux/lirc.h
+
 RCMM REMOTE CONTROLS DECODER
 M:	Patrick Lerda <[email protected]>
 S:	Maintained
Signature · 1 line
2.26.2