summaryrefslogtreecommitdiff
path: root/drivers/regulator/tps6287x-regulator.c
AgeCommit message (Collapse)AuthorFilesLines
2023-08-29regulator: tps6287x: Fix n_voltagesVincent Whitchurch1-1/+1
There are 256 possible voltage settings for each range, not 256 possible voltage settings in total. Fixes: 15a1cd245d5b ("regulator: tps6287x: Fix missing .n_voltages setting") Signed-off-by: Vincent Whitchurch <vincent.whitchurch@axis.com Link: https://lore.kernel.org/r/20230829-tps-voltages-v1-1-7ba4f958a194@axis.com Signed-off-by: Mark Brown <broonie@kernel.org
2023-07-25regulator: Use bitfield values for range selectorsChen-Yu Tsai1-2/+2
Right now the regulator helpers expect raw register values for the range selectors. This is different from the voltage selectors, which are normalized as bitfield values. This leads to a bit of confusion. Also, raw values are harder to copy from datasheets or match up with them, as datasheets will typically have bitfield values. Make the helpers expect bitfield values, and convert existing users. The field in regulator_desc is renamed to |linear_range_selectors_bitfield|. This is intended to cause drivers added in the same merge window and out-of-tree drivers using the incorrect variable and values to break, preventing incorrect values being used on actual hardware and potentially producing magic smoke. Also include bitops.h explicitly for ffs(), and reorder the header include statements. While at it, also replace module.h with export.h, since the only use is EXPORT_SYMBOL_GPL. Signed-off-by: Chen-Yu Tsai <wenst@chromium.org> Link: https://lore.kernel.org/r/20230714081408.274567-1-wenst@chromium.org Signed-off-by: Mark Brown <broonie@kernel.org>
2023-07-14regulator: Explicitly include correct DT includesRob Herring1-1/+1
The DT of_device.h and of_platform.h date back to the separate of_platform_bus_type before it as merged into the regular platform bus. As part of that merge prepping Arm DT support 13 years ago, they "temporarily" include each other. They also include platform_device.h and of.h. As a result, there's a pretty much random mix of those include files used throughout the tree. In order to detangle these headers and replace the implicit includes with struct declarations, users need to explicitly include the correct includes. Signed-off-by: Rob Herring <robh@kernel.org> Link: https://lore.kernel.org/r/20230714174930.4063320-1-robh@kernel.org Signed-off-by: Mark Brown <broonie@kernel.org>
2023-06-12regulator: Switch two more i2c drivers back to use .probe()Uwe Kleine-König1-1/+1
The previous conversion back to .probe done in commit 964e186547b2 ("regulator: Switch i2c drivers back to use .probe()") was done based on v6.3. Since then two more drivers were added which need to be convert back in the same way before eventually .probe_new() can be dropped from struct i2c_driver. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Link: https://lore.kernel.org/r/20230611203559.827168-1-u.kleine-koenig@pengutronix.de Signed-off-by: Mark Brown <broonie@kernel.org>
2023-05-17regulator: tps6287x: Fix missing .n_voltages settingAxel Lin1-0/+1
Otherwise, regulator_list_voltage() will return -EINVAL. Signed-off-by: Axel Lin <axel.lin@ingics.com Link: https://lore.kernel.org/r/20230516082333.466429-1-axel.lin@ingics.com Signed-off-by: Mark Brown <broonie@kernel.org
2023-05-09regulator: Add support for TI TPS6287x regulatorsMårten Lindahl1-0/+188
Add support for Texas Instruments TPS6287x, single-channel synchronous step-down converters with four output voltage ranges. Signed-off-by: Mårten Lindahl <marten.lindahl@axis.com Link: https://lore.kernel.org/r/20230502-tps6287x-driver-v3-2-e25140a023f5@axis.com Signed-off-by: Mark Brown <broonie@kernel.org