From: Tony Lindgren <tony-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org>
To: Linus Walleij <linus.walleij-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
Cc: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org,
Russell King - ARM Linux
<linux-lFZ/pmaqli7XmaaqVzeoHQ@public.gmane.org>
Subject: Re: Pin control mappings for DT
Date: Tue, 29 Nov 2011 09:42:55 -0800 [thread overview]
Message-ID: <20111129174255.GQ31337@atomide.com> (raw)
In-Reply-To: <CACRpkdYYvG2OXzwpiptbK4VWdeWVGTmE9c4PPC+EecFMkRZEiA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
Hi,
* Linus Walleij <linus.walleij-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org> [111128 23:07]:
> Greetings,
>
> can we have some initial idea about DT support for pin control
> devices and how these will look? Since pin control seems to be
> a cruicial piece for people to get board data out of their kernels
> we'd better have a common understanding.
Below is what I currently have for the pinmux-simple.c driver
I'm working on. That's easy to change though so please comment.
> The way I've understood it, we will need three pieces of
> DT data:
>
> 1) Per-driver info, includes the pin controller base, its pins, their
> (optional) names and their specific presets like bias etc.
pinmux@4a100000 {
compatible = "pinmux-simple";
reg = <0x4a100000 0x194>;
#address-cells = <1>;
#size-cells = <0>;
pinmux,access-width-16bit = <1>;
pinmux-gpmc_ad0@4a100040 {
reg = <0x4a100040>;
pinmux,functions =
"gpmc_ad0", "sdmmc2_dat0", "", "",
"", "", "", "";
};
pinmux-uart3_rx_irrx@4a100144 {
reg = <0x4a100144>;
pinmux,functions =
"uart3_rx_irrx", "dmtimer8_pwm_evt", "", "gpio_143",
"", "", "", "safe_mode";
};
...
};
> 2) Board pin group definitions, saying "these three pins
> belong to the group "i2c0-pins"
These should be there for each driver, just like the interrupts:
uart3: serial@48020000 {
compatible = "ti,8250";
reg = <0x48020000 0x100>;
reg-shift = <2>;
interrupts = < 106 >;
pins = "uart3_rx_irrx.uart3_rx_irrx",
"uart3_tx_irtx.uart3_tx_irtx";
};
Note that for now the format for now is pin_register.function.
I guess we could have it set up with something like:
pins = <&uart3_rx_irrx 7 0>;
But it easily becomes impossible for people to get it right.
Anybody got better suggestions here?
Also I don't have anything for setting the driver specific
default values yet.
> 3) Board function mapping definitions saying "the pin group
> 'i2c0-pins' is to be used with device i2c0" which can map
> several groups to a single device.
I don't think is needed? The #2 above allows mapping them
automatically. However, the mapping needs to be fixed for the
pinctrl fwk to make this work with both static data DT driver
instances.
> (1) should be read out by each pin controller driver and
> (2)+(3) by the pin controller, specifically pinmux core.
Yeah it makes sense to have the common code map the DT entries
to devices.
> I'm tentatively also thinking about:
>
> (4) Pin group state map - as in "group 'i2c0-pins' have
> the states 'active', 'sleeping' and 'idle' "
>
> Since this last piece needs to be connected to say
> bias settings etc it's currently unclear to me how that
> would work. But (1) thro (3) seem pretty solid.
Setting the pin states seems to be unhandled in the pinctrl
fwk currently, right?
In many cases it's only the pin using device driver that knows
how the pins should be set for PM and pulls, so these could
be set by the default values in DT for each driver.
Then some pins need to be dynamically re-muxed for wake-up
events etc, so I guess adding generic 'wakeup' and 'disabled'
modes might do the trick as long as those won't touch the
pull values configured by the driver. For example, 'wakeup' can
be used data lines, such as serial rx line. In that case the
serial rx line would be temporarily muxed into a GPIO input
function with wake-up flags set for the pin.
Regards,
Tony
next prev parent reply other threads:[~2011-11-29 17:42 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-11-29 7:42 Pin control mappings for DT Linus Walleij
[not found] ` <CACRpkdYYvG2OXzwpiptbK4VWdeWVGTmE9c4PPC+EecFMkRZEiA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2011-11-29 17:42 ` Tony Lindgren [this message]
[not found] ` <20111129174255.GQ31337-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org>
2011-11-29 18:02 ` Stephen Warren
[not found] ` <74CDBE0F657A3D45AFBB94109FB122FF174FDAFB24-C7FfzLzN0UxDw2glCA4ptUEOCMrvLtNR@public.gmane.org>
2011-11-29 19:59 ` Tony Lindgren
[not found] ` <20111129195937.GO13928-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org>
2011-11-30 15:14 ` Linus Walleij
[not found] ` <CACRpkdYY0Am52m2Lss+_wxnxXA9nHiGJ2TTdXymAPk=g4Zg+Jw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2011-11-30 16:54 ` Tony Lindgren
[not found] ` <20111130165415.GR13928-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org>
2011-11-30 17:45 ` Stephen Warren
[not found] ` <74CDBE0F657A3D45AFBB94109FB122FF174FDAFE75-C7FfzLzN0UxDw2glCA4ptUEOCMrvLtNR@public.gmane.org>
2011-11-30 18:49 ` Tony Lindgren
2011-12-01 12:50 ` Linus Walleij
[not found] ` <CACRpkdayqNgmOQAG+Kr_xPX8aeKghmeoDdaR4mK0N3U1CcYt-A-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2011-12-01 22:22 ` Tony Lindgren
[not found] ` <20111201222202.GG13928-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org>
2011-12-02 10:31 ` Linus Walleij
[not found] ` <CACRpkdYL8tzwrdkeuGFWsL=NC5wPqGrhrx093VevyanqUq+QkQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2011-12-02 16:30 ` Tony Lindgren
2011-11-30 18:16 ` Stephen Warren
[not found] ` <74CDBE0F657A3D45AFBB94109FB122FF174FDAFE9E-C7FfzLzN0UxDw2glCA4ptUEOCMrvLtNR@public.gmane.org>
2011-11-30 19:34 ` Tony Lindgren
[not found] ` <20111130193410.GW13928-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org>
2011-12-01 21:20 ` Stephen Warren
[not found] ` <74CDBE0F657A3D45AFBB94109FB122FF174FDB02DE-C7FfzLzN0UxDw2glCA4ptUEOCMrvLtNR@public.gmane.org>
2011-12-01 22:04 ` Tony Lindgren
2011-11-29 17:55 ` Stephen Warren
[not found] ` <74CDBE0F657A3D45AFBB94109FB122FF174FDAFB12-C7FfzLzN0UxDw2glCA4ptUEOCMrvLtNR@public.gmane.org>
2011-11-30 13:35 ` Linus Walleij
[not found] ` <CACRpkdb=dMWhyXv1g9-8jrF3kdqe1kM+fhbJy8kRO5BSR_GBvg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2011-11-30 17:12 ` Tony Lindgren
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=20111129174255.GQ31337@atomide.com \
--to=tony-4v6ys6ai5vpbdgjk7y7tuq@public.gmane.org \
--cc=devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org \
--cc=linus.walleij-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
--cc=linux-lFZ/pmaqli7XmaaqVzeoHQ@public.gmane.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).