wl18xx: add number of antennas and dc2dc type as module params
authorLuciano Coelho <coelho@ti.com>
Thu, 10 May 2012 09:13:52 +0000 (12:13 +0300)
committerLuciano Coelho <coelho@ti.com>
Tue, 5 Jun 2012 12:56:48 +0000 (15:56 +0300)
We need to specify the number of 2.4GHz and 5GHz antennas and whether
the board has an internal or external DC2DC.  Add some module
parameters that allow changing that.

In the future this will come from the "NVS" file.

Signed-off-by: Luciano Coelho <coelho@ti.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
drivers/net/wireless/ti/wl18xx/conf.h
drivers/net/wireless/ti/wl18xx/main.c

index d2b097e4d24e773c9d4f468be6fc9fe03c29fa9d..a6058fb86e7fbf629ccab1b01be0576b1351be91 100644 (file)
@@ -33,9 +33,6 @@ struct wl18xx_conf_phy {
        u8 low_band_component_type;
        u8 high_band_component;
        u8 high_band_component_type;
-       u8 number_of_assembled_ant2_4;
-       u8 number_of_assembled_ant5;
-       u8 external_pa_dc2dc;
        u8 tcxo_ldo_voltage;
        u8 xtal_itrim_val;
        u8 srf_state;
index f14141b3dbe463472ecaa814d68c0bbd8467007e..2f0cbf8f202c0587c236eceaf9f2f09b2ad2d073 100644 (file)
@@ -44,6 +44,9 @@
 
 static char *ht_mode_param;
 static char *board_type_param;
+static bool dc2dc_param = false;
+static int n_antennas_2_param = 1;
+static int n_antennas_5_param = 1;
 
 static const u8 wl18xx_rate_to_idx_2ghz[] = {
        /* MCS rates are used only with 11n */
@@ -487,9 +490,6 @@ static struct wl18xx_priv_conf wl18xx_default_priv_conf = {
                .low_band_component_type        = 0x05,
                .high_band_component            = COMPONENT_2_WAY_SWITCH,
                .high_band_component_type       = 0x09,
-               .number_of_assembled_ant2_4     = 0x01,
-               .number_of_assembled_ant5       = 0x01,
-               .external_pa_dc2dc              = 0x00,
                .tcxo_ldo_voltage               = 0x00,
                .xtal_itrim_val                 = 0x04,
                .srf_state                      = 0x00,
@@ -704,10 +704,10 @@ static void wl18xx_set_mac_and_phy(struct wl1271 *wl)
        params.high_band_component_type =
                phy->high_band_component_type;
        params.number_of_assembled_ant2_4 =
-               phy->number_of_assembled_ant2_4;
+               n_antennas_2_param;
        params.number_of_assembled_ant5 =
-               phy->number_of_assembled_ant5;
-       params.external_pa_dc2dc = phy->external_pa_dc2dc;
+               n_antennas_5_param;
+       params.external_pa_dc2dc = dc2dc_param;
        params.tcxo_ldo_voltage = phy->tcxo_ldo_voltage;
        params.xtal_itrim_val = phy->xtal_itrim_val;
        params.srf_state = phy->srf_state;
@@ -1105,6 +1105,15 @@ module_param_named(board_type, board_type_param, charp, S_IRUSR);
 MODULE_PARM_DESC(board_type, "Board type: fpga, hdk, evb, com8 or "
                 "dvp (default)");
 
+module_param_named(dc2dc, dc2dc_param, bool, S_IRUSR);
+MODULE_PARM_DESC(dc2dc, "External DC2DC: boolean (defaults to false)");
+
+module_param_named(n_antennas_2, n_antennas_2_param, uint, S_IRUSR);
+MODULE_PARM_DESC(n_antennas_2, "Number of installed 2.4GHz antennas: 1 (default) or 2");
+
+module_param_named(n_antennas_5, n_antennas_5_param, uint, S_IRUSR);
+MODULE_PARM_DESC(n_antennas_5, "Number of installed 5GHz antennas: 1 (default) or 2");
+
 MODULE_LICENSE("GPL v2");
 MODULE_AUTHOR("Luciano Coelho <coelho@ti.com>");
 MODULE_FIRMWARE(WL18XX_FW_NAME);