]> git.baikalelectronics.ru Git - kernel.git/commit
gpio/mxc: specify gpio base for device tree probe
authorShawn Guo <shawn.guo@linaro.org>
Sun, 5 Aug 2012 06:01:26 +0000 (14:01 +0800)
committerLinus Walleij <linus.walleij@linaro.org>
Tue, 7 Aug 2012 06:55:22 +0000 (08:55 +0200)
commit1bc780d0779cdc8064e9704152f6ce444a9f708c
treeb6a171ee5b2fc0611c968a9d905e07ba481c442e
parent5489cf5a386d7dcfb3fe60c42f80e371e61245a9
gpio/mxc: specify gpio base for device tree probe

Currently, unlike the non-DT probe where the gpio base is specified
with pdev->id, the DT probe uses the base dynamically allocated by
gpio core, which uses a completely different numbering scheme.  This
causes two issues to user space applications which access sysfs entry
/sys/class/gpio/gpioN.

* It breaks the compatibility with user space applications between
  non-DT and DT kernels.

* It's not intuitive and sometimes hard for users to map the Linux
  gpio number to the actual hardware pin.

Use alias to identify the gpio port/bank, and then the gpio base
can be specified with port id to solve above issues.  If alias is not
defined in device tree, the base number dynamically allocated by gpio
core will be used.

Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Tested-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
drivers/gpio/gpio-mxc.c