diff options
author | Keerthy <j-keerthy@ti.com> | 2019-09-05 10:17:46 -0600 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-11-12 19:18:19 +0100 |
commit | 1863e7fef65ca61bf10f8fccebc2f123bd5f10f9 (patch) | |
tree | 2eeeb165c1610580aa48eab699e2cbbfc7605a29 /drivers/mfd | |
parent | c813b4467a2291d14dd9c90f9542ad55eb1ec315 (diff) | |
download | linux-stable-1863e7fef65ca61bf10f8fccebc2f123bd5f10f9.tar.gz linux-stable-1863e7fef65ca61bf10f8fccebc2f123bd5f10f9.tar.bz2 linux-stable-1863e7fef65ca61bf10f8fccebc2f123bd5f10f9.zip |
mfd: palmas: Assign the right powerhold mask for tps65917
commit 572ff4d560be3784205b224cd67d6715620092d7 upstream
The powerhold mask for TPS65917 is different when comapred to
the other palmas versions. Hence assign the right mask that enables
power off of tps65917 pmic correctly.
Signed-off-by: Keerthy <j-keerthy@ti.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/mfd')
-rw-r--r-- | drivers/mfd/palmas.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/drivers/mfd/palmas.c b/drivers/mfd/palmas.c index 3922a93f9f92..663a2398b6b1 100644 --- a/drivers/mfd/palmas.c +++ b/drivers/mfd/palmas.c @@ -430,6 +430,7 @@ static void palmas_power_off(void) { unsigned int addr; int ret, slave; + u8 powerhold_mask; struct device_node *np = palmas_dev->dev->of_node; if (of_property_read_bool(np, "ti,palmas-override-powerhold")) { @@ -437,8 +438,15 @@ static void palmas_power_off(void) PALMAS_PRIMARY_SECONDARY_PAD2); slave = PALMAS_BASE_TO_SLAVE(PALMAS_PU_PD_OD_BASE); + if (of_device_is_compatible(np, "ti,tps65917")) + powerhold_mask = + TPS65917_PRIMARY_SECONDARY_PAD2_GPIO_5_MASK; + else + powerhold_mask = + PALMAS_PRIMARY_SECONDARY_PAD2_GPIO_7_MASK; + ret = regmap_update_bits(palmas_dev->regmap[slave], addr, - PALMAS_PRIMARY_SECONDARY_PAD2_GPIO_7_MASK, 0); + powerhold_mask, 0); if (ret) dev_err(palmas_dev->dev, "Unable to write PRIMARY_SECONDARY_PAD2 %d\n", |