From: Stephen Warren <swarren@wwwdotorg.org>
To: Tomasz Figa <tomasz.figa@gmail.com>
Cc: Tomasz Figa <t.figa@samsung.com>,
linux-arm-kernel@lists.infradead.org, kgene.kim@samsung.com,
devicetree-discuss@lists.ozlabs.org, kyungmin.park@samsung.com,
linux-samsung-soc@vger.kernel.org, thomas.abraham@linaro.org,
linus.walleij@linaro.org, m.szyprowski@samsung.com
Subject: Re: [RFC 0/6] pinctrl: samsung: Remove static platform-specific data
Date: Mon, 24 Sep 2012 11:34:12 -0600 [thread overview]
Message-ID: <50609994.8040005@wwwdotorg.org> (raw)
In-Reply-To: <3531529.1enE84BHSJ@flatron>
On 09/21/2012 01:31 PM, Tomasz Figa wrote:
> On Friday 21 of September 2012 12:40:35 Stephen Warren wrote:
>> On 09/20/2012 02:53 AM, Tomasz Figa wrote:
>>> This RFC series is a work on replacing static platform-specific data in
>>> pinctrl-samsung driver with data dynamically parsed from device tree.
...
>>> It aims at reducing the SoC-specific part of the driver and thus the
>>> amount of modifications to driver sources when adding support for next
>>> SoCs (like Exynos4x12).
>>>
>>> Furthermore, moving definitions of pin banks to device tree will allow
>>> to simplify GPIO and GEINT specification to a format similar to used
>>> previously by gpiolib-based implementation, using a phandle to the bank
>>> and pin index inside the bank, e.g.
>>>
>>> gpios = <&gpa1 4 0>;
>>> interrupt-parent = <&gpa1>;
>>> interrupts = <4 0>;
>>
>> I don't think those two are correlated; the GPIO specifier format could
>> just as easily be <bank pin> irrespective of whether the pinctrl driver
>> contains SoC-specific tables or not.
>
> Correct me if I'm wrong, but each bank needs to have its own subnode to be
> able to address pins like this. That was the starting point of the whole
> series and the idea that if all the banks (which are SoC-specific) have to
> be defined anyway, maybe it wouldn't be too bad to put all the SoC-specific
> parameters there too.
If you write your own custom .xlate function, I think you can do
basically anything you want; all of the following are possible, I believe:
a) Single DT node covering all banks, with GPIO specifier being <n>
where n is some linearized GPIO ID across all banks.
b) Single DT node covering all banks, with GPIO specifier being <b n>
where b is the bank number, and n is the GPIO ID within the bank (xlate
would presumably calculate "(b * MAX_GPIOS_PER_BANK) + n" and up with
the same data as in (a) above.
c) One DT node per bank, one gpio_chip registered per node, with the
GPIO specifier being <n> where n is the GPIO ID within the bank the
phandle points at.
d) One DT node per bank, all contained within a single parent DT node,
one gpio_chip registered per node (one for each bank node, and one for
the parent node), with GPIO phandles pointing at the parent node, with
GPIO specifier in the format of either (a) or (b) above, and the
top-level node's .xlate returning a different gpio_chip (for one of the
child bank-specific nodes) rather than the parent chip. At least, IIRC,
Grant Likely was going to extend a gpio_chip's .xlate to be able to
return a different chip; I'm not sure if that was implemented yet or not.
prev parent reply other threads:[~2012-09-24 17:34 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-09-20 8:53 [RFC 0/6] pinctrl: samsung: Remove static platform-specific data Tomasz Figa
2012-09-20 8:53 ` [RFC 1/6] pinctrl: exynos: Parse wakeup-eint parameters from DT Tomasz Figa
2012-09-20 8:53 ` [RFC 2/6] pinctrl: samsung: Parse pin banks " Tomasz Figa
2012-09-20 8:53 ` [RFC 3/6] pinctrl: exynos: Remove static platform-specific data Tomasz Figa
2012-09-20 8:53 ` [RFC 4/6] pinctrl: samsung: Parse bank-specific eint offset from DT Tomasz Figa
2012-09-20 8:53 ` [RFC 5/6] ARM: dts: exynos4210: Remove legacy gpio nodes Tomasz Figa
2012-09-20 8:53 ` [RFC 6/6] ARM: dts: exynos4210: Add platform-specific descriptions for pin controllers Tomasz Figa
2012-09-21 18:56 ` Stephen Warren
2012-09-21 19:54 ` Tomasz Figa
2012-09-24 17:42 ` Stephen Warren
2012-09-24 21:31 ` Tomasz Figa
2012-09-24 23:14 ` Stephen Warren
2012-09-25 9:37 ` Tomasz Figa
2012-09-25 16:49 ` Stephen Warren
2012-09-25 17:41 ` Tomasz Figa
2012-09-25 18:22 ` Stephen Warren
2012-09-25 18:35 ` Tomasz Figa
2012-09-25 22:52 ` Stephen Warren
2012-09-20 10:27 ` [RFC 0/6] pinctrl: samsung: Remove static platform-specific data Linus Walleij
2012-09-21 18:40 ` Stephen Warren
2012-09-21 19:31 ` Tomasz Figa
2012-09-24 17:34 ` Stephen Warren [this message]
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=50609994.8040005@wwwdotorg.org \
--to=swarren@wwwdotorg.org \
--cc=devicetree-discuss@lists.ozlabs.org \
--cc=kgene.kim@samsung.com \
--cc=kyungmin.park@samsung.com \
--cc=linus.walleij@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-samsung-soc@vger.kernel.org \
--cc=m.szyprowski@samsung.com \
--cc=t.figa@samsung.com \
--cc=thomas.abraham@linaro.org \
--cc=tomasz.figa@gmail.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 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).