[RFC] GPIO-based flow control in the cpm_uart driver

Laurent Pinchart laurentp at cse-semaphore.com
Tue Apr 15 23:47:41 EST 2008


On Tuesday 15 April 2008 15:40, Anton Vorontsov wrote:
> On Tue, Apr 15, 2008 at 03:22:33PM +0200, Laurent Pinchart wrote:
> > Hi everybody,
> > 
> > I'm implementing flow control and modem control lines support in the
> > cpm_uart driver.
> > 
> > The implementation is based on the GPIO lib. Modem control lines are
> > described in the device tree as GPIO resources and accessed through the OF
> > GPIO bindings. The I/O ports have to be initialized as GPIOs in the 
> > platform-specific code.
> > 
> > Reading and writing the modem control lines isn't an issue, but activating 
> > hardware flow control is more complex. The driver needs to turn dedicated 
> > functions on and off for the RTS and CTS signals, and the GPIO API doesn't 
> > provide a way to access the PPAR* registers (which does make sense -
> > although arguably - as PPAR* control specific functions, not GPIOs).
> > 
> > Hardcoding RTS and CTS lines control in the driver is not an option I want
> > to consider. Extending the GPIO API to handled special functions has been
> > nacked in the past (see 
> > http://ozlabs.org/pipermail/linuxppc-dev/2008-February/051241.html). An 
> > option would be to export gpio_to_chip from drivers/gpio/gpiolib.c and use 
> > cpm1/2_set_pin in the cpm_uart driver.
> 
> Since you have successfuly ported QE USB controller onto CPM USB
> hardware, now it's obvious that we will need generic gpio_set_dedicated()
> function. So I would rather beg David to accept gpio_set_dedicated()
> approach instead of exporting gpio_to_chip(). That way we'll kill two
> birds with one stone.

Or maybe some kind of gpio_set_option() with flags specific to the 
controller ? This could be used to enable open-drain outputs or internal 
pull-ups for instance.

-- 
Laurent Pinchart
CSE Semaphore Belgium

Chaussee de Bruxelles, 732A
B-1410 Waterloo
Belgium

T +32 (2) 387 42 59
F +32 (2) 387 42 75
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://lists.ozlabs.org/pipermail/linuxppc-dev/attachments/20080415/62b5bb5a/attachment.pgp>


More information about the Linuxppc-dev mailing list