linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Johan Hovold <johan@kernel.org>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Daniel Beer <daniel.beer@igorinstitute.com>,
	Jiri Kosina <jikos@kernel.org>,
	Benjamin Tissoires <benjamin.tissoires@redhat.com>,
	linux-kernel@vger.kernel.org, linux-input@vger.kernel.org,
	linux-i2c@vger.kernel.org,
	Michael Zaidman <michael.zaidman@gmail.com>,
	Christina Quast <contact@christina-quast.de>,
	linux-serial@vger.kernel.org, Jiri Slaby <jirislaby@kernel.org>
Subject: Re: [PATCH] hid-ft260: add UART support.
Date: Fri, 23 Dec 2022 12:14:31 +0100	[thread overview]
Message-ID: <Y6WNl6+ySy8zcSyg@hovoldconsulting.com> (raw)
In-Reply-To: <Y5G2PBEprjPp3FKR@kroah.com>

On Thu, Dec 08, 2022 at 11:02:36AM +0100, Greg Kroah-Hartman wrote:
> On Mon, Dec 05, 2022 at 02:24:03PM +1300, Daniel Beer wrote:
> > On Sun, Dec 04, 2022 at 10:39:21AM +0100, Greg Kroah-Hartman wrote:
> > > > Thanks for reviewing. This device is quite strange -- it presents itself
> > > > as a USB HID, but it provides both an I2C master and a UART. The
> > > > existing driver supports only the I2C functionality currently.

> > > > > A whole new major for just a single tty port?  Please no, use dynamic
> > > > > majors if you have to, or better yet, tie into the usb-serial
> > > > > implementation (this is a USB device, right?) and then you don't have to
> > > > > mess with this at all.
> > > > 
> > > > As far as I understand it, I don't think usb-serial is usable, due to
> > > > the fact that this is already an HID driver.
> > > 
> > > That should not be a restriction at all.  You are adding a tty device to
> > > this driver, no reason you can't interact with usb-serial instead.  That
> > > way you share the correct userspace tty name and major/minor numbers and
> > > all userspace tools should "just work" as they know that name and how to
> > > interact with it already.
> > > 
> > > Try doing that instead of your own "raw" tty device please.
> > 
> > Maybe I've misunderstood something. The reason I thought usb-serial was
> > unusable in this instance was that I couldn't see a way to create a port
> > except via usb-serial's own probe function (otherwise, the API looked
> > fine).
> > 
> > I don't know whether I'm looking at a serial or an I2C interface until
> > after it's already been probed by HID core, I have a struct hid_device
> > and I've asked what type of interface it is via an HID feature report.
> > This can't be determined otherwise, because strapping pins affect the
> > presentation of interfaces.
> > 
> > At that point, I (currently) call uart_add_one_port. I might have missed
> > it, but I didn't see anything analogous in the usb-serial API. Am I
> > going about this the wrong way?
> 
> I thought that this could be done, but I might be wrong.  Johan, any
> ideas?

It seems to me like this should be implemented as a new tty driver as
neither USB-serial or serial (core) is a good fit for such a HID device.

So this appears to be right approach in general:

	https://lore.kernel.org/all/20221207220617.116082-1-contact@christina-quast.de/

Johan

      reply	other threads:[~2022-12-23 11:13 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-21 22:19 [PATCH] hid-ft260: add UART support Daniel Beer
2022-12-04  8:18 ` Greg Kroah-Hartman
2022-12-04  9:12   ` Daniel Beer
2022-12-04  9:39     ` Greg Kroah-Hartman
2022-12-05  1:24       ` Daniel Beer
2022-12-08 10:02         ` Greg Kroah-Hartman
2022-12-23 11:14           ` Johan Hovold [this message]

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=Y6WNl6+ySy8zcSyg@hovoldconsulting.com \
    --to=johan@kernel.org \
    --cc=benjamin.tissoires@redhat.com \
    --cc=contact@christina-quast.de \
    --cc=daniel.beer@igorinstitute.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=jikos@kernel.org \
    --cc=jirislaby@kernel.org \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=michael.zaidman@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).