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>
This commit is contained in:
parent
36c4e7e4aa
commit
1e51acaa02
3 changed files with 19 additions and 5 deletions
|
@ -600,10 +600,15 @@ void ath9k_htc_rfkill_poll_state(struct ieee80211_hw *hw);
|
||||||
struct base_eep_header *ath9k_htc_get_eeprom_base(struct ath9k_htc_priv *priv);
|
struct base_eep_header *ath9k_htc_get_eeprom_base(struct ath9k_htc_priv *priv);
|
||||||
|
|
||||||
#ifdef CONFIG_MAC80211_LEDS
|
#ifdef CONFIG_MAC80211_LEDS
|
||||||
|
void ath9k_configure_leds(struct ath9k_htc_priv *priv);
|
||||||
void ath9k_init_leds(struct ath9k_htc_priv *priv);
|
void ath9k_init_leds(struct ath9k_htc_priv *priv);
|
||||||
void ath9k_deinit_leds(struct ath9k_htc_priv *priv);
|
void ath9k_deinit_leds(struct ath9k_htc_priv *priv);
|
||||||
void ath9k_led_work(struct work_struct *work);
|
void ath9k_led_work(struct work_struct *work);
|
||||||
#else
|
#else
|
||||||
|
static inline void ath9k_configure_leds(struct ath9k_htc_priv *priv)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
static inline void ath9k_init_leds(struct ath9k_htc_priv *priv)
|
static inline void ath9k_init_leds(struct ath9k_htc_priv *priv)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
|
@ -255,6 +255,17 @@ void ath9k_deinit_leds(struct ath9k_htc_priv *priv)
|
||||||
cancel_work_sync(&priv->led_work);
|
cancel_work_sync(&priv->led_work);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void ath9k_configure_leds(struct ath9k_htc_priv *priv)
|
||||||
|
{
|
||||||
|
/* Configure gpio 1 for output */
|
||||||
|
ath9k_hw_cfg_output(priv->ah, priv->ah->led_pin,
|
||||||
|
AR_GPIO_OUTPUT_MUX_AS_OUTPUT);
|
||||||
|
/* LED off, active low */
|
||||||
|
ath9k_hw_set_gpio(priv->ah, priv->ah->led_pin, 1);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
void ath9k_init_leds(struct ath9k_htc_priv *priv)
|
void ath9k_init_leds(struct ath9k_htc_priv *priv)
|
||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
|
@ -268,11 +279,7 @@ void ath9k_init_leds(struct ath9k_htc_priv *priv)
|
||||||
else
|
else
|
||||||
priv->ah->led_pin = ATH_LED_PIN_DEF;
|
priv->ah->led_pin = ATH_LED_PIN_DEF;
|
||||||
|
|
||||||
/* Configure gpio 1 for output */
|
ath9k_configure_leds(priv);
|
||||||
ath9k_hw_cfg_output(priv->ah, priv->ah->led_pin,
|
|
||||||
AR_GPIO_OUTPUT_MUX_AS_OUTPUT);
|
|
||||||
/* LED off, active low */
|
|
||||||
ath9k_hw_set_gpio(priv->ah, priv->ah->led_pin, 1);
|
|
||||||
|
|
||||||
snprintf(priv->led_name, sizeof(priv->led_name),
|
snprintf(priv->led_name, sizeof(priv->led_name),
|
||||||
"ath9k_htc-%s", wiphy_name(priv->hw->wiphy));
|
"ath9k_htc-%s", wiphy_name(priv->hw->wiphy));
|
||||||
|
|
|
@ -1000,6 +1000,8 @@ int ath9k_htc_resume(struct htc_target *htc_handle)
|
||||||
|
|
||||||
ret = ath9k_init_htc_services(priv, priv->ah->hw_version.devid,
|
ret = ath9k_init_htc_services(priv, priv->ah->hw_version.devid,
|
||||||
priv->ah->hw_version.usbdev);
|
priv->ah->hw_version.usbdev);
|
||||||
|
ath9k_configure_leds(priv);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue