Skip to contentSkip to conversation

Add support for the TI TPS65086 PMIC

PATCH Superseded Andrew F. Davis 2 participants 11 messages Oct 30, 2015 – Nov 3, 2015

Subsystems (4)

v2 of 6 Superseded Latest is v6 →

lore
Share & tools
lore
#0 lore raw

v2 cover Add support for the TI TPS65086 PMIC

This series adds support for the TPS65086 PMIC. It is a MFD with an I2C interface, several regulators and load switches, and a GPO controller.

Based on v4.3-rc1 and needs b4fe8ba ("regmap: Add generic macro to define regmap_irq") from Lee Jones' tree to build.

v1 can be found here: [1]

Changes from v1:
- Split up DT Docs into separate patches
- Use mfd core to instantiate sub-devices
- Several small fixes as discussed in v1 thread

[1] http://www.spinics.net/lists/devicetree/msg98403.html

Andrew F. Davis (6):
Documentation: tps65086: Add DT bindings for the TPS65086 PMIC
Documentation: tps65086: Add DT bindings for the TPS65086 regulators
Documentation: tps65086: Add DT bindings for the TPS65086 GPO
controller
mfd: tps65086: Add driver for the TPS65086 PMIC
regulator: tps65086: Add regulator driver for the TPS65086 PMIC
gpio: tps65086: Add GPIO driver for the TPS65086 PMIC

 .../devicetree/bindings/gpio/gpio-tps65086.txt     |  16 ++
 Documentation/devicetree/bindings/mfd/tps65086.txt |  46 ++++
 .../bindings/regulator/tps65086-regulator.txt      |  35 +++
 drivers/gpio/Kconfig                               |   6 +
 drivers/gpio/Makefile                              |   1 +
 drivers/gpio/gpio-tps65086.c                       | 115 +++++++++
 drivers/mfd/Kconfig                                |  14 ++
 drivers/mfd/Makefile                               |   1 +
 drivers/mfd/tps65086.c                             | 157 +++++++++++++
 drivers/regulator/Kconfig                          |   7 +
 drivers/regulator/Makefile                         |   1 +
 drivers/regulator/tps65086-regulator.c             | 260 +++++++++++++++++++++
 include/linux/mfd/tps65086.h                       | 120 ++++++++++
 13 files changed, 779 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/gpio/gpio-tps65086.txt
 create mode 100644 Documentation/devicetree/bindings/mfd/tps65086.txt
 create mode 100644 Documentation/devicetree/bindings/regulator/tps65086-regulator.txt
 create mode 100644 drivers/gpio/gpio-tps65086.c
 create mode 100644 drivers/mfd/tps65086.c
 create mode 100644 drivers/regulator/tps65086-regulator.c
 create mode 100644 include/linux/mfd/tps65086.h
Signature · 1 line
1.9.1
#1 lore raw

PATCH v2 1/6 Documentation: tps65086: Add DT bindings for the TPS65086 PMIC

The TPS65086 PMIC contains several regulators and a GPO controller. Add bindings for the TPS65086 PMIC.

---
 Documentation/devicetree/bindings/mfd/tps65086.txt | 46 ++++++++++++++++++++++
 1 file changed, 46 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/mfd/tps65086.txt
Documentation/devicetree/bindings/mfd/tps65086.txt new file +46 -0
new file mode 100644
index 0000000..2fd5394
@@ -0,0 +1,46 @@
+* TPS65086 Power Management Integrated Circuit bindings
+
+Required properties:
+ - compatible		: Should be "ti,tps65086".
+ - reg			: I2C slave address.
+ - interrupt-parent	: Phandle to he parent interrupt controller.
+ - interrupts		: The interrupt line the device is connected to.
+ - interrupt-controller	: Marks the device node as an interrupt controller.
+ - #interrupt-cells	: The number of cells to describe an IRQ, this
+			    should be 2. The first cell is the IRQ number,
+			    the second cell is the flags, encoded as the trigger
+			    masks from <dt-bindings/interrupt-controller/irq.h>.
+
+Additional nodes defined in:
+ - Regulators	: ../regulator/tps65086-regulator.txt
+ - GPIO		: ../gpio/gpio-tps65086.txt
+
+Example:
+
+	pmic: tps65086@5e {
+		compatible = "ti,tps65086";
+		reg = <0x5e>;
+		interrupt-parent = <&gpio1>;
+		interrupts = <28 IRQ_TYPE_LEVEL_LOW>;
+		interrupt-controller;
+		#interrupt-cells = <2>;
+
+		regulators {
+			compatible = "ti,tps65086-regulator";
+
+			buck1 {
+				regulator-name = "vcc1";
+				regulator-min-microvolt = <1600000>;
+				regulator-max-microvolt = <1600000>;
+				regulator-boot-on;
+				ti,regulator-decay;
+				ti,regulator-step-size-25mv;
+			};
+		};
+
+		gpio4: gpio {
+			compatible = "ti,tps65086-gpio";
+			gpio-controller;
+			#gpio-cells = <2>;
+		};
+	};
Signature · 6 lines
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#2 lore raw

PATCH v2 2/6 Documentation: tps65086: Add DT bindings for the TPS65086 regulators

In reply to Andrew F. Davis

The TPS65086 PMIC contains several regulators and a GPO controller. Add bindings for the TPS65086 regulators.

---
 .../bindings/regulator/tps65086-regulator.txt      | 35 ++++++++++++++++++++++
 1 file changed, 35 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/regulator/tps65086-regulator.txt
Documentation/devicetree/bindings/regulator/tps65086-regulator.txt new file +35 -0
new file mode 100644
index 0000000..de7d2d6
@@ -0,0 +1,35 @@
+* TPS65086 regulator bindings
+
+Required properties:
+ - compatible		: Should be "ti,tps65086-regulator".
+ - list of regulators provided by this controller, must be named after their
+     hardware counterparts: buck[1-6], ldoa[1-3], swa1, swb[1-2], and vtt.
+
+Optional properties:
+ - Per-regulator optional properties are defined in regulator.txt.
+ - ti,regulator-step-size-25mv	: This is applicable for buck[1,2,6], set this
+				  if the regulator is factory set with a 25mv
+				  step voltage mapping.
+ - ti,regulator-decay		: This is applicable for buck[1-6], set this if
+				  the output needs to decay, default is for the
+				  output to slew down.
+
+Example:
+
+	regulators {
+		compatible = "ti,tps65086-regulator";
+
+		buck1 {
+			regulator-name = "vcc1";
+			regulator-min-microvolt = <1600000>;
+			regulator-max-microvolt = <1600000>;
+			regulator-boot-on;
+			ti,regulator-step-size-25mv;
+			ti,regulator-decay;
+		};
+
+		swa1 {
+			regulator-name = "ls1";
+			regulator-boot-on;
+		};
+	};
Signature · 1 line
1.9.1
#3 lore raw

PATCH v2 3/6 Documentation: tps65086: Add DT bindings for the TPS65086 GPO controller

In reply to Andrew F. Davis

The TPS65086 PMIC contains several regulators and a GPO controller. Add bindings for the TPS65086 GPO controller.

---
 Documentation/devicetree/bindings/gpio/gpio-tps65086.txt | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/gpio/gpio-tps65086.txt
Documentation/devicetree/bindings/gpio/gpio-tps65086.txt new file +16 -0
new file mode 100644
index 0000000..ba05107
@@ -0,0 +1,16 @@
+* TPS65086 GPO Controller bindings
+
+Required properties:
+ - compatible		: Should be "ti,tps65086-gpio".
+ - gpio-controller	: Marks the device node as a GPIO Controller.
+ - #gpio-cells		: Should be two. The first cell is the pin number
+			    and the second cell is used to specify flags.
+			    See ../gpio/gpio.txt for possible values.
+
+Example:
+
+	gpio4: gpio {
+		compatible = "ti,tps65086-gpio";
+		gpio-controller;
+		#gpio-cells = <2>;
+	};
Signature · 1 line
1.9.1
#4 lore raw

PATCH v2 4/6 mfd: tps65086: Add driver for the TPS65086 PMIC

In reply to Andrew F. Davis

Add support for the TPS65912 device. It provides communication through I2C and contains the following components:

- Regulators
- Load switches
- GPO controller

---
 drivers/mfd/Kconfig          |  14 ++++
 drivers/mfd/Makefile         |   1 +
 drivers/mfd/tps65086.c       | 157 +++++++++++++++++++++++++++++++++++++++++++
 include/linux/mfd/tps65086.h | 120 +++++++++++++++++++++++++++++++++
 4 files changed, 292 insertions(+)
 create mode 100644 drivers/mfd/tps65086.c
 create mode 100644 include/linux/mfd/tps65086.h
drivers/mfd/Kconfig +14 -0
index 99d6367..b46ee3b9 100644
@@ -1093,6 +1093,20 @@ config TPS6507X
 	  This driver can also be built as a module.  If so, the module
 	  will be called tps6507x.
 
+config MFD_TPS65086
+	tristate "TI TPS65086 Power Management Integrated Chips (PMICs)"
+	select REGMAP
+	select REGMAP_IRQ
+	select REGMAP_I2C
+	depends on I2C
+	depends on OF || COMPILE_TEST
+	help
+	  If you say yes here you get support for the TPS65086 series of
+	  Power Management chips.
+	  This driver provides common support for accessing the device,
+	  additional drivers must be enabled in order to use the
+	  functionality of the device.
+
 config TPS65911_COMPARATOR
 	tristate
 
drivers/mfd/Makefile +1 -0
index a59e3fc..7adb902 100644
@@ -66,6 +66,7 @@ obj-$(CONFIG_MFD_WM8994)	+= wm8994-core.o wm8994-irq.o wm8994-regmap.o
 obj-$(CONFIG_TPS6105X)		+= tps6105x.o
 obj-$(CONFIG_TPS65010)		+= tps65010.o
 obj-$(CONFIG_TPS6507X)		+= tps6507x.o
+obj-$(CONFIG_MFD_TPS65086)	+= tps65086.o
 obj-$(CONFIG_MFD_TPS65217)	+= tps65217.o
 obj-$(CONFIG_MFD_TPS65218)	+= tps65218.o
 obj-$(CONFIG_MFD_TPS65910)	+= tps65910.o
drivers/mfd/tps65086.c new file +157 -0

157 lines not on this page · raw message

include/linux/mfd/tps65086.h new file +120 -0

120 lines not on this page · raw message

Signature · 1 line
1.9.1
#5 lore raw

PATCH v2 5/6 regulator: tps65086: Add regulator driver for the TPS65086 PMIC

In reply to Andrew F. Davis

Add support for TPS65086 PMIC regulators.

The regulators set consists of 3 Step-down Controllers, 3 Step-down Converters, 3 LDOs, 3 Load Switches, and a Sink and Source LDO. The output voltages are configurable and are meant to supply power to a SoC and/or other components.

---
 drivers/regulator/Kconfig              |   7 +
 drivers/regulator/Makefile             |   1 +
 drivers/regulator/tps65086-regulator.c | 260 +++++++++++++++++++++++++++++++++
 3 files changed, 268 insertions(+)
 create mode 100644 drivers/regulator/tps65086-regulator.c
drivers/regulator/Kconfig +7 -0
index 64bccff..24237cf 100644
@@ -680,6 +680,13 @@ config REGULATOR_TPS6507X
 	  three step-down converters and two general-purpose LDO voltage regulators.
 	  It supports TI's software based Class-2 SmartReflex implementation.
 
+config REGULATOR_TPS65086
+	tristate "TI TPS65086 Power regulators"
+	depends on MFD_TPS65086
+	help
+	  This driver provides support for the voltage regulators on
+	  TI TPS65086 PMICs.
+
 config REGULATOR_TPS65090
 	tristate "TI TPS65090 Power regulator"
 	depends on MFD_TPS65090
drivers/regulator/Makefile +1 -0
index 0f81749..945d8ec 100644
@@ -85,6 +85,7 @@ obj-$(CONFIG_REGULATOR_TPS6105X) += tps6105x-regulator.o
 obj-$(CONFIG_REGULATOR_TPS62360) += tps62360-regulator.o
 obj-$(CONFIG_REGULATOR_TPS65023) += tps65023-regulator.o
 obj-$(CONFIG_REGULATOR_TPS6507X) += tps6507x-regulator.o
+obj-$(CONFIG_REGULATOR_TPS65086) += tps65086-regulator.o
 obj-$(CONFIG_REGULATOR_TPS65090) += tps65090-regulator.o
 obj-$(CONFIG_REGULATOR_TPS65217) += tps65217-regulator.o
 obj-$(CONFIG_REGULATOR_TPS65218) += tps65218-regulator.o
drivers/regulator/tps65086-regulator.c new file +260 -0

260 lines not on this page · raw message

Signature · 1 line
1.9.1
#10 lore raw

PATCH v2 6/6 gpio: tps65086: Add GPIO driver for the TPS65086 PMIC

In reply to Andrew F. Davis

Add support for the TPS65086 PMIC GPOs.

TPS65086 has four configurable GPOs that can be used for several purposes.

---
 drivers/gpio/Kconfig         |   6 +++
 drivers/gpio/Makefile        |   1 +
 drivers/gpio/gpio-tps65086.c | 115 +++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 122 insertions(+)
 create mode 100644 drivers/gpio/gpio-tps65086.c
drivers/gpio/Kconfig +6 -0
index b4fc9e4..ccb7e0d 100644
@@ -824,6 +824,12 @@ config GPIO_TIMBERDALE
 	---help---
 	Add support for the GPIO IP in the timberdale FPGA.
 
+config GPIO_TPS65086
+	tristate "TI TPS65086 GPO"
+	depends on MFD_TPS65086
+	help
+	  This driver supports the GPO on TI TPS65086x PMICs.
+
 config GPIO_TPS6586X
 	bool "TPS6586X GPIO"
 	depends on MFD_TPS6586X
drivers/gpio/Makefile +1 -0
index f79a7c4..2611c7e 100644
@@ -94,6 +94,7 @@ obj-$(CONFIG_GPIO_TC3589X)	+= gpio-tc3589x.o
 obj-$(CONFIG_ARCH_TEGRA)	+= gpio-tegra.o
 obj-$(CONFIG_GPIO_TIMBERDALE)	+= gpio-timberdale.o
 obj-$(CONFIG_GPIO_PALMAS)	+= gpio-palmas.o
+obj-$(CONFIG_GPIO_TPS65086)	+= gpio-tps65086.o
 obj-$(CONFIG_GPIO_TPS6586X)	+= gpio-tps6586x.o
 obj-$(CONFIG_GPIO_TPS65910)	+= gpio-tps65910.o
 obj-$(CONFIG_GPIO_TPS65912)	+= gpio-tps65912.o
drivers/gpio/gpio-tps65086.c new file +115 -0

115 lines not on this page · raw message

Signature · 1 line
1.9.1
maintainer
#6 lore raw

Re: [PATCH v2 5/6] regulator: tps65086: Add regulator driver for the TPS65086 PMIC

In reply to Andrew F. Davis

drivers/regulator/tps65086-regulator.c line 66

Quoted 4 lines · Andrew F. Davis
drivers/regulator/tps65086-regulator.c new file +4 -0
+struct tps65086_regulator {
+	struct regulator_desc desc;
+	unsigned int decay_reg;
+	unsigned int decay_mask;

The decay_reg and decay_mask fields appear to be entirely write only, why are they present?

drivers/regulator/tps65086-regulator.c line 205

Quoted 7 lines
drivers/regulator/tps65086-regulator.c new file +7 -0
+	ret = of_regulator_match(&pdev->dev, pdev->dev.of_node,
+				 tps65086_matches,
+				 ARRAY_SIZE(tps65086_matches));
+	if (ret < 0) {
+		dev_err(tps->dev, "Error parsing regulator init data\n");
+		return ret;
+	}

Please match regulators using the fields in the regulator_desc rather than open coding.

#7 lore raw

Re: [PATCH v2 5/6] regulator: tps65086: Add regulator driver for the TPS65086 PMIC

Quoted 10 lines · Mark Brown

drivers/regulator/tps65086-regulator.c line 66

Quoted 4 lines · Andrew F. Davis
drivers/regulator/tps65086-regulator.c new file +4 -0
+struct tps65086_regulator {
+	struct regulator_desc desc;
+	unsigned int decay_reg;
+	unsigned int decay_mask;

The decay_reg and decay_mask fields appear to be entirely write only, why are they present?

Not sure what you mean, they are written to differently for each regulator, and read when setting the decay mode in _probe.

Quoted 11 lines

drivers/regulator/tps65086-regulator.c line 205

Quoted 7 lines
drivers/regulator/tps65086-regulator.c new file +7 -0
+	ret = of_regulator_match(&pdev->dev, pdev->dev.of_node,
+				 tps65086_matches,
+				 ARRAY_SIZE(tps65086_matches));
+	if (ret < 0) {
+		dev_err(tps->dev, "Error parsing regulator init data\n");
+		return ret;
+	}

Please match regulators using the fields in the regulator_desc rather than open coding.

I need to match to get the driver specific information for each regulator, if I let regulator_register do it I never get a chance to process the match, unless there is a callback or something I'm missing.

maintainer
#8 lore raw

Re: [PATCH v2 5/6] regulator: tps65086: Add regulator driver for the TPS65086 PMIC

Quoted 10 lines · Andrew F. Davis
Quoted 8 lines · Mark Brown

drivers/regulator/tps65086-regulator.c line 66

Quoted 3 lines · Andrew F. Davis
drivers/regulator/tps65086-regulator.c new file +3 -0
+	struct regulator_desc desc;
+	unsigned int decay_reg;
+	unsigned int decay_mask;

The decay_reg and decay_mask fields appear to be entirely write only, why are they present?

Quoted 2 lines

Not sure what you mean, they are written to differently for each regulator, and read when setting the decay mode in _probe.

Ugh, that's a bit hidden (mostly due to not using the callback).

Quoted 11 lines
Quoted 10 lines

drivers/regulator/tps65086-regulator.c line 205

Quoted 7 lines
drivers/regulator/tps65086-regulator.c new file +7 -0
+	ret = of_regulator_match(&pdev->dev, pdev->dev.of_node,
+				 tps65086_matches,
+				 ARRAY_SIZE(tps65086_matches));
+	if (ret < 0) {
+		dev_err(tps->dev, "Error parsing regulator init data\n");
+		return ret;
+	}

Please match regulators using the fields in the regulator_desc rather than open coding.

Quoted 3 lines

I need to match to get the driver specific information for each regulator, if I let regulator_register do it I never get a chance to process the match, unless there is a callback or something I'm missing.

There's a callback you are missing, of_parse_cb().

#9 lore raw

Re: [PATCH v2 5/6] regulator: tps65086: Add regulator driver for the TPS65086 PMIC

Quoted 27 lines · Mark Brown
Quoted 10 lines · Andrew F. Davis
Quoted 8 lines · Mark Brown

drivers/regulator/tps65086-regulator.c line 66

Quoted 3 lines · Andrew F. Davis
drivers/regulator/tps65086-regulator.c new file +3 -0
+	struct regulator_desc desc;
+	unsigned int decay_reg;
+	unsigned int decay_mask;

The decay_reg and decay_mask fields appear to be entirely write only, why are they present?

Quoted 2 lines

Not sure what you mean, they are written to differently for each regulator, and read when setting the decay mode in _probe.

Ugh, that's a bit hidden (mostly due to not using the callback).

Quoted 10 lines
Quoted 10 lines

drivers/regulator/tps65086-regulator.c line 205

Quoted 7 lines
drivers/regulator/tps65086-regulator.c new file +7 -0
+	ret = of_regulator_match(&pdev->dev, pdev->dev.of_node,
+				 tps65086_matches,
+				 ARRAY_SIZE(tps65086_matches));
+	if (ret < 0) {
+		dev_err(tps->dev, "Error parsing regulator init data\n");
+		return ret;
+	}

Please match regulators using the fields in the regulator_desc rather than open coding.

Quoted 6 lines
Quoted 3 lines

I need to match to get the driver specific information for each regulator, if I let regulator_register do it I never get a chance to process the match, unless there is a callback or something I'm missing.

There's a callback you are missing, of_parse_cb().

Ah, that will make things easier, I'll re-spin with the callback.