diff options
author | Russell King <rmk+kernel@armlinux.org.uk> | 2016-08-31 03:49:48 -0400 |
---|---|---|
committer | Russell King <rmk+kernel@armlinux.org.uk> | 2018-03-24 10:17:09 -0400 |
commit | a00315d1b334d9f869975d53e3b3b3eb37c6c17e (patch) | |
tree | 9c6a8d323be49879b6939bef14ce24b8f12e01af | |
parent | 780febd5b709fd9db80830ea656de96bbe3e5001 (diff) |
ARM: sa1100/h3xxx: switch h3xxx PCMCIA to use gpiod APIs
Switch h3xxx's PCMCIA implementation to use the gpiod APIs where
possible.
Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
-rw-r--r-- | arch/arm/mach-sa1100/h3xxx.c | 17 | ||||
-rw-r--r-- | drivers/pcmcia/sa1100_h3600.c | 16 |
2 files changed, 24 insertions, 9 deletions
diff --git a/arch/arm/mach-sa1100/h3xxx.c b/arch/arm/mach-sa1100/h3xxx.c index b69e76614d5b..36a78b0c106f 100644 --- a/arch/arm/mach-sa1100/h3xxx.c +++ b/arch/arm/mach-sa1100/h3xxx.c | |||
@@ -11,6 +11,7 @@ | |||
11 | */ | 11 | */ |
12 | 12 | ||
13 | #include <linux/kernel.h> | 13 | #include <linux/kernel.h> |
14 | #include <linux/gpio/machine.h> | ||
14 | #include <linux/gpio.h> | 15 | #include <linux/gpio.h> |
15 | #include <linux/gpio_keys.h> | 16 | #include <linux/gpio_keys.h> |
16 | #include <linux/input.h> | 17 | #include <linux/input.h> |
@@ -264,8 +265,24 @@ static struct platform_device *h3xxx_devices[] = { | |||
264 | &h3xxx_micro_asic, | 265 | &h3xxx_micro_asic, |
265 | }; | 266 | }; |
266 | 267 | ||
268 | static struct gpiod_lookup_table h3xxx_pcmcia_gpio_table = { | ||
269 | .dev_id = "sa11x0-pcmcia", | ||
270 | .table = { | ||
271 | GPIO_LOOKUP("gpio", H3XXX_GPIO_PCMCIA_CD0, | ||
272 | "pcmcia0-detect", GPIO_ACTIVE_LOW), | ||
273 | GPIO_LOOKUP("gpio", H3XXX_GPIO_PCMCIA_IRQ0, | ||
274 | "pcmcia0-ready", GPIO_ACTIVE_HIGH), | ||
275 | GPIO_LOOKUP("gpio", H3XXX_GPIO_PCMCIA_CD1, | ||
276 | "pcmcia1-detect", GPIO_ACTIVE_LOW), | ||
277 | GPIO_LOOKUP("gpio", H3XXX_GPIO_PCMCIA_IRQ1, | ||
278 | "pcmcia1-ready", GPIO_ACTIVE_HIGH), | ||
279 | { }, | ||
280 | }, | ||
281 | }; | ||
282 | |||
267 | void __init h3xxx_mach_init(void) | 283 | void __init h3xxx_mach_init(void) |
268 | { | 284 | { |
285 | gpiod_add_lookup_table(&h3xxx_pcmcia_gpio_table); | ||
269 | sa1100_register_uart_fns(&h3xxx_port_fns); | 286 | sa1100_register_uart_fns(&h3xxx_port_fns); |
270 | sa11x0_register_mtd(&h3xxx_flash_data, &h3xxx_flash_resource, 1); | 287 | sa11x0_register_mtd(&h3xxx_flash_data, &h3xxx_flash_resource, 1); |
271 | platform_add_devices(h3xxx_devices, ARRAY_SIZE(h3xxx_devices)); | 288 | platform_add_devices(h3xxx_devices, ARRAY_SIZE(h3xxx_devices)); |
diff --git a/drivers/pcmcia/sa1100_h3600.c b/drivers/pcmcia/sa1100_h3600.c index aebf9a66fdde..a91222bc3824 100644 --- a/drivers/pcmcia/sa1100_h3600.c +++ b/drivers/pcmcia/sa1100_h3600.c | |||
@@ -24,13 +24,15 @@ static int h3600_pcmcia_hw_init(struct soc_pcmcia_socket *skt) | |||
24 | { | 24 | { |
25 | int err; | 25 | int err; |
26 | 26 | ||
27 | skt->stat[SOC_STAT_CD].name = skt->nr ? "pcmcia1-detect" : "pcmcia0-detect"; | ||
28 | skt->stat[SOC_STAT_RDY].name = skt->nr ? "pcmcia1-ready" : "pcmcia0-ready"; | ||
29 | |||
30 | err = soc_pcmcia_request_gpiods(skt); | ||
31 | if (err) | ||
32 | return err; | ||
33 | |||
27 | switch (skt->nr) { | 34 | switch (skt->nr) { |
28 | case 0: | 35 | case 0: |
29 | skt->stat[SOC_STAT_CD].gpio = H3XXX_GPIO_PCMCIA_CD0; | ||
30 | skt->stat[SOC_STAT_CD].name = "PCMCIA CD0"; | ||
31 | skt->stat[SOC_STAT_RDY].gpio = H3XXX_GPIO_PCMCIA_IRQ0; | ||
32 | skt->stat[SOC_STAT_RDY].name = "PCMCIA IRQ0"; | ||
33 | |||
34 | err = gpio_request(H3XXX_EGPIO_OPT_NVRAM_ON, "OPT NVRAM ON"); | 36 | err = gpio_request(H3XXX_EGPIO_OPT_NVRAM_ON, "OPT NVRAM ON"); |
35 | if (err) | 37 | if (err) |
36 | goto err01; | 38 | goto err01; |
@@ -57,10 +59,6 @@ static int h3600_pcmcia_hw_init(struct soc_pcmcia_socket *skt) | |||
57 | goto err06; | 59 | goto err06; |
58 | break; | 60 | break; |
59 | case 1: | 61 | case 1: |
60 | skt->stat[SOC_STAT_CD].gpio = H3XXX_GPIO_PCMCIA_CD1; | ||
61 | skt->stat[SOC_STAT_CD].name = "PCMCIA CD1"; | ||
62 | skt->stat[SOC_STAT_RDY].gpio = H3XXX_GPIO_PCMCIA_IRQ1; | ||
63 | skt->stat[SOC_STAT_RDY].name = "PCMCIA IRQ1"; | ||
64 | break; | 62 | break; |
65 | } | 63 | } |
66 | return 0; | 64 | return 0; |