mbox

gpio: mvebu: new gpio driver for mvebu platforms

Message ID 1344691906-15985-1-git-send-email-thomas.petazzoni@free-electrons.com
State New
Headers show

Pull-request

git://github.com/MISL-EBU-System-SW/mainline-public.git mvebu-gpio

Message

Thomas Petazzoni Aug. 11, 2012, 1:31 p.m. UTC
Hello,

This patch set adds a new GPIO driver for Marvell EBU SoCs, which aims
at replacing the existing GPIO driver from plat-orion/gpio.c. The
driver comes with the necessary DT changes to make it work on Armada
370 and Armada XP, and it has been tested successfully by Sebastian
Hesselbarth on Dove. It should also work flawlessly on other Marvell
EBU SoCs (Kirkwood, Orion, Discovery), but this remains to be tested
by the relevant maintainers.

This new driver reuses a lot of code from the existing
plat-orion/gpio.c driver, but has a number of advantages:

 *) Support for Armada 370 and Armada XP
 *) It is integrated with the mvebu pinctrl driver so that GPIO pins
    are properly muxed, and the GPIO driver knows which GPIO pins are
    output-only or input-only. This driver has been submitted by
    Sebastian Hesselbarth today on the LAKML.
 *) Properly placed in drivers/gpio
 *) More extensible mechanism to support platform differences. The
    plat-orion driver uses a simple mask-offset DT property, which
    works fine for Discovery MV78200 but not for Armada XP. The new
    driver uses different compatible strings to identify the different
    variants of the GPIO controllers.

Thanks,

Thomas

The following changes since commit 872b6be95abf9d57e0639d0345fa2b5a0e4fa0f4:

  arm: mvebu: add pinctrl support in defconfig (2012-08-11 11:27:33 +0200)

are available in the git repository at:

  git://github.com/MISL-EBU-System-SW/mainline-public.git mvebu-gpio

for you to fetch changes up to 92dffc2d360b84d154ffdc049346d5011592bc7f:

  arm: mvebu: add gpio support in defconfig (2012-08-11 15:20:55 +0200)

----------------------------------------------------------------
Thomas Petazzoni (5):
      gpio: introduce gpio-mvebu driver for Marvell SoCs
      Documentation: add description of DT binding for the gpio-mvebu driver
      arm: mvebu: use GPIO support now that a driver is available
      arm: mvebu: add DT information for GPIO banks on Armada 370 and XP
      arm: mvebu: add gpio support in defconfig

 .../devicetree/bindings/gpio/gpio-mvebu.txt        |   44 ++
 arch/arm/Kconfig                                   |    1 +
 arch/arm/boot/dts/armada-370.dtsi                  |   30 +
 arch/arm/boot/dts/armada-xp-mv78230.dtsi           |   22 +
 arch/arm/boot/dts/armada-xp-mv78260.dtsi           |   33 +
 arch/arm/boot/dts/armada-xp-mv78460.dtsi           |   33 +
 arch/arm/configs/mvebu_defconfig                   |    2 +
 arch/arm/mach-mvebu/include/mach/gpio.h            |    1 +
 drivers/gpio/Kconfig                               |    6 +
 drivers/gpio/Makefile                              |    1 +
 drivers/gpio/gpio-mvebu.c                          |  650 ++++++++++++++++++++
 11 files changed, 823 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/gpio/gpio-mvebu.txt
 create mode 100644 arch/arm/mach-mvebu/include/mach/gpio.h
 create mode 100644 drivers/gpio/gpio-mvebu.c

Comments

Linus Walleij Aug. 20, 2012, 2:32 p.m. UTC | #1
On Sat, Aug 11, 2012 at 3:31 PM, Thomas Petazzoni
<thomas.petazzoni@free-electrons.com> wrote:

> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>

FWIW:
Acked-by: Linus Walleij <linus.walleij@linaro.org>

Yours,
Linus Walleij
Olof Johansson Aug. 27, 2012, 9:53 p.m. UTC | #2
Hi,

On Sat, Aug 11, 2012 at 03:31:43PM +0200, Thomas Petazzoni wrote:
> +- gpio-controller: marks the device node as a gpio controller
> +
> +- ngpios: number of GPIOs this controller has
> +
> +- #gpio-cells: Should be one. It is the pin number.

Most platforms will hit a need to encode polarity of the GPIO, in
particular on inputs. Having an extra cell for flags is quite useful.
Linus Walleij Sept. 2, 2012, 7:33 a.m. UTC | #3
On Mon, Aug 27, 2012 at 11:53 PM, Olof Johansson <olof@lixom.net> wrote:
> Hi,
>
> On Sat, Aug 11, 2012 at 03:31:43PM +0200, Thomas Petazzoni wrote:
>> +- gpio-controller: marks the device node as a gpio controller
>> +
>> +- ngpios: number of GPIOs this controller has
>> +
>> +- #gpio-cells: Should be one. It is the pin number.
>
> Most platforms will hit a need to encode polarity of the GPIO, in
> particular on inputs. Having an extra cell for flags is quite useful.

Isn't that surplus in this case since this driver has a proper
pinctrl backend controlling such stuff? I don't really like
pinctrl portions of GPIOs being showeled into the GPIO
actually. Or am I just getting this wrong...?

Yours,
Linus Walleij
Olof Johansson Sept. 5, 2012, 4:51 a.m. UTC | #4
On Sun, Sep 2, 2012 at 12:33 AM, Linus Walleij <linus.walleij@linaro.org> wrote:
> On Mon, Aug 27, 2012 at 11:53 PM, Olof Johansson <olof@lixom.net> wrote:
>> Hi,
>>
>> On Sat, Aug 11, 2012 at 03:31:43PM +0200, Thomas Petazzoni wrote:
>>> +- gpio-controller: marks the device node as a gpio controller
>>> +
>>> +- ngpios: number of GPIOs this controller has
>>> +
>>> +- #gpio-cells: Should be one. It is the pin number.
>>
>> Most platforms will hit a need to encode polarity of the GPIO, in
>> particular on inputs. Having an extra cell for flags is quite useful.
>
> Isn't that surplus in this case since this driver has a proper
> pinctrl backend controlling such stuff? I don't really like
> pinctrl portions of GPIOs being showeled into the GPIO
> actually. Or am I just getting this wrong...?

Ah, yes, true. Last time I had to add this was for a platform that
lacked pinctrl bindings (exynos).

I guess it doesn't hurt to add the flag since it might be used on
other OSes that have a gpio driver but not a pinctrl one, but that's a
pretty far corner case, no need to revise for it.


-Olof
Linus Walleij Sept. 5, 2012, 8:31 a.m. UTC | #5
On Wed, Sep 5, 2012 at 6:51 AM, Olof Johansson <olof@lixom.net> wrote:

> I guess it doesn't hurt to add the flag since it might be used on
> other OSes that have a gpio driver but not a pinctrl one, but that's a
> pretty far corner case, no need to revise for it.

Sounds a bit ambigous and redundant, as we are in the driver
seat for device tree I'd prefer to force every other OS to get their
pinctrl concepts right ;-)

Linus Walleij