public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@arndb.de>
To: Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: Timur Tabi <timur@freescale.com>, gregkh <gregkh@suse.de>,
	lkml <linux-kernel@vger.kernel.org>
Subject: Re: Writing a console/tty driver -- how to use tty_port?
Date: Sat, 30 Oct 2010 01:55:13 +0200	[thread overview]
Message-ID: <201010300155.13185.arnd@arndb.de> (raw)
In-Reply-To: <20101028231129.55b29420@pyx>

On Friday 29 October 2010, Alan Cox wrote:
> On Thu, 28 Oct 2010 22:57:33 +0200
> Arnd Bergmann <arnd@arndb.de> wrote:
> 
> > On Wednesday 27 October 2010 23:04:13 Timur Tabi wrote:
> > > Do you have an updated version of Tiny TTY that uses tty_port structures?  I'm
> > > trying to write a new TTY driver for a device that is not a UART, and I'm having
> > > a hard time finding a good example.  I suspect I need to understand the tty_port
> > > structure, but I can't find any documentation for it.
> > 
> > If the device is not a UART, the best option may be to make the driver
> > a backend to the hvc driver, like e.g. drivers/char/hvc_tile.c.
> > 
> > This works for all devices with or without interrupts that don't need
> > to set up the communication parameters but simply provide a read/write
> > character interface.
> 
> I really don't understand the love of hvc when the hvc drivers seem to be
> bigger than native tty_port code and haul a whole blob of extra midlayer
> glue into the system.
> 

Two reasons for me:

* It does all the timers for the tty device to poll reads and retry writes.
If someone writes similar code from scratch, they most likely get it wrong.

* It's about the simplest interface you can imagine for a new backend driver,
only register a data structure with two function pointers!

	Arnd


      reply	other threads:[~2010-10-29 23:54 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-27 21:04 Writing a console/tty driver -- how to use tty_port? Timur Tabi
2010-10-27 22:19 ` Alan Cox
2010-10-28 19:35   ` Timur Tabi
2010-10-29 13:55     ` Timur Tabi
2010-10-29 14:14       ` Timur Tabi
2010-10-28 20:34   ` Timur Tabi
2010-10-28 20:47     ` Timur Tabi
2010-10-28 20:57 ` Arnd Bergmann
2010-10-28 21:08   ` Timur Tabi
2010-10-29 14:21     ` Arnd Bergmann
2010-10-28 22:11   ` Alan Cox
2010-10-29 23:55     ` Arnd Bergmann [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=201010300155.13185.arnd@arndb.de \
    --to=arnd@arndb.de \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=gregkh@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=timur@freescale.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