Go to the documentation of this file.
18 #include <linux/device.h>
21 #include <linux/resource.h>
24 #define AMBA_NR_IRQS 2
25 #define AMBA_CID 0xb105f00d
55 #define to_amba_device(d) container_of(d, struct amba_device, dev)
57 #define amba_get_drvdata(d) dev_get_drvdata(&d->dev)
58 #define amba_set_drvdata(d,p) dev_set_drvdata(&d->dev, p)
68 int irq1,
int irq2,
void *
pdata,
72 int irq1,
int irq2,
void *
pdata,
79 #define amba_pclk_enable(d) \
80 (IS_ERR((d)->pclk) ? 0 : clk_enable((d)->pclk))
82 #define amba_pclk_disable(d) \
83 do { if (!IS_ERR((d)->pclk)) clk_disable((d)->pclk); } while (0)
86 #define AMBA_CONFIG_BITS(a) (((a) >> 24) & 0xff)
87 #define AMBA_REV_BITS(a) (((a) >> 20) & 0x0f)
88 #define AMBA_MANF_BITS(a) (((a) >> 12) & 0xff)
89 #define AMBA_PART_BITS(a) ((a) & 0xfff)
91 #define amba_config(d) AMBA_CONFIG_BITS((d)->periphid)
92 #define amba_rev(d) AMBA_REV_BITS((d)->periphid)
93 #define amba_manf(d) AMBA_MANF_BITS((d)->periphid)
94 #define amba_part(d) AMBA_PART_BITS((d)->periphid)
96 #define __AMBA_DEV(busid, data, mask) \
98 .coherent_dma_mask = mask, \
100 .platform_data = data, \
109 #define AMBA_APB_DEVICE(name, busid, id, base, irqs, data) \
110 struct amba_device name##_device = { \
111 .dev = __AMBA_DEV(busid, data, 0), \
112 .res = DEFINE_RES_MEM(base, SZ_4K), \
120 #define AMBA_AHB_DEVICE(name, busid, id, base, irqs, data) \
121 struct amba_device name##_device = { \
122 .dev = __AMBA_DEV(busid, data, ~0ULL), \
123 .res = DEFINE_RES_MEM(base, SZ_4K), \
135 #define module_amba_driver(__amba_drv) \
136 module_driver(__amba_drv, amba_driver_register, amba_driver_unregister)