regulator: wm8400: Simplify set REGULATOR_MODE_IDLE mode in wm8400_dcdc_set_mode
PATCH 1/1 regulator: wm8400: Simplify set REGULATOR_MODE_IDLE mode in wm8400_dcdc_set_mode
To set REGULATOR_MODE_IDLE mode, what we do is to clear DC1_ACTIVE and DC1_SLEEP bits, this can be done in one wm8400_set_bits() call.
Signed-off-by Axel Lin <[email protected]>
--- drivers/regulator/wm8400-regulator.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-)
drivers/regulator/wm8400-regulator.c +1 -6
@@ -120,13 +120,8 @@ static int wm8400_dcdc_set_mode(struct regulator_dev *dev, unsigned int mode)case REGULATOR_MODE_IDLE :/* Datasheet: standby */ - ret =wm8400_set_bits (wm8400,WM8400_DCDC1_CONTROL_1 + offset, -WM8400_DC1_ACTIVE ,0 ); -if (ret !=0 ) -return ret;return wm8400_set_bits (wm8400,WM8400_DCDC1_CONTROL_1 + offset, -WM8400_DC1_SLEEP ,0 ); - +WM8400_DC1_ACTIVE |WM8400_DC1_SLEEP ,0 );default :return -EINVAL ; }
Signature · 1 line
1.7.9.5
Mark Brown
AppliedQuoted 2 lines · Axel Lin
To set
REGULATOR_MODE_IDLEmode, what we do is to clearDC1_ACTIVEandDC1_SLEEPbits, this can be done in onewm8400_set_bits()call.
Applied, thanks.