1
2
3
4
5
6
7
8
9
10
11#ifndef AQ_HW_UTILS_H
12#define AQ_HW_UTILS_H
13
14#include <linux/iopoll.h>
15
16#include "aq_common.h"
17
18#ifndef HIDWORD
19#define LODWORD(_qw) ((u32)(_qw))
20#define HIDWORD(_qw) ((u32)(((_qw) >> 32) & 0xffffffff))
21#endif
22
23#define AQ_HW_SLEEP(_US_) mdelay(_US_)
24
25#define aq_pr_err(...) pr_err(AQ_CFG_DRV_NAME ": " __VA_ARGS__)
26#define aq_pr_trace(...) pr_info(AQ_CFG_DRV_NAME ": " __VA_ARGS__)
27
28struct aq_hw_s;
29
30void aq_hw_write_reg_bit(struct aq_hw_s *aq_hw, u32 addr, u32 msk,
31 u32 shift, u32 val);
32u32 aq_hw_read_reg_bit(struct aq_hw_s *aq_hw, u32 addr, u32 msk, u32 shift);
33u32 aq_hw_read_reg(struct aq_hw_s *hw, u32 reg);
34void aq_hw_write_reg(struct aq_hw_s *hw, u32 reg, u32 value);
35u64 aq_hw_read_reg64(struct aq_hw_s *hw, u32 reg);
36int aq_hw_err_from_flags(struct aq_hw_s *hw);
37
38#endif
39