mbox series

[v4,0/2] IR driver for USB-UIRT device

Message ID cover.1623318855.git.sean@mess.org
Headers show
Series IR driver for USB-UIRT device | expand

Message

Sean Young June 10, 2021, 10:16 a.m. UTC
This is a new rc-core driver for the USB-UIRT which you can see here
http://www.usbuirt.com/

This device is supported in lirc, via the usb serial kernel driver. This
driver is both for rc-core, which means it can use kernel/BPF decoding
ec. Also this implement is superior because it can:
 - support learning mode
 - setting transmit carrier
 - larger transmits using streaming tx command

Changes since v3:
 - Review comments from Johan Hovold
 - Do not move the ftdi_sio.h file an copy FTDI_* definitions instead

Changes since v2:
 - Fixed race condition is disconnect
 - Removed superfluous kmalloc in short tx

Changes since v1:
 - Review comments from Oliver Neukum
 - Simplified wideband read function

Sean Young (2):
  media: rc: new driver for USB-UIRT device
  USB: serial: blacklist USB-UIRT when driver is selected

 drivers/media/rc/Kconfig      |  11 +
 drivers/media/rc/Makefile     |   1 +
 drivers/media/rc/uirt.c       | 740 ++++++++++++++++++++++++++++++++++
 drivers/usb/serial/ftdi_sio.c |   6 +-
 4 files changed, 756 insertions(+), 2 deletions(-)
 create mode 100644 drivers/media/rc/uirt.c

Comments

Sean Young June 10, 2021, 10:34 a.m. UTC | #1
On Thu, Jun 10, 2021 at 12:23:53PM +0200, Greg Kroah-Hartman wrote:
> On Thu, Jun 10, 2021 at 11:16:25AM +0100, Sean Young wrote:
> > The USB-UIRT device has its own driver, so blacklist the fdti driver
> > from using it if the driver has been enabled.
> > 
> > Signed-off-by: Sean Young <sean@mess.org>
> > ---
> >  drivers/usb/serial/ftdi_sio.c | 6 ++++--
> >  1 file changed, 4 insertions(+), 2 deletions(-)
> > 
> > diff --git a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c
> > index 369ef140df78..2e9a9076a38d 100644
> > --- a/drivers/usb/serial/ftdi_sio.c
> > +++ b/drivers/usb/serial/ftdi_sio.c
> > @@ -106,7 +106,7 @@ static const struct ftdi_sio_quirk ftdi_NDI_device_quirk = {
> >  	.probe	= ftdi_NDI_device_setup,
> >  };
> >  
> > -static const struct ftdi_sio_quirk ftdi_USB_UIRT_quirk = {
> > +static __maybe_unused const struct ftdi_sio_quirk ftdi_USB_UIRT_quirk = {
> 
> Why make this change?

If CONFIG_IR_UIRT is enabled, then this struct is not used. This generates
a warning when compiling with W=1 (clang or gcc):

  CC [M]  drivers/usb/serial/ftdi_sio.o
drivers/usb/serial/ftdi_sio.c:109:36: warning: ‘ftdi_USB_UIRT_quirk’ defined but not used [-Wunused-const-variable=]
  109 | static const struct ftdi_sio_quirk ftdi_USB_UIRT_quirk = {
      |                                    ^~~~~~~~~~~~~~~~~~~

> 
> >  	.port_probe = ftdi_USB_UIRT_setup,
> >  };
> >  
> > @@ -568,8 +568,10 @@ static const struct usb_device_id id_table_combined[] = {
> >  	{ USB_DEVICE(OCT_VID, OCT_DK201_PID) },
> >  	{ USB_DEVICE(FTDI_VID, FTDI_HE_TIRA1_PID),
> >  		.driver_info = (kernel_ulong_t)&ftdi_HE_TIRA1_quirk },
> > +#if !IS_ENABLED(CONFIG_IR_UIRT)
> >  	{ USB_DEVICE(FTDI_VID, FTDI_USB_UIRT_PID),
> >  		.driver_info = (kernel_ulong_t)&ftdi_USB_UIRT_quirk },
> > +#endif
> >  	{ USB_DEVICE(FTDI_VID, PROTEGO_SPECIAL_1) },
> >  	{ USB_DEVICE(FTDI_VID, PROTEGO_R2X0) },
> >  	{ USB_DEVICE(FTDI_VID, PROTEGO_SPECIAL_3) },
> > @@ -2281,7 +2283,7 @@ static int ftdi_sio_port_probe(struct usb_serial_port *port)
> >  /* Setup for the USB-UIRT device, which requires hardwired
> >   * baudrate (38400 gets mapped to 312500) */
> >  /* Called from usbserial:serial_probe */
> > -static void ftdi_USB_UIRT_setup(struct ftdi_private *priv)
> > +static __maybe_unused void ftdi_USB_UIRT_setup(struct ftdi_private *priv)
> 
> Again, why this change here?

Same again.


Thanks for reviewing.

Sean