we introduce new accessors which provide for register
access with and without offsets.
This is just to make sure newer versions of the IP
can access the new registers prepended at the beginning
of the address space.
Signed-off-by: Felipe Balbi <balbi@xxxxxx>
---
drivers/mmc/host/omap_hsmmc.c | 36 ++++++++++++++++++++++++++++++++++++
1 file changed, 36 insertions(+)
diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c
index d46f768..e596c6a 100644
--- a/drivers/mmc/host/omap_hsmmc.c
+++ b/drivers/mmc/host/omap_hsmmc.c
@@ -211,6 +211,42 @@ struct omap_hsmmc_host {
struct omap_mmc_platform_data *pdata;
};
+static inline int _omap_hsmmc_read(struct omap_hsmmc_host *host,
+ u32 reg, bool offset)
+{
+ return readl(host->base + reg + (offset ? host->reg_offset : 0));
+}
+
+static inline void _omap_hsmmc_write(struct omap_hsmmc_host *host,
+ u32 reg, u32 val, bool offset)
+{
+ writel(val, host->base + reg + (offset ? host->reg_offset : 0));
+}
+
+static inline int omap_hsmmc_read_offset(struct omap_hsmmc_host *host,
+ u32 reg)
+{
+ return _omap_hsmmc_read(host, reg, true);
+}
+
+static inline void omap_hsmmc_write_offset(struct omap_hsmmc_host *host,