Message ID | 20201130153742.9163-6-johan@kernel.org (mailing list archive) |
---|---|
State | Superseded |
Headers | show |
Series | tty: add flag to suppress ready signalling on open | expand |
On 30. 11. 20, 16:37, Johan Hovold wrote: > --- a/drivers/usb/serial/ftdi_sio.c > +++ b/drivers/usb/serial/ftdi_sio.c ... > @@ -2386,6 +2393,21 @@ static int ftdi_stmclite_probe(struct usb_serial *serial) > return 0; > } > > +/* > + * FreeCalypso DUART28C is an FT2232D-based USB to dual UART adapter > + * with a special quirk: Channel B RTS and DTR outputs (BDBUS2 and BDBUS4 > + * on the chip) have been repurposed to drive PWON and RESET controls. > + */ > +static void ftdi_duart28c_setup(struct usb_serial_port *port) > +{ > + struct usb_serial *serial = port->serial; > + struct usb_interface *intf = serial->interface; > + int ifnum = intf->cur_altsetting->desc.bInterfaceNumber; > + > + if (ifnum == 1) > + tty_port_set_nordy(&port->port, 1); So s/1/true, provided the parameter is defined as bool now. thanks,
On Tue, Dec 01, 2020 at 07:54:10AM +0100, Jiri Slaby wrote: > On 30. 11. 20, 16:37, Johan Hovold wrote: > > --- a/drivers/usb/serial/ftdi_sio.c > > +++ b/drivers/usb/serial/ftdi_sio.c > ... > > @@ -2386,6 +2393,21 @@ static int ftdi_stmclite_probe(struct usb_serial *serial) > > return 0; > > } > > > > +/* > > + * FreeCalypso DUART28C is an FT2232D-based USB to dual UART adapter > > + * with a special quirk: Channel B RTS and DTR outputs (BDBUS2 and BDBUS4 > > + * on the chip) have been repurposed to drive PWON and RESET controls. > > + */ > > +static void ftdi_duart28c_setup(struct usb_serial_port *port) > > +{ > > + struct usb_serial *serial = port->serial; > > + struct usb_interface *intf = serial->interface; > > + int ifnum = intf->cur_altsetting->desc.bInterfaceNumber; > > + > > + if (ifnum == 1) > > + tty_port_set_nordy(&port->port, 1); > > So s/1/true, provided the parameter is defined as bool now. Also here I'm following the convention used for the other port-flag helper which are used with numerical constants (just about) consistently throughout the tree. Johan
diff --git a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c index b69032c9ec2b..b555bbc1b0a9 100644 --- a/drivers/usb/serial/ftdi_sio.c +++ b/drivers/usb/serial/ftdi_sio.c @@ -97,6 +97,7 @@ static int ftdi_stmclite_probe(struct usb_serial *serial); static int ftdi_8u2232c_probe(struct usb_serial *serial); static void ftdi_USB_UIRT_setup(struct usb_serial_port *port); static void ftdi_HE_TIRA1_setup(struct usb_serial_port *port); +static void ftdi_duart28c_setup(struct usb_serial_port *port); static const struct ftdi_sio_quirk ftdi_jtag_quirk = { .probe = ftdi_jtag_probe, @@ -122,6 +123,10 @@ static const struct ftdi_sio_quirk ftdi_8u2232c_quirk = { .probe = ftdi_8u2232c_probe, }; +static const struct ftdi_sio_quirk ftdi_duart28c_quirk = { + .port_probe = ftdi_duart28c_setup, +}; + /* * The 8U232AM has the same API as the sio except for: * - it can support MUCH higher baudrates; up to: @@ -1042,6 +1047,8 @@ static const struct usb_device_id id_table_combined[] = { .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk }, { USB_DEVICE(FTDI_VID, FTDI_FALCONIA_JTAG_UNBUF_PID), .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk }, + { USB_DEVICE(FTDI_VID, FTDI_FALCONIA_DUART28C_PID), + .driver_info = (kernel_ulong_t)&ftdi_duart28c_quirk }, { } /* Terminating entry */ }; @@ -2386,6 +2393,21 @@ static int ftdi_stmclite_probe(struct usb_serial *serial) return 0; } +/* + * FreeCalypso DUART28C is an FT2232D-based USB to dual UART adapter + * with a special quirk: Channel B RTS and DTR outputs (BDBUS2 and BDBUS4 + * on the chip) have been repurposed to drive PWON and RESET controls. + */ +static void ftdi_duart28c_setup(struct usb_serial_port *port) +{ + struct usb_serial *serial = port->serial; + struct usb_interface *intf = serial->interface; + int ifnum = intf->cur_altsetting->desc.bInterfaceNumber; + + if (ifnum == 1) + tty_port_set_nordy(&port->port, 1); +} + static int ftdi_sio_port_remove(struct usb_serial_port *port) { struct ftdi_private *priv = usb_get_serial_port_data(port); diff --git a/drivers/usb/serial/ftdi_sio_ids.h b/drivers/usb/serial/ftdi_sio_ids.h index 3d47c6d72256..3081b8916a0a 100644 --- a/drivers/usb/serial/ftdi_sio_ids.h +++ b/drivers/usb/serial/ftdi_sio_ids.h @@ -45,6 +45,7 @@ */ #define FTDI_FALCONIA_JTAG_BUF_PID 0x7150 #define FTDI_FALCONIA_JTAG_UNBUF_PID 0x7151 +#define FTDI_FALCONIA_DUART28C_PID 0x7152 /* Sienna Serial Interface by Secyourit GmbH */ #define FTDI_SIENNA_PID 0x8348