From: Janusz Krzysztofik <jkrzyszt@tis.icnet.pl>
To: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"linux-serial@vger.kernel.org" <linux-serial@vger.kernel.org>,
"alsa-devel@alsa-project.org" <alsa-devel@alsa-project.org>
Subject: [RFC] tty (or char) bus?
Date: Tue, 14 Jul 2009 17:31:23 +0200 [thread overview]
Message-ID: <4A5CA4CB.8070500@tis.icnet.pl> (raw)
Hi,
In my attempt to add support for contols to a voice modem codec sound
device driver, I found that in order to talk to the modem, it would be
convenient if I can get access to a tty device from inside the kernel in
a way similiar to that available form userspace. AFAICS, even if tty
lowlevel write() could be used unmodified, a convenient way of reading
characters from a tty is missing and should be implemented in a line
discipline. Please correct me if I am wrong.
OTOH, I found that some kind of abstraction layer for acccessing devices
over a tty could be convenient. Instead of allocating a new line
discipline for each specific device, sometimes found on a specific board
only, why not just create a new bus type?
Implemented as a line discipline, activated (hot-plugged) from userspace
with ldattach, that new bus adapter would give kernel level access to an
arbitrary device hanging off a tty. As the bus can be assumed
point-to-point, a single generic device could be registered
automatically in order to trigger that bus registerd drivers' probes
(vendor/model id queries, for example). If not enough, an ioctl and a
ldattach replacement could be provided for setting up a device id that
would match a driver id (something like inputattach does for N_MOUSE).
Once detected by a voice modem codec driver tty bus probe(), a codec
subdevice could then be registered with a sound card.
Please let me know if you like the idea. If not, please push me in a
better direction.
Many of the new code could be probably based on currently existing
drivers and line discplines. As I'm not familiar enough with the linux
kernel code, unlike most of you, so please give me some hints on what
specific drivers should I look at to get examples best matching my idea.
Thanks,
Janusz
next reply other threads:[~2009-07-14 15:31 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-07-14 15:31 Janusz Krzysztofik [this message]
2009-07-17 17:54 ` [RFC] tty (or char) bus? Samuel Thibault
2009-07-19 13:19 ` Tilman Schmidt
2009-07-19 13:34 ` Samuel Thibault
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=4A5CA4CB.8070500@tis.icnet.pl \
--to=jkrzyszt@tis.icnet.pl \
--cc=alsa-devel@alsa-project.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-serial@vger.kernel.org \
/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