linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: baruch@tkos.co.il (Baruch Siach)
To: linux-arm-kernel@lists.infradead.org
Subject: Query on direction_output fn of PL061 GPIO driver.
Date: Tue, 13 Apr 2010 14:32:39 +0300	[thread overview]
Message-ID: <20100413113237.GA2212@tarshish> (raw)
In-Reply-To: <4BC44C7E.20306@st.com>

Hi Viresh,

On Tue, Apr 13, 2010 at 04:20:38PM +0530, Viresh KUMAR wrote:
> I have a query on PL061 GPIO drivers API pl061_direction_output().
> Purpose of this function is to set GPIO pin in OUT mode and set/reset
> its value.
> 
> In current implementation, firstly value of GPIO pin is modified and then its
> direction is set to OUT. In our SOCs (ST SPEAr), this implementation doesn't
> work correctly (we have pl061 in our soc). Suppose previously pin is in IN mode,
> now writing val to it doesn't change anything because it is in IN mode and we
> can write to a pin only when it is in OUT mode. Now if its direction is
> changed to OUT then also its value will remain same and will not be changed to
> what we wanted.
> 
> Am i missing something?

Probably not. This is a design bug in the PL061 hardware. Changing the 
direction before the value makes the output value of the GPIO undefined 
(apparently 0) for a short period of time. This is bad news for some 
applications.

Anyway, the right thing to do here is to reverse do just that, since the 
current way of doing things is broken.

baruch

-- 
                                                     ~. .~   Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
   - baruch at tkos.co.il - tel: +972.2.679.5364, http://www.tkos.co.il -

  reply	other threads:[~2010-04-13 11:32 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-13 10:50 Query on direction_output fn of PL061 GPIO driver Viresh KUMAR
2010-04-13 11:32 ` Baruch Siach [this message]
2010-04-13 11:40   ` Viresh KUMAR
2010-04-13 11:53     ` Baruch Siach
2010-04-13 18:57       ` Russell King - ARM Linux
2010-04-14  5:29         ` Baruch Siach
2010-04-15  4:14           ` Viresh KUMAR
2010-04-17 18:20             ` Baruch Siach

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=20100413113237.GA2212@tarshish \
    --to=baruch@tkos.co.il \
    --cc=linux-arm-kernel@lists.infradead.org \
    /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;
as well as URLs for NNTP newsgroup(s).