Skip to content

Commit c9d6765

Browse files
Keerthyjgregkh
authored andcommitted
mfd: palmas: Reset the POWERHOLD mux during power off
[ Upstream commit 85fdaf8eb9bbec1f0f8a52fd5d85659d60738816 ] 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 <[email protected]> Signed-off-by: Lee Jones <[email protected]> Signed-off-by: Sasha Levin <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 354ae15 commit c9d6765

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

drivers/mfd/palmas.c

+14
Original file line numberDiff line numberDiff line change
@@ -430,6 +430,20 @@ static void palmas_power_off(void)
430430
{
431431
unsigned int addr;
432432
int ret, slave;
433+
struct device_node *np = palmas_dev->dev->of_node;
434+
435+
if (of_property_read_bool(np, "ti,palmas-override-powerhold")) {
436+
addr = PALMAS_BASE_TO_REG(PALMAS_PU_PD_OD_BASE,
437+
PALMAS_PRIMARY_SECONDARY_PAD2);
438+
slave = PALMAS_BASE_TO_SLAVE(PALMAS_PU_PD_OD_BASE);
439+
440+
ret = regmap_update_bits(palmas_dev->regmap[slave], addr,
441+
PALMAS_PRIMARY_SECONDARY_PAD2_GPIO_7_MASK, 0);
442+
if (ret)
443+
dev_err(palmas_dev->dev,
444+
"Unable to write PRIMARY_SECONDARY_PAD2 %d\n",
445+
ret);
446+
}
433447

434448
if (!palmas_dev)
435449
return;

0 commit comments

Comments
 (0)