aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorKalle Valo <kvalo@qca.qualcomm.com>2013-09-01 03:01:53 -0400
committerKalle Valo <kvalo@qca.qualcomm.com>2013-09-03 02:49:07 -0400
commite479ed437bb876c6f16e80a492223da2f449f221 (patch)
treedeba7218cf62e4ed7a93ad7c6bee1cd497219dba /drivers/net
parentaa5c1db4451596be424f8df511aa5435a7d51e6c (diff)
ath10k: convert ath10k_pci_reg_read/write32() to take struct ath10k
This is consistent with all other functions. Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/wireless/ath/ath10k/pci.c19
-rw-r--r--drivers/net/wireless/ath/ath10k/pci.h12
2 files changed, 15 insertions, 16 deletions
diff --git a/drivers/net/wireless/ath/ath10k/pci.c b/drivers/net/wireless/ath/ath10k/pci.c
index 418de1ecfc8a..e0cf75f5a8a1 100644
--- a/drivers/net/wireless/ath/ath10k/pci.c
+++ b/drivers/net/wireless/ath/ath10k/pci.c
@@ -2323,18 +2323,13 @@ static int ath10k_pci_reset_target(struct ath10k *ar)
2323 2323
2324static void ath10k_pci_device_reset(struct ath10k *ar) 2324static void ath10k_pci_device_reset(struct ath10k *ar)
2325{ 2325{
2326 struct ath10k_pci *ar_pci = ath10k_pci_priv(ar);
2327 void __iomem *mem = ar_pci->mem;
2328 int i; 2326 int i;
2329 u32 val; 2327 u32 val;
2330 2328
2331 if (!SOC_GLOBAL_RESET_ADDRESS) 2329 if (!SOC_GLOBAL_RESET_ADDRESS)
2332 return; 2330 return;
2333 2331
2334 if (!mem) 2332 ath10k_pci_reg_write32(ar, PCIE_SOC_WAKE_ADDRESS,
2335 return;
2336
2337 ath10k_pci_reg_write32(mem, PCIE_SOC_WAKE_ADDRESS,
2338 PCIE_SOC_WAKE_V_MASK); 2333 PCIE_SOC_WAKE_V_MASK);
2339 for (i = 0; i < ATH_PCI_RESET_WAIT_MAX; i++) { 2334 for (i = 0; i < ATH_PCI_RESET_WAIT_MAX; i++) {
2340 if (ath10k_pci_target_is_awake(ar)) 2335 if (ath10k_pci_target_is_awake(ar))
@@ -2343,12 +2338,12 @@ static void ath10k_pci_device_reset(struct ath10k *ar)
2343 } 2338 }
2344 2339
2345 /* Put Target, including PCIe, into RESET. */ 2340 /* Put Target, including PCIe, into RESET. */
2346 val = ath10k_pci_reg_read32(mem, SOC_GLOBAL_RESET_ADDRESS); 2341 val = ath10k_pci_reg_read32(ar, SOC_GLOBAL_RESET_ADDRESS);
2347 val |= 1; 2342 val |= 1;
2348 ath10k_pci_reg_write32(mem, SOC_GLOBAL_RESET_ADDRESS, val); 2343 ath10k_pci_reg_write32(ar, SOC_GLOBAL_RESET_ADDRESS, val);
2349 2344
2350 for (i = 0; i < ATH_PCI_RESET_WAIT_MAX; i++) { 2345 for (i = 0; i < ATH_PCI_RESET_WAIT_MAX; i++) {
2351 if (ath10k_pci_reg_read32(mem, RTC_STATE_ADDRESS) & 2346 if (ath10k_pci_reg_read32(ar, RTC_STATE_ADDRESS) &
2352 RTC_STATE_COLD_RESET_MASK) 2347 RTC_STATE_COLD_RESET_MASK)
2353 break; 2348 break;
2354 msleep(1); 2349 msleep(1);
@@ -2356,16 +2351,16 @@ static void ath10k_pci_device_reset(struct ath10k *ar)
2356 2351
2357 /* Pull Target, including PCIe, out of RESET. */ 2352 /* Pull Target, including PCIe, out of RESET. */
2358 val &= ~1; 2353 val &= ~1;
2359 ath10k_pci_reg_write32(mem, SOC_GLOBAL_RESET_ADDRESS, val); 2354 ath10k_pci_reg_write32(ar, SOC_GLOBAL_RESET_ADDRESS, val);
2360 2355
2361 for (i = 0; i < ATH_PCI_RESET_WAIT_MAX; i++) { 2356 for (i = 0; i < ATH_PCI_RESET_WAIT_MAX; i++) {
2362 if (!(ath10k_pci_reg_read32(mem, RTC_STATE_ADDRESS) & 2357 if (!(ath10k_pci_reg_read32(ar, RTC_STATE_ADDRESS) &
2363 RTC_STATE_COLD_RESET_MASK)) 2358 RTC_STATE_COLD_RESET_MASK))
2364 break; 2359 break;
2365 msleep(1); 2360 msleep(1);
2366 } 2361 }
2367 2362
2368 ath10k_pci_reg_write32(mem, PCIE_SOC_WAKE_ADDRESS, PCIE_SOC_WAKE_RESET); 2363 ath10k_pci_reg_write32(ar, PCIE_SOC_WAKE_ADDRESS, PCIE_SOC_WAKE_RESET);
2369} 2364}
2370 2365
2371static void ath10k_pci_dump_features(struct ath10k_pci *ar_pci) 2366static void ath10k_pci_dump_features(struct ath10k_pci *ar_pci)
diff --git a/drivers/net/wireless/ath/ath10k/pci.h b/drivers/net/wireless/ath/ath10k/pci.h
index 2a6cb090b8b0..395f61021829 100644
--- a/drivers/net/wireless/ath/ath10k/pci.h
+++ b/drivers/net/wireless/ath/ath10k/pci.h
@@ -240,14 +240,18 @@ static inline struct ath10k_pci *ath10k_pci_priv(struct ath10k *ar)
240 return ar->hif.priv; 240 return ar->hif.priv;
241} 241}
242 242
243static inline u32 ath10k_pci_reg_read32(void __iomem *mem, u32 addr) 243static inline u32 ath10k_pci_reg_read32(struct ath10k *ar, u32 addr)
244{ 244{
245 return ioread32(mem + PCIE_LOCAL_BASE_ADDRESS + addr); 245 struct ath10k_pci *ar_pci = ath10k_pci_priv(ar);
246
247 return ioread32(ar_pci->mem + PCIE_LOCAL_BASE_ADDRESS + addr);
246} 248}
247 249
248static inline void ath10k_pci_reg_write32(void __iomem *mem, u32 addr, u32 val) 250static inline void ath10k_pci_reg_write32(struct ath10k *ar, u32 addr, u32 val)
249{ 251{
250 iowrite32(val, mem + PCIE_LOCAL_BASE_ADDRESS + addr); 252 struct ath10k_pci *ar_pci = ath10k_pci_priv(ar);
253
254 iowrite32(val, ar_pci->mem + PCIE_LOCAL_BASE_ADDRESS + addr);
251} 255}
252 256
253#define ATH_PCI_RESET_WAIT_MAX 10 /* ms */ 257#define ATH_PCI_RESET_WAIT_MAX 10 /* ms */