IR Toy / IR Droid USB driver
Subsystems (4)
Sean Young
maintainerv3 cover IR Toy / IR Droid USB driver
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 | 493 ++++++++++++++++++++++++++++++++++++ drivers/usb/class/cdc-acm.c | 6 + 5 files changed, 524 insertions(+) create mode 100644 drivers/media/rc/ir_toy.c
Signature · 1 line
2.26.2
Sean Young
maintainerPATCH v3 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 | 493 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 505 insertions(+) create mode 100644 drivers/media/rc/ir_toy.c
drivers/media/rc/Kconfig +11 -0
@@ -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
@@ -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 +493 -0
493 lines not on this page · raw message
Signature · 1 line
2.26.2
kbuild test robot
build botRe: [PATCH v3 1/3] media: rc: add support for Infrared Toy and IR Droid devices
I love your patch! Yet something to improve:
Hi Sean,
I love your patch! Yet something to improve:
[auto build test ERROR on linuxtv-media/master]
[also build test ERROR on usb/usb-testing balbi-usb/testing/next linus/master v5.7-rc7 next-20200526] [if your patch is applied to the wrong git tree, please drop us a note to help improve the system. BTW, we also suggest to use '--base' option to specify the
base tree in git format-patch, please see https://stackoverflow.com/a/37406982]
url: https://github.com/0day-ci/linux/commits/Sean-Young/IR-Toy-IR-Droid-USB-driver/20200527-233914 base: git://linuxtv.org/media_tree.git master config: x86_64-allyesconfig (attached as .config) compiler: clang version 11.0.0 (https://github.com/llvm/llvm-project 3393cc4cebf9969db94dc424b7a2b6195589c33b)
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross
# install x86_64 cross compiling tool for clang build
# apt-get install binutils-x86-64-linux-gnu
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64
If you fix the issue, kindly add following tag as appropriate
All errors (new ones prefixed by >>, old ones prefixed by <<):
>> drivers/media/rc/ir_toy.c:197:4: error: expected identifier or '('
} else {
^
>> drivers/media/rc/ir_toy.c:200:1: error: extraneous closing brace ('}')}
^
2 errors generated.
vim +197 drivers/media/rc/ir_toy.c
188
189 static void irtoy_out_callback(struct urb *urb)
190 {
191 struct irtoy *irtoy = urb->context;
192
193 if (urb->status == 0) {
194 if (irtoy->state == STATE_RESET)
195 complete(&irtoy->command_done);
196 }
> 197 } else {
198 dev_warn(irtoy->dev, "out urb status: %d\n", urb->status);
199 }
> 200 }201
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org
Sean Young
maintainerPATCH v3 2/3 USB: cdc-acm: blacklist IR Droid / IR Toy device
In reply to Sean YoungThe 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
@@ -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
Sean Young
maintainerPATCH v3 3/3 MAINTAINERS: rc core and lirc maintainership
In reply to Sean YoungThis has been maintained for some time, update MAINTAINERS to reflect.
--- MAINTAINERS | 13 +++++++++++++ 1 file changed, 13 insertions(+)
MAINTAINERS +13 -0
@@ -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