diff options
author | Juuso Oikarinen <juuso.oikarinen@nokia.com> | 2009-12-11 08:41:08 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-12-28 16:31:36 -0500 |
commit | 38ad2d87d42ba847c100ef132e8e363513982c8b (patch) | |
tree | bb30d7074cf775b3d942255e578cc3ec322c258c /drivers | |
parent | 71449f8d7059b69e6e45063997d225d8202221a2 (diff) |
wl1271: Add support for acx_pm_config
This acx configures host clock parameters in correspondence with the clock
request line - the settling time of the clock, and whether fast wake-up is
supported.
Signed-off-by: Juuso Oikarinen <juuso.oikarinen@nokia.com>
Reviewed-by: Luciano Coelho <luciano.coelho@nokia.com>
Signed-off-by: Luciano Coelho <luciano.coelho@nokia.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/wireless/wl12xx/wl1271_acx.c | 28 | ||||
-rw-r--r-- | drivers/net/wireless/wl12xx/wl1271_acx.h | 9 | ||||
-rw-r--r-- | drivers/net/wireless/wl12xx/wl1271_conf.h | 17 | ||||
-rw-r--r-- | drivers/net/wireless/wl12xx/wl1271_init.c | 5 | ||||
-rw-r--r-- | drivers/net/wireless/wl12xx/wl1271_main.c | 4 |
5 files changed, 63 insertions, 0 deletions
diff --git a/drivers/net/wireless/wl12xx/wl1271_acx.c b/drivers/net/wireless/wl12xx/wl1271_acx.c index 0ea1a48c45fa..0b3434843476 100644 --- a/drivers/net/wireless/wl12xx/wl1271_acx.c +++ b/drivers/net/wireless/wl12xx/wl1271_acx.c | |||
@@ -1118,3 +1118,31 @@ out: | |||
1118 | kfree(acx); | 1118 | kfree(acx); |
1119 | return ret; | 1119 | return ret; |
1120 | } | 1120 | } |
1121 | |||
1122 | int wl1271_acx_pm_config(struct wl1271 *wl) | ||
1123 | { | ||
1124 | struct wl1271_acx_pm_config *acx = NULL; | ||
1125 | struct conf_pm_config_settings *c = &wl->conf.pm_config; | ||
1126 | int ret = 0; | ||
1127 | |||
1128 | wl1271_debug(DEBUG_ACX, "acx pm config"); | ||
1129 | |||
1130 | acx = kzalloc(sizeof(*acx), GFP_KERNEL); | ||
1131 | if (!acx) { | ||
1132 | ret = -ENOMEM; | ||
1133 | goto out; | ||
1134 | } | ||
1135 | |||
1136 | acx->host_clk_settling_time = cpu_to_le32(c->host_clk_settling_time); | ||
1137 | acx->host_fast_wakeup_support = c->host_fast_wakeup_support; | ||
1138 | |||
1139 | ret = wl1271_cmd_configure(wl, ACX_PM_CONFIG, acx, sizeof(*acx)); | ||
1140 | if (ret < 0) { | ||
1141 | wl1271_warning("acx pm config failed: %d", ret); | ||
1142 | goto out; | ||
1143 | } | ||
1144 | |||
1145 | out: | ||
1146 | kfree(acx); | ||
1147 | return ret; | ||
1148 | } | ||
diff --git a/drivers/net/wireless/wl12xx/wl1271_acx.h b/drivers/net/wireless/wl12xx/wl1271_acx.h index b6a473f60658..1bb63af64f0e 100644 --- a/drivers/net/wireless/wl12xx/wl1271_acx.h +++ b/drivers/net/wireless/wl12xx/wl1271_acx.h | |||
@@ -961,6 +961,13 @@ struct wl1271_acx_arp_filter { | |||
961 | used. */ | 961 | used. */ |
962 | } __attribute__((packed)); | 962 | } __attribute__((packed)); |
963 | 963 | ||
964 | struct wl1271_acx_pm_config { | ||
965 | struct acx_header header; | ||
966 | |||
967 | __le32 host_clk_settling_time; | ||
968 | u8 host_fast_wakeup_support; | ||
969 | u8 padding[3]; | ||
970 | } __attribute__ ((packed)); | ||
964 | 971 | ||
965 | enum { | 972 | enum { |
966 | ACX_WAKE_UP_CONDITIONS = 0x0002, | 973 | ACX_WAKE_UP_CONDITIONS = 0x0002, |
@@ -1025,6 +1032,7 @@ enum { | |||
1025 | DOT11_RX_DOT11_MODE = 0x1012, | 1032 | DOT11_RX_DOT11_MODE = 0x1012, |
1026 | DOT11_RTS_THRESHOLD = 0x1013, | 1033 | DOT11_RTS_THRESHOLD = 0x1013, |
1027 | DOT11_GROUP_ADDRESS_TBL = 0x1014, | 1034 | DOT11_GROUP_ADDRESS_TBL = 0x1014, |
1035 | ACX_PM_CONFIG = 0x1016, | ||
1028 | 1036 | ||
1029 | MAX_DOT11_IE = DOT11_GROUP_ADDRESS_TBL, | 1037 | MAX_DOT11_IE = DOT11_GROUP_ADDRESS_TBL, |
1030 | 1038 | ||
@@ -1073,5 +1081,6 @@ int wl1271_acx_smart_reflex(struct wl1271 *wl); | |||
1073 | int wl1271_acx_bet_enable(struct wl1271 *wl, bool enable); | 1081 | int wl1271_acx_bet_enable(struct wl1271 *wl, bool enable); |
1074 | int wl1271_acx_arp_ip_filter(struct wl1271 *wl, bool enable, u8 *address, | 1082 | int wl1271_acx_arp_ip_filter(struct wl1271 *wl, bool enable, u8 *address, |
1075 | u8 version); | 1083 | u8 version); |
1084 | int wl1271_acx_pm_config(struct wl1271 *wl); | ||
1076 | 1085 | ||
1077 | #endif /* __WL1271_ACX_H__ */ | 1086 | #endif /* __WL1271_ACX_H__ */ |
diff --git a/drivers/net/wireless/wl12xx/wl1271_conf.h b/drivers/net/wireless/wl12xx/wl1271_conf.h index 5d1b5b6493e9..1993d63c214e 100644 --- a/drivers/net/wireless/wl12xx/wl1271_conf.h +++ b/drivers/net/wireless/wl12xx/wl1271_conf.h | |||
@@ -904,6 +904,22 @@ struct conf_itrim_settings { | |||
904 | u32 timeout; | 904 | u32 timeout; |
905 | }; | 905 | }; |
906 | 906 | ||
907 | struct conf_pm_config_settings { | ||
908 | /* | ||
909 | * Host clock settling time | ||
910 | * | ||
911 | * Range: 0 - 30000 us | ||
912 | */ | ||
913 | u32 host_clk_settling_time; | ||
914 | |||
915 | /* | ||
916 | * Host fast wakeup support | ||
917 | * | ||
918 | * Range: true, false | ||
919 | */ | ||
920 | bool host_fast_wakeup_support; | ||
921 | }; | ||
922 | |||
907 | struct conf_drv_settings { | 923 | struct conf_drv_settings { |
908 | struct conf_sg_settings sg; | 924 | struct conf_sg_settings sg; |
909 | struct conf_rx_settings rx; | 925 | struct conf_rx_settings rx; |
@@ -911,6 +927,7 @@ struct conf_drv_settings { | |||
911 | struct conf_conn_settings conn; | 927 | struct conf_conn_settings conn; |
912 | struct conf_init_settings init; | 928 | struct conf_init_settings init; |
913 | struct conf_itrim_settings itrim; | 929 | struct conf_itrim_settings itrim; |
930 | struct conf_pm_config_settings pm_config; | ||
914 | }; | 931 | }; |
915 | 932 | ||
916 | #endif | 933 | #endif |
diff --git a/drivers/net/wireless/wl12xx/wl1271_init.c b/drivers/net/wireless/wl12xx/wl1271_init.c index 3b4ed070f439..c9848eecb767 100644 --- a/drivers/net/wireless/wl12xx/wl1271_init.c +++ b/drivers/net/wireless/wl12xx/wl1271_init.c | |||
@@ -303,6 +303,11 @@ int wl1271_hw_init(struct wl1271 *wl) | |||
303 | if (ret < 0) | 303 | if (ret < 0) |
304 | goto out_free_memmap; | 304 | goto out_free_memmap; |
305 | 305 | ||
306 | /* configure PM */ | ||
307 | ret = wl1271_acx_pm_config(wl); | ||
308 | if (ret < 0) | ||
309 | goto out_free_memmap; | ||
310 | |||
306 | return 0; | 311 | return 0; |
307 | 312 | ||
308 | out_free_memmap: | 313 | out_free_memmap: |
diff --git a/drivers/net/wireless/wl12xx/wl1271_main.c b/drivers/net/wireless/wl12xx/wl1271_main.c index 90a60c1147a8..7e6b500dfb6f 100644 --- a/drivers/net/wireless/wl12xx/wl1271_main.c +++ b/drivers/net/wireless/wl12xx/wl1271_main.c | |||
@@ -321,6 +321,10 @@ static struct conf_drv_settings default_conf = { | |||
321 | .itrim = { | 321 | .itrim = { |
322 | .enable = false, | 322 | .enable = false, |
323 | .timeout = 50000, | 323 | .timeout = 50000, |
324 | }, | ||
325 | .pm_config = { | ||
326 | .host_clk_settling_time = 5000, | ||
327 | .host_fast_wakeup_support = false | ||
324 | } | 328 | } |
325 | }; | 329 | }; |
326 | 330 | ||