Deleted Added
full compact
ar5416_power.c (221163) ar5416_power.c (221800)
1/*
2 * Copyright (c) 2002-2008 Sam Leffler, Errno Consulting
3 * Copyright (c) 2002-2008 Atheros Communications, Inc.
4 *
5 * Permission to use, copy, modify, and/or distribute this software for any
6 * purpose with or without fee is hereby granted, provided that the above
7 * copyright notice and this permission notice appear in all copies.
8 *
9 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16 *
1/*
2 * Copyright (c) 2002-2008 Sam Leffler, Errno Consulting
3 * Copyright (c) 2002-2008 Atheros Communications, Inc.
4 *
5 * Permission to use, copy, modify, and/or distribute this software for any
6 * purpose with or without fee is hereby granted, provided that the above
7 * copyright notice and this permission notice appear in all copies.
8 *
9 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16 *
17 * $FreeBSD: head/sys/dev/ath/ath_hal/ar5416/ar5416_power.c 221163 2011-04-28 12:47:40Z adrian $
17 * $FreeBSD: head/sys/dev/ath/ath_hal/ar5416/ar5416_power.c 221800 2011-05-12 03:15:21Z adrian $
18 */
19#include "opt_ah.h"
20
21#include "ah.h"
22#include "ah_internal.h"
23
24#include "ar5416/ar5416.h"
25#include "ar5416/ar5416reg.h"

--- 25 unchanged lines hidden (view full) ---

51 if (!ar5416SetResetReg(ah, HAL_RESET_POWER_ON))
52 goto bad;
53 }
54
55 if (AR_SREV_HOWL(ah))
56 OS_REG_SET_BIT(ah, AR_RTC_RESET, AR_RTC_RESET_EN);
57
58 OS_REG_SET_BIT(ah, AR_RTC_FORCE_WAKE, AR_RTC_FORCE_WAKE_EN);
18 */
19#include "opt_ah.h"
20
21#include "ah.h"
22#include "ah_internal.h"
23
24#include "ar5416/ar5416.h"
25#include "ar5416/ar5416reg.h"

--- 25 unchanged lines hidden (view full) ---

51 if (!ar5416SetResetReg(ah, HAL_RESET_POWER_ON))
52 goto bad;
53 }
54
55 if (AR_SREV_HOWL(ah))
56 OS_REG_SET_BIT(ah, AR_RTC_RESET, AR_RTC_RESET_EN);
57
58 OS_REG_SET_BIT(ah, AR_RTC_FORCE_WAKE, AR_RTC_FORCE_WAKE_EN);
59 OS_DELAY(50); /* Give chip the chance to awake */
59 if (AR_SREV_HOWL(ah))
60 OS_DELAY(10000);
61 else
62 OS_DELAY(50); /* Give chip the chance to awake */
60
61 for (i = POWER_UP_TIME / 50; i != 0; i--) {
62 val = OS_REG_READ(ah, AR_RTC_STATUS) & AR_RTC_STATUS_M;
63 if (val == AR_RTC_STATUS_ON)
64 break;
65 OS_DELAY(50);
66 OS_REG_SET_BIT(ah, AR_RTC_FORCE_WAKE, AR_RTC_FORCE_WAKE_EN);
67 }

--- 21 unchanged lines hidden (view full) ---

89{
90 OS_REG_SET_BIT(ah, AR_STA_ID1, AR_STA_ID1_PWR_SAV);
91 if (setChip) {
92 /* Clear the RTC force wake bit to allow the mac to sleep */
93 OS_REG_CLR_BIT(ah, AR_RTC_FORCE_WAKE, AR_RTC_FORCE_WAKE_EN);
94 if (! AR_SREV_HOWL(ah))
95 OS_REG_WRITE(ah, AR_RC, AR_RC_AHB|AR_RC_HOSTIF);
96 /* Shutdown chip. Active low */
63
64 for (i = POWER_UP_TIME / 50; i != 0; i--) {
65 val = OS_REG_READ(ah, AR_RTC_STATUS) & AR_RTC_STATUS_M;
66 if (val == AR_RTC_STATUS_ON)
67 break;
68 OS_DELAY(50);
69 OS_REG_SET_BIT(ah, AR_RTC_FORCE_WAKE, AR_RTC_FORCE_WAKE_EN);
70 }

--- 21 unchanged lines hidden (view full) ---

92{
93 OS_REG_SET_BIT(ah, AR_STA_ID1, AR_STA_ID1_PWR_SAV);
94 if (setChip) {
95 /* Clear the RTC force wake bit to allow the mac to sleep */
96 OS_REG_CLR_BIT(ah, AR_RTC_FORCE_WAKE, AR_RTC_FORCE_WAKE_EN);
97 if (! AR_SREV_HOWL(ah))
98 OS_REG_WRITE(ah, AR_RC, AR_RC_AHB|AR_RC_HOSTIF);
99 /* Shutdown chip. Active low */
97 OS_REG_CLR_BIT(ah, AR_RTC_RESET, AR_RTC_RESET_EN);
100 if (! AR_SREV_OWL(ah))
101 OS_REG_CLR_BIT(ah, AR_RTC_RESET, AR_RTC_RESET_EN);
98 }
99}
100
101/*
102 * Notify Power Management is enabled in self-generating
103 * fames. If request, set power mode of chip to
104 * auto/normal. Duration in units of 128us (1/8 TU).
105 */

--- 72 unchanged lines hidden ---
102 }
103}
104
105/*
106 * Notify Power Management is enabled in self-generating
107 * fames. If request, set power mode of chip to
108 * auto/normal. Duration in units of 128us (1/8 TU).
109 */

--- 72 unchanged lines hidden ---