ARM: OMAP3: control: add API for setting up the modem pads
authorTero Kristo <t-kristo@ti.com>
Tue, 4 Mar 2014 15:17:06 +0000 (17:17 +0200)
committerTero Kristo <t-kristo@ti.com>
Fri, 4 Jul 2014 14:02:18 +0000 (17:02 +0300)
This patch moves the functionality from PM core to control driver.

Signed-off-by: Tero Kristo <t-kristo@ti.com>
arch/arm/mach-omap2/control.c
arch/arm/mach-omap2/control.h
arch/arm/mach-omap2/pm34xx.c

index 83080949d0d30f9b5c8aae783150acdb1c1e5a9d..f432ffc0deb23fe76ccd0fc17f3d74fc425a5e24 100644 (file)
@@ -569,4 +569,30 @@ void omap3_ctrl_set_iva_bootmode_idle(void)
        omap_ctrl_writel(OMAP3_IVA2_BOOTMOD_IDLE,
                         OMAP343X_CONTROL_IVA2_BOOTMOD);
 }
+
+/**
+ * omap3_ctrl_setup_d2d_padconf - setup stacked modem pads for idle
+ *
+ * Sets up the pads controlling the stacked modem in such way that the
+ * device can enter idle.
+ */
+void omap3_ctrl_setup_d2d_padconf(void)
+{
+       u16 mask, padconf;
+
+       /*
+        * In a stand alone OMAP3430 where there is not a stacked
+        * modem for the D2D Idle Ack and D2D MStandby must be pulled
+        * high. S CONTROL_PADCONF_SAD2D_IDLEACK and
+        * CONTROL_PADCONF_SAD2D_MSTDBY to have a pull up.
+        */
+       mask = (1 << 4) | (1 << 3); /* pull-up, enabled */
+       padconf = omap_ctrl_readw(OMAP3_PADCONF_SAD2D_MSTANDBY);
+       padconf |= mask;
+       omap_ctrl_writew(padconf, OMAP3_PADCONF_SAD2D_MSTANDBY);
+
+       padconf = omap_ctrl_readw(OMAP3_PADCONF_SAD2D_IDLEACK);
+       padconf |= mask;
+       omap_ctrl_writew(padconf, OMAP3_PADCONF_SAD2D_IDLEACK);
+}
 #endif /* CONFIG_ARCH_OMAP3 && CONFIG_PM */
index da054801b114d9baf0c9b9b2113622a1071ead43..fc001587ebf573043c7688d733df060e910e205b 100644 (file)
@@ -428,6 +428,7 @@ extern void omap_ctrl_write_dsp_boot_mode(u8 bootmode);
 extern void omap3630_ctrl_disable_rta(void);
 extern int omap3_ctrl_save_padconf(void);
 extern void omap3_ctrl_set_iva_bootmode_idle(void);
+void omap3_ctrl_setup_d2d_padconf(void);
 extern void omap2_set_globals_control(void __iomem *ctrl,
                                      void __iomem *ctrl_pad);
 #else
index 3ea04ac10d166f18103146b2a756863b575b6076..126f3ec2d17472f9bdb5f458724226516e20f156 100644 (file)
@@ -355,20 +355,7 @@ restore:
 
 static void __init omap3_d2d_idle(void)
 {
-       u16 mask, padconf;
-
-       /* In a stand alone OMAP3430 where there is not a stacked
-        * modem for the D2D Idle Ack and D2D MStandby must be pulled
-        * high. S CONTROL_PADCONF_SAD2D_IDLEACK and
-        * CONTROL_PADCONF_SAD2D_MSTDBY to have a pull up. */
-       mask = (1 << 4) | (1 << 3); /* pull-up, enabled */
-       padconf = omap_ctrl_readw(OMAP3_PADCONF_SAD2D_MSTANDBY);
-       padconf |= mask;
-       omap_ctrl_writew(padconf, OMAP3_PADCONF_SAD2D_MSTANDBY);
-
-       padconf = omap_ctrl_readw(OMAP3_PADCONF_SAD2D_IDLEACK);
-       padconf |= mask;
-       omap_ctrl_writew(padconf, OMAP3_PADCONF_SAD2D_IDLEACK);
+       omap3_ctrl_setup_d2d_padconf();
 
        /* reset modem */
        omap3_prm_reset_modem();