All of lore.kernel.org
 help / color / mirror / Atom feed
From: Anton Vorontsov <avorontsov@ru.mvista.com>
To: Laurent Pinchart <laurentp@cse-semaphore.com>
Cc: David Brownell <dbrownell@users.sourceforge.net>,
	Greg Kroah-Hartman <greg@kroah.com>,
	linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org,
	linuxppc-dev@ozlabs.org, Li Yang <leoli@freescale.com>,
	Timur Tabi <timur@freescale.com>
Subject: Re: [PATCH 1/3] gpiolib: make gpio_to_chip() public
Date: Thu, 14 Aug 2008 19:10:22 +0400	[thread overview]
Message-ID: <20080814151022.GA9885@oksana.dev.rtsoft.ru> (raw)
In-Reply-To: <200808141645.56418.laurentp@cse-semaphore.com>

On Thu, Aug 14, 2008 at 04:45:52PM +0200, Laurent Pinchart wrote:
> On Thursday 14 August 2008, Anton Vorontsov wrote:
> > On Thu, Aug 14, 2008 at 04:04:18PM +0200, Laurent Pinchart wrote:
> > > On Friday 08 August 2008, Anton Vorontsov wrote:
> > > > We'll need this function to write platform-specific hooks to deal
> > > > with pin's dedicated functions. Quite obviously this will work only
> > > > for the platforms with 1-to-1 GPIO to PIN mapping.
> > > > 
> > > > This is stopgap solution till we think out and implement a proper
> > > > api (pinlib?).
> > > 
> > > How do you support reverting the GPIO mode to non-dedicated ?
> > 
> > As we always do with the GPIO API: gpio_direction_*() calls.
> 
> So the proper sequence to configure a pin in dedicated mode is to set
> the direction first (which will unset the dedicated mode bit) and
> then set dedicated mode (which will not touch the direction bit) ?

Not exactly. But you can do this way, if you need to preserve
a direction. What I did is a bit different though.

qe_gpio_set_dedicated() actually just restores a mode that
firmware had set up, including direction (since direction could
be a part of dedicated configuration).

That is, upon GPIO controller registration, we save all registers,
then driver can set up a pin to a GPIO mode via standard API, and
then it can _revert_ a pin to a dedicated function via
qe_gpio_set_dedicated() call. Dedicated function is specified by
the firmware (or board file), we're just restoring it.

-- 
Anton Vorontsov
email: cbouatmailru@gmail.com
irc://irc.freenode.net/bd2

WARNING: multiple messages have this Message-ID (diff)
From: Anton Vorontsov <avorontsov@ru.mvista.com>
To: Laurent Pinchart <laurentp@cse-semaphore.com>
Cc: linuxppc-dev@ozlabs.org, Greg Kroah-Hartman <greg@kroah.com>,
	linux-usb@vger.kernel.org,
	David Brownell <dbrownell@users.sourceforge.net>,
	Li Yang <leoli@freescale.com>,
	linux-kernel@vger.kernel.org, Timur Tabi <timur@freescale.com>
Subject: Re: [PATCH 1/3] gpiolib: make gpio_to_chip() public
Date: Thu, 14 Aug 2008 19:10:22 +0400	[thread overview]
Message-ID: <20080814151022.GA9885@oksana.dev.rtsoft.ru> (raw)
In-Reply-To: <200808141645.56418.laurentp@cse-semaphore.com>

On Thu, Aug 14, 2008 at 04:45:52PM +0200, Laurent Pinchart wrote:
> On Thursday 14 August 2008, Anton Vorontsov wrote:
> > On Thu, Aug 14, 2008 at 04:04:18PM +0200, Laurent Pinchart wrote:
> > > On Friday 08 August 2008, Anton Vorontsov wrote:
> > > > We'll need this function to write platform-specific hooks to deal
> > > > with pin's dedicated functions. Quite obviously this will work only
> > > > for the platforms with 1-to-1 GPIO to PIN mapping.
> > > > 
> > > > This is stopgap solution till we think out and implement a proper
> > > > api (pinlib?).
> > > 
> > > How do you support reverting the GPIO mode to non-dedicated ?
> > 
> > As we always do with the GPIO API: gpio_direction_*() calls.
> 
> So the proper sequence to configure a pin in dedicated mode is to set
> the direction first (which will unset the dedicated mode bit) and
> then set dedicated mode (which will not touch the direction bit) ?

Not exactly. But you can do this way, if you need to preserve
a direction. What I did is a bit different though.

qe_gpio_set_dedicated() actually just restores a mode that
firmware had set up, including direction (since direction could
be a part of dedicated configuration).

That is, upon GPIO controller registration, we save all registers,
then driver can set up a pin to a GPIO mode via standard API, and
then it can _revert_ a pin to a dedicated function via
qe_gpio_set_dedicated() call. Dedicated function is specified by
the firmware (or board file), we're just restoring it.

-- 
Anton Vorontsov
email: cbouatmailru@gmail.com
irc://irc.freenode.net/bd2

  reply	other threads:[~2008-08-14 15:32 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-08-08 16:17 [PATCH 0/3] Patches to support QE USB Host Controller Anton Vorontsov
2008-08-08 16:17 ` Anton Vorontsov
2008-08-08 16:18 ` [PATCH 1/3] gpiolib: make gpio_to_chip() public Anton Vorontsov
2008-08-08 16:18   ` Anton Vorontsov
2008-08-14 14:04   ` Laurent Pinchart
2008-08-14 14:04     ` Laurent Pinchart
2008-08-14 14:14     ` Anton Vorontsov
2008-08-14 14:14       ` Anton Vorontsov
2008-08-14 14:45       ` Laurent Pinchart
2008-08-14 14:45         ` Laurent Pinchart
2008-08-14 15:10         ` Anton Vorontsov [this message]
2008-08-14 15:10           ` Anton Vorontsov
2008-08-18 13:58           ` Laurent Pinchart
2008-08-18 13:58             ` Laurent Pinchart
2008-08-18 14:33             ` Anton Vorontsov
2008-08-18 14:33               ` Anton Vorontsov
2008-08-18 14:44               ` Laurent Pinchart
2008-08-18 14:44                 ` Laurent Pinchart
2008-08-18 15:33                 ` Anton Vorontsov
2008-08-18 15:33                   ` Anton Vorontsov
2008-08-19  9:26                   ` Laurent Pinchart
2008-08-19  9:26                     ` Laurent Pinchart
2008-08-19 14:50                     ` Anton Vorontsov
2008-08-19 14:50                       ` Anton Vorontsov
2008-08-08 16:18 ` [PATCH 2/3] powerpc/qe: new call to revert a gpio to a dedicated function Anton Vorontsov
2008-08-08 16:18   ` Anton Vorontsov
2008-08-08 16:18 ` [PATCH 3/3] USB: driver for Freescale QUICC Engine USB Host Controller Anton Vorontsov
2008-08-08 16:18   ` Anton Vorontsov
2008-08-08 23:26 ` [PATCH 0/3] Patches to support QE " Greg KH
2008-08-08 23:26   ` Greg KH
2008-08-26 15:49   ` Anton Vorontsov
2008-08-26 15:49     ` Anton Vorontsov
2008-08-14 12:15 ` Laurent Pinchart
2008-08-14 12:15   ` Laurent Pinchart
2008-09-24 20:04   ` David Brownell
2008-09-24 20:04     ` David Brownell
  -- strict thread matches above, loose matches on Subject: below --
2008-09-18 15:16 Anton Vorontsov
2008-09-18 15:17 ` [PATCH 1/3] gpiolib: make gpio_to_chip() public Anton Vorontsov
2008-09-18 15:17   ` Anton Vorontsov

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=20080814151022.GA9885@oksana.dev.rtsoft.ru \
    --to=avorontsov@ru.mvista.com \
    --cc=dbrownell@users.sourceforge.net \
    --cc=greg@kroah.com \
    --cc=laurentp@cse-semaphore.com \
    --cc=leoli@freescale.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=linuxppc-dev@ozlabs.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.