aboutsummaryrefslogtreecommitdiffstats
path: root/target
diff options
context:
space:
mode:
authorFlorian Fainelli <florian@openwrt.org>2009-06-04 10:03:03 +0000
committerFlorian Fainelli <florian@openwrt.org>2009-06-04 10:03:03 +0000
commite41524a2981f9a175b294a235d19fe1fc87104fd (patch)
tree2f24cf5d62eb1c3f2dafe9a9fc06b0a6162538ba /target
parent6f2968d917d6b95b8d29b2becc68942636a22878 (diff)
downloadupstream-e41524a2981f9a175b294a235d19fe1fc87104fd.tar.gz
upstream-e41524a2981f9a175b294a235d19fe1fc87104fd.tar.bz2
upstream-e41524a2981f9a175b294a235d19fe1fc87104fd.zip
[brcm63xx] request gpio pins and set direction correctly for pcmcia
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@16332 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target')
-rw-r--r--target/linux/brcm63xx/files/drivers/pcmcia/bcm63xx_pcmcia.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/target/linux/brcm63xx/files/drivers/pcmcia/bcm63xx_pcmcia.c b/target/linux/brcm63xx/files/drivers/pcmcia/bcm63xx_pcmcia.c
index 94a776273d..19b05fce0c 100644
--- a/target/linux/brcm63xx/files/drivers/pcmcia/bcm63xx_pcmcia.c
+++ b/target/linux/brcm63xx/files/drivers/pcmcia/bcm63xx_pcmcia.c
@@ -409,9 +409,18 @@ static int bcm63xx_drv_pcmcia_probe(struct platform_device *pdev)
val |= 3 << PCMCIA_C2_HOLD_SHIFT;
pcmcia_writel(skt, val, PCMCIA_C2_REG);
+ /* request and setup ready gpio */
+ ret = gpio_request(skt->pd->ready_gpio, "bcm63xx_pcmcia");
+ if (ret < 0)
+ goto err;
+
+ ret = gpio_direction_input(skt->pd->ready_gpio);
+ if (ret < 0)
+ goto err_gpio;
+
ret = pcmcia_register_socket(sock);
if (ret)
- goto err;
+ goto err_gpio;
/* start polling socket */
mod_timer(&skt->timer,
@@ -420,6 +429,9 @@ static int bcm63xx_drv_pcmcia_probe(struct platform_device *pdev)
platform_set_drvdata(pdev, skt);
return 0;
+err_gpio:
+ gpio_free(skt->pd->ready_gpio);
+
err:
if (skt->io_base)
iounmap(skt->io_base);
@@ -442,6 +454,7 @@ static int bcm63xx_drv_pcmcia_remove(struct platform_device *pdev)
iounmap(skt->io_base);
res = skt->reg_res;
release_mem_region(res->start, res->end - res->start + 1);
+ gpio_free(skt->pd->ready_gpio);
kfree(skt);
return 0;
}