aboutsummaryrefslogtreecommitdiff
path: root/drivers/staging/hikey9xx
diff options
context:
space:
mode:
authorGravatar Mauro Carvalho Chehab <mchehab+huawei@kernel.org> 2021-01-21 08:18:14 +0100
committerGravatar Greg Kroah-Hartman <gregkh@linuxfoundation.org> 2021-01-26 18:52:55 +0100
commit75d39eb5389308b0233a7cec9c6150507a7366ef (patch)
treee76b8ddde6be79dd8323ed6c392a110672bbea11 /drivers/staging/hikey9xx
parentstaging: hikey9xx: hi6421v600-regulator: cleanup comments (diff)
downloadlinux-75d39eb5389308b0233a7cec9c6150507a7366ef.tar.gz
linux-75d39eb5389308b0233a7cec9c6150507a7366ef.tar.bz2
linux-75d39eb5389308b0233a7cec9c6150507a7366ef.zip
staging: hikey9xx: hi6421v600-regulator: fix get_optimum_mode
During the driver refactor, a regression broke the logic inside hi6421_spmi_regulator_get_optimum_mode(). Basically, if a LDO has eco_uA == 0, it doesn't support economic mode. So, it should return REGULATOR_MODE_NORMAL. If economic mode is supported, it can return either REGULATOR_MODE_IDLE or REGULATOR_MODE_NORMAL, depending on the load current. Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org> Link: https://lore.kernel.org/r/f087981eb695eaab8c301c42977a4aa884affbbf.1611212783.git.mchehab+huawei@kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/hikey9xx')
-rw-r--r--drivers/staging/hikey9xx/hi6421v600-regulator.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/staging/hikey9xx/hi6421v600-regulator.c b/drivers/staging/hikey9xx/hi6421v600-regulator.c
index 9f096d4e46db..382a0b21643e 100644
--- a/drivers/staging/hikey9xx/hi6421v600-regulator.c
+++ b/drivers/staging/hikey9xx/hi6421v600-regulator.c
@@ -206,7 +206,7 @@ hi6421_spmi_regulator_get_optimum_mode(struct regulator_dev *rdev,
{
struct hi6421_spmi_reg_info *sreg = rdev_get_drvdata(rdev);
- if (load_uA || ((unsigned int)load_uA > sreg->eco_uA))
+ if (!sreg->eco_uA || ((unsigned int)load_uA > sreg->eco_uA))
return REGULATOR_MODE_NORMAL;
return REGULATOR_MODE_IDLE;