* [PATCH 1/4] Documentation: pinctrl: palmas: Add ti,palmas-powerhold-override property definition
2016-10-27 9:10 [PATCH 0/4] mfd: palmas: add powerhold overriding during power off Keerthy
@ 2016-10-27 9:10 ` Keerthy
2016-11-09 16:10 ` Lee Jones
2016-10-27 9:10 ` [PATCH 2/4] mfd: palmas: Reset the POWERHOLD mux during power off Keerthy
` (2 subsequent siblings)
3 siblings, 1 reply; 9+ messages in thread
From: Keerthy @ 2016-10-27 9:10 UTC (permalink / raw)
To: tony, lee.jones, robh+dt
Cc: linux-omap, linux-kernel, devicetree, linux-gpio, nm, j-keerthy,
t-kristo
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
^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [PATCH 1/4] Documentation: pinctrl: palmas: Add ti,palmas-powerhold-override property definition
2016-10-27 9:10 ` [PATCH 1/4] Documentation: pinctrl: palmas: Add ti,palmas-powerhold-override property definition Keerthy
@ 2016-11-09 16:10 ` Lee Jones
2016-11-10 4:11 ` Keerthy
0 siblings, 1 reply; 9+ messages in thread
From: Lee Jones @ 2016-11-09 16:10 UTC (permalink / raw)
To: Keerthy
Cc: tony, robh+dt, linux-omap, linux-kernel, devicetree, linux-gpio,
nm, t-kristo
On Thu, 27 Oct 2016, Keerthy wrote:
> 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(+)
This requires a DT Ack.
> 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:
--
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 1/4] Documentation: pinctrl: palmas: Add ti,palmas-powerhold-override property definition
2016-11-09 16:10 ` Lee Jones
@ 2016-11-10 4:11 ` Keerthy
0 siblings, 0 replies; 9+ messages in thread
From: Keerthy @ 2016-11-10 4:11 UTC (permalink / raw)
To: Lee Jones
Cc: tony, robh+dt, linux-omap, linux-kernel, devicetree, linux-gpio,
nm, t-kristo
On Wednesday 09 November 2016 09:40 PM, Lee Jones wrote:
> On Thu, 27 Oct 2016, Keerthy wrote:
>
>> 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(+)
>
> This requires a DT Ack.
Okay.
>
>> 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:
>
^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH 2/4] mfd: palmas: Reset the POWERHOLD mux during power off
2016-10-27 9:10 [PATCH 0/4] mfd: palmas: add powerhold overriding during power off Keerthy
2016-10-27 9:10 ` [PATCH 1/4] Documentation: pinctrl: palmas: Add ti,palmas-powerhold-override property definition Keerthy
@ 2016-10-27 9:10 ` Keerthy
[not found] ` <1477559414-12520-3-git-send-email-j-keerthy-l0cyMroinI0@public.gmane.org>
2016-10-27 9:10 ` [PATCH 3/4] arm: dts: am57xx-beagle-x15-common: Add overide powerhold property Keerthy
[not found] ` <1477559414-12520-1-git-send-email-j-keerthy-l0cyMroinI0@public.gmane.org>
3 siblings, 1 reply; 9+ messages in thread
From: Keerthy @ 2016-10-27 9:10 UTC (permalink / raw)
To: tony, lee.jones, robh+dt
Cc: linux-omap, linux-kernel, devicetree, linux-gpio, nm, j-keerthy,
t-kristo
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>
---
drivers/mfd/palmas.c | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
diff --git a/drivers/mfd/palmas.c b/drivers/mfd/palmas.c
index 8f8bacb..8fbc5e0 100644
--- a/drivers/mfd/palmas.c
+++ b/drivers/mfd/palmas.c
@@ -430,10 +430,28 @@ static void palmas_power_off(void)
{
unsigned int addr;
int ret, slave;
+ struct device_node *node;
+ bool override_powerhold;
if (!palmas_dev)
return;
+ node = palmas_dev->dev->of_node;
+ override_powerhold = of_property_read_bool(node,
+ "ti,palmas-override-powerhold");
+
+ if (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)
+ pr_err("%s: Unable to write PALMAS_PRIMARY_SECONDARY_PAD2 %d\n",
+ __func__, 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
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH 3/4] arm: dts: am57xx-beagle-x15-common: Add overide powerhold property
2016-10-27 9:10 [PATCH 0/4] mfd: palmas: add powerhold overriding during power off Keerthy
2016-10-27 9:10 ` [PATCH 1/4] Documentation: pinctrl: palmas: Add ti,palmas-powerhold-override property definition Keerthy
2016-10-27 9:10 ` [PATCH 2/4] mfd: palmas: Reset the POWERHOLD mux during power off Keerthy
@ 2016-10-27 9:10 ` Keerthy
[not found] ` <1477559414-12520-1-git-send-email-j-keerthy-l0cyMroinI0@public.gmane.org>
3 siblings, 0 replies; 9+ messages in thread
From: Keerthy @ 2016-10-27 9:10 UTC (permalink / raw)
To: tony, lee.jones, robh+dt
Cc: linux-omap, linux-kernel, devicetree, linux-gpio, nm, j-keerthy,
t-kristo
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 6de163c..1b5e776 100644
--- a/arch/arm/boot/dts/am57xx-beagle-x15-common.dtsi
+++ b/arch/arm/boot/dts/am57xx-beagle-x15-common.dtsi
@@ -216,6 +216,7 @@
interrupt-controller;
ti,system-power-controller;
+ ti,palmas-override-powerhold;
tps659038_pmic {
compatible = "ti,tps659038-pmic";
--
1.9.1
^ permalink raw reply related [flat|nested] 9+ messages in thread
[parent not found: <1477559414-12520-1-git-send-email-j-keerthy-l0cyMroinI0@public.gmane.org>]
* [PATCH 4/4] arm: dts: am57xx-idk-common: Add overide powerhold property
[not found] ` <1477559414-12520-1-git-send-email-j-keerthy-l0cyMroinI0@public.gmane.org>
@ 2016-10-27 9:10 ` Keerthy
0 siblings, 0 replies; 9+ messages in thread
From: Keerthy @ 2016-10-27 9:10 UTC (permalink / raw)
To: tony-4v6yS6AI5VpBDgjK7y7TUQ, lee.jones-QSEj5FYQhm4dnm+yROfE0A,
robh+dt-DgEjT+Ai2ygdnm+yROfE0A
Cc: linux-omap-u79uwXL29TY76Z2rM5mHXA,
linux-kernel-u79uwXL29TY76Z2rM5mHXA,
devicetree-u79uwXL29TY76Z2rM5mHXA,
linux-gpio-u79uwXL29TY76Z2rM5mHXA, nm-l0cyMroinI0,
j-keerthy-l0cyMroinI0, t-kristo-l0cyMroinI0
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-l0cyMroinI0@public.gmane.org>
---
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 6d537cf..18297f3 100644
--- a/arch/arm/boot/dts/am57xx-idk-common.dtsi
+++ b/arch/arm/boot/dts/am57xx-idk-common.dtsi
@@ -200,6 +200,7 @@
#interrupt-cells = <2>;
interrupt-controller;
ti,system-power-controller;
+ ti,palmas-override-powerhold;
tps659038_pmic {
compatible = "ti,tps659038-pmic";
--
1.9.1
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related [flat|nested] 9+ messages in thread