diff options
author | Russell King <rmk+kernel@armlinux.org.uk> | 2016-08-31 03:49:47 -0400 |
---|---|---|
committer | Russell King <rmk+kernel@armlinux.org.uk> | 2018-03-24 10:17:08 -0400 |
commit | 780febd5b709fd9db80830ea656de96bbe3e5001 (patch) | |
tree | b943d3bec7901264f84342b11b4ac31dcb20038e /drivers | |
parent | 29786e9b6551b822de66aa64b07e21eeb36ded89 (diff) |
ARM: sa1100/cerf: convert to generic CF sockets
Convert Cerf to use the generic CF socket support.
Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/pcmcia/Makefile | 1 | ||||
-rw-r--r-- | drivers/pcmcia/sa1100_cerf.c | 86 | ||||
-rw-r--r-- | drivers/pcmcia/sa1100_generic.c | 3 | ||||
-rw-r--r-- | drivers/pcmcia/sa1100_generic.h | 1 |
4 files changed, 0 insertions, 91 deletions
diff --git a/drivers/pcmcia/Makefile b/drivers/pcmcia/Makefile index 130a06649b41..da31af9b3158 100644 --- a/drivers/pcmcia/Makefile +++ b/drivers/pcmcia/Makefile | |||
@@ -46,7 +46,6 @@ sa1111_cs-$(CONFIG_SA1100_JORNADA720) += sa1111_jornada720.o | |||
46 | sa1111_cs-$(CONFIG_ARCH_LUBBOCK) += sa1111_lubbock.o | 46 | sa1111_cs-$(CONFIG_ARCH_LUBBOCK) += sa1111_lubbock.o |
47 | 47 | ||
48 | sa1100_cs-y += sa1100_generic.o | 48 | sa1100_cs-y += sa1100_generic.o |
49 | sa1100_cs-$(CONFIG_SA1100_CERF) += sa1100_cerf.o | ||
50 | sa1100_cs-$(CONFIG_SA1100_COLLIE) += pxa2xx_sharpsl.o | 49 | sa1100_cs-$(CONFIG_SA1100_COLLIE) += pxa2xx_sharpsl.o |
51 | sa1100_cs-$(CONFIG_SA1100_H3100) += sa1100_h3600.o | 50 | sa1100_cs-$(CONFIG_SA1100_H3100) += sa1100_h3600.o |
52 | sa1100_cs-$(CONFIG_SA1100_H3600) += sa1100_h3600.o | 51 | sa1100_cs-$(CONFIG_SA1100_H3600) += sa1100_h3600.o |
diff --git a/drivers/pcmcia/sa1100_cerf.c b/drivers/pcmcia/sa1100_cerf.c deleted file mode 100644 index 2a54081d161d..000000000000 --- a/drivers/pcmcia/sa1100_cerf.c +++ /dev/null | |||
@@ -1,86 +0,0 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
2 | /* | ||
3 | * drivers/pcmcia/sa1100_cerf.c | ||
4 | * | ||
5 | * PCMCIA implementation routines for CerfBoard | ||
6 | * Based off the Assabet. | ||
7 | * | ||
8 | */ | ||
9 | #include <linux/module.h> | ||
10 | #include <linux/kernel.h> | ||
11 | #include <linux/device.h> | ||
12 | #include <linux/init.h> | ||
13 | #include <linux/delay.h> | ||
14 | #include <linux/gpio.h> | ||
15 | |||
16 | #include <mach/hardware.h> | ||
17 | #include <asm/mach-types.h> | ||
18 | #include <asm/irq.h> | ||
19 | #include <mach/cerf.h> | ||
20 | #include "sa1100_generic.h" | ||
21 | |||
22 | #define CERF_SOCKET 1 | ||
23 | |||
24 | static int cerf_pcmcia_hw_init(struct soc_pcmcia_socket *skt) | ||
25 | { | ||
26 | int ret; | ||
27 | |||
28 | ret = gpio_request_one(CERF_GPIO_CF_RESET, GPIOF_OUT_INIT_LOW, "CF_RESET"); | ||
29 | if (ret) | ||
30 | return ret; | ||
31 | |||
32 | skt->stat[SOC_STAT_CD].gpio = CERF_GPIO_CF_CD; | ||
33 | skt->stat[SOC_STAT_CD].name = "CF_CD"; | ||
34 | skt->stat[SOC_STAT_BVD1].gpio = CERF_GPIO_CF_BVD1; | ||
35 | skt->stat[SOC_STAT_BVD1].name = "CF_BVD1"; | ||
36 | skt->stat[SOC_STAT_BVD2].gpio = CERF_GPIO_CF_BVD2; | ||
37 | skt->stat[SOC_STAT_BVD2].name = "CF_BVD2"; | ||
38 | skt->stat[SOC_STAT_RDY].gpio = CERF_GPIO_CF_IRQ; | ||
39 | skt->stat[SOC_STAT_RDY].name = "CF_IRQ"; | ||
40 | |||
41 | return 0; | ||
42 | } | ||
43 | |||
44 | static void cerf_pcmcia_hw_shutdown(struct soc_pcmcia_socket *skt) | ||
45 | { | ||
46 | gpio_free(CERF_GPIO_CF_RESET); | ||
47 | } | ||
48 | |||
49 | static int | ||
50 | cerf_pcmcia_configure_socket(struct soc_pcmcia_socket *skt, | ||
51 | const socket_state_t *state) | ||
52 | { | ||
53 | switch (state->Vcc) { | ||
54 | case 0: | ||
55 | case 50: | ||
56 | case 33: | ||
57 | break; | ||
58 | |||
59 | default: | ||
60 | printk(KERN_ERR "%s(): unrecognized Vcc %u\n", | ||
61 | __func__, state->Vcc); | ||
62 | return -1; | ||
63 | } | ||
64 | |||
65 | gpio_set_value(CERF_GPIO_CF_RESET, !!(state->flags & SS_RESET)); | ||
66 | |||
67 | return 0; | ||
68 | } | ||
69 | |||
70 | static struct pcmcia_low_level cerf_pcmcia_ops = { | ||
71 | .owner = THIS_MODULE, | ||
72 | .hw_init = cerf_pcmcia_hw_init, | ||
73 | .hw_shutdown = cerf_pcmcia_hw_shutdown, | ||
74 | .socket_state = soc_common_cf_socket_state, | ||
75 | .configure_socket = cerf_pcmcia_configure_socket, | ||
76 | }; | ||
77 | |||
78 | int pcmcia_cerf_init(struct device *dev) | ||
79 | { | ||
80 | int ret = -ENODEV; | ||
81 | |||
82 | if (machine_is_cerf()) | ||
83 | ret = sa11xx_drv_pcmcia_probe(dev, &cerf_pcmcia_ops, CERF_SOCKET, 1); | ||
84 | |||
85 | return ret; | ||
86 | } | ||
diff --git a/drivers/pcmcia/sa1100_generic.c b/drivers/pcmcia/sa1100_generic.c index 1987d94361e9..110365e998b8 100644 --- a/drivers/pcmcia/sa1100_generic.c +++ b/drivers/pcmcia/sa1100_generic.c | |||
@@ -98,9 +98,6 @@ static struct pcmcia_low_level sa11x0_cf_ops = { | |||
98 | int __init pcmcia_collie_init(struct device *dev); | 98 | int __init pcmcia_collie_init(struct device *dev); |
99 | 99 | ||
100 | static int (*sa11x0_pcmcia_legacy_hw_init[])(struct device *dev) = { | 100 | static int (*sa11x0_pcmcia_legacy_hw_init[])(struct device *dev) = { |
101 | #ifdef CONFIG_SA1100_CERF | ||
102 | pcmcia_cerf_init, | ||
103 | #endif | ||
104 | #if defined(CONFIG_SA1100_H3100) || defined(CONFIG_SA1100_H3600) | 101 | #if defined(CONFIG_SA1100_H3100) || defined(CONFIG_SA1100_H3600) |
105 | pcmcia_h3600_init, | 102 | pcmcia_h3600_init, |
106 | #endif | 103 | #endif |
diff --git a/drivers/pcmcia/sa1100_generic.h b/drivers/pcmcia/sa1100_generic.h index 597c796f7dad..bce9e73a4651 100644 --- a/drivers/pcmcia/sa1100_generic.h +++ b/drivers/pcmcia/sa1100_generic.h | |||
@@ -7,7 +7,6 @@ | |||
7 | */ | 7 | */ |
8 | extern int pcmcia_adsbitsy_init(struct device *); | 8 | extern int pcmcia_adsbitsy_init(struct device *); |
9 | extern int pcmcia_badge4_init(struct device *); | 9 | extern int pcmcia_badge4_init(struct device *); |
10 | extern int pcmcia_cerf_init(struct device *); | ||
11 | extern int pcmcia_flexanet_init(struct device *); | 10 | extern int pcmcia_flexanet_init(struct device *); |
12 | extern int pcmcia_freebird_init(struct device *); | 11 | extern int pcmcia_freebird_init(struct device *); |
13 | extern int pcmcia_gcplus_init(struct device *); | 12 | extern int pcmcia_gcplus_init(struct device *); |