wl12xx: move hardcoded hci_io_ds value into the conf struct
authorLuciano Coelho <coelho@ti.com>
Fri, 1 Apr 2011 17:48:02 +0000 (20:48 +0300)
committerLuciano Coelho <coelho@ti.com>
Tue, 19 Apr 2011 13:49:22 +0000 (16:49 +0300)
Instead of hardcoding the hci_io_ds configuration that we write to the
SDIO_IO_DS top registed, read it from the default configuration so
that it's easier to change for different platforms.

Reported-by: Ido Yariv <ido@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
drivers/net/wireless/wl12xx/boot.c
drivers/net/wireless/wl12xx/boot.h
drivers/net/wireless/wl12xx/conf.h
drivers/net/wireless/wl12xx/main.c

index b5ec2c2b6f783267ef1b4074fadce8d96a945b41..2b0cf85788b376e4f255545194c70f6d3ef11fe7 100644 (file)
@@ -779,7 +779,7 @@ int wl1271_load_firmware(struct wl1271 *wl)
         * to upload_fw) */
 
        if (wl->chip.id == CHIP_ID_1283_PG20)
-               wl1271_top_reg_write(wl, SDIO_IO_DS, HCI_IO_DS_6MA);
+               wl1271_top_reg_write(wl, SDIO_IO_DS, wl->conf.hci_io_ds);
 
        ret = wl1271_boot_upload_firmware(wl);
        if (ret < 0)
index d9de64ac14423ff0c96715134da095d4d751a7f6..e8f8255bbabeb45641a465d8602b6e4fb1871a7d 100644 (file)
@@ -117,10 +117,13 @@ struct wl1271_static_data {
 #define SDIO_IO_DS                   0xd14
 
 /* SDIO/wSPI DS configuration values */
-#define HCI_IO_DS_8MA                0
-#define HCI_IO_DS_4MA                1 /* default */
-#define HCI_IO_DS_6MA                2
-#define HCI_IO_DS_2MA                3
+enum {
+       HCI_IO_DS_8MA = 0,
+       HCI_IO_DS_4MA = 1, /* default */
+       HCI_IO_DS_6MA = 2,
+       HCI_IO_DS_2MA = 3,
+};
+
 /* end PLL configuration algorithm for wl128x */
 
 #endif
index 743bd0beb63b2de742f24905ce7f2194398af52e..52269d4d36236969d1527fda1c3965c86393e504 100644 (file)
@@ -1206,6 +1206,7 @@ struct conf_drv_settings {
        struct conf_ht_setting ht;
        struct conf_memory_settings mem_wl127x;
        struct conf_memory_settings mem_wl128x;
+       u8 hci_io_ds;
 };
 
 #endif
index a5a5d01330239a4abe142cc7095e25aabd64e84a..732fd21beafb5e3545af9465e3dd03a346111cba 100644 (file)
@@ -319,6 +319,7 @@ static struct conf_drv_settings default_conf = {
                .min_req_rx_blocks            = 22,
                .tx_min                       = 27,
        },
+       .hci_io_ds = HCI_IO_DS_6MA,
 };
 
 static void __wl1271_op_remove_interface(struct wl1271 *wl);