aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorOleksij Rempel <linux@rempel-privat.de>2013-12-12 09:30:36 -0500
committerJohn W. Linville <linville@tuxdriver.com>2013-12-18 15:23:02 -0500
commit1e51acaa02563ca96c0f3fa9827174cefde6093c (patch)
tree7890324554eee6d6f9e245fed398147bf664b2fd /drivers/net
parent36c4e7e4aa0605cd175ee4b953eaced7a00157f4 (diff)
ath9k_htc: reconfigure led_gpios after resume
On suspend/resume, firmware will restart and gpios configuration will be reseted. Restore this configureation at least for LEDs Signed-off-by: Oleksij Rempel <linux@rempel-privat.de> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/wireless/ath/ath9k/htc.h5
-rw-r--r--drivers/net/wireless/ath/ath9k/htc_drv_gpio.c17
-rw-r--r--drivers/net/wireless/ath/ath9k/htc_drv_init.c2
3 files changed, 19 insertions, 5 deletions
diff --git a/drivers/net/wireless/ath/ath9k/htc.h b/drivers/net/wireless/ath/ath9k/htc.h
index 055d7c25e090..58da3468d1f0 100644
--- a/drivers/net/wireless/ath/ath9k/htc.h
+++ b/drivers/net/wireless/ath/ath9k/htc.h
@@ -600,10 +600,15 @@ void ath9k_htc_rfkill_poll_state(struct ieee80211_hw *hw);
600struct base_eep_header *ath9k_htc_get_eeprom_base(struct ath9k_htc_priv *priv); 600struct base_eep_header *ath9k_htc_get_eeprom_base(struct ath9k_htc_priv *priv);
601 601
602#ifdef CONFIG_MAC80211_LEDS 602#ifdef CONFIG_MAC80211_LEDS
603void ath9k_configure_leds(struct ath9k_htc_priv *priv);
603void ath9k_init_leds(struct ath9k_htc_priv *priv); 604void ath9k_init_leds(struct ath9k_htc_priv *priv);
604void ath9k_deinit_leds(struct ath9k_htc_priv *priv); 605void ath9k_deinit_leds(struct ath9k_htc_priv *priv);
605void ath9k_led_work(struct work_struct *work); 606void ath9k_led_work(struct work_struct *work);
606#else 607#else
608static inline void ath9k_configure_leds(struct ath9k_htc_priv *priv)
609{
610}
611
607static inline void ath9k_init_leds(struct ath9k_htc_priv *priv) 612static inline void ath9k_init_leds(struct ath9k_htc_priv *priv)
608{ 613{
609} 614}
diff --git a/drivers/net/wireless/ath/ath9k/htc_drv_gpio.c b/drivers/net/wireless/ath/ath9k/htc_drv_gpio.c
index 105582d6b714..50f74a2a4cf8 100644
--- a/drivers/net/wireless/ath/ath9k/htc_drv_gpio.c
+++ b/drivers/net/wireless/ath/ath9k/htc_drv_gpio.c
@@ -255,6 +255,17 @@ void ath9k_deinit_leds(struct ath9k_htc_priv *priv)
255 cancel_work_sync(&priv->led_work); 255 cancel_work_sync(&priv->led_work);
256} 256}
257 257
258
259void ath9k_configure_leds(struct ath9k_htc_priv *priv)
260{
261 /* Configure gpio 1 for output */
262 ath9k_hw_cfg_output(priv->ah, priv->ah->led_pin,
263 AR_GPIO_OUTPUT_MUX_AS_OUTPUT);
264 /* LED off, active low */
265 ath9k_hw_set_gpio(priv->ah, priv->ah->led_pin, 1);
266
267}
268
258void ath9k_init_leds(struct ath9k_htc_priv *priv) 269void ath9k_init_leds(struct ath9k_htc_priv *priv)
259{ 270{
260 int ret; 271 int ret;
@@ -268,11 +279,7 @@ void ath9k_init_leds(struct ath9k_htc_priv *priv)
268 else 279 else
269 priv->ah->led_pin = ATH_LED_PIN_DEF; 280 priv->ah->led_pin = ATH_LED_PIN_DEF;
270 281
271 /* Configure gpio 1 for output */ 282 ath9k_configure_leds(priv);
272 ath9k_hw_cfg_output(priv->ah, priv->ah->led_pin,
273 AR_GPIO_OUTPUT_MUX_AS_OUTPUT);
274 /* LED off, active low */
275 ath9k_hw_set_gpio(priv->ah, priv->ah->led_pin, 1);
276 283
277 snprintf(priv->led_name, sizeof(priv->led_name), 284 snprintf(priv->led_name, sizeof(priv->led_name),
278 "ath9k_htc-%s", wiphy_name(priv->hw->wiphy)); 285 "ath9k_htc-%s", wiphy_name(priv->hw->wiphy));
diff --git a/drivers/net/wireless/ath/ath9k/htc_drv_init.c b/drivers/net/wireless/ath/ath9k/htc_drv_init.c
index c3676bf1d6c4..b576c44bb314 100644
--- a/drivers/net/wireless/ath/ath9k/htc_drv_init.c
+++ b/drivers/net/wireless/ath/ath9k/htc_drv_init.c
@@ -1000,6 +1000,8 @@ int ath9k_htc_resume(struct htc_target *htc_handle)
1000 1000
1001 ret = ath9k_init_htc_services(priv, priv->ah->hw_version.devid, 1001 ret = ath9k_init_htc_services(priv, priv->ah->hw_version.devid,
1002 priv->ah->hw_version.usbdev); 1002 priv->ah->hw_version.usbdev);
1003 ath9k_configure_leds(priv);
1004
1003 return ret; 1005 return ret;
1004} 1006}
1005#endif 1007#endif