From: Dong Aisheng <aisheng.dong@freescale.com>
To: Guo Shawn-R65073 <r65073@freescale.com>
Cc: Dong Aisheng-B29396 <B29396@freescale.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"linux-arm-kernel@lists.infradead.org"
<linux-arm-kernel@lists.infradead.org>,
"linus.walleij@stericsson.com" <linus.walleij@stericsson.com>,
"swarren@wwwdotorg.org" <swarren@wwwdotorg.org>
Subject: Re: [PATCH RFC 1/1] pinctrl: improve gpio support for dt
Date: Thu, 17 May 2012 10:24:13 +0800 [thread overview]
Message-ID: <20120517022412.GH10347@shlinux2.ap.freescale.net> (raw)
In-Reply-To: <20120517021614.GG3764@S2100-06.ap.freescale.net>
On Thu, May 17, 2012 at 10:16:15AM +0800, Guo Shawn-R65073 wrote:
> On Tue, May 15, 2012 at 10:07:19PM +0800, Dong Aisheng wrote:
> > From: Dong Aisheng <dong.aisheng@linaro.org>
> >
> > For dt, the gpio base may be dynamically allocated, thus the original
> > implementation of gpio support based on static gpio number and pin id
> > map may not be easy to use for dt.
> >
> > One solution is a) use alias id for gpio node and refer to it in gpio
> > range, then we can get the fixed the gpio devices for this range and
> > b) get gpio chip from node which is specified in gpio range structure,
> > then get the dynamically allocated gpio chip base and c) using the chip
> > gpio base and offset to map to a physical pin id for dt.
> >
> > To implement that, we need add two members in pinctrl_gpio_range structure,
> > 'np' the gpio node for this range and 'off' the offset in this gpio range
> > of the gpio chip.
> >
> > For devicetree, user can use this two member instead of range->base
> > to create the map, the core will dynamically set the correct range->base
> > based on the gpio base plus gpio offset.
> >
> > For example:
> > static struct pinctrl_gpio_range imx28_gpio_ranges[] = {
> > { .name = "gpio", .id = 0, .pin_base = 0, .npins = 8, .np = np_gpio0 .off = 0,},
> > { .name = "gpio", .id = 0, .pin_base = 16, .npins = 13, .np = np_gpio0 .off = 16,},
> > { .name = "gpio", .id = 1, .pin_base = 32, .npins = 32, .np = np_gpio1 .off = 16},
>
> How do you have .np statically assigned?
>
The drivers are responsible for set .np, usually dynamically get it from whether
the driver wants.
Regards
Dong Aisheng
next prev parent reply other threads:[~2012-05-17 2:19 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-05-15 14:07 Dong Aisheng
2012-05-17 2:16 ` Shawn Guo
2012-05-17 2:24 ` Dong Aisheng [this message]
2012-05-17 20:06 ` Stephen Warren
2012-05-18 7:26 ` Dong Aisheng
2012-05-18 15:48 ` Stephen Warren
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=20120517022412.GH10347@shlinux2.ap.freescale.net \
--to=aisheng.dong@freescale.com \
--cc=B29396@freescale.com \
--cc=linus.walleij@stericsson.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=r65073@freescale.com \
--cc=swarren@wwwdotorg.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
Powered by JetHome