summaryrefslogtreecommitdiff
path: root/drivers/power/reset/qcom-pon.c
diff options
context:
space:
mode:
authorKejia Hu <kejia.hu@codethink.co.uk>2020-04-28 08:04:37 +0100
committerSebastian Reichel <sre@kernel.org>2020-04-28 21:16:45 +0200
commitfc5be29f9b2cd9fc7243bf3c26ed042f2868fa8b (patch)
treeaaf2a728ab76206693341d7f4ad790249438f700 /drivers/power/reset/qcom-pon.c
parent164eaf6b435c31d98fdabe0151e979fa0b4280a0 (diff)
power: reset: qcom-pon: reg write mask depends on pon generation
Instead of hardcode the mask, it should be depends on which generation of pon it was. Signed-off-by: Kejia Hu <kejia.hu@codethink.co.uk> Fixes: fce5430f6a86 ("reset: qcom-pon: Add support for gen2 pon") Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Diffstat (limited to 'drivers/power/reset/qcom-pon.c')
-rw-r--r--drivers/power/reset/qcom-pon.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/power/reset/qcom-pon.c b/drivers/power/reset/qcom-pon.c
index 22a743a0bf28..4a688741a88a 100644
--- a/drivers/power/reset/qcom-pon.c
+++ b/drivers/power/reset/qcom-pon.c
@@ -34,7 +34,8 @@ static int pm8916_reboot_mode_write(struct reboot_mode_driver *reboot,
ret = regmap_update_bits(pon->regmap,
pon->baseaddr + PON_SOFT_RB_SPARE,
- 0xfc, magic << pon->reason_shift);
+ GENMASK(7, pon->reason_shift),
+ magic << pon->reason_shift);
if (ret < 0)
dev_err(pon->dev, "update reboot mode bits failed\n");