mfd: tps6586x: move regulator dt parsing to regulator driver
PATCH 1/1 mfd: tps6586x: move regulator dt parsing to regulator driver
Moving regulator node parsing to regulator driver in place of parsing it on mfd driver.
The motivation for this change are:
- MFD core driver should not depends on regulator and able to instantiate device without regulator.
- The API for matching regulators are in regulator core and it is good that regulator driver only calls this API.
- Regulator specific support should be in regulator driver only to ease any enhancement/modification for regulators.
- The regulator driver is now registered as mfd sub device and all regulator registration is done from single probe call.
--- drivers/mfd/Kconfig | 1 - drivers/mfd/tps6586x.c | 76 ++------------ drivers/regulator/tps6586x-regulator.c | 181 +++++++++++++++++++++++++++----- include/linux/mfd/tps6586x.h | 3 + 4 files changed, 166 insertions(+), 95 deletions(-)
drivers/mfd/Kconfig +0 -1
@@ -201,7 +201,6 @@ config MFD_TPS6586X depends on I2C=y && GENERIC_HARDIRQS select MFD_CORE select REGMAP_I2C - depends on REGULATOR help If you say yes here you get support for the TPS6586X series of Power Management chips.
drivers/mfd/tps6586x.c +8 -68
102 lines not on this page · raw message
drivers/regulator/tps6586x-regulator.c +155 -26
236 lines not on this page · raw message
include/linux/mfd/tps6586x.h +3 -0
@@ -29,6 +29,7 @@ enum {TPS6586X_ID_LDO_8 ,TPS6586X_ID_LDO_9 ,TPS6586X_ID_LDO_RTC , + TPS6586X_ID_MAX_REGULATOR, }; enum {
@@ -79,6 +80,8 @@ struct tps6586x_platform_data {int gpio_base;int irq_base;bool pm_off; + +struct regulator_init_data *reg_init_data[TPS6586X_ID_MAX_REGULATOR ]; };/*
Signature · 1 line
1.7.1.1
Mark Brown
AppliedQuoted 2 lines · Laxman Dewangan
Moving regulator node parsing to regulator driver in place of parsing it on mfd driver.
Applied, thanks.
Quoted 7 lines · Mark Brown
* PGP Signed by an unknown key
Quoted 2 lines · Laxman Dewangan
Moving regulator node parsing to regulator driver in place of parsing it on mfd driver.
Applied, thanks.
Thanks, I hope it will not create conflict with Samuel's mfd subsystem tree as some changes on same file got merged recently in mfd subsystem.