aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorEliad Peller <eliad@wizery.com>2012-01-26 07:12:31 -0500
committerLuciano Coelho <coelho@ti.com>2012-02-15 01:38:30 -0500
commitb4748306368a61b64b97b16f11cb6a82eebb60f9 (patch)
treed950f39758921d7415260ce18020ae40c68812da /drivers
parent2801d69e84d04714c22f8cc22fbe8535ac5f1eb7 (diff)
Revert "wl12xx: Change claiming of the SDIO bus"
This reverts commit 393fb560d328cc06e6a5c7b7473901ad724f82e7. Commit b6ad726 ("mmc: core: Prevent too long response times for suspend") fails the suspend if the mmc host can't be claimed before suspend. As the host is claimed by us as long as the chip is powered on, suspend will always fail. Revert to claiming the sdio bus only when needed. Signed-off-by: Eliad Peller <eliad@wizery.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/wireless/wl12xx/sdio.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/net/wireless/wl12xx/sdio.c b/drivers/net/wireless/wl12xx/sdio.c
index 468a50553fac..099c2c9c1a2d 100644
--- a/drivers/net/wireless/wl12xx/sdio.c
+++ b/drivers/net/wireless/wl12xx/sdio.c
@@ -74,6 +74,8 @@ static void wl12xx_sdio_raw_read(struct device *child, int addr, void *buf,
74 struct wl12xx_sdio_glue *glue = dev_get_drvdata(child->parent); 74 struct wl12xx_sdio_glue *glue = dev_get_drvdata(child->parent);
75 struct sdio_func *func = dev_to_sdio_func(glue->dev); 75 struct sdio_func *func = dev_to_sdio_func(glue->dev);
76 76
77 sdio_claim_host(func);
78
77 if (unlikely(addr == HW_ACCESS_ELP_CTRL_REG_ADDR)) { 79 if (unlikely(addr == HW_ACCESS_ELP_CTRL_REG_ADDR)) {
78 ((u8 *)buf)[0] = sdio_f0_readb(func, addr, &ret); 80 ((u8 *)buf)[0] = sdio_f0_readb(func, addr, &ret);
79 dev_dbg(child->parent, "sdio read 52 addr 0x%x, byte 0x%02x\n", 81 dev_dbg(child->parent, "sdio read 52 addr 0x%x, byte 0x%02x\n",
@@ -88,6 +90,8 @@ static void wl12xx_sdio_raw_read(struct device *child, int addr, void *buf,
88 addr, len); 90 addr, len);
89 } 91 }
90 92
93 sdio_release_host(func);
94
91 if (ret) 95 if (ret)
92 dev_err(child->parent, "sdio read failed (%d)\n", ret); 96 dev_err(child->parent, "sdio read failed (%d)\n", ret);
93} 97}
@@ -99,6 +103,8 @@ static void wl12xx_sdio_raw_write(struct device *child, int addr, void *buf,
99 struct wl12xx_sdio_glue *glue = dev_get_drvdata(child->parent); 103 struct wl12xx_sdio_glue *glue = dev_get_drvdata(child->parent);
100 struct sdio_func *func = dev_to_sdio_func(glue->dev); 104 struct sdio_func *func = dev_to_sdio_func(glue->dev);
101 105
106 sdio_claim_host(func);
107
102 if (unlikely(addr == HW_ACCESS_ELP_CTRL_REG_ADDR)) { 108 if (unlikely(addr == HW_ACCESS_ELP_CTRL_REG_ADDR)) {
103 sdio_f0_writeb(func, ((u8 *)buf)[0], addr, &ret); 109 sdio_f0_writeb(func, ((u8 *)buf)[0], addr, &ret);
104 dev_dbg(child->parent, "sdio write 52 addr 0x%x, byte 0x%02x\n", 110 dev_dbg(child->parent, "sdio write 52 addr 0x%x, byte 0x%02x\n",
@@ -113,6 +119,8 @@ static void wl12xx_sdio_raw_write(struct device *child, int addr, void *buf,
113 ret = sdio_memcpy_toio(func, addr, buf, len); 119 ret = sdio_memcpy_toio(func, addr, buf, len);
114 } 120 }
115 121
122 sdio_release_host(func);
123
116 if (ret) 124 if (ret)
117 dev_err(child->parent, "sdio write failed (%d)\n", ret); 125 dev_err(child->parent, "sdio write failed (%d)\n", ret);
118} 126}
@@ -136,6 +144,7 @@ static int wl12xx_sdio_power_on(struct wl12xx_sdio_glue *glue)
136 144
137 sdio_claim_host(func); 145 sdio_claim_host(func);
138 sdio_enable_func(func); 146 sdio_enable_func(func);
147 sdio_release_host(func);
139 148
140out: 149out:
141 return ret; 150 return ret;
@@ -146,6 +155,7 @@ static int wl12xx_sdio_power_off(struct wl12xx_sdio_glue *glue)
146 int ret; 155 int ret;
147 struct sdio_func *func = dev_to_sdio_func(glue->dev); 156 struct sdio_func *func = dev_to_sdio_func(glue->dev);
148 157
158 sdio_claim_host(func);
149 sdio_disable_func(func); 159 sdio_disable_func(func);
150 sdio_release_host(func); 160 sdio_release_host(func);
151 161