aboutsummaryrefslogtreecommitdiff
path: root/arch/arm/mach-pxa/include
diff options
context:
space:
mode:
authorMark Brown <broonie@sirena.org.uk>2008-08-26 18:40:57 +0100
committerRussell King <rmk+kernel@arm.linux.org.uk>2008-09-09 16:32:52 +0100
commit63bef5473892ae683a9e989975180a5754b0ae33 (patch)
treed3362f0cdbe205fbb094f0edaed19a3c28a731fe /arch/arm/mach-pxa/include
parente7d48fa2b5fbc7f74bb7ef4a8d7e080b0e831ef0 (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>
Diffstat (limited to 'arch/arm/mach-pxa/include')
-rw-r--r--arch/arm/mach-pxa/include/mach/ssp.h24
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 a012882c9ee..cb5cb766f0f 100644
--- a/arch/arm/mach-pxa/include/mach/ssp.h
+++ b/arch/arm/mach-pxa/include/mach/ssp.h
@@ -20,6 +20,7 @@
#define __ASM_ARCH_SSP_H
#include <linux/list.h>
+#include <linux/io.h>
enum pxa_ssp_type {
SSP_UNDEFINED = 0,
@@ -78,6 +79,29 @@ int ssp_init(struct ssp_dev *dev, u32 port, u32 init_flags);
int ssp_config(struct ssp_dev *dev, u32 mode, u32 flags, u32 psp_flags, u32 speed);
void ssp_exit(struct ssp_dev *dev);
+/**
+ * ssp_write_reg - Write to a SSP register
+ *
+ * @dev: SSP device to access
+ * @reg: Register to write to
+ * @val: Value to be written.
+ */
+static inline void ssp_write_reg(struct ssp_device *dev, u32 reg, u32 val)
+{
+ __raw_writel(val, dev->mmio_base + reg);
+}
+
+/**
+ * ssp_read_reg - Read from a SSP register
+ *
+ * @dev: SSP device to access
+ * @reg: Register to read from
+ */
+static inline u32 ssp_read_reg(struct ssp_device *dev, u32 reg)
+{
+ return __raw_readl(dev->mmio_base + reg);
+}
+
struct ssp_device *ssp_request(int port, const char *label);
void ssp_free(struct ssp_device *);
#endif /* __ASM_ARCH_SSP_H */