Commit Graph

9 Commits

Author SHA1 Message Date
Julia Lawall aedd4fdf69 drivers/gpio/gpio-tegra.c: use devm_request_and_ioremap
Reimplement a call to devm_request_mem_region followed by a call to ioremap
or ioremap_nocache by a call to devm_request_and_ioremap.

The semantic patch that makes this transformation is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@nm@
expression myname;
identifier i;
@@

struct platform_driver i = { .driver = { .name = myname } };

@@
expression dev,res,size;
expression nm.myname;
@@

-if (!devm_request_mem_region(dev, res->start, size,
-                              \(res->name\|dev_name(dev)\|myname\))) {
-   ...
-   return ...;
-}
... when != res->start
(
-devm_ioremap(dev,res->start,size)
+devm_request_and_ioremap(dev,res)
|
-devm_ioremap_nocache(dev,res->start,size)
+devm_request_and_ioremap(dev,res)
)
... when any
    when != res->start
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
2012-01-02 01:43:50 -07:00
Arnd Bergmann efa62e1355 Merge branch 'depends/rmk/gpio' into next/devel
Conflicts:
	arch/arm/mach-mxs/include/mach/gpio.h
	arch/arm/plat-mxc/include/mach/gpio.h

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2011-10-31 23:46:42 +01:00
Stephen Warren 88d8951e58 gpio/tegra: Convert to a platform device
v3: Make regs variable static. Remove empty init of tegra_gpio_banks.

v2: Retrieve IRQ and memory addresses from resources instead of hard-
coding them. Add back initialization of tegra_gpio_chip.of_node.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
Acked-by: Grant Likely <grant.likely@secretlab.ca>
[olof: switched probe routine to __devinit]
Signed-off-by: Olof Johansson <olof@lixom.net>
2011-10-13 15:04:52 -07:00
Stephen Warren ea5abbd215 ARM: 7101/1: arm/tegra: Replace <mach/gpio.h> with <mach/gpio-tegra.h>
This will eventually allow <mach/gpio.h> to be deleted. This mirrors
LinusW's recent equivalent work on various other ARM platforms.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
Acked-by: Olof Johansson <olof@lixom.net>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2011-09-27 00:20:53 +01:00
Stephen Warren 438a99c078 ARM: 7053/1: gpio/tegra: Implement gpio_chip.to_irq
Signed-off-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2011-08-24 08:28:37 +01:00
Stephen Warren 470080015c ARM: 7052/1: gpio/tegra: Remove use of irq_to_gpio
irq_to_gpio is being removed. Replace the only use of that API by
the ARM Tegra sub-architecture.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2011-08-24 08:28:37 +01:00
Stephen Warren f7f678a063 gpio/tegra: Use engineering names in DT compatible property
Engineering names are more stable than marketing names. Hence, use them
for Device Tree compatible properties instead.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
2011-07-05 23:36:32 -06:00
Grant Likely df2212270c gpio/tegra: add devicetree support
Add support for decoding gpios from the device tree

Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Acked-by: Olof Johansson <olof@lixom.net>
2011-06-15 14:54:14 -06:00
Grant Likely ea5a9607cb gpio/tegra: Move Tegra gpio driver to drivers/gpio
As part of the gpio driver consolidation, this patch moves the Tegra driver
into drivers/gpio

Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Acked-by: Olof Johansson <olof@lixom.net>
Acked-by: Colin Cross <ccross@android.com>
2011-06-15 14:52:43 -06:00