Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ada1de89 authored by Linus Walleij's avatar Linus Walleij Committed by Sebastian Reichel
Browse files

power: gemini-poweroff: Avoid more spurious poweroffs



Even after the previous fix I have experienced more spurious
poweroffs on the gemini SoC. After this fix it finally seems
to go away.

Fixes: f7a388d6 ("power: reset: Add a driver for the Gemini poweroff")
Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
Signed-off-by: default avatarSebastian Reichel <sebastian.reichel@collabora.co.uk>
parent 09bebb1a
Loading
Loading
Loading
Loading
+11 −1
Original line number Diff line number Diff line
@@ -130,7 +130,17 @@ static int gemini_poweroff_probe(struct platform_device *pdev)
	val |= GEMINI_CTRL_ENABLE;
	writel(val, gpw->base + GEMINI_PWC_CTRLREG);

	/* Now that the state machine is active, clear the IRQ */
	/* Clear the IRQ */
	val = readl(gpw->base + GEMINI_PWC_CTRLREG);
	val |= GEMINI_CTRL_IRQ_CLR;
	writel(val, gpw->base + GEMINI_PWC_CTRLREG);

	/* Wait for this to clear */
	val = readl(gpw->base + GEMINI_PWC_STATREG);
	while (val & 0x70U)
		val = readl(gpw->base + GEMINI_PWC_STATREG);

	/* Clear the IRQ again */
	val = readl(gpw->base + GEMINI_PWC_CTRLREG);
	val |= GEMINI_CTRL_IRQ_CLR;
	writel(val, gpw->base + GEMINI_PWC_CTRLREG);