linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Johan Hovold <johan@kernel.org>
To: Sean Young <sean@mess.org>
Cc: linux-media@vger.kernel.org, linux-usb@vger.kernel.org,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Jon Rhees <support@usbuirt.com>, Oliver Neukum <oneukum@suse.com>
Subject: Re: [PATCH v3 3/3] USB: serial: blacklist USB-UIRT when driver is selected
Date: Fri, 14 May 2021 13:40:21 +0200	[thread overview]
Message-ID: <YJ5hpTqH7Ke+Fv7V@hovoldconsulting.com> (raw)
In-Reply-To: <37339f4102666345168a738d0ffd80d8133a6a03.1620304986.git.sean@mess.org>

On Thu, May 06, 2021 at 01:44:55PM +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 | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c
> index 542073d2f0dd..2320bda57796 100644
> --- a/drivers/usb/serial/ftdi_sio.c
> +++ b/drivers/usb/serial/ftdi_sio.c
> @@ -95,7 +95,9 @@ static int   ftdi_jtag_probe(struct usb_serial *serial);
>  static int   ftdi_NDI_device_setup(struct usb_serial *serial);
>  static int   ftdi_stmclite_probe(struct usb_serial *serial);
>  static int   ftdi_8u2232c_probe(struct usb_serial *serial);
> +#if !IS_ENABLED(CONFIG_IR_UIRT)
>  static void  ftdi_USB_UIRT_setup(struct ftdi_private *priv);
> +#endif
>  static void  ftdi_HE_TIRA1_setup(struct ftdi_private *priv);
>  
>  static const struct ftdi_sio_quirk ftdi_jtag_quirk = {
> @@ -106,9 +108,11 @@ static const struct ftdi_sio_quirk ftdi_NDI_device_quirk = {
>  	.probe	= ftdi_NDI_device_setup,
>  };
>  
> +#if !IS_ENABLED(CONFIG_IR_UIRT)
>  static const struct ftdi_sio_quirk ftdi_USB_UIRT_quirk = {

Please use __maybe_unused instead of sprinkling ifdefs throughout the
driver.

>  	.port_probe = ftdi_USB_UIRT_setup,
>  };
> +#endif
>  
>  static const struct ftdi_sio_quirk ftdi_HE_TIRA1_quirk = {
>  	.port_probe = ftdi_HE_TIRA1_setup,
> @@ -568,8 +572,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

This would still be needed.

>  	{ USB_DEVICE(FTDI_VID, PROTEGO_SPECIAL_1) },
>  	{ USB_DEVICE(FTDI_VID, PROTEGO_R2X0) },
>  	{ USB_DEVICE(FTDI_VID, PROTEGO_SPECIAL_3) },
> @@ -2292,6 +2298,7 @@ static int ftdi_sio_port_probe(struct usb_serial_port *port)
>  	return 0;
>  }
>  
> +#if !IS_ENABLED(CONFIG_IR_UIRT)
>  /* Setup for the USB-UIRT device, which requires hardwired
>   * baudrate (38400 gets mapped to 312500) */
>  /* Called from usbserial:serial_probe */
> @@ -2301,6 +2308,7 @@ static void ftdi_USB_UIRT_setup(struct ftdi_private *priv)
>  	priv->custom_divisor = 77;
>  	priv->force_baud = 38400;
>  }
> +#endif
>  
>  /* Setup for the HE-TIRA1 device, which requires hardwired
>   * baudrate (38400 gets mapped to 100000) and RTS-CTS enabled.  */

Johan

  reply	other threads:[~2021-05-14 11:40 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-06 12:44 [PATCH v3 0/3] IR driver for USB-UIRT device Sean Young
2021-05-06 12:44 ` [PATCH v3 1/3] USB: serial: move ftdi_sio.h into include directories Sean Young
2021-05-14 11:16   ` Johan Hovold
2021-05-06 12:44 ` [PATCH v3 2/3] media: rc: new driver for USB-UIRT device Sean Young
2021-05-14 11:38   ` Johan Hovold
2021-05-15  9:52     ` Sean Young
2021-05-17  9:38       ` Johan Hovold
2021-05-06 12:44 ` [PATCH v3 3/3] USB: serial: blacklist USB-UIRT when driver is selected Sean Young
2021-05-14 11:40   ` Johan Hovold [this message]
2021-05-15  9:56     ` Sean Young
2021-05-17  9:40       ` Johan Hovold
2021-05-10  8:15 ` [PATCH v3 0/3] IR driver for USB-UIRT device Johan Hovold
2021-05-11 10:32   ` Sean Young
2021-05-14 11:16     ` Johan Hovold
2021-05-15  9:22       ` Sean Young
2021-05-17  9:30         ` Johan Hovold
2021-05-17 10:35           ` Sean Young
2021-05-17 12:35             ` Sean Young
2021-05-20 13:40               ` Johan Hovold
2021-05-20 13:31             ` Johan Hovold
2021-05-21 11:39               ` Sean Young
2021-06-23 12:48                 ` Johan Hovold
2021-05-25 12:25               ` Oliver Neukum
2021-06-23 13:10                 ` Johan Hovold
2021-06-24  9:13                   ` Sean Young
2021-06-24  9:41                     ` Johan Hovold
2021-06-25  8:08                       ` Sean Young
2021-07-02 10:44                         ` Johan Hovold

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YJ5hpTqH7Ke+Fv7V@hovoldconsulting.com \
    --to=johan@kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-media@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=oneukum@suse.com \
    --cc=sean@mess.org \
    --cc=support@usbuirt.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).