diff options
Diffstat (limited to 'include/asm-powerpc/dcr-mmio.h')
-rw-r--r-- | include/asm-powerpc/dcr-mmio.h | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/include/asm-powerpc/dcr-mmio.h b/include/asm-powerpc/dcr-mmio.h index 08532ff1899c..acd491dbd45a 100644 --- a/include/asm-powerpc/dcr-mmio.h +++ b/include/asm-powerpc/dcr-mmio.h | |||
@@ -27,20 +27,26 @@ typedef struct { | |||
27 | void __iomem *token; | 27 | void __iomem *token; |
28 | unsigned int stride; | 28 | unsigned int stride; |
29 | unsigned int base; | 29 | unsigned int base; |
30 | } dcr_host_t; | 30 | } dcr_host_mmio_t; |
31 | 31 | ||
32 | #define DCR_MAP_OK(host) ((host).token != NULL) | 32 | static inline bool dcr_map_ok_mmio(dcr_host_mmio_t host) |
33 | { | ||
34 | return host.token != NULL; | ||
35 | } | ||
33 | 36 | ||
34 | extern dcr_host_t dcr_map(struct device_node *dev, unsigned int dcr_n, | 37 | extern dcr_host_mmio_t dcr_map_mmio(struct device_node *dev, |
35 | unsigned int dcr_c); | 38 | unsigned int dcr_n, |
36 | extern void dcr_unmap(dcr_host_t host, unsigned int dcr_c); | 39 | unsigned int dcr_c); |
40 | extern void dcr_unmap_mmio(dcr_host_mmio_t host, unsigned int dcr_c); | ||
37 | 41 | ||
38 | static inline u32 dcr_read(dcr_host_t host, unsigned int dcr_n) | 42 | static inline u32 dcr_read_mmio(dcr_host_mmio_t host, unsigned int dcr_n) |
39 | { | 43 | { |
40 | return in_be32(host.token + ((host.base + dcr_n) * host.stride)); | 44 | return in_be32(host.token + ((host.base + dcr_n) * host.stride)); |
41 | } | 45 | } |
42 | 46 | ||
43 | static inline void dcr_write(dcr_host_t host, unsigned int dcr_n, u32 value) | 47 | static inline void dcr_write_mmio(dcr_host_mmio_t host, |
48 | unsigned int dcr_n, | ||
49 | u32 value) | ||
44 | { | 50 | { |
45 | out_be32(host.token + ((host.base + dcr_n) * host.stride), value); | 51 | out_be32(host.token + ((host.base + dcr_n) * host.stride), value); |
46 | } | 52 | } |