From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.dev.rtsoft.ru (unknown [85.21.88.2]) by ozlabs.org (Postfix) with SMTP id 35B49DE597 for ; Wed, 16 Apr 2008 00:30:38 +1000 (EST) Date: Tue, 15 Apr 2008 18:30:37 +0400 From: Anton Vorontsov To: Laurent Pinchart Subject: Re: [RFC] GPIO-based flow control in the cpm_uart driver Message-ID: <20080415143037.GA18931@polina.dev.rtsoft.ru> References: <200804151522.36884.laurentp@cse-semaphore.com> <20080415134007.GA17096@polina.dev.rtsoft.ru> <200804151547.44052.laurentp@cse-semaphore.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 In-Reply-To: <200804151547.44052.laurentp@cse-semaphore.com> Cc: David Brownell , linuxppc-dev@ozlabs.org Reply-To: avorontsov@ru.mvista.com List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , On Tue, Apr 15, 2008 at 03:47:41PM +0200, Laurent Pinchart wrote: > 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. Yes, probably this name. The purpose will be the same anyway. ;-) -- Anton Vorontsov email: cbouatmailru@gmail.com irc://irc.freenode.net/bd2