diff options
Diffstat (limited to 'drivers/net/wireless/wl12xx/wl1251_sdio.c')
-rw-r--r-- | drivers/net/wireless/wl12xx/wl1251_sdio.c | 52 |
1 files changed, 37 insertions, 15 deletions
diff --git a/drivers/net/wireless/wl12xx/wl1251_sdio.c b/drivers/net/wireless/wl12xx/wl1251_sdio.c index 9423f22bdced..2051ef06e9ec 100644 --- a/drivers/net/wireless/wl12xx/wl1251_sdio.c +++ b/drivers/net/wireless/wl12xx/wl1251_sdio.c | |||
@@ -20,20 +20,11 @@ | |||
20 | * Copyright (C) 2009 Bob Copeland (me@bobcopeland.com) | 20 | * Copyright (C) 2009 Bob Copeland (me@bobcopeland.com) |
21 | */ | 21 | */ |
22 | #include <linux/module.h> | 22 | #include <linux/module.h> |
23 | #include <linux/crc7.h> | ||
24 | #include <linux/mod_devicetable.h> | 23 | #include <linux/mod_devicetable.h> |
25 | #include <linux/irq.h> | ||
26 | #include <linux/mmc/sdio_func.h> | 24 | #include <linux/mmc/sdio_func.h> |
27 | #include <linux/mmc/sdio_ids.h> | 25 | #include <linux/mmc/sdio_ids.h> |
28 | #include <linux/platform_device.h> | ||
29 | 26 | ||
30 | #include "wl1251.h" | 27 | #include "wl1251.h" |
31 | #include "wl12xx_80211.h" | ||
32 | #include "wl1251_reg.h" | ||
33 | #include "wl1251_ps.h" | ||
34 | #include "wl1251_io.h" | ||
35 | #include "wl1251_tx.h" | ||
36 | #include "wl1251_debugfs.h" | ||
37 | 28 | ||
38 | #ifndef SDIO_VENDOR_ID_TI | 29 | #ifndef SDIO_VENDOR_ID_TI |
39 | #define SDIO_VENDOR_ID_TI 0x104c | 30 | #define SDIO_VENDOR_ID_TI 0x104c |
@@ -65,7 +56,8 @@ static const struct sdio_device_id wl1251_devices[] = { | |||
65 | MODULE_DEVICE_TABLE(sdio, wl1251_devices); | 56 | MODULE_DEVICE_TABLE(sdio, wl1251_devices); |
66 | 57 | ||
67 | 58 | ||
68 | void wl1251_sdio_read(struct wl1251 *wl, int addr, void *buf, size_t len) | 59 | static void wl1251_sdio_read(struct wl1251 *wl, int addr, |
60 | void *buf, size_t len) | ||
69 | { | 61 | { |
70 | int ret; | 62 | int ret; |
71 | struct sdio_func *func = wl_to_func(wl); | 63 | struct sdio_func *func = wl_to_func(wl); |
@@ -77,7 +69,8 @@ void wl1251_sdio_read(struct wl1251 *wl, int addr, void *buf, size_t len) | |||
77 | sdio_release_host(func); | 69 | sdio_release_host(func); |
78 | } | 70 | } |
79 | 71 | ||
80 | void wl1251_sdio_write(struct wl1251 *wl, int addr, void *buf, size_t len) | 72 | static void wl1251_sdio_write(struct wl1251 *wl, int addr, |
73 | void *buf, size_t len) | ||
81 | { | 74 | { |
82 | int ret; | 75 | int ret; |
83 | struct sdio_func *func = wl_to_func(wl); | 76 | struct sdio_func *func = wl_to_func(wl); |
@@ -89,7 +82,33 @@ void wl1251_sdio_write(struct wl1251 *wl, int addr, void *buf, size_t len) | |||
89 | sdio_release_host(func); | 82 | sdio_release_host(func); |
90 | } | 83 | } |
91 | 84 | ||
92 | void wl1251_sdio_reset(struct wl1251 *wl) | 85 | static void wl1251_sdio_read_elp(struct wl1251 *wl, int addr, u32 *val) |
86 | { | ||
87 | int ret = 0; | ||
88 | struct sdio_func *func = wl_to_func(wl); | ||
89 | |||
90 | sdio_claim_host(func); | ||
91 | *val = sdio_readb(func, addr, &ret); | ||
92 | sdio_release_host(func); | ||
93 | |||
94 | if (ret) | ||
95 | wl1251_error("sdio_readb failed (%d)", ret); | ||
96 | } | ||
97 | |||
98 | static void wl1251_sdio_write_elp(struct wl1251 *wl, int addr, u32 val) | ||
99 | { | ||
100 | int ret = 0; | ||
101 | struct sdio_func *func = wl_to_func(wl); | ||
102 | |||
103 | sdio_claim_host(func); | ||
104 | sdio_writeb(func, val, addr, &ret); | ||
105 | sdio_release_host(func); | ||
106 | |||
107 | if (ret) | ||
108 | wl1251_error("sdio_writeb failed (%d)", ret); | ||
109 | } | ||
110 | |||
111 | static void wl1251_sdio_reset(struct wl1251 *wl) | ||
93 | { | 112 | { |
94 | } | 113 | } |
95 | 114 | ||
@@ -111,19 +130,22 @@ static void wl1251_sdio_disable_irq(struct wl1251 *wl) | |||
111 | sdio_release_host(func); | 130 | sdio_release_host(func); |
112 | } | 131 | } |
113 | 132 | ||
114 | void wl1251_sdio_set_power(bool enable) | 133 | static void wl1251_sdio_set_power(bool enable) |
115 | { | 134 | { |
116 | } | 135 | } |
117 | 136 | ||
118 | struct wl1251_if_operations wl1251_sdio_ops = { | 137 | static const struct wl1251_if_operations wl1251_sdio_ops = { |
119 | .read = wl1251_sdio_read, | 138 | .read = wl1251_sdio_read, |
120 | .write = wl1251_sdio_write, | 139 | .write = wl1251_sdio_write, |
140 | .write_elp = wl1251_sdio_write_elp, | ||
141 | .read_elp = wl1251_sdio_read_elp, | ||
121 | .reset = wl1251_sdio_reset, | 142 | .reset = wl1251_sdio_reset, |
122 | .enable_irq = wl1251_sdio_enable_irq, | 143 | .enable_irq = wl1251_sdio_enable_irq, |
123 | .disable_irq = wl1251_sdio_disable_irq, | 144 | .disable_irq = wl1251_sdio_disable_irq, |
124 | }; | 145 | }; |
125 | 146 | ||
126 | int wl1251_sdio_probe(struct sdio_func *func, const struct sdio_device_id *id) | 147 | static int wl1251_sdio_probe(struct sdio_func *func, |
148 | const struct sdio_device_id *id) | ||
127 | { | 149 | { |
128 | int ret; | 150 | int ret; |
129 | struct wl1251 *wl; | 151 | struct wl1251 *wl; |