aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ti/wlcore/io.h
diff options
context:
space:
mode:
authorLuciano Coelho <coelho@ti.com>2011-11-29 13:38:37 +0200
committerLuciano Coelho <coelho@ti.com>2012-04-12 08:43:56 +0300
commit00782136b4d6e2316e0a2a55f3b1fba160e9576e (patch)
tree67a75d38098a2c66c78ce0b70de6f8cf99d8c673 /drivers/net/wireless/ti/wlcore/io.h
parentwlcore/wl12xx: implement chip-specific partition tables (diff)
downloadlinux-dev-00782136b4d6e2316e0a2a55f3b1fba160e9576e.tar.xz
linux-dev-00782136b4d6e2316e0a2a55f3b1fba160e9576e.zip
wlcore/wl12xx: implement chip-specific register tables
Add register tables support in wlcore, add some new IO functions to read and write to chip-specific register and data addresses. Move some common register values from wl12xx to wlcore and add the registers table to wl12xx. Signed-off-by: Luciano Coelho <coelho@ti.com>
Diffstat (limited to 'drivers/net/wireless/ti/wlcore/io.h')
-rw-r--r--drivers/net/wireless/ti/wlcore/io.h36
1 files changed, 35 insertions, 1 deletions
diff --git a/drivers/net/wireless/ti/wlcore/io.h b/drivers/net/wireless/ti/wlcore/io.h
index 495ab335b465..c5ca3c83631a 100644
--- a/drivers/net/wireless/ti/wlcore/io.h
+++ b/drivers/net/wireless/ti/wlcore/io.h
@@ -26,7 +26,6 @@
#define __IO_H__
#include <linux/irqreturn.h>
-#include "reg.h"
#define HW_ACCESS_MEMORY_MAX_RANGE 0x1FFC0
@@ -65,6 +64,18 @@ static inline void wl1271_raw_read(struct wl1271 *wl, int addr, void *buf,
wl->if_ops->read(wl->dev, addr, buf, len, fixed);
}
+static inline void wlcore_raw_read_data(struct wl1271 *wl, int reg, void *buf,
+ size_t len, bool fixed)
+{
+ wl1271_raw_read(wl, wl->rtable[reg], buf, len, fixed);
+}
+
+static inline void wlcore_raw_write_data(struct wl1271 *wl, int reg, void *buf,
+ size_t len, bool fixed)
+{
+ wl1271_raw_write(wl, wl->rtable[reg], buf, len, fixed);
+}
+
static inline u32 wl1271_raw_read32(struct wl1271 *wl, int addr)
{
wl1271_raw_read(wl, addr, &wl->buffer_32,
@@ -100,6 +111,18 @@ static inline void wl1271_write(struct wl1271 *wl, int addr, void *buf,
wl1271_raw_write(wl, physical, buf, len, fixed);
}
+static inline void wlcore_write_data(struct wl1271 *wl, int reg, void *buf,
+ size_t len, bool fixed)
+{
+ wl1271_write(wl, wl->rtable[reg], buf, len, fixed);
+}
+
+static inline void wlcore_read_data(struct wl1271 *wl, int reg, void *buf,
+ size_t len, bool fixed)
+{
+ wl1271_read(wl, wl->rtable[reg], buf, len, fixed);
+}
+
static inline void wl1271_read_hwaddr(struct wl1271 *wl, int hwaddr,
void *buf, size_t len, bool fixed)
{
@@ -124,6 +147,17 @@ static inline void wl1271_write32(struct wl1271 *wl, int addr, u32 val)
wl1271_raw_write32(wl, wlcore_translate_addr(wl, addr), val);
}
+static inline u32 wlcore_read_reg(struct wl1271 *wl, int reg)
+{
+ return wl1271_raw_read32(wl,
+ wlcore_translate_addr(wl, wl->rtable[reg]));
+}
+
+static inline void wlcore_write_reg(struct wl1271 *wl, int reg, u32 val)
+{
+ wl1271_raw_write32(wl, wlcore_translate_addr(wl, wl->rtable[reg]), val);
+}
+
static inline void wl1271_power_off(struct wl1271 *wl)
{
wl->if_ops->power(wl->dev, false);