From: lost.distance@yahoo.com (Paul Parsons)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] ARM: pxa: mfp: Force gpio direction for MFP_LPM_KEEP_OUTPUT
Date: Mon, 2 Apr 2012 16:34:27 +0100 (BST) [thread overview]
Message-ID: <1333380867.84262.YahooMailClassic@web29015.mail.ird.yahoo.com> (raw)
In-Reply-To: <CAN1soZy3JLK0NNt-VmgaJ8ofq5Qj7Y2WnpDKwPxyQXxZ_Mbw2w@mail.gmail.com>
Hello Haojian,
--- On Mon, 2/4/12, Haojian Zhuang <haojian.zhuang@gmail.com> wrote:
> >> > But since DRIVE_HIGH or
> DRIVE_LOW currently don't
> >> prevent that,
> >>
> >> Don't prevent what?
> >
> > Don't prevent a GPIO input being changed to an output
> when entering
> > suspend().
> >
> PGSRx register allow for selecting the output state (the
> driven value)
> of each GPIO pin when the processor enters and while it is
> in sleep
> mode.
>
> Each bit of PGSRx register is named as SS (Sleep State of
> GPIO<n>).
>
> SS '0' -- If GPIO is programmed as an output, the pin is
> driven and held
> low during the transition to and while in sleep mode.
>
> SS '1' -- If GPIO is programmed as an output, the pin is
> driven and held
> high during the transition to and while in sleep mode.
>
> So pin must be configured to GPIO output first before
> entering sleep mode.
>
> Now the issue comes. If you use the pin as input, why do you
> need to change
> it into output mode in run time?
I cannot think of a reason why you would change an input to an output.
But the possibility that the direction could be changed from input
to output has been cited as a reason why KEEP_OUTPUT cannot force
the gpio direction to output.
It is relatively easy to verify that KEEP_OUTPUT does not change the
direction from input to output, because currently only 2 platforms
use KEEP_OUTPUT, namely corgi and hx4700.
It is less easy to verify that DRIVE_HIGH and DRIVE_LOW do not change
the direction from input to output, because many more platforms use
them; a cursory check suggests that up to 16 platforms use them.
>
> > By the way, there is still the issue of DRIVE_HIGH and
> DRIVE_LOW
> > forcing the GPIO direction to output in
> pxa2xx_mfp_suspend()
> > *before* the PGSR values take effect. Surely a bug?
> >
> It's evil to change pin from input mode to output mode if
> it's in active mode.
Agreed.
So pxa2xx_mfp_suspend() contains a potential bug, unless someone can
verify that DRIVE_HIGH and DRIVE_LOW never change the direction from
input to output.
>
> Actually we only need to configure control pins to
> peripherals on pxa27x. It's
> a little different from pxa3xx. For pxa3xx, we can even
> configure input pin
> in low power mode. PXA3xx has standby mode that internal
> device keeps
> its state. PXA27x doesn't have this feature. If we want to
> save power while
> PXA27x is suspend, the peripheral should be shutdown too.
>
> Since we need to shutdown peripheral, control pin should
> always connect to
> reset or chip select signal of peripheral, we can disable
> the peripheral. So
> we needn't to configure low power mode of those input pins.
Regards,
Paul
next prev parent reply other threads:[~2012-04-02 15:34 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-03-31 12:20 [PATCH] ARM: pxa: mfp: Force gpio direction for MFP_LPM_KEEP_OUTPUT Paul Parsons
2012-04-01 9:15 ` Igor Grinberg
2012-04-01 10:56 ` Paul Parsons
2012-04-01 12:23 ` Igor Grinberg
2012-04-01 17:56 ` Paul Parsons
2012-04-02 8:39 ` Igor Grinberg
2012-04-02 11:30 ` Paul Parsons
2012-04-02 12:44 ` Igor Grinberg
2012-04-02 13:33 ` Paul Parsons
2012-04-02 14:58 ` Haojian Zhuang
2012-04-02 15:34 ` Paul Parsons [this message]
2012-04-03 8:48 ` Igor Grinberg
2012-04-03 8:01 ` Igor Grinberg
2012-04-03 12:30 ` Paul Parsons
2012-04-03 14:42 ` Igor Grinberg
2012-04-03 15:08 ` Igor Grinberg
2012-04-03 16:26 ` Paul Parsons
2012-04-12 10:59 ` Igor Grinberg
2012-04-04 1:00 ` Paul Parsons
2012-04-03 23:55 ` Paul Parsons
2012-04-05 8:16 ` Igor Grinberg
2012-04-05 11:15 ` Paul Parsons
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=1333380867.84262.YahooMailClassic@web29015.mail.ird.yahoo.com \
--to=lost.distance@yahoo.com \
--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