]> rtime.felk.cvut.cz Git - sojka/nv-tegra/linux-3.10.git/commitdiff
ARM: tegra: pluto: put HV IOs into DPD explicitly during LP1
authorDaniel Solomon <daniels@nvidia.com>
Fri, 12 Apr 2013 18:36:30 +0000 (11:36 -0700)
committerDan Willemsen <dwillemsen@nvidia.com>
Sat, 14 Sep 2013 20:13:54 +0000 (13:13 -0700)
Rail VDDIO_HV is consuming higher power than predicted during LP1,
this could be fixed by explicitly putting the pins on that rail
into DPD mode. And by putting the pins into tristate mode, it
saves additional power during LP1.

bug 1248007

Change-Id: I636a307c6a24d4489b4889a068ccd2d00c6665d3
Signed-off-by: Eric Miao <emiao@nvidia.com>
Signed-off-by: Daniel Solomon <daniels@nvidia.com>
Reviewed-on: http://git-master/r/213864
(Cherry picked from fce59945c9a121033d8c0fd6ab623129676e4120)
Reviewed-on: http://git-master/r/226773
Reviewed-by: Simone Willett <swillett@nvidia.com>
Tested-by: Simone Willett <swillett@nvidia.com>
arch/arm/mach-tegra/board-pluto-pinmux.c
arch/arm/mach-tegra/board-pluto-power.c

index 8232fe1be1d8599ab58645c7f30687c3a4051460..0fa2c1c3d5c5a006d460f0f7cfdf22c666203d7b 100644 (file)
@@ -136,6 +136,13 @@ static struct tegra_pingroup_config pluto_sleep_pinmux[] = {
        DEFAULT_PINMUX(GMI_CS7_N,   GMI,     NORMAL,    NORMAL,    INPUT),
        DEFAULT_PINMUX(GMI_IORDY,   GMI,     NORMAL,    NORMAL,    INPUT),
        DEFAULT_PINMUX(GMI_RST_N,   GMI,     NORMAL,    NORMAL,    INPUT),
+
+       /* VDDIO_HV_AP */
+       DEFAULT_PINMUX(OWR,  OWR,  NORMAL, TRISTATE, INPUT),
+       CEC_PINMUX(HDMI_CEC, CEC,  NORMAL, TRISTATE, INPUT, DISABLE, ENABLE),
+       I2C_PINMUX(DDC_SCL,  I2C4, NORMAL, TRISTATE, INPUT, DEFAULT, DEFAULT),
+       I2C_PINMUX(DDC_SDA,  I2C4, NORMAL, TRISTATE, INPUT, DEFAULT, DEFAULT),
+       USB_PINMUX(USB_VBUS_EN0, RSVD3, NORMAL, NORMAL, OUTPUT, DISABLE, DISABLE),
 };
 #endif
 
index 99e1926c7888da1562c475b6788975bb2646de63..ac673c3d73b7cef4f116faa5f6662ab4c644921a 100644 (file)
 #include <linux/platform_device.h>
 #include <linux/resource.h>
 #include <linux/io.h>
+#include <linux/gpio.h>
 
 #include <mach/edp.h>
 #include <mach/irqs.h>
 #include <mach/hardware.h>
+#include <mach/io_dpd.h>
 #include <linux/regulator/fixed.h>
 #include <linux/mfd/palmas.h>
 #include <linux/regulator/machine.h>
@@ -702,6 +704,30 @@ static int __init pluto_fixed_regulator_init(void)
 }
 subsys_initcall_sync(pluto_fixed_regulator_init);
 
+static struct tegra_io_dpd hv_io = {
+       .name                   = "HV",
+       .io_dpd_reg_index       = 1,
+       .io_dpd_bit             = 6,
+};
+
+static void pluto_board_suspend(int state, enum suspend_stage stage)
+{
+       /* put HV IOs into DPD mode to save additional power */
+       if (state == TEGRA_SUSPEND_LP1 && stage == TEGRA_SUSPEND_BEFORE_CPU) {
+               gpio_direction_input(TEGRA_GPIO_PK6);
+               tegra_io_dpd_enable(&hv_io);
+       }
+}
+
+static void pluto_board_resume(int state, enum resume_stage stage)
+{
+       /* bring HV IOs back from DPD mode, GPIO configuration
+        * will be restored by gpio driver
+        */
+       if (state == TEGRA_SUSPEND_LP1 && stage == TEGRA_RESUME_AFTER_CPU)
+               tegra_io_dpd_disable(&hv_io);
+}
+
 static struct tegra_suspend_platform_data pluto_suspend_data = {
        .cpu_timer      = 300,
        .cpu_off_timer  = 300,
@@ -721,6 +747,8 @@ static struct tegra_suspend_platform_data pluto_suspend_data = {
        .lp1_core_volt_low = 0x2e,
        .lp1_core_volt_high = 0x42,
 #endif
+       .board_suspend  = pluto_board_suspend,
+       .board_resume   = pluto_board_resume,
 };
 
 int __init pluto_suspend_init(void)