drivers: regulator: npm6001: handle LDO0 set voltage correctly

Even if the regulator is fixed, allow valid voltage input (1.8V).

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
This commit is contained in:
Gerard Marull-Paretas 2023-01-12 15:33:06 +01:00 committed by Carles Cufí
commit 0c28da26ba

View file

@ -383,7 +383,10 @@ static int regulator_npm6001_set_voltage(const struct device *dev,
case NPM6001_SOURCE_LDO0:
return regulator_npm6001_ldo0_set_voltage(dev, min_uv, max_uv);
case NPM6001_SOURCE_LDO1:
return -ENOTSUP;
if ((min_uv != 1800000) && (max_uv != 1800000)) {
return -EINVAL;
}
break;
default:
__ASSERT(NULL, "Unexpected source");
}