public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Russell King <rmk+lkml@arm.linux.org.uk>
To: Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: Dmitry <dbaryshkov@gmail.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	linux-kernel@vger.kernel.org, haavard.skinnemoen@atmel.com,
	lethal@linux-sh.org, philipp.zabel@gmail.com, pavel@ucw.cz,
	tony@atomide.com, paul@pwsan.com
Subject: Re: [PATCH 5/6] Clocklib: Use correct clock for IrDA on pxa
Date: Wed, 9 Apr 2008 22:37:09 +0100	[thread overview]
Message-ID: <20080409213709.GC31386@flint.arm.linux.org.uk> (raw)
In-Reply-To: <20080409215233.1a1c0002@core>

On Wed, Apr 09, 2008 at 09:52:33PM +0100, Alan Cox wrote:
> > > It's called a line discipline, we've had them for many years. We may need
> > > a way for ldiscs and drivers to co-operate a bit more but these days we
> > > support proper buffering and arbitary baud rates (except on a few
> > > platforms whose maintainers are not paying attention ;)).
> > 
> > I feel that's a "it would be nice if" solution - and something worth
> > aiming for, but the amount of work required to get there is not going
> > to be insignificant.
> 
> The work required to fix up the existing FIR hacks is not insignifcant
> either. Also right now the tty layer is getting a major rework so now is
> actually the time to sort out anything extra that is needed.
> 
> If you want 4MBit please just use an ldisc and do
> 
> 	struct ktermios tmp;
> 	mutex_lock(&tty->termios_mutex);
> 	tmp = *tty->termios;
> 	tty_encode_baud_rate(tty, 4000000, 4000000);
> 	tty->driver->set_termios(tty, &tmp);
> 	mutex_unlock(&tty->termios_mutex);

There's more to FIR than just a baud rate change.  On PXA for instance,
SIR is implemented using the standard UART device in "SIR" mode, but FIR
is a completely separate hardware block with its own IRQs and clocks -
you need to switch the pin muxing from the UART to the FIR device.

So it's not just a matter of setting the baud rate to 4Mbps.

However, you can't just say "have two separate drivers and only use
one or the other" - all IrDA link negotiation is done at SIR at 9600
baud and only when negotiation is complete will the selected rate
become effective - be that SIR or FIR based.

So yes, using a ldisc for SIR (with a hook into the driver to tell the
driver to setup the port for IR) sounds ideal, but we're still going to
need to deal with the FIR device and switch IrDA between that and the
SIR UART ldisc.

Note - there are other reasons for finally sorting this out as well -
there are systems with IR which want to support both IrDA up to FIR
and other uart-based IR applications.  IIRC this came up on the iPAQs.
I forget exactly which applications but I believe lirc might fall into
the "want a serial port not the FIR network device interface" class.
Having SIR always go via ldiscs should sort that out nicely as well.
(I'm thinking maybe we want some control to set a port into IR
transmission/reception mode independent of selecting the IrDA ldisc -
but I'd suggest further research first - I may be just handwaving
about an already solved problem.)

-- 
Russell King
 Linux kernel    2.6 ARM Linux   - http://www.arm.linux.org.uk/
 maintainer of:

  reply	other threads:[~2008-04-09 21:37 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-04-03 13:21 [PATCH 0/6] Clocklib: generic clocks framework Dmitry Baryshkov
2008-04-03 13:23 ` [PATCH 1/6] Clocklib: add generic framework for managing clocks Dmitry Baryshkov
2008-04-07 22:55   ` Andrew Morton
2008-04-03 13:23 ` [PATCH 2/6] Clocklib: debugfs support Dmitry Baryshkov
2008-04-07 22:59   ` Andrew Morton
2008-04-08  1:04     ` Greg KH
2008-04-03 13:23 ` [PATCH 3/6] Clocklib: support sa1100 sub-arch Dmitry Baryshkov
2008-04-03 13:23 ` [PATCH 4/6] Clocklib: support ARM pxa sub-arch Dmitry Baryshkov
2008-04-03 13:24 ` [PATCH 5/6] Clocklib: Use correct clock for IrDA on pxa Dmitry Baryshkov
2008-04-07 23:00   ` Andrew Morton
2008-04-07 23:04     ` Russell King
2008-04-08  9:47       ` Dmitry
2008-04-08 19:33         ` Russell King
2008-04-09  7:15           ` Dmitry
2008-04-09 19:05             ` Russell King
2008-04-09 19:09               ` Alan Cox
2008-04-09 19:20                 ` Russell King
2008-04-09 19:39                   ` Dmitry
2008-04-09 20:52                   ` Alan Cox
2008-04-09 21:37                     ` Russell King [this message]
2008-04-03 13:24 ` [PATCH 6/6] Clocklib: use correct name for 3,6MHz clock Dmitry Baryshkov
2008-04-07 23:01   ` Andrew Morton
2008-04-07 23:06     ` Russell King
2008-04-08  9:52     ` Dmitry
2008-04-08 19:35       ` Russell King
2008-04-08 19:58         ` Dmitry
2008-04-08 20:07           ` Russell King
2008-04-09  7:19             ` Dmitry
2008-04-11 10:25             ` Dmitry Baryshkov
  -- strict thread matches above, loose matches on Subject: below --
2008-03-31  8:39 [PATCH 0/6] Clocklib: generic clocks framework Dmitry Baryshkov
2008-03-31  8:44 ` [PATCH 5/6] Clocklib: Use correct clock for IrDA on pxa Dmitry Baryshkov

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=20080409213709.GC31386@flint.arm.linux.org.uk \
    --to=rmk+lkml@arm.linux.org.uk \
    --cc=akpm@linux-foundation.org \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=dbaryshkov@gmail.com \
    --cc=haavard.skinnemoen@atmel.com \
    --cc=lethal@linux-sh.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=paul@pwsan.com \
    --cc=pavel@ucw.cz \
    --cc=philipp.zabel@gmail.com \
    --cc=tony@atomide.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