Skip to contentSkip to conversation

Add support for the TI TPS65086 PMIC

PATCH Superseded Andrew F. Davis 3 participants 16 messages Nov 4, 2015 – Nov 30, 2015

Subsystems (4)

v3 of 6 Superseded Latest is v6 →

lore
Share & tools
lore
#0 lore raw

v3 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] v2: [2]

Changes from v2:
- Use DT match callback in regulator
- Typo fixes

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
[2] http://www.spinics.net/lists/kernel/msg2111345.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             | 250 +++++++++++++++++++++
 include/linux/mfd/tps65086.h                       | 120 ++++++++++
 13 files changed, 769 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 v3 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 · 1 line
1.9.1
#3 lore raw

PATCH v3 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
#5 lore raw

PATCH v3 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 · 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
#8 lore raw

PATCH v3 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
#9 lore raw

PATCH v3 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 | 250 +++++++++++++++++++++++++++++++++
 3 files changed, 258 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 +250 -0

250 lines not on this page · raw message

Signature · 1 line
1.9.1
#10 lore raw

PATCH v3 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 Acked-by on v3 2/6
#4 lore raw

Re: [PATCH v3 2/6] Documentation: tps65086: Add DT bindings for the TPS65086 regulators

In reply to Andrew F. Davis
Quoted 4 lines · Andrew F. Davis

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

Quoted 49 lines
---
 .../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
maintainer Acked-by on v3 1/6
#2 lore raw

Re: [PATCH v3 1/6] Documentation: tps65086: Add DT bindings for the TPS65086 PMIC

In reply to Andrew F. Davis
Quoted 4 lines · Andrew F. Davis

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

Quoted 60 lines
---
 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 · 1 line
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

maintainer Acked-by on v3 3/6
#6 lore raw

Re: [PATCH v3 3/6] Documentation: tps65086: Add DT bindings for the TPS65086 GPO controller

In reply to Andrew F. Davis
Quoted 4 lines · Andrew F. Davis

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

Quoted 30 lines
---
 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
#7 lore raw

Re: [PATCH v3 3/6] Documentation: tps65086: Add DT bindings for the TPS65086 GPO controller

In reply to Andrew F. Davis
Quoted 4 lines · Andrew F. Davis

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

Patch applied to the GPIO tree with Rob's ACK.

Yours,
Linus Walleij
--
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

#11 lore raw

Re: [PATCH v3 6/6] gpio: tps65086: Add GPIO driver for the TPS65086 PMIC

In reply to Andrew F. Davis
Quoted 6 lines · Andrew F. Davis

Add support for the TPS65086 PMIC GPOs.

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

OK...

drivers/gpio/gpio-tps65086.c line 47

Quoted 2 lines
drivers/gpio/gpio-tps65086.c new file +2 -0
+static int tps65086_gpio_get(struct gpio_chip *gc, unsigned offset)
+static void tps65086_gpio_set(struct gpio_chip *gc, unsigned offset,

Just get/set and no get_direction/direction_input/direction_output? Are you sure?

Yours,
Linus Walleij
--
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

#12 lore raw

Re: [PATCH v3 6/6] gpio: tps65086: Add GPIO driver for the TPS65086 PMIC

Quoted 9 lines · Linus Walleij
Quoted 6 lines · Andrew F. Davis

Add support for the TPS65086 PMIC GPOs.

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

Quoted 8 lines

OK...

drivers/gpio/gpio-tps65086.c line 47

Quoted 2 lines
drivers/gpio/gpio-tps65086.c new file +2 -0
+static int tps65086_gpio_get(struct gpio_chip *gc, unsigned offset)
+static void tps65086_gpio_set(struct gpio_chip *gc, unsigned offset,

Just get/set and no get_direction/direction_input/direction_output? Are you sure?

Yeah, these are output only, I could probably add get_direction and just always return output, but setters wouldn't make sense here.

Andrew

Quoted 3 lines

Yours,
Linus Walleij

#13 lore raw

Re: [PATCH v3 6/6] gpio: tps65086: Add GPIO driver for the TPS65086 PMIC

Quoted 22 lines · Andrew F. Davis
Quoted 11 lines · Linus Walleij
Quoted 6 lines · Andrew F. Davis

Add support for the TPS65086 PMIC GPOs.

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

Quoted 9 lines

OK...

drivers/gpio/gpio-tps65086.c line 47

Quoted 2 lines
drivers/gpio/gpio-tps65086.c new file +2 -0
+static int tps65086_gpio_get(struct gpio_chip *gc, unsigned offset)
+static void tps65086_gpio_set(struct gpio_chip *gc, unsigned offset,

Just get/set and no get_direction/direction_input/direction_output? Are you sure?

Quoted 2 lines

Yeah, these are output only, I could probably add get_direction and just always return output, but setters wouldn't make sense here.

It's important that you note in the driver, commit blurb and maybe even Kconfig that these GPIOs are output-only. Someone could get confused.

You should implement .direction_output() and return 0, and implement .direction_input and return negative error code. As it is now, it will seem like input is working, while it's not, right?

Yours,
Linus Walleij

#14 lore raw

Re: [PATCH v3 6/6] gpio: tps65086: Add GPIO driver for the TPS65086 PMIC

Quoted 29 lines · Linus Walleij
Quoted 22 lines · Andrew F. Davis
Quoted 11 lines · Linus Walleij
Quoted 6 lines · Andrew F. Davis

Add support for the TPS65086 PMIC GPOs.

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

Quoted 9 lines

OK...

drivers/gpio/gpio-tps65086.c line 47

Quoted 2 lines
drivers/gpio/gpio-tps65086.c new file +2 -0
+static int tps65086_gpio_get(struct gpio_chip *gc, unsigned offset)
+static void tps65086_gpio_set(struct gpio_chip *gc, unsigned offset,

Just get/set and no get_direction/direction_input/direction_output? Are you sure?

Quoted 2 lines

Yeah, these are output only, I could probably add get_direction and just always return output, but setters wouldn't make sense here.

It's important that you note in the driver, commit blurb and maybe even Kconfig that these GPIOs are output-only. Someone could get confused.

Quoted 7 lines

You should implement .direction_output() and return 0, and implement .direction_input and return negative error code. As it is now, it will seem like input is working, while it's not, right?

Yours,
Linus Walleij

Right, will add.

Also I would hold off on taking the GPIO bindings just yet. Mark Brown has stated he would like the compatible string removed from the regulator sub-node before he takes the regulator components, so for consistency sake I am also removing the string from GPIO as well. With this, it is difficult to have the sub-node still be a GPIO controller.

( gpiochip->of_node vs gpiochip->dev->of_node gpiolib.c:694 etc.. )

So the main pmic node will also be the GPIO controller node.

pmic: tps65912@2d {
	compatible = "ti,tps65912";
	reg = <0x2d>;

	interrupt-parent = <&gpio1>;
	interrupts = <28 8>;

	interrupt-controller;
	#interrupt-cells = <2>;

	gpio-controller;
	#gpio-cells = <2>;
};
#15 lore raw

Re: [PATCH v3 6/6] gpio: tps65086: Add GPIO driver for the TPS65086 PMIC

In reply to Andrew F. Davis
Quoted 6 lines · Andrew F. Davis

Add support for the TPS65086 PMIC GPOs.

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

(...)

drivers/gpio/gpio-tps65086.c line 76

Quoted 2 lines
drivers/gpio/gpio-tps65086.c new file +2 -0
+       gpio->tps = dev_get_drvdata(pdev->dev.parent);
+       gpio->gpio_chip = template_chip;

No gpio->gpio_chip.parent = &pdev->dev?

Yours,
Linus Walleij