Skip to content

Commit cb3a0f8

Browse files
M-Vaittinenbroonie
authored andcommitted
regulator: rohm-regulator: warn if unsupported voltage is set
A few of the ROHM PMICs allow setting low-power state specific voltages for regulators. These voltages are then taken in use (by the hardware) when the PMIC state is changed. The voltages for these states can be given via device-tree. If unsupported voltage has been given, the users have only seen print: "driver callback failed to parse DT for regulator <name>". This does help to pinpoint the problem to some extent, but there may be several properties in device-tree so it should help if we can be a bit more specific. Print the voltage value and the run-state property if voltage can not be supported. Signed-off-by: Matti Vaittinen <[email protected]> Link: https://msgid.link/r/0937411855967cbefd9ff2d6045a52ca26712c4a.1715848512.git.mazziesaccount@gmail.com Signed-off-by: Mark Brown <[email protected]>
1 parent 0f9f7c6 commit cb3a0f8

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

drivers/regulator/rohm-regulator.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,13 +46,17 @@ static int set_dvs_level(const struct regulator_desc *desc,
4646
continue;
4747
if (ret == uv) {
4848
i <<= ffs(desc->vsel_mask) - 1;
49+
4950
ret = regmap_update_bits(regmap, reg, mask, i);
5051
if (omask && !ret)
5152
ret = regmap_update_bits(regmap, oreg, omask,
5253
omask);
5354
break;
5455
}
5556
}
57+
if (i == desc->n_voltages)
58+
pr_warn("Unsupported %s voltage %u\n", prop, uv);
59+
5660
return ret;
5761
}
5862

0 commit comments

Comments
 (0)