diff options
author | Teemu Paasikivi <ext-teemu.3.paasikivi@nokia.com> | 2010-02-22 01:38:25 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2010-03-09 15:02:58 -0500 |
commit | 760d969f9e91a734161a5979a3b3818062e80b7e (patch) | |
tree | 8c2e639dcc97990fc6d21a656c206e0c9e8d2bdc /drivers/net/wireless/wl12xx/wl1271_spi.c | |
parent | b42f91ba49ff135392b8f6140e21f85fb0467285 (diff) |
wl1271: Removed wl1271_spi.h and made some functions static
Removed wl1271_spi.h header as there's no more need to access functions
declared there outside of wl1271_spi.c. Also made those SPI access
functions static.
Signed-off-by: Teemu Paasikivi <ext-teemu.3.paasikivi@nokia.com>
Reviewed-by: Juuso Oikarinen <juuso.oikarinen@nokia.com>
Signed-off-by: Juuso Oikarinen <juuso.oikarinen@nokia.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/wl12xx/wl1271_spi.c')
-rw-r--r-- | drivers/net/wireless/wl12xx/wl1271_spi.c | 44 |
1 files changed, 37 insertions, 7 deletions
diff --git a/drivers/net/wireless/wl12xx/wl1271_spi.c b/drivers/net/wireless/wl12xx/wl1271_spi.c index f89e1b3ac1bb..51171d7d5da3 100644 --- a/drivers/net/wireless/wl12xx/wl1271_spi.c +++ b/drivers/net/wireless/wl12xx/wl1271_spi.c | |||
@@ -30,9 +30,39 @@ | |||
30 | 30 | ||
31 | #include "wl1271.h" | 31 | #include "wl1271.h" |
32 | #include "wl12xx_80211.h" | 32 | #include "wl12xx_80211.h" |
33 | #include "wl1271_spi.h" | ||
34 | #include "wl1271_io.h" | 33 | #include "wl1271_io.h" |
35 | 34 | ||
35 | #include "wl1271_reg.h" | ||
36 | |||
37 | #define WSPI_CMD_READ 0x40000000 | ||
38 | #define WSPI_CMD_WRITE 0x00000000 | ||
39 | #define WSPI_CMD_FIXED 0x20000000 | ||
40 | #define WSPI_CMD_BYTE_LENGTH 0x1FFE0000 | ||
41 | #define WSPI_CMD_BYTE_LENGTH_OFFSET 17 | ||
42 | #define WSPI_CMD_BYTE_ADDR 0x0001FFFF | ||
43 | |||
44 | #define WSPI_INIT_CMD_CRC_LEN 5 | ||
45 | |||
46 | #define WSPI_INIT_CMD_START 0x00 | ||
47 | #define WSPI_INIT_CMD_TX 0x40 | ||
48 | /* the extra bypass bit is sampled by the TNET as '1' */ | ||
49 | #define WSPI_INIT_CMD_BYPASS_BIT 0x80 | ||
50 | #define WSPI_INIT_CMD_FIXEDBUSY_LEN 0x07 | ||
51 | #define WSPI_INIT_CMD_EN_FIXEDBUSY 0x80 | ||
52 | #define WSPI_INIT_CMD_DIS_FIXEDBUSY 0x00 | ||
53 | #define WSPI_INIT_CMD_IOD 0x40 | ||
54 | #define WSPI_INIT_CMD_IP 0x20 | ||
55 | #define WSPI_INIT_CMD_CS 0x10 | ||
56 | #define WSPI_INIT_CMD_WS 0x08 | ||
57 | #define WSPI_INIT_CMD_WSPI 0x01 | ||
58 | #define WSPI_INIT_CMD_END 0x01 | ||
59 | |||
60 | #define WSPI_INIT_CMD_LEN 8 | ||
61 | |||
62 | #define HW_ACCESS_WSPI_FIXED_BUSY_LEN \ | ||
63 | ((WL1271_BUSY_WORD_LEN - 4) / sizeof(u32)) | ||
64 | #define HW_ACCESS_WSPI_INIT_CMD_MASK 0 | ||
65 | |||
36 | static inline struct spi_device *wl_to_spi(struct wl1271 *wl) | 66 | static inline struct spi_device *wl_to_spi(struct wl1271 *wl) |
37 | { | 67 | { |
38 | return wl->if_priv; | 68 | return wl->if_priv; |
@@ -43,17 +73,17 @@ static struct device *wl1271_spi_wl_to_dev(struct wl1271 *wl) | |||
43 | return &(wl_to_spi(wl)->dev); | 73 | return &(wl_to_spi(wl)->dev); |
44 | } | 74 | } |
45 | 75 | ||
46 | void wl1271_spi_disable_interrupts(struct wl1271 *wl) | 76 | static void wl1271_spi_disable_interrupts(struct wl1271 *wl) |
47 | { | 77 | { |
48 | disable_irq(wl->irq); | 78 | disable_irq(wl->irq); |
49 | } | 79 | } |
50 | 80 | ||
51 | void wl1271_spi_enable_interrupts(struct wl1271 *wl) | 81 | static void wl1271_spi_enable_interrupts(struct wl1271 *wl) |
52 | { | 82 | { |
53 | enable_irq(wl->irq); | 83 | enable_irq(wl->irq); |
54 | } | 84 | } |
55 | 85 | ||
56 | void wl1271_spi_reset(struct wl1271 *wl) | 86 | static void wl1271_spi_reset(struct wl1271 *wl) |
57 | { | 87 | { |
58 | u8 *cmd; | 88 | u8 *cmd; |
59 | struct spi_transfer t; | 89 | struct spi_transfer t; |
@@ -79,7 +109,7 @@ void wl1271_spi_reset(struct wl1271 *wl) | |||
79 | wl1271_dump(DEBUG_SPI, "spi reset -> ", cmd, WSPI_INIT_CMD_LEN); | 109 | wl1271_dump(DEBUG_SPI, "spi reset -> ", cmd, WSPI_INIT_CMD_LEN); |
80 | } | 110 | } |
81 | 111 | ||
82 | void wl1271_spi_init(struct wl1271 *wl) | 112 | static void wl1271_spi_init(struct wl1271 *wl) |
83 | { | 113 | { |
84 | u8 crc[WSPI_INIT_CMD_CRC_LEN], *cmd; | 114 | u8 crc[WSPI_INIT_CMD_CRC_LEN], *cmd; |
85 | struct spi_transfer t; | 115 | struct spi_transfer t; |
@@ -199,7 +229,7 @@ static void wl1271_spi_read_busy(struct wl1271 *wl, void *buf, size_t len) | |||
199 | } | 229 | } |
200 | #endif | 230 | #endif |
201 | 231 | ||
202 | void wl1271_spi_raw_read(struct wl1271 *wl, int addr, void *buf, | 232 | static void wl1271_spi_raw_read(struct wl1271 *wl, int addr, void *buf, |
203 | size_t len, bool fixed) | 233 | size_t len, bool fixed) |
204 | { | 234 | { |
205 | struct spi_transfer t[3]; | 235 | struct spi_transfer t[3]; |
@@ -244,7 +274,7 @@ void wl1271_spi_raw_read(struct wl1271 *wl, int addr, void *buf, | |||
244 | wl1271_dump(DEBUG_SPI, "spi_read buf <- ", buf, len); | 274 | wl1271_dump(DEBUG_SPI, "spi_read buf <- ", buf, len); |
245 | } | 275 | } |
246 | 276 | ||
247 | void wl1271_spi_raw_write(struct wl1271 *wl, int addr, void *buf, | 277 | static void wl1271_spi_raw_write(struct wl1271 *wl, int addr, void *buf, |
248 | size_t len, bool fixed) | 278 | size_t len, bool fixed) |
249 | { | 279 | { |
250 | struct spi_transfer t[2]; | 280 | struct spi_transfer t[2]; |