From: Johan Hovold <johan@kernel.org>
To: "Mychaela N. Falconia" <falcon@freecalypso.org>
Cc: Johan Hovold <johan@kernel.org>,
linux-usb@vger.kernel.org, mychaela.falconia@gmail.com
Subject: Re: [PATCH 0/3] a family of FTDI-based devices that need ftdi_sio quirks
Date: Tue, 29 Sep 2020 12:13:30 +0200 [thread overview]
Message-ID: <20200929101330.GQ24441@localhost> (raw)
In-Reply-To: <20200916015621.EFCDA374023F@freecalypso.org>
On Wed, Sep 16, 2020 at 01:56:21AM +0000, Mychaela N. Falconia wrote:
> Hello Johan,
>
> This patch series adds support for a family of FTDI-based devices that
> need special quirks in the ftdi_sio driver. The devices in question
> are produced by my hobby company Falconia Partners LLC, and I got a
> block of PIDs from FTDI (from their VID), so I assign custom USB IDs
> when I program FT2232 EEPROMs on my boards. These custom USD IDs are
> intended to facilitate conditionalized quirks in the ftdi_sio driver,
> as implemented in this patch series.
>
> The 3 devices (3 USB IDs) for which this patch series adds support
> consist of two JTAG+UART adapters and one dual UART adapter. Support
> for the two JTAG+UART adapters consists of nothing more than adding
> them to the USB ID table with the already existing ftdi_jtag_quirk
> applied, but the dual UART adapter (DUART28C) is more involved.
>
> The special quirk with DUART28C is that FT2232D BDBUS2 and BDBUS4
> outputs (which would normally be Channel B RTS and DTR, respectively)
> have been repurposed to drive power and reset controls to Calypso
> targets, and these power and reset controls must not be triggered
> on their own - instead their control needs to be left to special
> userspace applications. The problem is that the standard behaviour
> of all tty devices under Linux (not just ftdi_sio and not just USB
> serial, but apparently all ttys) is that DTR and RTS are always
> unconditionally asserted as soon as the tty device (ttyUSB in the
> present case) is opened, and userspace does not get a chance to
> intervene. It is not my place to debate whether this behaviour is
> good or not for true serial ports where DTR/RTS really are DTR/RTS,
> but it is a total killer for non-standard hardware where the USB to
> serial chip's DTR & RTS outputs have been repurposed to do something
> disruptive like power and reset control.
>
> The solution that works beautifully in my own hardware lab is contained
> in the present patch series: the new DUART28C-specific quirk simply
> suppresses automatic assertion of DTR&RTS for Channel B on this device.
> Userspace can then trigger PWON and RESET actions as needed with
> TIOCMBIS ioctls (followed by a delay and TIOCMBIC to make a pulse),
> and everything works beautifully. If I could get this DUART28C quirk
> (conditionalized on the USB ID which FTDI officially allocated to me)
> mainlined, it would spare my users the pain of having to apply this
> patch themselves locally.
Thanks for the well-argued series. I've applied the first one now after
dropping the PID for the dual-port device, which isn't used until the
last patch.
As you probably expected, I'm a bit reluctant to adding quirks like this
(e.g. as it makes the code harder to read and maintain):
Did you try inverting the signals so that they can be used on any serial
port to power on and release reset on open, and then just clear HUPCL if
you want the connected device to remain powered after the port is closed?
> Mychaela N. Falconia (3):
> USB: serial: ftdi_sio: add support for FreeCalypso JTAG+UART adapters
> USB: serial: ftdi_sio: pass port to quirk port_probe functions
> USB: serial: ftdi_sio: add support for FreeCalypso DUART28C adapter
>
> drivers/usb/serial/ftdi_sio.c | 72 +++++++++++++++++++++++++++++++++------
> drivers/usb/serial/ftdi_sio_ids.h | 8 +++++
> 2 files changed, 70 insertions(+), 10 deletions(-)
Johan
next prev parent reply other threads:[~2020-09-29 10:13 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-16 1:56 [PATCH 0/3] a family of FTDI-based devices that need ftdi_sio quirks Mychaela N. Falconia
2020-09-29 10:13 ` Johan Hovold [this message]
2020-09-29 19:40 ` Mychaela Falconia
2020-10-05 10:57 ` Johan Hovold
2020-10-05 20:02 ` Mychaela Falconia
2020-10-27 20:18 ` Mychaela Falconia
2020-10-28 7:17 ` Johan Hovold
2020-11-30 15:13 ` Johan Hovold
2020-11-30 20:15 ` Mychaela Falconia
2020-12-01 9:00 ` 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=20200929101330.GQ24441@localhost \
--to=johan@kernel.org \
--cc=falcon@freecalypso.org \
--cc=linux-usb@vger.kernel.org \
--cc=mychaela.falconia@gmail.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).