This source file includes following definitions.
- ddblreadl
- ddblwritel
- ddbreadl
- ddbwritel
- ddbcpyto
- ddbcpyfrom
- safe_ddbreadl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 #ifndef __DDBRIDGE_IO_H__
20 #define __DDBRIDGE_IO_H__
21
22 #include <linux/io.h>
23
24 #include "ddbridge.h"
25
26
27
28 static inline u32 ddblreadl(struct ddb_link *link, u32 adr)
29 {
30 return readl(link->dev->regs + adr);
31 }
32
33 static inline void ddblwritel(struct ddb_link *link, u32 val, u32 adr)
34 {
35 writel(val, link->dev->regs + adr);
36 }
37
38 static inline u32 ddbreadl(struct ddb *dev, u32 adr)
39 {
40 return readl(dev->regs + adr);
41 }
42
43 static inline void ddbwritel(struct ddb *dev, u32 val, u32 adr)
44 {
45 writel(val, dev->regs + adr);
46 }
47
48 static inline void ddbcpyto(struct ddb *dev, u32 adr, void *src, long count)
49 {
50 memcpy_toio(dev->regs + adr, src, count);
51 }
52
53 static inline void ddbcpyfrom(struct ddb *dev, void *dst, u32 adr, long count)
54 {
55 memcpy_fromio(dst, dev->regs + adr, count);
56 }
57
58 static inline u32 safe_ddbreadl(struct ddb *dev, u32 adr)
59 {
60 u32 val = ddbreadl(dev, adr);
61
62
63 if (val == ~0) {
64 dev_err(&dev->pdev->dev, "ddbreadl failure, adr=%08x\n", adr);
65 return 0;
66 }
67
68 return val;
69 }
70
71 #endif