Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1518690 > unrolled thread

[PATCH v2 0/5] mfd: palmas: add powerhold overriding during power off

Started byKeerthy <j-keerthy@ti.com>
First post2016-11-10 06:10 +0100
Last post2016-11-10 06:40 +0100
Articles 6 — 1 participant

Back to article view | Back to linux.kernel


Contents

  [PATCH v2 0/5] mfd: palmas: add powerhold overriding during power off Keerthy <j-keerthy@ti.com> - 2016-11-10 06:10 +0100
    [PATCH v2 2/5] mfd: palmas: Remove redundant check in palmas_power_off Keerthy <j-keerthy@ti.com> - 2016-11-10 06:10 +0100
    [PATCH v2 5/5] arm: dts: am57xx-idk-common: Add overide powerhold property Keerthy <j-keerthy@ti.com> - 2016-11-10 06:20 +0100
    [PATCH v2 4/5] arm: dts: am57xx-beagle-x15-common: Add overide powerhold property Keerthy <j-keerthy@ti.com> - 2016-11-10 06:20 +0100
    [PATCH v2 1/5] Documentation: pinctrl: palmas: Add ti,palmas-powerhold-override property definition Keerthy <j-keerthy@ti.com> - 2016-11-10 06:20 +0100
    [PATCH v2 3/5] mfd: palmas: Reset the POWERHOLD mux during power off Keerthy <j-keerthy@ti.com> - 2016-11-10 06:40 +0100

#1518690 — [PATCH v2 0/5] mfd: palmas: add powerhold overriding during power off

FromKeerthy <j-keerthy@ti.com>
Date2016-11-10 06:10 +0100
Subject[PATCH v2 0/5] mfd: palmas: add powerhold overriding during power off
Message-ID<sBPMB-13Z-5@gated-at.bofh.it>
The series lets one over powerhold for pmic.
The powerhold is used to keep the pmic power on even
after the DEV_CTRL On bit is set to off.

Tested on am572x-idk board, dra72-evm, dra7-evm for poweroff. 

Keerthy (5):
  Documentation: pinctrl: palmas: Add ti,palmas-powerhold-override
    property definition
  mfd: palmas: Remove redundant check in palmas_power_off
  mfd: palmas: Reset the POWERHOLD mux during power off
  arm: dts: am57xx-beagle-x15-common: Add overide powerhold property
  arm: dts: am57xx-idk-common: Add overide powerhold property

 .../devicetree/bindings/pinctrl/pinctrl-palmas.txt        |  9 +++++++++
 arch/arm/boot/dts/am57xx-beagle-x15-common.dtsi           |  1 +
 arch/arm/boot/dts/am57xx-idk-common.dtsi                  |  1 +
 drivers/mfd/palmas.c                                      | 15 +++++++++++++--
 4 files changed, 24 insertions(+), 2 deletions(-)

-- 
1.9.1

[toc] | [next] | [standalone]


#1518691 — [PATCH v2 2/5] mfd: palmas: Remove redundant check in palmas_power_off

FromKeerthy <j-keerthy@ti.com>
Date2016-11-10 06:10 +0100
Subject[PATCH v2 2/5] mfd: palmas: Remove redundant check in palmas_power_off
Message-ID<sBPMB-13Z-3@gated-at.bofh.it>
In reply to#1518690
palmas_dev and palmas_power_off are always assigned together.
So the check for palmas_dev inside palmas_power_off function
is redundant. Removing the same.

Signed-off-by: Keerthy <j-keerthy@ti.com>
---
 drivers/mfd/palmas.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/drivers/mfd/palmas.c b/drivers/mfd/palmas.c
index 8f8bacb..ee9e9ea 100644
--- a/drivers/mfd/palmas.c
+++ b/drivers/mfd/palmas.c
@@ -431,9 +431,6 @@ static void palmas_power_off(void)
 	unsigned int addr;
 	int ret, slave;
 
-	if (!palmas_dev)
-		return;
-
 	slave = PALMAS_BASE_TO_SLAVE(PALMAS_PMU_CONTROL_BASE);
 	addr = PALMAS_BASE_TO_REG(PALMAS_PMU_CONTROL_BASE, PALMAS_DEV_CTRL);
 
-- 
1.9.1

[toc] | [prev] | [next] | [standalone]


#1518693 — [PATCH v2 5/5] arm: dts: am57xx-idk-common: Add overide powerhold property

FromKeerthy <j-keerthy@ti.com>
Date2016-11-10 06:20 +0100
Subject[PATCH v2 5/5] arm: dts: am57xx-idk-common: Add overide powerhold property
Message-ID<sBPWi-17h-13@gated-at.bofh.it>
In reply to#1518690
The PMICs have POWERHOLD set by default which prevents PMIC shutdown
even on DEV_CTRL On bit set to 0 as the Powerhold has higher priority.
So to enable pmic power off this property lets one over ride the default
value and enable pmic power off.

Signed-off-by: Keerthy <j-keerthy@ti.com>
---
 arch/arm/boot/dts/am57xx-idk-common.dtsi | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm/boot/dts/am57xx-idk-common.dtsi b/arch/arm/boot/dts/am57xx-idk-common.dtsi
index 03cec62..6e7db63 100644
--- a/arch/arm/boot/dts/am57xx-idk-common.dtsi
+++ b/arch/arm/boot/dts/am57xx-idk-common.dtsi
@@ -57,6 +57,7 @@
 		#interrupt-cells = <2>;
 		interrupt-controller;
 		ti,system-power-controller;
+		ti,palmas-override-powerhold;
 
 		tps659038_pmic {
 			compatible = "ti,tps659038-pmic";
-- 
1.9.1

[toc] | [prev] | [next] | [standalone]


#1518694 — [PATCH v2 4/5] arm: dts: am57xx-beagle-x15-common: Add overide powerhold property

FromKeerthy <j-keerthy@ti.com>
Date2016-11-10 06:20 +0100
Subject[PATCH v2 4/5] arm: dts: am57xx-beagle-x15-common: Add overide powerhold property
Message-ID<sBPWi-17h-21@gated-at.bofh.it>
In reply to#1518690
The PMICs have POWERHOLD set by default which prevents PMIC shutdown
even on DEV_CTRL On bit set to 0 as the Powerhold has higher priority.
So to enable pmic power off this property lets one over ride the default
value and enable pmic power off.

Signed-off-by: Keerthy <j-keerthy@ti.com>
---
 arch/arm/boot/dts/am57xx-beagle-x15-common.dtsi | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm/boot/dts/am57xx-beagle-x15-common.dtsi b/arch/arm/boot/dts/am57xx-beagle-x15-common.dtsi
index 6df7829..78bee26 100644
--- a/arch/arm/boot/dts/am57xx-beagle-x15-common.dtsi
+++ b/arch/arm/boot/dts/am57xx-beagle-x15-common.dtsi
@@ -204,6 +204,7 @@
 		interrupt-controller;
 
 		ti,system-power-controller;
+		ti,palmas-override-powerhold;
 
 		tps659038_pmic {
 			compatible = "ti,tps659038-pmic";
-- 
1.9.1

[toc] | [prev] | [next] | [standalone]


#1518695 — [PATCH v2 1/5] Documentation: pinctrl: palmas: Add ti,palmas-powerhold-override property definition

FromKeerthy <j-keerthy@ti.com>
Date2016-11-10 06:20 +0100
Subject[PATCH v2 1/5] Documentation: pinctrl: palmas: Add ti,palmas-powerhold-override property definition
Message-ID<sBPWi-17h-11@gated-at.bofh.it>
In reply to#1518690
GPIO7 is configured in POWERHOLD mode which has higher priority
over DEV_ON bit and keeps the PMIC supplies on even after the DEV_ON
bit is turned off. This property enables driver to over ride the
POWERHOLD value to GPIO7 so as to turn off the PMIC in power off
scenarios.

Signed-off-by: Keerthy <j-keerthy@ti.com>
---
 Documentation/devicetree/bindings/pinctrl/pinctrl-palmas.txt | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/Documentation/devicetree/bindings/pinctrl/pinctrl-palmas.txt b/Documentation/devicetree/bindings/pinctrl/pinctrl-palmas.txt
index caf297b..c28d4eb8 100644
--- a/Documentation/devicetree/bindings/pinctrl/pinctrl-palmas.txt
+++ b/Documentation/devicetree/bindings/pinctrl/pinctrl-palmas.txt
@@ -35,6 +35,15 @@ Optional properties:
 - ti,palmas-enable-dvfs2: Enable DVFS2. Configure pins for DVFS2 mode.
 	Selection primary or secondary function associated to GPADC_START
 	and SYSEN2 pin/pad for DVFS2 interface
+- ti,palmas-override-powerhold: This is applicable for PMICs for which
+	GPIO7 is configured in POWERHOLD mode which has higher priority
+	over DEV_ON bit and keeps the PMIC supplies on even after the DEV_ON
+	bit is turned off. This property enables driver to over ride the
+	POWERHOLD value to GPIO7 so as to turn off the PMIC in power off
+	scenarios. So for GPIO7 if ti,palmas-override-powerhold is set
+	then the GPIO_7 field should never be muxed to anything else.
+	It should be set to POWERHOLD by default and only in case of
+	power off scenarios the driver will over ride the mux value.
 
 This binding uses the following generic properties as defined in
 pinctrl-bindings.txt:
-- 
1.9.1

[toc] | [prev] | [next] | [standalone]


#1518700 — [PATCH v2 3/5] mfd: palmas: Reset the POWERHOLD mux during power off

FromKeerthy <j-keerthy@ti.com>
Date2016-11-10 06:40 +0100
Subject[PATCH v2 3/5] mfd: palmas: Reset the POWERHOLD mux during power off
Message-ID<sBQfD-1gO-3@gated-at.bofh.it>
In reply to#1518690
POWERHOLD signal has higher priority  over the DEV_ON bit.
So power off will not happen if the POWERHOLD is held high.
Hence reset the MUX to GPIO_7 mode to release the POWERHOLD
and the DEV_ON bit to take effect to power off the PMIC.

PMIC Power off happens in dire situations like thermal shutdown
so irrespective of the POWERHOLD setting go ahead and turn off
the powerhold.  Currently poweroff is broken on boards that have
powerhold enabled. This fixes poweroff on those boards.

Signed-off-by: Keerthy <j-keerthy@ti.com>
---

Changes in v2:

  * Changed pr_err to dev_err
  * removed redundant boolean variable override-powerhold

 drivers/mfd/palmas.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/drivers/mfd/palmas.c b/drivers/mfd/palmas.c
index ee9e9ea..da90124 100644
--- a/drivers/mfd/palmas.c
+++ b/drivers/mfd/palmas.c
@@ -430,6 +430,20 @@ static void palmas_power_off(void)
 {
 	unsigned int addr;
 	int ret, slave;
+	struct device_node *np = palmas_dev->dev->of_node;
+
+	if (of_property_read_bool(np, "ti,palmas-override-powerhold")) {
+		addr = PALMAS_BASE_TO_REG(PALMAS_PU_PD_OD_BASE,
+					  PALMAS_PRIMARY_SECONDARY_PAD2);
+		slave = PALMAS_BASE_TO_SLAVE(PALMAS_PU_PD_OD_BASE);
+
+		ret = regmap_update_bits(palmas_dev->regmap[slave], addr,
+				PALMAS_PRIMARY_SECONDARY_PAD2_GPIO_7_MASK, 0);
+		if (ret)
+			dev_err(palmas_dev->dev,
+				"Unable to write PRIMARY_SECONDARY_PAD2 %d\n",
+				ret);
+	}
 
 	slave = PALMAS_BASE_TO_SLAVE(PALMAS_PMU_CONTROL_BASE);
 	addr = PALMAS_BASE_TO_REG(PALMAS_PMU_CONTROL_BASE, PALMAS_DEV_CTRL);
-- 
1.9.1

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web