Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

mfd: twl4030-power: Fix PM idle pin configuration to not conflict with regulators

Commit 43fef47f94a1 (mfd: twl4030-power: Add a configuration to turn
off oscillator during off-idle) added support for configuring the PMIC
to cut off resources during deeper idle states to save power.

This however caused regression for n900 display power that needed the
PMIC configuration to be disabled with commit d937678ab625 (ARM: dts:
Revert enabling of twl configuration for n900).

Turns out the root cause of the problem is that we must use
TWL4030_RESCONFIG_UNDEF instead of DEV_GRP_NULL to avoid disabling
regulators that may have been enabled before the init function
for twl4030-power.c runs. With TWL4030_RESCONFIG_UNDEF we let the
regulator framework control the regulators like it should. Here we
need to only configure the sys_clken and sys_off_mode triggers for
the regulators that cannot be done by the regulator framework as
it's not running at that point.

This allows us to enable the PMIC configuration for n900.

Fixes: 43fef47f94a1 (mfd: twl4030-power: Add a configuration to turn off oscillator during off-idle)

Cc: stable@vger.kernel.org # v3.16
Signed-off-by: Tony Lindgren <tony@atomide.com>
Tested-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Lee Jones <lee.jones@linaro.org>

authored by

Tony Lindgren and committed by
Lee Jones
daebabd5 bc804360

+11 -11
+1 -1
arch/arm/boot/dts/omap3-n900.dts
··· 353 353 }; 354 354 355 355 twl_power: power { 356 - compatible = "ti,twl4030-power-n900"; 356 + compatible = "ti,twl4030-power-n900", "ti,twl4030-power-idle-osc-off"; 357 357 ti,use_poweroff; 358 358 }; 359 359 };
+10 -10
drivers/mfd/twl4030-power.c
··· 724 724 * above. 725 725 */ 726 726 static struct twl4030_resconfig omap3_idle_rconfig[] = { 727 - TWL_REMAP_SLEEP(RES_VAUX1, DEV_GRP_NULL, 0, 0), 728 - TWL_REMAP_SLEEP(RES_VAUX2, DEV_GRP_NULL, 0, 0), 729 - TWL_REMAP_SLEEP(RES_VAUX3, DEV_GRP_NULL, 0, 0), 730 - TWL_REMAP_SLEEP(RES_VAUX4, DEV_GRP_NULL, 0, 0), 731 - TWL_REMAP_SLEEP(RES_VMMC1, DEV_GRP_NULL, 0, 0), 732 - TWL_REMAP_SLEEP(RES_VMMC2, DEV_GRP_NULL, 0, 0), 727 + TWL_REMAP_SLEEP(RES_VAUX1, TWL4030_RESCONFIG_UNDEF, 0, 0), 728 + TWL_REMAP_SLEEP(RES_VAUX2, TWL4030_RESCONFIG_UNDEF, 0, 0), 729 + TWL_REMAP_SLEEP(RES_VAUX3, TWL4030_RESCONFIG_UNDEF, 0, 0), 730 + TWL_REMAP_SLEEP(RES_VAUX4, TWL4030_RESCONFIG_UNDEF, 0, 0), 731 + TWL_REMAP_SLEEP(RES_VMMC1, TWL4030_RESCONFIG_UNDEF, 0, 0), 732 + TWL_REMAP_SLEEP(RES_VMMC2, TWL4030_RESCONFIG_UNDEF, 0, 0), 733 733 TWL_REMAP_OFF(RES_VPLL1, DEV_GRP_P1, 3, 1), 734 734 TWL_REMAP_SLEEP(RES_VPLL2, DEV_GRP_P1, 0, 0), 735 - TWL_REMAP_SLEEP(RES_VSIM, DEV_GRP_NULL, 0, 0), 736 - TWL_REMAP_SLEEP(RES_VDAC, DEV_GRP_NULL, 0, 0), 735 + TWL_REMAP_SLEEP(RES_VSIM, TWL4030_RESCONFIG_UNDEF, 0, 0), 736 + TWL_REMAP_SLEEP(RES_VDAC, TWL4030_RESCONFIG_UNDEF, 0, 0), 737 737 TWL_REMAP_SLEEP(RES_VINTANA1, TWL_DEV_GRP_P123, 1, 2), 738 738 TWL_REMAP_SLEEP(RES_VINTANA2, TWL_DEV_GRP_P123, 0, 2), 739 739 TWL_REMAP_SLEEP(RES_VINTDIG, TWL_DEV_GRP_P123, 1, 2), 740 740 TWL_REMAP_SLEEP(RES_VIO, TWL_DEV_GRP_P123, 2, 2), 741 741 TWL_REMAP_OFF(RES_VDD1, DEV_GRP_P1, 4, 1), 742 742 TWL_REMAP_OFF(RES_VDD2, DEV_GRP_P1, 3, 1), 743 - TWL_REMAP_SLEEP(RES_VUSB_1V5, DEV_GRP_NULL, 0, 0), 744 - TWL_REMAP_SLEEP(RES_VUSB_1V8, DEV_GRP_NULL, 0, 0), 743 + TWL_REMAP_SLEEP(RES_VUSB_1V5, TWL4030_RESCONFIG_UNDEF, 0, 0), 744 + TWL_REMAP_SLEEP(RES_VUSB_1V8, TWL4030_RESCONFIG_UNDEF, 0, 0), 745 745 TWL_REMAP_SLEEP(RES_VUSB_3V1, TWL_DEV_GRP_P123, 0, 0), 746 746 /* Resource #20 USB charge pump skipped */ 747 747 TWL_REMAP_SLEEP(RES_REGEN, TWL_DEV_GRP_P123, 2, 1),