regulator: rtq6752: Enclose 'enable' gpio control by enable flag
authorChiYuan Huang <cy_huang@richtek.com>
Tue, 14 Sep 2021 14:20:49 +0000 (22:20 +0800)
committerMark Brown <broonie@kernel.org>
Wed, 15 Sep 2021 12:12:39 +0000 (13:12 +0100)
commit6f3a9b100379320d27f4a64fa90f58101c95c5a8
tree9e66f4d159fcafc2bb0a8620d044e95ce128bd7a
parentb1c36aae51c951af1c011de0b4f15bab06e82a52
regulator: rtq6752: Enclose 'enable' gpio control by enable flag

Fix 'enable' gpio control logic from the below cases if it's specified.

1. All off and both are sequentially controlled to be on.
The 'enable' gpio control block to be called twice including the delay time.

2. Both are on and one is preparing to be off.
The 'enable' gpio control low before register cache is configured to be true.

Signed-off-by: ChiYuan Huang <cy_huang@richtek.com>
Link: https://lore.kernel.org/r/1631629249-9998-1-git-send-email-u0084500@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/regulator/rtq6752-regulator.c