aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath9k/hw.c
diff options
context:
space:
mode:
authorVasanthakumar Thiagarajan <vasanth@atheros.com>2008-08-25 11:17:29 -0400
committerJohn W. Linville <linville@tuxdriver.com>2008-08-29 16:24:09 -0400
commitc83be6885e2f1ee6e0b290b6cfc82014c675e087 (patch)
treeee8410596f5400b916e391b861b4537014355ebb /drivers/net/wireless/ath9k/hw.c
parent36aedc903ea11a4188de0a118d26c9f20afdd272 (diff)
ath9k: Add LED support
Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/ath9k/hw.c')
-rw-r--r--drivers/net/wireless/ath9k/hw.c33
1 files changed, 4 insertions, 29 deletions
diff --git a/drivers/net/wireless/ath9k/hw.c b/drivers/net/wireless/ath9k/hw.c
index 47c60acac41f..2578411c6019 100644
--- a/drivers/net/wireless/ath9k/hw.c
+++ b/drivers/net/wireless/ath9k/hw.c
@@ -2800,32 +2800,11 @@ static void ath9k_hw_gpio_cfg_output_mux(struct ath_hal *ah,
2800 } 2800 }
2801} 2801}
2802 2802
2803static bool ath9k_hw_cfg_output(struct ath_hal *ah, u32 gpio, 2803void ath9k_hw_cfg_output(struct ath_hal *ah, u32 gpio,
2804 enum ath9k_gpio_output_mux_type 2804 u32 ah_signal_type)
2805 halSignalType)
2806{ 2805{
2807 u32 ah_signal_type;
2808 u32 gpio_shift; 2806 u32 gpio_shift;
2809 2807
2810 static u32 MuxSignalConversionTable[] = {
2811
2812 AR_GPIO_OUTPUT_MUX_AS_OUTPUT,
2813
2814 AR_GPIO_OUTPUT_MUX_AS_PCIE_ATTENTION_LED,
2815
2816 AR_GPIO_OUTPUT_MUX_AS_PCIE_POWER_LED,
2817
2818 AR_GPIO_OUTPUT_MUX_AS_MAC_NETWORK_LED,
2819
2820 AR_GPIO_OUTPUT_MUX_AS_MAC_POWER_LED,
2821 };
2822
2823 if ((halSignalType >= 0)
2824 && (halSignalType < ARRAY_SIZE(MuxSignalConversionTable)))
2825 ah_signal_type = MuxSignalConversionTable[halSignalType];
2826 else
2827 return false;
2828
2829 ath9k_hw_gpio_cfg_output_mux(ah, gpio, ah_signal_type); 2808 ath9k_hw_gpio_cfg_output_mux(ah, gpio, ah_signal_type);
2830 2809
2831 gpio_shift = 2 * gpio; 2810 gpio_shift = 2 * gpio;
@@ -2834,16 +2813,12 @@ static bool ath9k_hw_cfg_output(struct ath_hal *ah, u32 gpio,
2834 AR_GPIO_OE_OUT, 2813 AR_GPIO_OE_OUT,
2835 (AR_GPIO_OE_OUT_DRV_ALL << gpio_shift), 2814 (AR_GPIO_OE_OUT_DRV_ALL << gpio_shift),
2836 (AR_GPIO_OE_OUT_DRV << gpio_shift)); 2815 (AR_GPIO_OE_OUT_DRV << gpio_shift));
2837
2838 return true;
2839} 2816}
2840 2817
2841static bool ath9k_hw_set_gpio(struct ath_hal *ah, u32 gpio, 2818void ath9k_hw_set_gpio(struct ath_hal *ah, u32 gpio, u32 val)
2842 u32 val)
2843{ 2819{
2844 REG_RMW(ah, AR_GPIO_IN_OUT, ((val & 1) << gpio), 2820 REG_RMW(ah, AR_GPIO_IN_OUT, ((val & 1) << gpio),
2845 AR_GPIO_BIT(gpio)); 2821 AR_GPIO_BIT(gpio));
2846 return true;
2847} 2822}
2848 2823
2849static u32 ath9k_hw_gpio_get(struct ath_hal *ah, u32 gpio) 2824static u32 ath9k_hw_gpio_get(struct ath_hal *ah, u32 gpio)
@@ -5923,7 +5898,7 @@ bool ath9k_hw_reset(struct ath_hal *ah,
5923 else 5898 else
5924 ath9k_hw_set_gpio(ah, 9, 1); 5899 ath9k_hw_set_gpio(ah, 9, 1);
5925 } 5900 }
5926 ath9k_hw_cfg_output(ah, 9, ATH9K_GPIO_OUTPUT_MUX_AS_OUTPUT); 5901 ath9k_hw_cfg_output(ah, 9, AR_GPIO_OUTPUT_MUX_AS_OUTPUT);
5927 } 5902 }
5928 5903
5929 ecode = ath9k_hw_process_ini(ah, chan, macmode); 5904 ecode = ath9k_hw_process_ini(ah, chan, macmode);