power: pmic: Add support for LP873X family of PMICs
v3 cover power: pmic: Add support for LP873X family of PMICs
The series adds support for LP873X family of PMICs. Implements functions to configure regulators. Enable/Disable Get/Set voltages of regulators.
Keerthy (2):
power: pmic: lp873x: Add the base pmic support
power: regulator: lp873x: Add regulator support
drivers/power/pmic/Kconfig | 7 + drivers/power/pmic/Makefile | 1 + drivers/power/pmic/lp873x.c | 86 +++++++ drivers/power/regulator/Kconfig | 8 + drivers/power/regulator/Makefile | 1 + drivers/power/regulator/lp873x_regulator.c | 357 +++++++++++++++++++++++++++++ include/power/lp873x.h | 19 ++ 7 files changed, 479 insertions(+) create mode 100644 drivers/power/pmic/lp873x.c create mode 100644 drivers/power/regulator/lp873x_regulator.c create mode 100644 include/power/lp873x.h
Signature · 1 line
1.9.1
PATCH v3 1/2 power: pmic: lp873x: Add the base pmic support
Add support to bind the regulators/child nodes with the pmic.
---
Changes in v3:
* Used dm_i2c_write and dm_i2c_read in place of dm_i2c_reg_write dm_i2c_reg_read respectively.
Changes in v2:
* Added pmic read/write functions.
drivers/power/pmic/Kconfig | 7 ++++ drivers/power/pmic/Makefile | 1 + drivers/power/pmic/lp873x.c | 86 +++++++++++++++++++++++++++++++++++++++++++++ include/power/lp873x.h | 19 ++++++++++ 4 files changed, 113 insertions(+) create mode 100644 drivers/power/pmic/lp873x.c create mode 100644 include/power/lp873x.h
drivers/power/pmic/Kconfig +7 -0
@@ -142,3 +142,10 @@ config PMIC_PALMAS ---help--- The PALMAS is a PMIC containing several LDOs, SMPS. This driver binds the pmic children. + +config PMIC_LP873X + bool "Enable driver for Texas Instruments LP873X PMIC" + depends on DM_PMIC + ---help--- + The LP873X is a PMIC containing couple of LDOs and couple of SMPS. + This driver binds the pmic children.
drivers/power/pmic/Makefile +1 -0
@@ -16,6 +16,7 @@ obj-$(CONFIG_PMIC_RK808) += rk808.o obj-$(CONFIG_PMIC_TPS65090) += tps65090.o obj-$(CONFIG_PMIC_S5M8767) += s5m8767.o obj-$(CONFIG_$(SPL_)PMIC_PALMAS) += palmas.o +obj-$(CONFIG_$(SPL_)PMIC_LP873X) += lp873x.o obj-$(CONFIG_POWER_LTC3676) += pmic_ltc3676.o obj-$(CONFIG_POWER_MAX77696) += pmic_max77696.o
drivers/power/pmic/lp873x.c new file +86 -0
86 lines not on this page · raw message
include/power/lp873x.h new file +19 -0
@@ -0,0 +1,19 @@ +#define LP8732 0x0 +#define LP8733 0x1 + +#define LP873X_LDO_NUM 2 +#define LP873X_BUCK_NUM 2 + +/* Drivers name */ +#define LP873X_LDO_DRIVER "lp873x_ldo" +#define LP873X_BUCK_DRIVER "lp873x_buck" + +#define LP873X_BUCK_VOLT_MASK 0xFF +#define LP873X_BUCK_VOLT_MAX_HEX 0xFF +#define LP873X_BUCK_VOLT_MAX 3360000 +#define LP873X_BUCK_MODE_MASK 0x1 + +#define LP873X_LDO_VOLT_MASK 0x1F +#define LP873X_LDO_VOLT_MAX_HEX 0x19 +#define LP873X_LDO_VOLT_MAX 3300000 +#define LP873X_LDO_MODE_MASK 0x1
Signature · 1 line
1.9.1
PATCH v3 2/2 power: regulator: lp873x: Add regulator support
In reply to KeerthyThe driver provides regulator set/get voltage enable/disable functions for lp873x family of PMICs.
---
Changes in v2:
* Used pmic_reg_read/pmic_reg_write instead of direct i2c read/write calls.
drivers/power/regulator/Kconfig | 8 + drivers/power/regulator/Makefile | 1 + drivers/power/regulator/lp873x_regulator.c | 357 +++++++++++++++++++++++++++++ 3 files changed, 366 insertions(+) create mode 100644 drivers/power/regulator/lp873x_regulator.c
drivers/power/regulator/Kconfig +8 -0
@@ -123,3 +123,11 @@ config DM_REGULATOR_PALMAS This enables implementation of driver-model regulator uclass features for REGULATOR PALMAS and the family of PALMAS PMICs. The driver implements get/set api for: value and enable. + +config DM_REGULATOR_LP873X + bool "Enable driver for LP873X PMIC regulators" + depends on PMIC_LP873X + ---help--- + This enables implementation of driver-model regulator uclass + features for REGULATOR LP873X and the family of LP873X PMICs. + The driver implements get/set api for: value and enable.
drivers/power/regulator/Makefile +1 -0
@@ -15,3 +15,4 @@ obj-$(CONFIG_REGULATOR_S5M8767) += s5m8767.o obj-$(CONFIG_DM_REGULATOR_SANDBOX) += sandbox.o obj-$(CONFIG_REGULATOR_TPS65090) += tps65090_regulator.o obj-$(CONFIG_$(SPL_)DM_REGULATOR_PALMAS) += palmas_regulator.o +obj-$(CONFIG_$(SPL_)DM_REGULATOR_LP873X) += lp873x_regulator.o
drivers/power/regulator/lp873x_regulator.c new file +357 -0
357 lines not on this page · raw message
Signature · 1 line
1.9.1
PATCH v3 1/2 power: pmic: lp873x: Add the base pmic support
In reply to KeerthyQuoted 15 lines · Keerthy
Add support to bind the regulators/child nodes with the pmic.
Signed-off-by Keerthy <[email protected]>Reviewed-by Simon Glass <[email protected]>---
Changes in v3:
* Used
dm_i2c_writeanddm_i2c_readin place ofdm_i2c_reg_writedm_i2c_reg_readrespectively.Changes in v2:
* Added pmic read/write functions.
Quoted 7 lines
drivers/power/pmic/Kconfig | 7 ++++ drivers/power/pmic/Makefile | 1 + drivers/power/pmic/lp873x.c | 86 +++++++++++++++++++++++++++++++++++++++++++++ include/power/lp873x.h | 19 ++++++++++ 4 files changed, 113 insertions(+) create mode 100644 drivers/power/pmic/lp873x.c create mode 100644 include/power/lp873x.h
Applied to u-boot-dm, thanks!
PATCH v3 2/2 power: regulator: lp873x: Add regulator support
In reply to KeerthyQuoted 8 lines · Keerthy
The driver provides regulator set/get voltage enable/disable functions for lp873x family of PMICs.
Signed-off-by Keerthy <[email protected]>Reviewed-by Simon Glass <[email protected]>---
Changes in v2:
Quoted 8 lines
* Used pmic_reg_read/pmic_reg_write instead of direct i2c read/write calls.
drivers/power/regulator/Kconfig | 8 + drivers/power/regulator/Makefile | 1 + drivers/power/regulator/lp873x_regulator.c | 357 +++++++++++++++++++++++++++++ 3 files changed, 366 insertions(+) create mode 100644 drivers/power/regulator/lp873x_regulator.c
Applied to u-boot-dm, thanks!