1bea258bd47803ba30675be6bab7a25b51b254cb
[openwrt.git] / package / mac80211 / patches / 408-ath9k-remove-u16-casts-from-rtc-register-access.patch
1 From 480e7cbba032b1710768ffa1f067f34f99016a73 Mon Sep 17 00:00:00 2001
2 From: Gabor Juhos <juhosg@openwrt.org>
3 Date: Mon, 5 Jan 2009 11:11:28 +0100
4 Subject: [PATCH v3 08/11] ath9k: remove (u16) casts from rtc register access
5
6 The RTC register offsets don't fit into 'u16' on the AR913x, so we have
7 to remove the existing casts.
8
9 Changes-licensed-under: ISC
10
11 Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
12 Signed-off-by: Imre Kaloz <kaloz@openwrt.org>
13 ---
14  drivers/net/wireless/ath9k/hw.c  |   14 +++++++-------
15  drivers/net/wireless/ath9k/reg.h |    4 ++--
16  2 files changed, 9 insertions(+), 9 deletions(-)
17
18 --- a/drivers/net/wireless/ath9k/hw.c
19 +++ b/drivers/net/wireless/ath9k/hw.c
20 @@ -1008,7 +1008,7 @@ static void ath9k_hw_init_pll(struct ath
21                                 pll |= SM(0xb, AR_RTC_PLL_DIV);
22                 }
23         }
24 -       REG_WRITE(ah, (u16) (AR_RTC_PLL_CONTROL), pll);
25 +       REG_WRITE(ah, AR_RTC_PLL_CONTROL, pll);
26  
27         udelay(RTC_PLL_SETTLE_DELAY);
28  
29 @@ -1547,11 +1547,11 @@ static bool ath9k_hw_set_reset(struct at
30                         rst_flags |= AR_RTC_RC_MAC_COLD;
31         }
32  
33 -       REG_WRITE(ah, (u16) (AR_RTC_RC), rst_flags);
34 +       REG_WRITE(ah, AR_RTC_RC, rst_flags);
35         udelay(50);
36  
37 -       REG_WRITE(ah, (u16) (AR_RTC_RC), 0);
38 -       if (!ath9k_hw_wait(ah, (u16) (AR_RTC_RC), AR_RTC_RC_M, 0)) {
39 +       REG_WRITE(ah, AR_RTC_RC, 0);
40 +       if (!ath9k_hw_wait(ah, AR_RTC_RC, AR_RTC_RC_M, 0)) {
41                 DPRINTF(ah->ah_sc, ATH_DBG_RESET,
42                         "RTC stuck in MAC reset\n");
43                 return false;
44 @@ -1573,8 +1573,8 @@ static bool ath9k_hw_set_reset_power_on(
45         REG_WRITE(ah, AR_RTC_FORCE_WAKE, AR_RTC_FORCE_WAKE_EN |
46                   AR_RTC_FORCE_WAKE_ON_INT);
47  
48 -       REG_WRITE(ah, (u16) (AR_RTC_RESET), 0);
49 -       REG_WRITE(ah, (u16) (AR_RTC_RESET), 1);
50 +       REG_WRITE(ah, AR_RTC_RESET, 0);
51 +       REG_WRITE(ah, AR_RTC_RESET, 1);
52  
53         if (!ath9k_hw_wait(ah,
54                            AR_RTC_STATUS,
55 @@ -2616,7 +2616,7 @@ static void ath9k_set_power_sleep(struct
56                 if (!AR_SREV_9100(ah))
57                         REG_WRITE(ah, AR_RC, AR_RC_AHB | AR_RC_HOSTIF);
58  
59 -               REG_CLR_BIT(ah, (u16) (AR_RTC_RESET),
60 +               REG_CLR_BIT(ah, (AR_RTC_RESET),
61                             AR_RTC_RESET_EN);
62         }
63  }
64 --- a/drivers/net/wireless/ath9k/reg.h
65 +++ b/drivers/net/wireless/ath9k/reg.h
66 @@ -953,7 +953,7 @@ enum {
67  
68  #define AR_RTC_BASE             0x00020000
69  #define AR_RTC_RC \
70 -       (AR_SREV_9100(ah)) ? (AR_RTC_BASE + 0x0000) : 0x7000
71 +       ((AR_SREV_9100(ah)) ? (AR_RTC_BASE + 0x0000) : 0x7000)
72  #define AR_RTC_RC_M            0x00000003
73  #define AR_RTC_RC_MAC_WARM      0x00000001
74  #define AR_RTC_RC_MAC_COLD      0x00000002
75 @@ -961,7 +961,7 @@ enum {
76  #define AR_RTC_RC_WARM_RESET    0x00000008
77  
78  #define AR_RTC_PLL_CONTROL \
79 -       (AR_SREV_9100(ah)) ? (AR_RTC_BASE + 0x0014) : 0x7014
80 +       ((AR_SREV_9100(ah)) ? (AR_RTC_BASE + 0x0014) : 0x7014)
81  
82  #define AR_RTC_PLL_DIV          0x0000001f
83  #define AR_RTC_PLL_DIV_S        0