summaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-pxa/spitz.c
diff options
context:
space:
mode:
authorLinus Walleij <linus.walleij@linaro.org>2018-12-02 09:43:22 +0100
committerUlf Hansson <ulf.hansson@linaro.org>2018-12-17 08:26:24 +0100
commit32d1544880aa87aebe4d20babb48615c65874b02 (patch)
tree355d12b2d3b8b6b4b001745d4fd8369645c9852a /arch/arm/mach-pxa/spitz.c
parent5128f8d4450159f59565d247437d3bedda3994cb (diff)
downloadtalos-obmc-linux-32d1544880aa87aebe4d20babb48615c65874b02.tar.gz
talos-obmc-linux-32d1544880aa87aebe4d20babb48615c65874b02.zip
ARM: pxa: Add gpio descriptor lookup tables for MMC CD/WP
This adds GPIO descriptor look-up tables for a whole bunch of PXA boards with MMC card detect (CD) and write protect (WP) GPIO lines, so we can move away from the hard-coded GPIO numberspace. In some cases the platforms were compulsively including the <linux/gpio.h> header even if they weren't actually using it, and in these cases I simply replaced that inclusion with the more appropriate <linux/gpio/machine.h> which is what board files should be including most of the time. Cc: Daniel Mack <daniel@zonque.org> Cc: Robert Jarzmik <robert.jarzmik@free.fr> Cc: Bartosz Golaszewski <brgl@bgdev.pl> Cc: Andrea Adami <andrea.adami@gmail.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Acked-by: Robert Jarzmik <robert.jarzmik@free.fr> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Diffstat (limited to 'arch/arm/mach-pxa/spitz.c')
-rw-r--r--arch/arm/mach-pxa/spitz.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/arch/arm/mach-pxa/spitz.c b/arch/arm/mach-pxa/spitz.c
index 5d50025492b7..ca9442c82178 100644
--- a/arch/arm/mach-pxa/spitz.c
+++ b/arch/arm/mach-pxa/spitz.c
@@ -18,6 +18,7 @@
#include <linux/delay.h>
#include <linux/gpio_keys.h>
#include <linux/gpio.h>
+#include <linux/gpio/machine.h>
#include <linux/leds.h>
#include <linux/i2c.h>
#include <linux/platform_data/i2c-pxa.h>
@@ -620,8 +621,20 @@ static struct pxamci_platform_data spitz_mci_platform_data = {
.gpio_power = -1,
};
+static struct gpiod_lookup_table spitz_mci_gpio_table = {
+ .dev_id = "pxa2xx-mci.0",
+ .table = {
+ GPIO_LOOKUP("gpio-pxa", SPITZ_GPIO_nSD_DETECT,
+ "cd", GPIO_ACTIVE_LOW),
+ GPIO_LOOKUP("gpio-pxa", SPITZ_GPIO_nSD_WP,
+ "wp", GPIO_ACTIVE_LOW),
+ { },
+ },
+};
+
static void __init spitz_mmc_init(void)
{
+ gpiod_add_lookup_table(&spitz_mci_gpio_table);
pxa_set_mci_info(&spitz_mci_platform_data);
}
#else
OpenPOWER on IntegriCloud