Lines Matching refs:ah

21 #include "ah.h"
37 ar5416SetPowerModeAwake(struct ath_hal *ah, int setChip)
49 if ((OS_REG_READ(ah, AR_RTC_STATUS)
51 if (!ar5416SetResetReg(ah, HAL_RESET_POWER_ON))
53 AH5416(ah)->ah_initPLL(ah, AH_NULL);
56 if (AR_SREV_HOWL(ah))
57 OS_REG_SET_BIT(ah, AR_RTC_RESET, AR_RTC_RESET_EN);
59 OS_REG_SET_BIT(ah, AR_RTC_FORCE_WAKE, AR_RTC_FORCE_WAKE_EN);
60 if (AR_SREV_HOWL(ah))
66 val = OS_REG_READ(ah, AR_RTC_STATUS) & AR_RTC_STATUS_M;
70 OS_REG_SET_BIT(ah, AR_RTC_FORCE_WAKE, AR_RTC_FORCE_WAKE_EN);
75 ath_hal_printf(ah, "%s: Failed to wakeup in %ums\n",
82 OS_REG_CLR_BIT(ah, AR_STA_ID1, AR_STA_ID1_PWR_SAV);
92 ar5416SetPowerModeSleep(struct ath_hal *ah, int setChip)
94 OS_REG_SET_BIT(ah, AR_STA_ID1, AR_STA_ID1_PWR_SAV);
97 OS_REG_CLR_BIT(ah, AR_RTC_FORCE_WAKE, AR_RTC_FORCE_WAKE_EN);
98 if (! AR_SREV_HOWL(ah))
99 OS_REG_WRITE(ah, AR_RC, AR_RC_AHB|AR_RC_HOSTIF);
101 if (! AR_SREV_OWL(ah))
102 OS_REG_CLR_BIT(ah, AR_RTC_RESET, AR_RTC_RESET_EN);
112 ar5416SetPowerModeNetworkSleep(struct ath_hal *ah, int setChip)
114 OS_REG_SET_BIT(ah, AR_STA_ID1, AR_STA_ID1_PWR_SAV);
117 OS_REG_CLR_BIT(ah, AR_RTC_FORCE_WAKE, AR_RTC_FORCE_WAKE_EN);
125 ar5416SetPowerMode(struct ath_hal *ah, HAL_POWER_MODE mode, int setChip)
142 HALDEBUG(ah, HAL_DEBUG_POWER, "%s: %s -> %s (%s)\n", __func__,
143 modes[ah->ah_powerMode], modes[mode], setChip ? "set chip " : "");
147 ah->ah_powerMode = mode;
148 status = ar5416SetPowerModeAwake(ah, setChip);
151 ar5416SetPowerModeSleep(ah, setChip);
153 ah->ah_powerMode = mode;
156 ar5416SetPowerModeNetworkSleep(ah, setChip);
158 ah->ah_powerMode = mode;
161 HALDEBUG(ah, HAL_DEBUG_ANY, "%s: unknown power mode 0x%x\n",
172 ar5416GetPowerMode(struct ath_hal *ah)
174 int mode = OS_REG_READ(ah, AR_RTC_STATUS);
184 HALDEBUG(ah, HAL_DEBUG_ANY,