From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752819AbbDCPBg (ORCPT ); Fri, 3 Apr 2015 11:01:36 -0400 Received: from opensource.wolfsonmicro.com ([80.75.67.52]:46158 "EHLO opensource.wolfsonmicro.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752654AbbDCPBe (ORCPT ); Fri, 3 Apr 2015 11:01:34 -0400 Date: Fri, 3 Apr 2015 16:01:30 +0100 From: Charles Keepax To: lee.jones@linaro.org Cc: linux-kernel@vger.kernel.org, broonie@kernel.org, sameo@linux.intel.com, patches@opensource.wolfsonmicro.com Subject: Re: [PATCH v2 4/5] mfd: arizona: Add better support for system suspend Message-ID: <20150403150130.GD5442@opensource.wolfsonmicro.com> References: <1427216396-15517-1-git-send-email-ckeepax@opensource.wolfsonmicro.com> <1427216396-15517-5-git-send-email-ckeepax@opensource.wolfsonmicro.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1427216396-15517-5-git-send-email-ckeepax@opensource.wolfsonmicro.com> User-Agent: Mutt/1.5.17+20080114 (2008-01-14) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 > --- > @@ -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