Re: [PATCH v2 4/5] mfd: arizona: Add better support for system suspend

From: Charles Keepax
Date: Fri Apr 03 2015 - 11:01:45 EST


On Tue, Mar 24, 2015 at 04:59:55PM +0000, Charles Keepax wrote:
> Allow the chip to completely power off if we enter runtime suspend and
> there is no jack detection active. This is helpful for systems where
> system suspend might remove the supplies to the CODEC, without informing
> us. Note the powering off is done in runtime suspend rather than system
> suspend, because we need to hold reset until the first time DCVDD is
> powered anyway (which would be in runtime resume), and we might as well
> save the extra power.
>
> Signed-off-by: Charles Keepax <ckeepax@xxxxxxxxxxxxxxxxxxxxxxxxxxx>
> ---
> @@ -581,6 +616,18 @@ static int arizona_runtime_suspend(struct device *dev)
> regcache_mark_dirty(arizona->regmap);
> regulator_disable(arizona->dcvdd);
>
> + /* Allow us to completely power down if no jack detection */
> + if (!(val & ARIZONA_JD1_ENA)) {
> + dev_dbg(arizona->dev, "Fully powering off\n");
> +
> + arizona->has_fully_powered_off = true;
> +
> + arizona_enable_reset(arizona);
> +
> + regulator_bulk_disable(arizona->num_core_supplies,
> + arizona->core_supplies);
> + }
> +

Turns out we will need to disable the IRQ across this as well, we
lose control of it once we put the chip into reset. So depending
on pulls etc. we might get pulled straight out of suspend again
if we leave the IRQ enabled.

I will send a new series shortly.

Thanks,
Charles
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/