[U-Boot] [PATCH v4] power: pmic/regulator: Add basic support for TPS65910
Simon Glass
sjg at chromium.org
Fri Dec 1 23:24:26 UTC 2017
On 30 November 2017 at 05:52, Felix Brack <fb at ltec.ch> wrote:
> Texas Instrument's TPS65910 PMIC contains 3 buck DC-DC converts, one
> boost DC-DC converter and 8 LDOs. This patch implements driver model
> support for the TPS65910 PMIC and its regulators making the get/set
> API for regulator value/enable available.
> This patch depends on the patch "am33xx: Add a function to query MPU
> voltage in uV" to build correctly. For boards relying on the DT
> include file tps65910.dtsi the v3 patch "power: extend prefix match
> to regulator-name property" and an appropriate regulator naming is
> also required.
>
> Signed-off-by: Felix Brack <fb at ltec.ch>
> ---
>
> Changes in v4:
> - remove unnecessary test of unit number since it can't be negative
>
> Changes in v3:
> - use dev_get_driver_data() instead of dev->driver_data
> - use dev_get_platdata() instead of dev->platdata
> - store unit address in platdata during ofdata_to_platdata() instead
> of queering it multiple times by dev_get_driver_data()
> - use pmic_reg_read() instead of pmic_read() wherever possible
> - eliminate the use small data types like u8 if not required
>
> Changes in v2:
> - move information about regulator supply power from the PMIC to the
> regulator driver which greatly simplifies and streamlines the code
> of both drivers (thanks Simon!)
> - use dev_get_uclass_platdata() to get the regulator constraints
> instead of reinventing the wheel and reading them from the DT
> - make pmic_tps65910_write() and pmic_tps65910_read() return the
> results of the i2c operation instead of obscuring it
> - generally review and eventually fix return values
> - modify regulator description in Kconfig
> - get_ctrl_reg_from_unit_addr() uses a lookup array instead of a
> switch statement
> - rename some local functions to prevent confusion with generic
> functions
> - reformatting code for better readability
>
> drivers/power/pmic/Kconfig | 8 +
> drivers/power/pmic/Makefile | 1 +
> drivers/power/pmic/pmic_tps65910_dm.c | 98 ++++++
> drivers/power/regulator/Kconfig | 8 +
> drivers/power/regulator/Makefile | 1 +
> drivers/power/regulator/tps65910_regulator.c | 459 +++++++++++++++++++++++++++
> include/power/tps65910_pmic.h | 130 ++++++++
> 7 files changed, 705 insertions(+)
> create mode 100644 drivers/power/pmic/pmic_tps65910_dm.c
> create mode 100644 drivers/power/regulator/tps65910_regulator.c
> create mode 100644 include/power/tps65910_pmic.h
Reviewed-by: Simon Glass <sjg at chromium.org>
More information about the U-Boot
mailing list