diff options
-rw-r--r-- | drivers/amba/bus.c | 2 | ||||
-rw-r--r-- | include/linux/amba/bus.h | 15 |
2 files changed, 12 insertions, 5 deletions
diff --git a/drivers/amba/bus.c b/drivers/amba/bus.c index d31590e7011b..2737b9752205 100644 --- a/drivers/amba/bus.c +++ b/drivers/amba/bus.c | |||
@@ -298,7 +298,7 @@ int amba_device_register(struct amba_device *dev, struct resource *parent) | |||
298 | 298 | ||
299 | amba_put_disable_pclk(dev); | 299 | amba_put_disable_pclk(dev); |
300 | 300 | ||
301 | if (cid == 0xb105f00d) | 301 | if (cid == AMBA_CID) |
302 | dev->periphid = pid; | 302 | dev->periphid = pid; |
303 | 303 | ||
304 | if (!dev->periphid) | 304 | if (!dev->periphid) |
diff --git a/include/linux/amba/bus.h b/include/linux/amba/bus.h index b0c174012436..c6454cca0447 100644 --- a/include/linux/amba/bus.h +++ b/include/linux/amba/bus.h | |||
@@ -20,6 +20,7 @@ | |||
20 | #include <linux/resource.h> | 20 | #include <linux/resource.h> |
21 | 21 | ||
22 | #define AMBA_NR_IRQS 2 | 22 | #define AMBA_NR_IRQS 2 |
23 | #define AMBA_CID 0xb105f00d | ||
23 | 24 | ||
24 | struct clk; | 25 | struct clk; |
25 | 26 | ||
@@ -70,9 +71,15 @@ void amba_release_regions(struct amba_device *); | |||
70 | #define amba_pclk_disable(d) \ | 71 | #define amba_pclk_disable(d) \ |
71 | do { if (!IS_ERR((d)->pclk)) clk_disable((d)->pclk); } while (0) | 72 | do { if (!IS_ERR((d)->pclk)) clk_disable((d)->pclk); } while (0) |
72 | 73 | ||
73 | #define amba_config(d) (((d)->periphid >> 24) & 0xff) | 74 | /* Some drivers don't use the struct amba_device */ |
74 | #define amba_rev(d) (((d)->periphid >> 20) & 0x0f) | 75 | #define AMBA_CONFIG_BITS(a) (((a) >> 24) & 0xff) |
75 | #define amba_manf(d) (((d)->periphid >> 12) & 0xff) | 76 | #define AMBA_REV_BITS(a) (((a) >> 20) & 0x0f) |
76 | #define amba_part(d) ((d)->periphid & 0xfff) | 77 | #define AMBA_MANF_BITS(a) (((a) >> 12) & 0xff) |
78 | #define AMBA_PART_BITS(a) ((a) & 0xfff) | ||
79 | |||
80 | #define amba_config(d) AMBA_CONFIG_BITS((d)->periphid) | ||
81 | #define amba_rev(d) AMBA_REV_BITS((d)->periphid) | ||
82 | #define amba_manf(d) AMBA_MANF_BITS((d)->periphid) | ||
83 | #define amba_part(d) AMBA_PART_BITS((d)->periphid) | ||
77 | 84 | ||
78 | #endif | 85 | #endif |