diff options
Diffstat (limited to 'include/linux/amba/bus.h')
| -rw-r--r-- | include/linux/amba/bus.h | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/include/linux/amba/bus.h b/include/linux/amba/bus.h index ab94335b4bb9..b0c174012436 100644 --- a/include/linux/amba/bus.h +++ b/include/linux/amba/bus.h | |||
| @@ -1,5 +1,9 @@ | |||
| 1 | /* | 1 | /* |
| 2 | * linux/include/asm-arm/hardware/amba.h | 2 | * linux/include/amba/bus.h |
| 3 | * | ||
| 4 | * This device type deals with ARM PrimeCells and anything else that | ||
| 5 | * presents a proper CID (0xB105F00D) at the end of the I/O register | ||
| 6 | * region or that is derived from a PrimeCell. | ||
| 3 | * | 7 | * |
| 4 | * Copyright (C) 2003 Deep Blue Solutions Ltd, All Rights Reserved. | 8 | * Copyright (C) 2003 Deep Blue Solutions Ltd, All Rights Reserved. |
| 5 | * | 9 | * |
| @@ -10,11 +14,19 @@ | |||
| 10 | #ifndef ASMARM_AMBA_H | 14 | #ifndef ASMARM_AMBA_H |
| 11 | #define ASMARM_AMBA_H | 15 | #define ASMARM_AMBA_H |
| 12 | 16 | ||
| 17 | #include <linux/clk.h> | ||
| 18 | #include <linux/device.h> | ||
| 19 | #include <linux/err.h> | ||
| 20 | #include <linux/resource.h> | ||
| 21 | |||
| 13 | #define AMBA_NR_IRQS 2 | 22 | #define AMBA_NR_IRQS 2 |
| 14 | 23 | ||
| 24 | struct clk; | ||
| 25 | |||
| 15 | struct amba_device { | 26 | struct amba_device { |
| 16 | struct device dev; | 27 | struct device dev; |
| 17 | struct resource res; | 28 | struct resource res; |
| 29 | struct clk *pclk; | ||
| 18 | u64 dma_mask; | 30 | u64 dma_mask; |
| 19 | unsigned int periphid; | 31 | unsigned int periphid; |
| 20 | unsigned int irq[AMBA_NR_IRQS]; | 32 | unsigned int irq[AMBA_NR_IRQS]; |
| @@ -52,6 +64,12 @@ struct amba_device *amba_find_device(const char *, struct device *, unsigned int | |||
| 52 | int amba_request_regions(struct amba_device *, const char *); | 64 | int amba_request_regions(struct amba_device *, const char *); |
| 53 | void amba_release_regions(struct amba_device *); | 65 | void amba_release_regions(struct amba_device *); |
| 54 | 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 | |||
| 55 | #define amba_config(d) (((d)->periphid >> 24) & 0xff) | 73 | #define amba_config(d) (((d)->periphid >> 24) & 0xff) |
| 56 | #define amba_rev(d) (((d)->periphid >> 20) & 0x0f) | 74 | #define amba_rev(d) (((d)->periphid >> 20) & 0x0f) |
| 57 | #define amba_manf(d) (((d)->periphid >> 12) & 0xff) | 75 | #define amba_manf(d) (((d)->periphid >> 12) & 0xff) |
