Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

mfd: palmas: Assign the right powerhold mask for tps65917

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>

authored by

Keerthy and committed by
Lee Jones
572ff4d5 0a5d79bf

+12 -1
+9 -1
drivers/mfd/palmas.c
··· 430 430 { 431 431 unsigned int addr; 432 432 int ret, slave; 433 + u8 powerhold_mask; 433 434 struct device_node *np = palmas_dev->dev->of_node; 434 435 435 436 if (of_property_read_bool(np, "ti,palmas-override-powerhold")) { ··· 438 437 PALMAS_PRIMARY_SECONDARY_PAD2); 439 438 slave = PALMAS_BASE_TO_SLAVE(PALMAS_PU_PD_OD_BASE); 440 439 440 + if (of_device_is_compatible(np, "ti,tps65917")) 441 + powerhold_mask = 442 + TPS65917_PRIMARY_SECONDARY_PAD2_GPIO_5_MASK; 443 + else 444 + powerhold_mask = 445 + PALMAS_PRIMARY_SECONDARY_PAD2_GPIO_7_MASK; 446 + 441 447 ret = regmap_update_bits(palmas_dev->regmap[slave], addr, 442 - PALMAS_PRIMARY_SECONDARY_PAD2_GPIO_7_MASK, 0); 448 + powerhold_mask, 0); 443 449 if (ret) 444 450 dev_err(palmas_dev->dev, 445 451 "Unable to write PRIMARY_SECONDARY_PAD2 %d\n",
+3
include/linux/mfd/palmas.h
··· 3733 3733 #define TPS65917_REGEN3_CTRL_MODE_ACTIVE 0x01 3734 3734 #define TPS65917_REGEN3_CTRL_MODE_ACTIVE_SHIFT 0x00 3735 3735 3736 + /* POWERHOLD Mask field for PRIMARY_SECONDARY_PAD2 register */ 3737 + #define TPS65917_PRIMARY_SECONDARY_PAD2_GPIO_5_MASK 0xC 3738 + 3736 3739 /* Registers for function RESOURCE */ 3737 3740 #define TPS65917_REGEN1_CTRL 0x2 3738 3741 #define TPS65917_PLLEN_CTRL 0x3