summaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ti/wl12xx/main.c
diff options
context:
space:
mode:
authorLuciano Coelho <coelho@ti.com>2011-11-29 16:27:31 +0200
committerLuciano Coelho <coelho@ti.com>2012-04-12 08:43:57 +0300
commit6f7dd16cb125468a5393861c22fbecfb52dd9653 (patch)
tree45803828a2b7a5d0808510e73d24af3e075f6e23 /drivers/net/wireless/ti/wl12xx/main.c
parent00782136b4d6e2316e0a2a55f3b1fba160e9576e (diff)
downloadblackbird-op-linux-6f7dd16cb125468a5393861c22fbecfb52dd9653.tar.gz
blackbird-op-linux-6f7dd16cb125468a5393861c22fbecfb52dd9653.zip
wlcore/wl12xx: add chip-specific identify chip operation
Move the code that identifies the chip ID and selects the appropriate firmware to an operation implemented by the lower driver. Also move the quirks definitions into wlcore.h and rename to WLCORE_QUIRK_*. Signed-off-by: Luciano Coelho <coelho@ti.com>
Diffstat (limited to 'drivers/net/wireless/ti/wl12xx/main.c')
-rw-r--r--drivers/net/wireless/ti/wl12xx/main.c65
1 files changed, 62 insertions, 3 deletions
diff --git a/drivers/net/wireless/ti/wl12xx/main.c b/drivers/net/wireless/ti/wl12xx/main.c
index ea8480c1fae7..83ed48d206b2 100644
--- a/drivers/net/wireless/ti/wl12xx/main.c
+++ b/drivers/net/wireless/ti/wl12xx/main.c
@@ -29,9 +29,6 @@
#include "reg.h"
-static struct wlcore_ops wl12xx_ops = {
-};
-
static struct wlcore_partition_set wl12xx_ptable[PART_TABLE_LEN] = {
[PART_DOWN] = {
.mem = {
@@ -131,6 +128,62 @@ static const int wl12xx_rtable[REG_TABLE_LEN] = {
[REG_RAW_FW_STATUS_ADDR] = FW_STATUS_ADDR,
};
+/* TODO: maybe move to a new header file? */
+#define WL127X_FW_NAME_MULTI "ti-connectivity/wl127x-fw-4-mr.bin"
+#define WL127X_FW_NAME_SINGLE "ti-connectivity/wl127x-fw-4-sr.bin"
+#define WL127X_PLT_FW_NAME "ti-connectivity/wl127x-fw-4-plt.bin"
+
+#define WL128X_FW_NAME_MULTI "ti-connectivity/wl128x-fw-4-mr.bin"
+#define WL128X_FW_NAME_SINGLE "ti-connectivity/wl128x-fw-4-sr.bin"
+#define WL128X_PLT_FW_NAME "ti-connectivity/wl128x-fw-4-plt.bin"
+
+static int wl12xx_identify_chip(struct wl1271 *wl)
+{
+ int ret = 0;
+
+ switch (wl->chip.id) {
+ case CHIP_ID_1271_PG10:
+ wl1271_warning("chip id 0x%x (1271 PG10) support is obsolete",
+ wl->chip.id);
+
+ wl->quirks |= WLCORE_QUIRK_NO_BLOCKSIZE_ALIGNMENT;
+ wl->plt_fw_name = WL127X_PLT_FW_NAME;
+ wl->sr_fw_name = WL127X_FW_NAME_SINGLE;
+ wl->mr_fw_name = WL127X_FW_NAME_MULTI;
+ break;
+
+ case CHIP_ID_1271_PG20:
+ wl1271_debug(DEBUG_BOOT, "chip id 0x%x (1271 PG20)",
+ wl->chip.id);
+
+ wl->quirks |= WLCORE_QUIRK_NO_BLOCKSIZE_ALIGNMENT;
+ wl->plt_fw_name = WL127X_PLT_FW_NAME;
+ wl->sr_fw_name = WL127X_FW_NAME_SINGLE;
+ wl->mr_fw_name = WL127X_FW_NAME_MULTI;
+ break;
+
+ case CHIP_ID_1283_PG20:
+ wl1271_debug(DEBUG_BOOT, "chip id 0x%x (1283 PG20)",
+ wl->chip.id);
+ wl->plt_fw_name = WL128X_PLT_FW_NAME;
+ wl->sr_fw_name = WL128X_FW_NAME_SINGLE;
+ wl->mr_fw_name = WL128X_FW_NAME_MULTI;
+ break;
+ case CHIP_ID_1283_PG10:
+ default:
+ wl1271_warning("unsupported chip id: 0x%x", wl->chip.id);
+ ret = -ENODEV;
+ goto out;
+ }
+
+out:
+ return ret;
+}
+
+static struct wlcore_ops wl12xx_ops = {
+ .identify_chip = wl12xx_identify_chip,
+};
+
static int __devinit wl12xx_probe(struct platform_device *pdev)
{
struct wl1271 *wl;
@@ -180,3 +233,9 @@ module_exit(wl12xx_exit);
MODULE_LICENSE("GPL v2");
MODULE_AUTHOR("Luciano Coelho <coelho@ti.com>");
+MODULE_FIRMWARE(WL127X_FW_NAME_SINGLE);
+MODULE_FIRMWARE(WL127X_FW_NAME_MULTI);
+MODULE_FIRMWARE(WL127X_PLT_FW_NAME);
+MODULE_FIRMWARE(WL128X_FW_NAME_SINGLE);
+MODULE_FIRMWARE(WL128X_FW_NAME_MULTI);
+MODULE_FIRMWARE(WL128X_PLT_FW_NAME);
OpenPOWER on IntegriCloud