Skip to contentSkip to conversation

regulator: DA9055 regulator driver

PATCH Applied Ashish Jangam 2 participants 2 messages Nov 1, 2012 – Nov 15, 2012

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

PATCH v4 2/7 regulator: DA9055 regulator driver

This is the Regulator patch for the DA9055 PMIC and has got dependency on the DA9055 MFD core.

This patch support all of the DA9055 regulators. The output voltages are fully programmable through I2C interface only. The platform data with regulation constraints is passed down from the board to the regulator.

This patch is functionaly tested on SMDK6410 board. DA9055 Evaluation board was connected to the SMDK6410 board.

---
changes since version v4:
- Remove the unsupported regulator IDLE mode
- Fix the missing break condition
- In function *_get_voltage_sel() use of direct register values
- In fuction *_set_voltage_sel() set voltage is placed in if/else
- In suspend related functions took care of GPIO regulator selection condition.
- Fix indentation issue in find_regulator_info()
changes since version v3:
- Use of regulator framework API regulator_map_voltage_linear() and regulator_list_voltage_linear().
- Modify comments to indicate GPIO pins are muxed.
- Get the GPIO number from platform data.
changes since v2:
- restructuring of GPIO regulator initialization code.

---
 drivers/regulator/Kconfig            |   10 +
 drivers/regulator/Makefile           |    1 +
 drivers/regulator/da9055-regulator.c |  663 ++++++++++++++++++++++++++++++++++
 include/linux/mfd/da9055/pdata.h     |   27 ++-
 4 files changed, 698 insertions(+), 3 deletions(-)
 create mode 100644 drivers/regulator/da9055-regulator.c
drivers/regulator/Kconfig +10 -0
index 7b920c7..d1fa325 100644
@@ -109,6 +109,16 @@ config REGULATOR_DA9052
 	  This driver supports the voltage regulators of DA9052-BC and
 	  DA9053-AA/Bx PMIC.
 
+config REGULATOR_DA9055
+	tristate "Dialog Semiconductor DA9055 regulators"
+	depends on MFD_DA9055
+	help
+	  Say y here to support the BUCKs and LDOs regulators found on
+	  Dialog Semiconductor DA9055 PMIC.
+
+	  This driver can also be built as a module. If so, the module
+	  will be called da9055-regulator.
+
 config REGULATOR_FAN53555
 	tristate "Fairchild FAN53555 Regulator"
 	depends on I2C
drivers/regulator/Makefile +1 -0
index db274dc..c4e2b2b 100644
@@ -18,6 +18,7 @@ obj-$(CONFIG_REGULATOR_ANATOP) += anatop-regulator.o
 obj-$(CONFIG_REGULATOR_ARIZONA) += arizona-micsupp.o arizona-ldo1.o
 obj-$(CONFIG_REGULATOR_DA903X)	+= da903x.o
 obj-$(CONFIG_REGULATOR_DA9052)	+= da9052-regulator.o
+obj-$(CONFIG_REGULATOR_DA9055)	+= da9055-regulator.o
 obj-$(CONFIG_REGULATOR_DBX500_PRCMU) += dbx500-prcmu.o
 obj-$(CONFIG_REGULATOR_DB8500_PRCMU) += db8500-prcmu.o
 obj-$(CONFIG_REGULATOR_FAN53555) += fan53555.o
drivers/regulator/da9055-regulator.c new file +663 -0

663 lines not on this page · raw message

include/linux/mfd/da9055/pdata.h +24 -3
index 147293b..f87a6c1 100644
@@ -25,8 +25,29 @@ struct da9055_pdata {
 	int gpio_base;
 
 	struct regulator_init_data *regulators[DA9055_MAX_REGULATORS];
-	bool reset_enable;		/* Enable RTC in RESET Mode */
-	enum gpio_select *gpio_rsel;	/* Select regulator set thru GPIO 1/2 */
-	enum gpio_select *gpio_ren;	/* Enable regulator thru GPIO 1/2 */
+	/* Enable RTC in RESET Mode */
+	bool reset_enable;
+	/*
+	 * GPI muxed pin to control
+	 * regulator state A/B, 0 if not available.
+	 */
+	int *gpio_ren;
+	/*
+	 * GPI muxed pin to control
+	 * regulator set, 0 if not available.
+	 */
+	int *gpio_rsel;
+	/*
+	 * Regulator mode control bits value (GPI offset) that
+	 * that controls the regulator state, 0 if not available.
+	 */
+	enum gpio_select *reg_ren;
+	/*
+	 * Regulator mode control bits value (GPI offset) that
+	 * controls the regulator set A/B, 0 if  not available.
+	 */
+	enum gpio_select *reg_rsel;
+	/* GPIOs to enable regulator, 0 if not available */
+	int *ena_gpio;
 };
 #endif /* __DA9055_PDATA_H */
Signature · 1 line
1.7.0.4
Applied
#1 lore raw
Quoted 2 lines · Ashish Jangam

This is the Regulator patch for the DA9055 PMIC and has got dependency on the DA9055 MFD core.

Applied, thanks.