Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit 51d3a0c9 authored by Laxman Dewangan's avatar Laxman Dewangan Committed by Mark Brown
Browse files

regulator: palmas: preserve modes of rails during enable/disable



The Palma device like TPS65913 have the mode mask which is also
used for enable/disable the rails. The mode bits are defined as
	00: OFF
	01: AUTO
	10: ECO
	11: Forced PWM

and modes are set accordingly as
	REGULATOR_MODE_NORMAL: AUTO
	REGULATOR_MODE_IDLE: ECO
	REGULATOR_MODE_FAST: PWM

Two issue observed:
1. If client calls following sequence:
	regulator_enable(),
	regulator_set_mode(FAST),
	regulator_disable()

	and again the regulator_enable() then the mode is reset
	to NORMAL inplace of keeping the mode as FAST.

	Fixing this by storing the current mode configured by client
	and restoring modes when enable() is called after disable().

2. In following sequence, the regulator get enabled:
	regulator_disable()
	regulator_set_mode(FAST),

	Fixing this by updating new mode in register only if it is
	enabled.

Signed-off-by: default avatarLaxman Dewangan <ldewangan@nvidia.com>
Acked-by: default avatarGraeme Gregory <gg@slimlogic.co.uk>
Signed-off-by: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
parent 28d1e8cd
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment