aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/amba/bus.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/amba/bus.h')
-rw-r--r--include/linux/amba/bus.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/include/linux/amba/bus.h b/include/linux/amba/bus.h
index 8b1038607831..b0c174012436 100644
--- a/include/linux/amba/bus.h
+++ b/include/linux/amba/bus.h
@@ -14,14 +14,19 @@
14#ifndef ASMARM_AMBA_H 14#ifndef ASMARM_AMBA_H
15#define ASMARM_AMBA_H 15#define ASMARM_AMBA_H
16 16
17#include <linux/clk.h>
17#include <linux/device.h> 18#include <linux/device.h>
19#include <linux/err.h>
18#include <linux/resource.h> 20#include <linux/resource.h>
19 21
20#define AMBA_NR_IRQS 2 22#define AMBA_NR_IRQS 2
21 23
24struct clk;
25
22struct amba_device { 26struct amba_device {
23 struct device dev; 27 struct device dev;
24 struct resource res; 28 struct resource res;
29 struct clk *pclk;
25 u64 dma_mask; 30 u64 dma_mask;
26 unsigned int periphid; 31 unsigned int periphid;
27 unsigned int irq[AMBA_NR_IRQS]; 32 unsigned int irq[AMBA_NR_IRQS];
@@ -59,6 +64,12 @@ struct amba_device *amba_find_device(const char *, struct device *, unsigned int
59int amba_request_regions(struct amba_device *, const char *); 64int amba_request_regions(struct amba_device *, const char *);
60void amba_release_regions(struct amba_device *); 65void amba_release_regions(struct amba_device *);
61 66
67#define amba_pclk_enable(d) \
68 (IS_ERR((d)->pclk) ? 0 : clk_enable((d)->pclk))
69
70#define amba_pclk_disable(d) \
71 do { if (!IS_ERR((d)->pclk)) clk_disable((d)->pclk); } while (0)
72
62#define amba_config(d) (((d)->periphid >> 24) & 0xff) 73#define amba_config(d) (((d)->periphid >> 24) & 0xff)
63#define amba_rev(d) (((d)->periphid >> 20) & 0x0f) 74#define amba_rev(d) (((d)->periphid >> 20) & 0x0f)
64#define amba_manf(d) (((d)->periphid >> 12) & 0xff) 75#define amba_manf(d) (((d)->periphid >> 12) & 0xff)