From: Oliver Neukum <oneukum@suse.com>
To: "Andreas Färber" <afaerber@suse.de>,
"Rob Herring" <robh@kernel.org>,
"linux-serial@vger.kernel.org" <linux-serial@vger.kernel.org>,
linux-usb@vger.kernel.org
Cc: Jian-Hong Pan <starnight@g.ncu.edu.tw>,
Xue Liu <liuxuenetmail@gmail.com>,
Ben Whitten <ben.whitten@lairdtech.com>,
Linux-MIPS <linux-mips@linux-mips.org>,
"linux-arm-kernel@lists.infradead.org"
<linux-arm-kernel@lists.infradead.org>,
Stefan Rehm <rehm@miromico.ch>,
"LoRa_Community_Support@semtech.com"
<LoRa_Community_Support@semtech.com>,
Alexander Graf <agraf@suse.de>,
devicetree@vger.kernel.org,
"netdev@vger.kernel.org" <netdev@vger.kernel.org>
Subject: Re: serdev: How to attach serdev devices to USB based tty devices?
Date: Tue, 14 Aug 2018 09:23:06 +0200 [thread overview]
Message-ID: <1534231386.31827.3.camel@suse.com> (raw)
In-Reply-To: <3639955d-5990-1c82-7158-ac07b33c41f2@suse.de>
On Di, 2018-08-14 at 04:28 +0200, Andreas Färber wrote:
> My idea then was that if we had some unique criteria like vendor and
> product IDs (or whatever is supported in usb_device_id), we could write
> a usb_driver with suitable USB_DEVICE*() macro. In its probe function we
> could call into the existing tty driver's probe function and afterwards
> try creating and attaching the appropriate serdev device, i.e. a fixed
> USB-to-serdev driver mapping. Problem is that most devices don't seem to
> implement any unique identifier I could make this depend on - either by
> using a standard FT232/FT2232/CH340G chip or by using STMicroelectronics
> virtual com port identifiers in CDC firmware and only differing in the
> textual description [3] the usb_device_id does not seem to match on.
If you really must do this you can benignly fail probe(). Thus you
can compare strings within your probe() method.
This sucks because you need to make sure your drivers are always
loaded in a certain order and you really rely on undocumented
properties, but it can be done.
Regards
Oliver
next prev parent reply other threads:[~2018-08-14 10:17 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-08-14 2:28 serdev: How to attach serdev devices to USB based tty devices? Andreas Färber
2018-08-14 7:23 ` Oliver Neukum [this message]
2018-08-15 0:46 ` Andrew Lunn
2018-08-15 18:21 ` Sebastian Reichel
2018-08-21 14:29 ` Johan Hovold
2018-08-15 19:53 ` Rob Herring
2018-08-21 16:32 ` Frank Kunz
2018-08-21 18:01 ` Rob Herring
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=1534231386.31827.3.camel@suse.com \
--to=oneukum@suse.com \
--cc=LoRa_Community_Support@semtech.com \
--cc=afaerber@suse.de \
--cc=agraf@suse.de \
--cc=ben.whitten@lairdtech.com \
--cc=devicetree@vger.kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-mips@linux-mips.org \
--cc=linux-serial@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=liuxuenetmail@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=rehm@miromico.ch \
--cc=robh@kernel.org \
--cc=starnight@g.ncu.edu.tw \
/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).