24 #include <linux/module.h>
25 #include <linux/slab.h>
52 static void wl1251_spi_reset(
struct wl1251 *wl)
71 spi_message_add_tail(&
t, &
m);
80 static void wl1251_spi_wake(
struct wl1251 *wl)
92 memset(crc, 0,
sizeof(crc));
127 spi_message_add_tail(&
t, &
m);
136 static void wl1251_spi_reset_wake(
struct wl1251 *wl)
138 wl1251_spi_reset(wl);
142 static void wl1251_spi_read(
struct wl1251 *wl,
int addr,
void *
buf,
158 spi_message_init(&
m);
163 spi_message_add_tail(&
t[0], &
m);
166 t[1].rx_buf = busy_buf;
168 spi_message_add_tail(&
t[1], &
m);
172 spi_message_add_tail(&
t[2], &
m);
182 static void wl1251_spi_write(
struct wl1251 *wl,
int addr,
void *buf,
196 spi_message_init(&
m);
200 t[0].len =
sizeof(*cmd);
201 spi_message_add_tail(&
t[0], &
m);
205 spi_message_add_tail(&
t[1], &
m);
213 static void wl1251_spi_enable_irq(
struct wl1251 *wl)
218 static void wl1251_spi_disable_irq(
struct wl1251 *wl)
223 static int wl1251_spi_set_power(
struct wl1251 *wl,
bool enable)
232 .read = wl1251_spi_read,
233 .write = wl1251_spi_write,
234 .reset = wl1251_spi_reset_wake,
235 .enable_irq = wl1251_spi_enable_irq,
236 .disable_irq = wl1251_spi_disable_irq,
237 .power = wl1251_spi_set_power,
247 pdata = spi->
dev.platform_data;
259 SET_IEEE80211_DEV(hw, &spi->
dev);
262 wl->
if_ops = &wl1251_spi_ops;
276 wl1251_error(
"set power function missing in platform data");
322 static struct spi_driver wl1251_spi_driver = {
328 .probe = wl1251_spi_probe,
332 static int __init wl1251_spi_init(
void)
346 static void __exit wl1251_spi_exit(
void)
348 spi_unregister_driver(&wl1251_spi_driver);