Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 108652
b: refs/heads/master
c: 574047f
h: refs/heads/master
v: v3
  • Loading branch information
Marek Vašut authored and Russell King committed Aug 16, 2008
1 parent 013a045 commit 64dde7d
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 8b5942c391ff92417b0a133abf7a970fa4fc942a
refs/heads/master: 574047f96a302cbca2f9bfafd78b1869b6a900bf
49 changes: 47 additions & 2 deletions trunk/drivers/pcmcia/pxa2xx_palmtx.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,57 @@

static int palmtx_pcmcia_hw_init(struct soc_pcmcia_socket *skt)
{
skt->irq = IRQ_GPIO(GPIO_NR_PALMTX_PCMCIA_READY);
int ret;

ret = gpio_request(GPIO_NR_PALMTX_PCMCIA_POWER1, "PCMCIA PWR1");
if (ret)
goto err1;
ret = gpio_direction_output(GPIO_NR_PALMTX_PCMCIA_POWER1, 0);
if (ret)
goto err2;

ret = gpio_request(GPIO_NR_PALMTX_PCMCIA_POWER2, "PCMCIA PWR2");
if (ret)
goto err2;
ret = gpio_direction_output(GPIO_NR_PALMTX_PCMCIA_POWER2, 0);
if (ret)
goto err3;

ret = gpio_request(GPIO_NR_PALMTX_PCMCIA_RESET, "PCMCIA RST");
if (ret)
goto err3;
ret = gpio_direction_output(GPIO_NR_PALMTX_PCMCIA_RESET, 1);
if (ret)
goto err4;

ret = gpio_request(GPIO_NR_PALMTX_PCMCIA_READY, "PCMCIA RDY");
if (ret)
goto err4;
ret = gpio_direction_input(GPIO_NR_PALMTX_PCMCIA_READY);
if (ret)
goto err5;

skt->irq = gpio_to_irq(GPIO_NR_PALMTX_PCMCIA_READY);
return 0;

err5:
gpio_free(GPIO_NR_PALMTX_PCMCIA_READY);
err4:
gpio_free(GPIO_NR_PALMTX_PCMCIA_RESET);
err3:
gpio_free(GPIO_NR_PALMTX_PCMCIA_POWER2);
err2:
gpio_free(GPIO_NR_PALMTX_PCMCIA_POWER1);
err1:
return ret;
}

static void palmtx_pcmcia_hw_shutdown(struct soc_pcmcia_socket *skt)
{
gpio_free(GPIO_NR_PALMTX_PCMCIA_READY);
gpio_free(GPIO_NR_PALMTX_PCMCIA_RESET);
gpio_free(GPIO_NR_PALMTX_PCMCIA_POWER2);
gpio_free(GPIO_NR_PALMTX_PCMCIA_POWER1);
}

static void palmtx_pcmcia_socket_state(struct soc_pcmcia_socket *skt,
Expand Down Expand Up @@ -109,7 +154,7 @@ static void __exit palmtx_pcmcia_exit(void)
platform_device_unregister(palmtx_pcmcia_device);
}

fs_initcall(palmtx_pcmcia_init);
module_init(palmtx_pcmcia_init);
module_exit(palmtx_pcmcia_exit);

MODULE_AUTHOR("Marek Vasut <marek.vasut@gmail.com>");
Expand Down

0 comments on commit 64dde7d

Please sign in to comment.