23 #include <linux/module.h>
34 #ifndef SDIO_VENDOR_ID_TI
35 #define SDIO_VENDOR_ID_TI 0x104c
38 #ifndef SDIO_DEVICE_ID_TI_WL1251
39 #define SDIO_DEVICE_ID_TI_WL1251 0x9066
70 static void wl1251_sdio_read(
struct wl1251 *wl,
int addr,
71 void *
buf,
size_t len)
83 static void wl1251_sdio_write(
struct wl1251 *wl,
int addr,
84 void *buf,
size_t len)
96 static void wl1251_sdio_read_elp(
struct wl1251 *wl,
int addr,
u32 *
val)
116 static void wl1251_sdio_write_elp(
struct wl1251 *wl,
int addr,
u32 val)
132 static void wl1251_sdio_reset(
struct wl1251 *wl)
136 static void wl1251_sdio_enable_irq(
struct wl1251 *wl)
145 static void wl1251_sdio_disable_irq(
struct wl1251 *wl)
164 static void wl1251_enable_line_irq(
struct wl1251 *wl)
169 static void wl1251_disable_line_irq(
struct wl1251 *wl)
174 static int wl1251_sdio_set_power(
struct wl1251 *wl,
bool enable)
188 ret = pm_runtime_get_sync(&func->
dev);
200 ret = pm_runtime_put_sync(&func->
dev);
213 .read = wl1251_sdio_read,
214 .write = wl1251_sdio_write,
215 .write_elp = wl1251_sdio_write_elp,
216 .read_elp = wl1251_sdio_read_elp,
217 .reset = wl1251_sdio_reset,
218 .power = wl1251_sdio_set_power,
221 static int wl1251_sdio_probe(
struct sdio_func *func,
236 wl_sdio = kzalloc(
sizeof(*wl_sdio),
GFP_KERNEL);
237 if (wl_sdio ==
NULL) {
250 SET_IEEE80211_DEV(hw, &func->
dev);
253 wl->
if_ops = &wl1251_sdio_ops;
256 if (!IS_ERR(wl12xx_board_data)) {
258 wl->
irq = wl12xx_board_data->
irq;
272 wl1251_sdio_ops.
enable_irq = wl1251_enable_line_irq;
273 wl1251_sdio_ops.
disable_irq = wl1251_disable_line_irq;
277 wl1251_sdio_ops.
enable_irq = wl1251_sdio_enable_irq;
278 wl1251_sdio_ops.
disable_irq = wl1251_sdio_disable_irq;
290 pm_runtime_put_noidle(&func->
dev);
314 pm_runtime_get_noresume(&func->
dev);
327 static int wl1251_suspend(
struct device *
dev)
336 static int wl1251_resume(
struct device *
dev)
341 static const struct dev_pm_ops wl1251_sdio_pm_ops = {
342 .suspend = wl1251_suspend,
343 .resume = wl1251_resume,
347 .name =
"wl1251_sdio",
348 .id_table = wl1251_devices,
349 .probe = wl1251_sdio_probe,
351 .drv.pm = &wl1251_sdio_pm_ops,
354 static int __init wl1251_sdio_init(
void)
360 wl1251_error(
"failed to register sdio driver: %d", err);
364 static void __exit wl1251_sdio_exit(
void)