Skip to contentSkip to conversation

mfd: tps6586x: move regulator dt parsing to regulator driver

PATCH Applied Laxman Dewangan 2 participants 3 messages Oct 18, 2012 – Nov 15, 2012

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

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
index acab3ef..05acef8 100644
@@ -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
index 2dd1231..f8da0e1 100644
@@ -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
Applied
#1 lore raw
Quoted 2 lines · Laxman Dewangan

Moving regulator node parsing to regulator driver in place of parsing it on mfd driver.

Applied, thanks.

#2 lore raw
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.