]> git.karo-electronics.de Git - linux-beck.git/commitdiff
omap4: control: Add accessor api's for pad control module
authorSantosh Shilimkar <santosh.shilimkar@ti.com>
Mon, 27 Sep 2010 20:02:57 +0000 (14:02 -0600)
committerPaul Walmsley <paul@pwsan.com>
Mon, 27 Sep 2010 20:02:57 +0000 (14:02 -0600)
On OMAP4 control pad are not addressable from control
core base. So the common omap_ctrl_read/write APIs breaks
Hence export separate APIs to manage the omap4 pad control
registers.

This APIs will work only for OMAP4

Signed-off-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
Signed-off-by: Paul Walmsley <paul@pwsan.com>
arch/arm/mach-omap2/control.c
arch/arm/plat-omap/include/plat/control.h

index 99c0eb645d4d3ea5edbde45aede9185ac2a80709..8b3c469e7bcd756d07694098460a9666a0d9ce1d 100644 (file)
@@ -138,6 +138,7 @@ static struct omap3_control_regs control_context;
 #endif /* CONFIG_ARCH_OMAP3 && CONFIG_PM */
 
 #define OMAP_CTRL_REGADDR(reg)         (omap2_ctrl_base + (reg))
+#define OMAP4_CTRL_PAD_REGADDR(reg)    (omap4_ctrl_pad_base + (reg))
 
 void __init omap2_set_globals_control(struct omap_globals *omap2_globals)
 {
@@ -189,6 +190,23 @@ void omap_ctrl_writel(u32 val, u16 offset)
        __raw_writel(val, OMAP_CTRL_REGADDR(offset));
 }
 
+/*
+ * On OMAP4 control pad are not addressable from control
+ * core base. So the common omap_ctrl_read/write APIs breaks
+ * Hence export separate APIs to manage the omap4 pad control
+ * registers. This APIs will work only for OMAP4
+ */
+
+u32 omap4_ctrl_pad_readl(u16 offset)
+{
+       return __raw_readl(OMAP4_CTRL_PAD_REGADDR(offset));
+}
+
+void omap4_ctrl_pad_writel(u32 val, u16 offset)
+{
+       __raw_writel(val, OMAP4_CTRL_PAD_REGADDR(offset));
+}
+
 #if defined(CONFIG_ARCH_OMAP3) && defined(CONFIG_PM)
 /*
  * Clears the scratchpad contents in case of cold boot-
index 131bf405c2f6432fdc7058efff9dbb9996932994..2916b7e9372fd38181586f93c30acad5672f0a29 100644 (file)
@@ -354,9 +354,11 @@ extern void __iomem *omap_ctrl_base_get(void);
 extern u8 omap_ctrl_readb(u16 offset);
 extern u16 omap_ctrl_readw(u16 offset);
 extern u32 omap_ctrl_readl(u16 offset);
+extern u32 omap4_ctrl_pad_readl(u16 offset);
 extern void omap_ctrl_writeb(u8 val, u16 offset);
 extern void omap_ctrl_writew(u16 val, u16 offset);
 extern void omap_ctrl_writel(u32 val, u16 offset);
+extern void omap4_ctrl_pad_writel(u32 val, u16 offset);
 
 extern void omap3_save_scratchpad_contents(void);
 extern void omap3_clear_scratchpad_contents(void);
@@ -371,9 +373,11 @@ extern void omap3_control_restore_context(void);
 #define omap_ctrl_readb(x)             0
 #define omap_ctrl_readw(x)             0
 #define omap_ctrl_readl(x)             0
+#define omap4_ctrl_pad_readl(x)                0
 #define omap_ctrl_writeb(x, y)         WARN_ON(1)
 #define omap_ctrl_writew(x, y)         WARN_ON(1)
 #define omap_ctrl_writel(x, y)         WARN_ON(1)
+#define omap4_ctrl_pad_writel(x, y)    WARN_ON(1)
 #endif
 #endif /* __ASSEMBLY__ */