aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRussell King <rmk+kernel@armlinux.org.uk>2016-08-31 03:49:48 -0400
committerRussell King <rmk+kernel@armlinux.org.uk>2018-04-06 10:53:22 -0400
commit64b2f129c38713a059e1299662fc68fc6bf6f0a6 (patch)
tree3c28653814a5d6154b30c8d522f5e6672bea60aa
parentb51af86559d4b5c831abbec545c76f721a8d8237 (diff)
ARM: sa1100/simpad: switch simpad CF to use gpiod APIs
Switch simpad's CF implementation to use the gpiod APIs. The inverted detection is handled using gpiolib's native inversion abilities. Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
-rw-r--r--arch/arm/mach-sa1100/simpad.c11
-rw-r--r--drivers/pcmcia/sa1100_simpad.c12
2 files changed, 14 insertions, 9 deletions
diff --git a/arch/arm/mach-sa1100/simpad.c b/arch/arm/mach-sa1100/simpad.c
index 7d4feb8a49ac..ace010479eb6 100644
--- a/arch/arm/mach-sa1100/simpad.c
+++ b/arch/arm/mach-sa1100/simpad.c
@@ -4,6 +4,7 @@
4 */ 4 */
5 5
6#include <linux/module.h> 6#include <linux/module.h>
7#include <linux/gpio/machine.h>
7#include <linux/init.h> 8#include <linux/init.h>
8#include <linux/kernel.h> 9#include <linux/kernel.h>
9#include <linux/tty.h> 10#include <linux/tty.h>
@@ -364,6 +365,15 @@ static struct platform_device *devices[] __initdata = {
364 &simpad_i2c, 365 &simpad_i2c,
365}; 366};
366 367
368/* Compact Flash */
369static struct gpiod_lookup_table simpad_cf_gpio_table = {
370 .dev_id = "sa11x0-pcmcia",
371 .table = {
372 GPIO_LOOKUP("gpio", GPIO_CF_IRQ, "cf-ready", GPIO_ACTIVE_HIGH),
373 GPIO_LOOKUP("gpio", GPIO_CF_CD, "cf-detect", GPIO_ACTIVE_HIGH),
374 { },
375 },
376};
367 377
368 378
369static int __init simpad_init(void) 379static int __init simpad_init(void)
@@ -385,6 +395,7 @@ static int __init simpad_init(void)
385 395
386 pm_power_off = simpad_power_off; 396 pm_power_off = simpad_power_off;
387 397
398 sa11x0_register_pcmcia(-1, &simpad_cf_gpio_table);
388 sa11x0_ppc_configure_mcp(); 399 sa11x0_ppc_configure_mcp();
389 sa11x0_register_mtd(&simpad_flash_data, simpad_flash_resources, 400 sa11x0_register_mtd(&simpad_flash_data, simpad_flash_resources,
390 ARRAY_SIZE(simpad_flash_resources)); 401 ARRAY_SIZE(simpad_flash_resources));
diff --git a/drivers/pcmcia/sa1100_simpad.c b/drivers/pcmcia/sa1100_simpad.c
index 7ce65bb23a8e..e235ee14eaa6 100644
--- a/drivers/pcmcia/sa1100_simpad.c
+++ b/drivers/pcmcia/sa1100_simpad.c
@@ -12,7 +12,6 @@
12 12
13#include <mach/hardware.h> 13#include <mach/hardware.h>
14#include <asm/mach-types.h> 14#include <asm/mach-types.h>
15#include <asm/irq.h>
16#include <mach/simpad.h> 15#include <mach/simpad.h>
17#include "sa1100_generic.h" 16#include "sa1100_generic.h"
18 17
@@ -21,12 +20,10 @@ static int simpad_pcmcia_hw_init(struct soc_pcmcia_socket *skt)
21 20
22 simpad_clear_cs3_bit(VCC_3V_EN|VCC_5V_EN|EN0|EN1); 21 simpad_clear_cs3_bit(VCC_3V_EN|VCC_5V_EN|EN0|EN1);
23 22
24 skt->stat[SOC_STAT_CD].gpio = GPIO_CF_CD; 23 skt->stat[SOC_STAT_CD].name = "cf-detect";
25 skt->stat[SOC_STAT_CD].name = "CF_CD"; 24 skt->stat[SOC_STAT_RDY].name = "cf-ready";
26 skt->stat[SOC_STAT_RDY].gpio = GPIO_CF_IRQ;
27 skt->stat[SOC_STAT_RDY].name = "CF_RDY";
28 25
29 return 0; 26 return soc_pcmcia_request_gpiods(skt);
30} 27}
31 28
32static void simpad_pcmcia_hw_shutdown(struct soc_pcmcia_socket *skt) 29static void simpad_pcmcia_hw_shutdown(struct soc_pcmcia_socket *skt)
@@ -42,9 +39,6 @@ simpad_pcmcia_socket_state(struct soc_pcmcia_socket *skt,
42{ 39{
43 long cs3reg = simpad_get_cs3_ro(); 40 long cs3reg = simpad_get_cs3_ro();
44 41
45 /* the detect signal is inverted - fix that up here */
46 state->detect = !state->detect;
47
48 state->bvd1 = 1; /* Might be cs3reg & PCMCIA_BVD1 */ 42 state->bvd1 = 1; /* Might be cs3reg & PCMCIA_BVD1 */
49 state->bvd2 = 1; /* Might be cs3reg & PCMCIA_BVD2 */ 43 state->bvd2 = 1; /* Might be cs3reg & PCMCIA_BVD2 */
50 44