diff options
| -rw-r--r-- | drivers/pcmcia/pxa2xx_palmtx.c | 49 |
1 files changed, 47 insertions, 2 deletions
diff --git a/drivers/pcmcia/pxa2xx_palmtx.c b/drivers/pcmcia/pxa2xx_palmtx.c index a8771ffc61e8..e07b5c51ec5b 100644 --- a/drivers/pcmcia/pxa2xx_palmtx.c +++ b/drivers/pcmcia/pxa2xx_palmtx.c | |||
| @@ -23,12 +23,57 @@ | |||
| 23 | 23 | ||
| 24 | static int palmtx_pcmcia_hw_init(struct soc_pcmcia_socket *skt) | 24 | static int palmtx_pcmcia_hw_init(struct soc_pcmcia_socket *skt) |
| 25 | { | 25 | { |
| 26 | skt->irq = IRQ_GPIO(GPIO_NR_PALMTX_PCMCIA_READY); | 26 | int ret; |
| 27 | |||
| 28 | ret = gpio_request(GPIO_NR_PALMTX_PCMCIA_POWER1, "PCMCIA PWR1"); | ||
| 29 | if (ret) | ||
| 30 | goto err1; | ||
| 31 | ret = gpio_direction_output(GPIO_NR_PALMTX_PCMCIA_POWER1, 0); | ||
| 32 | if (ret) | ||
| 33 | goto err2; | ||
| 34 | |||
| 35 | ret = gpio_request(GPIO_NR_PALMTX_PCMCIA_POWER2, "PCMCIA PWR2"); | ||
| 36 | if (ret) | ||
| 37 | goto err2; | ||
| 38 | ret = gpio_direction_output(GPIO_NR_PALMTX_PCMCIA_POWER2, 0); | ||
| 39 | if (ret) | ||
| 40 | goto err3; | ||
| 41 | |||
| 42 | ret = gpio_request(GPIO_NR_PALMTX_PCMCIA_RESET, "PCMCIA RST"); | ||
| 43 | if (ret) | ||
| 44 | goto err3; | ||
| 45 | ret = gpio_direction_output(GPIO_NR_PALMTX_PCMCIA_RESET, 1); | ||
| 46 | if (ret) | ||
| 47 | goto err4; | ||
| 48 | |||
| 49 | ret = gpio_request(GPIO_NR_PALMTX_PCMCIA_READY, "PCMCIA RDY"); | ||
| 50 | if (ret) | ||
| 51 | goto err4; | ||
| 52 | ret = gpio_direction_input(GPIO_NR_PALMTX_PCMCIA_READY); | ||
| 53 | if (ret) | ||
| 54 | goto err5; | ||
| 55 | |||
| 56 | skt->irq = gpio_to_irq(GPIO_NR_PALMTX_PCMCIA_READY); | ||
| 27 | return 0; | 57 | return 0; |
| 58 | |||
| 59 | err5: | ||
| 60 | gpio_free(GPIO_NR_PALMTX_PCMCIA_READY); | ||
| 61 | err4: | ||
| 62 | gpio_free(GPIO_NR_PALMTX_PCMCIA_RESET); | ||
| 63 | err3: | ||
| 64 | gpio_free(GPIO_NR_PALMTX_PCMCIA_POWER2); | ||
| 65 | err2: | ||
| 66 | gpio_free(GPIO_NR_PALMTX_PCMCIA_POWER1); | ||
| 67 | err1: | ||
| 68 | return ret; | ||
| 28 | } | 69 | } |
| 29 | 70 | ||
| 30 | static void palmtx_pcmcia_hw_shutdown(struct soc_pcmcia_socket *skt) | 71 | static void palmtx_pcmcia_hw_shutdown(struct soc_pcmcia_socket *skt) |
| 31 | { | 72 | { |
| 73 | gpio_free(GPIO_NR_PALMTX_PCMCIA_READY); | ||
| 74 | gpio_free(GPIO_NR_PALMTX_PCMCIA_RESET); | ||
| 75 | gpio_free(GPIO_NR_PALMTX_PCMCIA_POWER2); | ||
| 76 | gpio_free(GPIO_NR_PALMTX_PCMCIA_POWER1); | ||
| 32 | } | 77 | } |
| 33 | 78 | ||
| 34 | static void palmtx_pcmcia_socket_state(struct soc_pcmcia_socket *skt, | 79 | static void palmtx_pcmcia_socket_state(struct soc_pcmcia_socket *skt, |
| @@ -109,7 +154,7 @@ static void __exit palmtx_pcmcia_exit(void) | |||
| 109 | platform_device_unregister(palmtx_pcmcia_device); | 154 | platform_device_unregister(palmtx_pcmcia_device); |
| 110 | } | 155 | } |
| 111 | 156 | ||
| 112 | fs_initcall(palmtx_pcmcia_init); | 157 | module_init(palmtx_pcmcia_init); |
| 113 | module_exit(palmtx_pcmcia_exit); | 158 | module_exit(palmtx_pcmcia_exit); |
| 114 | 159 | ||
| 115 | MODULE_AUTHOR("Marek Vasut <marek.vasut@gmail.com>"); | 160 | MODULE_AUTHOR("Marek Vasut <marek.vasut@gmail.com>"); |
