diff options
| author | Mark Brown <broonie@sirena.org.uk> | 2008-08-26 13:40:57 -0400 |
|---|---|---|
| committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2008-09-09 11:32:52 -0400 |
| commit | 63bef5473892ae683a9e989975180a5754b0ae33 (patch) | |
| tree | d3362f0cdbe205fbb094f0edaed19a3c28a731fe | |
| parent | e7d48fa2b5fbc7f74bb7ef4a8d7e080b0e831ef0 (diff) | |
[ARM] 5224/2: PXA SSP: Introduce register accessors
Introduce accessors for the SSP registers so that drivers don't need to
open code offsets from the MMIO base.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Eric Miao <eric.miao@marvell.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
| -rw-r--r-- | arch/arm/mach-pxa/include/mach/ssp.h | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/arch/arm/mach-pxa/include/mach/ssp.h b/arch/arm/mach-pxa/include/mach/ssp.h index a012882c9ee6..cb5cb766f0f1 100644 --- a/arch/arm/mach-pxa/include/mach/ssp.h +++ b/arch/arm/mach-pxa/include/mach/ssp.h | |||
| @@ -20,6 +20,7 @@ | |||
| 20 | #define __ASM_ARCH_SSP_H | 20 | #define __ASM_ARCH_SSP_H |
| 21 | 21 | ||
| 22 | #include <linux/list.h> | 22 | #include <linux/list.h> |
| 23 | #include <linux/io.h> | ||
| 23 | 24 | ||
| 24 | enum pxa_ssp_type { | 25 | enum pxa_ssp_type { |
| 25 | SSP_UNDEFINED = 0, | 26 | SSP_UNDEFINED = 0, |
| @@ -78,6 +79,29 @@ int ssp_init(struct ssp_dev *dev, u32 port, u32 init_flags); | |||
| 78 | int ssp_config(struct ssp_dev *dev, u32 mode, u32 flags, u32 psp_flags, u32 speed); | 79 | int ssp_config(struct ssp_dev *dev, u32 mode, u32 flags, u32 psp_flags, u32 speed); |
| 79 | void ssp_exit(struct ssp_dev *dev); | 80 | void ssp_exit(struct ssp_dev *dev); |
| 80 | 81 | ||
| 82 | /** | ||
| 83 | * ssp_write_reg - Write to a SSP register | ||
| 84 | * | ||
| 85 | * @dev: SSP device to access | ||
| 86 | * @reg: Register to write to | ||
| 87 | * @val: Value to be written. | ||
| 88 | */ | ||
| 89 | static inline void ssp_write_reg(struct ssp_device *dev, u32 reg, u32 val) | ||
| 90 | { | ||
| 91 | __raw_writel(val, dev->mmio_base + reg); | ||
| 92 | } | ||
| 93 | |||
| 94 | /** | ||
| 95 | * ssp_read_reg - Read from a SSP register | ||
| 96 | * | ||
| 97 | * @dev: SSP device to access | ||
| 98 | * @reg: Register to read from | ||
| 99 | */ | ||
| 100 | static inline u32 ssp_read_reg(struct ssp_device *dev, u32 reg) | ||
| 101 | { | ||
| 102 | return __raw_readl(dev->mmio_base + reg); | ||
| 103 | } | ||
| 104 | |||
| 81 | struct ssp_device *ssp_request(int port, const char *label); | 105 | struct ssp_device *ssp_request(int port, const char *label); |
| 82 | void ssp_free(struct ssp_device *); | 106 | void ssp_free(struct ssp_device *); |
| 83 | #endif /* __ASM_ARCH_SSP_H */ | 107 | #endif /* __ASM_ARCH_SSP_H */ |
