linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: haojian.zhuang@gmail.com (Haojian Zhuang)
To: linux-arm-kernel@lists.infradead.org
Subject: How to add GPIO outputs to the PXA2xx MFP configuration?
Date: Fri, 30 Mar 2012 21:25:50 +0800	[thread overview]
Message-ID: <CAN1soZwgUooLEcDimUxyLO20x0__pAa+J3wRrH3zoW3pJsR2bg@mail.gmail.com> (raw)
In-Reply-To: <1333104093.65224.YahooMailClassic@web29002.mail.ird.yahoo.com>

On Fri, Mar 30, 2012 at 6:41 PM, Paul Parsons <lost.distance@yahoo.com> wrote:
> --- On Fri, 30/3/12, Haojian Zhuang <haojian.zhuang@gmail.com> wrote:
>> On Thu, Mar 29, 2012 at 2:12 AM, Paul
>> Parsons <lost.distance@yahoo.com>
>> wrote:
>> > On PXA2xx platforms, the MFP API (described in
>> Documentation/arm/pxa/mfp.txt)
>> > provides values for the following:
>> >
>> > 1. GPIO inputs (e.g. GPIO105_GPIO).
>> > 2. Alternate function inputs (e.g. GPIO105_CIF_DD_1).
>> > 3. Alternate function outputs (e.g.
>> GPIO105_KP_MKOUT_2).
>> >
>> > It does not provide values for GPIO outputs (i.e. AF0
>> outputs).
>> >
>> > One cannot use the macro used by the MFP API internally
>> - MFP_CFG_OUT() - to
>> > define new GPIO output values, since that macro is
>> forbidden in platform code.
>> >
>> > Without the ability to add GPIO outputs to the MFP
>> configuration, it is not
>> > possible to drive GPIO outputs high during sleep mode.
>> >
>> > This would be useful, for example, on the hx4700
>> platform, where driving the
>> > infrared powerdown GPIO 105 high during sleep mode
>> would save some mA.
>> >
>> > So my question is: what method should one use to add
>> GPIO outputs to the MFP
>> > configuration?
>> >
>> > One possible method, namely manually defining values in
>> the platform code:
>> >
>> > ? ? ? ?MFP_PIN_GPIO105 | MFP_AF0 | MFP_DIR_OUT |
>> MFP_LPM_DRIVE_HIGH,
>> >
>> > is essentially no different from using the forbidden
>> MFP_CFG_OUT() macro.
>> >
>>
>> Does MFP_CFG_OUT() help you? This macro is defined in
>> mfp-pxa2xx.h.
>
> Yes, MFP_CFG_OUT() does help. But it has been pointed out that
> MFP_CFG_OUT() is not allowed to be used in board support code:
>
> http://lists.infradead.org/pipermail/linux-arm-kernel/2012-February/086456.html
>
> Is that no longer true?

I'm sorry that I messed it. Since GPIOxx_GPIO is always defined as MFP_CFG_IN().
It seems that you're blocked to specify MFP_CFG_OUT().

Actually it's not a problem. While you're using it as output, you must
assign special
usage for this pin, like some peripheral rest signal. So I think that
you can define new
macro GPIOxx_yy() in mfp-pxa27x.h, like GPIO9_HZ_CLK(). Is it meaningful?

Best Regards
Haojian

  reply	other threads:[~2012-03-30 13:25 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-28 18:12 How to add GPIO outputs to the PXA2xx MFP configuration? Paul Parsons
2012-03-30  1:33 ` Haojian Zhuang
2012-03-30 10:41   ` Paul Parsons
2012-03-30 13:25     ` Haojian Zhuang [this message]
2012-03-30 14:30       ` Paul Parsons
2012-03-30 14:50         ` Haojian Zhuang
2012-03-30 14:59 ` Igor Grinberg
2012-03-30 15:06   ` Paul Parsons
2012-03-30 15:28     ` Igor Grinberg
2012-03-30 15:34     ` Igor Grinberg
2012-03-30 15:52       ` Paul Parsons
2012-03-30 17:59         ` Igor Grinberg
2012-03-30 21:13           ` Paul Parsons
2012-03-30 21:40             ` 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=CAN1soZwgUooLEcDimUxyLO20x0__pAa+J3wRrH3zoW3pJsR2bg@mail.gmail.com \
    --to=haojian.zhuang@gmail.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;
as well as URLs for NNTP newsgroup(s).