diff options
Diffstat (limited to 'drivers/pcmcia/pxa2xx_viper.c')
-rw-r--r-- | drivers/pcmcia/pxa2xx_viper.c | 39 |
1 files changed, 6 insertions, 33 deletions
diff --git a/drivers/pcmcia/pxa2xx_viper.c b/drivers/pcmcia/pxa2xx_viper.c index 1064b1c2869d..adfae4987a42 100644 --- a/drivers/pcmcia/pxa2xx_viper.c +++ b/drivers/pcmcia/pxa2xx_viper.c | |||
@@ -32,13 +32,6 @@ | |||
32 | 32 | ||
33 | static struct platform_device *arcom_pcmcia_dev; | 33 | static struct platform_device *arcom_pcmcia_dev; |
34 | 34 | ||
35 | static struct pcmcia_irqs irqs[] = { | ||
36 | { | ||
37 | .sock = 0, | ||
38 | .str = "PCMCIA_CD", | ||
39 | }, | ||
40 | }; | ||
41 | |||
42 | static inline struct arcom_pcmcia_pdata *viper_get_pdata(void) | 35 | static inline struct arcom_pcmcia_pdata *viper_get_pdata(void) |
43 | { | 36 | { |
44 | return arcom_pcmcia_dev->dev.platform_data; | 37 | return arcom_pcmcia_dev->dev.platform_data; |
@@ -49,38 +42,28 @@ static int viper_pcmcia_hw_init(struct soc_pcmcia_socket *skt) | |||
49 | struct arcom_pcmcia_pdata *pdata = viper_get_pdata(); | 42 | struct arcom_pcmcia_pdata *pdata = viper_get_pdata(); |
50 | unsigned long flags; | 43 | unsigned long flags; |
51 | 44 | ||
52 | skt->socket.pci_irq = gpio_to_irq(pdata->rdy_gpio); | 45 | skt->stat[SOC_STAT_CD].gpio = pdata->cd_gpio; |
53 | irqs[0].irq = gpio_to_irq(pdata->cd_gpio); | 46 | skt->stat[SOC_STAT_CD].name = "PCMCIA_CD"; |
54 | 47 | skt->stat[SOC_STAT_RDY].gpio = pdata->rdy_gpio; | |
55 | if (gpio_request(pdata->cd_gpio, "CF detect")) | 48 | skt->stat[SOC_STAT_RDY].name = "CF ready"; |
56 | goto err_request_cd; | ||
57 | |||
58 | if (gpio_request(pdata->rdy_gpio, "CF ready")) | ||
59 | goto err_request_rdy; | ||
60 | 49 | ||
61 | if (gpio_request(pdata->pwr_gpio, "CF power")) | 50 | if (gpio_request(pdata->pwr_gpio, "CF power")) |
62 | goto err_request_pwr; | 51 | goto err_request_pwr; |
63 | 52 | ||
64 | local_irq_save(flags); | 53 | local_irq_save(flags); |
65 | 54 | ||
66 | if (gpio_direction_output(pdata->pwr_gpio, 0) || | 55 | if (gpio_direction_output(pdata->pwr_gpio, 0)) { |
67 | gpio_direction_input(pdata->cd_gpio) || | ||
68 | gpio_direction_input(pdata->rdy_gpio)) { | ||
69 | local_irq_restore(flags); | 56 | local_irq_restore(flags); |
70 | goto err_dir; | 57 | goto err_dir; |
71 | } | 58 | } |
72 | 59 | ||
73 | local_irq_restore(flags); | 60 | local_irq_restore(flags); |
74 | 61 | ||
75 | return soc_pcmcia_request_irqs(skt, irqs, ARRAY_SIZE(irqs)); | 62 | return 0; |
76 | 63 | ||
77 | err_dir: | 64 | err_dir: |
78 | gpio_free(pdata->pwr_gpio); | 65 | gpio_free(pdata->pwr_gpio); |
79 | err_request_pwr: | 66 | err_request_pwr: |
80 | gpio_free(pdata->rdy_gpio); | ||
81 | err_request_rdy: | ||
82 | gpio_free(pdata->cd_gpio); | ||
83 | err_request_cd: | ||
84 | dev_err(&arcom_pcmcia_dev->dev, "Failed to setup PCMCIA GPIOs\n"); | 67 | dev_err(&arcom_pcmcia_dev->dev, "Failed to setup PCMCIA GPIOs\n"); |
85 | return -1; | 68 | return -1; |
86 | } | 69 | } |
@@ -92,22 +75,12 @@ static void viper_pcmcia_hw_shutdown(struct soc_pcmcia_socket *skt) | |||
92 | { | 75 | { |
93 | struct arcom_pcmcia_pdata *pdata = viper_get_pdata(); | 76 | struct arcom_pcmcia_pdata *pdata = viper_get_pdata(); |
94 | 77 | ||
95 | soc_pcmcia_free_irqs(skt, irqs, ARRAY_SIZE(irqs)); | ||
96 | gpio_free(pdata->pwr_gpio); | 78 | gpio_free(pdata->pwr_gpio); |
97 | gpio_free(pdata->rdy_gpio); | ||
98 | gpio_free(pdata->cd_gpio); | ||
99 | } | 79 | } |
100 | 80 | ||
101 | static void viper_pcmcia_socket_state(struct soc_pcmcia_socket *skt, | 81 | static void viper_pcmcia_socket_state(struct soc_pcmcia_socket *skt, |
102 | struct pcmcia_state *state) | 82 | struct pcmcia_state *state) |
103 | { | 83 | { |
104 | struct arcom_pcmcia_pdata *pdata = viper_get_pdata(); | ||
105 | |||
106 | state->detect = !gpio_get_value(pdata->cd_gpio); | ||
107 | state->ready = !!gpio_get_value(pdata->rdy_gpio); | ||
108 | state->bvd1 = 1; | ||
109 | state->bvd2 = 1; | ||
110 | state->wrprot = 0; | ||
111 | state->vs_3v = 1; /* Can only apply 3.3V */ | 84 | state->vs_3v = 1; /* Can only apply 3.3V */ |
112 | state->vs_Xv = 0; | 85 | state->vs_Xv = 0; |
113 | } | 86 | } |