xref: /openbmc/linux/drivers/net/wireless/ath/ath11k/ahb.h (revision 06b72824)
1 /* SPDX-License-Identifier: BSD-3-Clause-Clear */
2 /*
3  * Copyright (c) 2018-2019 The Linux Foundation. All rights reserved.
4  */
5 #ifndef ATH11K_AHB_H
6 #define ATH11K_AHB_H
7 
8 #include "core.h"
9 
10 #define ATH11K_AHB_RECOVERY_TIMEOUT (3 * HZ)
11 struct ath11k_base;
12 
13 static inline u32 ath11k_ahb_read32(struct ath11k_base *ab, u32 offset)
14 {
15 	return ioread32(ab->mem + offset);
16 }
17 
18 static inline void ath11k_ahb_write32(struct ath11k_base *ab, u32 offset, u32 value)
19 {
20 	iowrite32(value, ab->mem + offset);
21 }
22 
23 void ath11k_ahb_ext_irq_enable(struct ath11k_base *ab);
24 void ath11k_ahb_ext_irq_disable(struct ath11k_base *ab);
25 int ath11k_ahb_start(struct ath11k_base *ab);
26 void ath11k_ahb_stop(struct ath11k_base *ab);
27 int ath11k_ahb_power_up(struct ath11k_base *ab);
28 void ath11k_ahb_power_down(struct ath11k_base *ab);
29 int ath11k_ahb_map_service_to_pipe(struct ath11k_base *ab, u16 service_id,
30 				   u8 *ul_pipe, u8 *dl_pipe);
31 
32 int ath11k_ahb_init(void);
33 void ath11k_ahb_exit(void);
34 
35 #endif
36