GPIO and Pinmux device tree support for Exynos.

Shawn Guo shawn.guo at freescale.com
Sun Aug 14 01:30:50 EST 2011


On Fri, Aug 12, 2011 at 01:07:37PM -0700, Stephen Warren wrote:
> Thomas Abraham wrote at Friday, August 12, 2011 1:06 AM:
> > On 12 August 2011 01:36, Stephen Warren <swarren at nvidia.com> wrote:
> > > Thomas Abraham wrote at Thursday, August 11, 2011 12:09 PM:
> > >> I did some work on the gpio and pinmux device tree support for exynos.
> > >> I thought to discuss with you about what was done before proceeding
> > >> further.
> ...
> > >> GPA: gpio-controller at 11400000 {
> > >>               compatible = "samsung,exynos4-gpio-gpa0", "samsung,exynos4-gpio";
> > >>               #gpio-cells = <4>;
> > >>               gpio-controller;
> > >> };
> ...
> > >> Device nodes would include the gpio's that it would use (as in below example)
> > >>
> > >> serial at 13800000 {
> > >>               compatible = "samsung,s5pv310-uart";
> > >>               reg = <0x13800000 0x100>;
> > >>               interrupts = <116>;
> > >>               gpios = <&GPA  0  2  0  2   /* Tx */
> > >>                               &GPA  1  2  0  2>;  /* Rx */
> > >> };
> > >
> > > The one problem with this approach is that presumably every single driver
> > > (e.g. for the serial port above) must look for and handle the gpios
> > > property, whereas presumably a serial port would otherwise have no need
> > > to deal with GPIOs.
> > 
> > The pin-mux setting on exynos4 is done in the device driver's probe
> > function. A pointer to a function, which is in the platform code, that
> > sets up the pin-mux for the driver/peripheral is passed in the
> > platform data of the driver. The driver invokes that function during
> > the probe to setup the pinmux. And all drivers adopt this approach.
> > 
> > The advantage of this approach is that the pin-mux are configured at
> > driver probe time and makes it possible to switch the functionality of
> > the pin at runtime if a pin is used by two controllers.
> 
> Does this happen often in practice?

It happens often on boards for evaluation purpose.  But yes, as you
mentioned below, we can leave it to pinctrl API. 

Regards,
Shawn

> It seems like it wouldn't be that
> common due to the HW difficulties of using the same SoC pins for different
> purposes on the same board.
> 
> Once Linus W's proposed pinctrl API is present, that might address this
> situation more directly. I don't recall any detailed discussion about how
> that API would integrate with device tree. That's probably a conversation
> we need to have.
> 



More information about the devicetree-discuss mailing list