lkml.org 
[lkml]   [2015]   [Apr]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: [PATCH v2 4/5] mfd: arizona: Add better support for system suspend
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@opensource.wolfsonmicro.com>
> ---
> @@ -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


\
 
 \ /
  Last update: 2015-04-03 17:41    [W:0.068 / U:0.712 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site