From patchwork Tue Feb 4 15:58:56 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 24122 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-yk0-f197.google.com (mail-yk0-f197.google.com [209.85.160.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 03B16202FA for ; Tue, 4 Feb 2014 16:00:01 +0000 (UTC) Received: by mail-yk0-f197.google.com with SMTP id 20sf52114082yks.0 for ; Tue, 04 Feb 2014 08:00:01 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe; bh=+mDnL/nT/CpaWoKox4c3Frm8Ds3V78ROeCrmNxjRYKo=; b=Zl1gOjeTg8nL8cGjwj1pp4lJgzdGu0mcPlOdqr2ctso+K9s1B8zpDlNMMf3usUJXZi R9ieBYP3bF4WywMpHxAAjps6UP/zYo+gXO/Q8i1kHSU5nNoV2hhAcSmN4Z+ewJES/djM 1/iFg6YJjAMF+E0bSU5IljxWjcGnvIHsLBFIC1idBnP4BGQXCol8kIoWANu8D2J9Eg1r 7Nc3o3S2ku32shDWspLSZiM+hVqmXxDuuIKzJzzk/Qn56HUvAasV+6KqGK5ZpuOwsXIs uJgzRKSliXsnLsr3NnQCleo22T4V3T9gBdoQFkdOFew4BQgpNEvOaPW6WMlGR/R/Sc6J LDag== X-Gm-Message-State: ALoCoQlhFQEfFkdOguSmFlmvvv2ugyxr64sZ1Pet5mc0Eh2TITMmFpa5EuUKjAvzvXUl8KqhEXbi X-Received: by 10.236.26.209 with SMTP id c57mr14348004yha.45.1391529600901; Tue, 04 Feb 2014 08:00:00 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.28.6 with SMTP id 6ls2291139qgy.16.gmail; Tue, 04 Feb 2014 08:00:00 -0800 (PST) X-Received: by 10.221.29.196 with SMTP id rz4mr18710469vcb.8.1391529600763; Tue, 04 Feb 2014 08:00:00 -0800 (PST) Received: from mail-vc0-f176.google.com (mail-vc0-f176.google.com [209.85.220.176]) by mx.google.com with ESMTPS id rx9si8337581vcb.138.2014.02.04.08.00.00 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 04 Feb 2014 08:00:00 -0800 (PST) Received-SPF: neutral (google.com: 209.85.220.176 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.220.176; Received: by mail-vc0-f176.google.com with SMTP id la4so5841383vcb.7 for ; Tue, 04 Feb 2014 08:00:00 -0800 (PST) X-Received: by 10.220.106.84 with SMTP id w20mr33505301vco.18.1391529600684; Tue, 04 Feb 2014 08:00:00 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.220.174.196 with SMTP id u4csp245399vcz; Tue, 4 Feb 2014 07:59:59 -0800 (PST) X-Received: by 10.112.27.176 with SMTP id u16mr179242lbg.81.1391529599150; Tue, 04 Feb 2014 07:59:59 -0800 (PST) Received: from mail-la0-f44.google.com (mail-la0-f44.google.com [209.85.215.44]) by mx.google.com with ESMTPS id 6si12959659laq.85.2014.02.04.07.59.58 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 04 Feb 2014 07:59:59 -0800 (PST) Received-SPF: neutral (google.com: 209.85.215.44 is neither permitted nor denied by best guess record for domain of ulf.hansson@linaro.org) client-ip=209.85.215.44; Received: by mail-la0-f44.google.com with SMTP id hr13so2998679lab.3 for ; Tue, 04 Feb 2014 07:59:58 -0800 (PST) X-Received: by 10.153.9.72 with SMTP id dq8mr1603501lad.60.1391529598464; Tue, 04 Feb 2014 07:59:58 -0800 (PST) Received: from localhost.localdomain (host-95-199-220-119.mobileonline.telia.com. [95.199.220.119]) by mx.google.com with ESMTPSA id dm8sm35906603lad.7.2014.02.04.07.59.55 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 04 Feb 2014 07:59:57 -0800 (PST) From: Ulf Hansson To: Russell King , linux-arm-kernel@lists.infradead.org Cc: Alessandro Rubini , Linus Walleij , Wolfram Sang , Chris Ball , Mark Brown , linux-kernel@vger.kernel.org, linux-i2c@vger.kernel.org, linux-spi@vger.kernel.org, linux-mmc@vger.kernel.org, Ulf Hansson Subject: [PATCH 15/17] i2c: nomadik: Convert to late and early system PM callbacks Date: Tue, 4 Feb 2014 16:58:56 +0100 Message-Id: <1391529538-21685-16-git-send-email-ulf.hansson@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1391529538-21685-1-git-send-email-ulf.hansson@linaro.org> References: <1391529538-21685-1-git-send-email-ulf.hansson@linaro.org> X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: ulf.hansson@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.176 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , At system suspend_late, runtime PM has been disabled by the PM core which means we can safely operate on these resources. Consequentially we no longer have to wait until the noirq phase of the system suspend. Cc: Alessandro Rubini Cc: Linus Walleij Cc: Wolfram Sang Signed-off-by: Ulf Hansson --- drivers/i2c/busses/i2c-nomadik.c | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/drivers/i2c/busses/i2c-nomadik.c b/drivers/i2c/busses/i2c-nomadik.c index 2d7dbc9..eda4f0d 100644 --- a/drivers/i2c/busses/i2c-nomadik.c +++ b/drivers/i2c/busses/i2c-nomadik.c @@ -890,9 +890,8 @@ static irqreturn_t i2c_irq_handler(int irq, void *arg) return IRQ_HANDLED; } - -#ifdef CONFIG_PM -static int nmk_i2c_suspend(struct device *dev) +#ifdef CONFIG_PM_SLEEP +static int nmk_i2c_suspend_late(struct device *dev) { struct amba_device *adev = to_amba_device(dev); struct nmk_i2c_dev *nmk_i2c = amba_get_drvdata(adev); @@ -905,7 +904,7 @@ static int nmk_i2c_suspend(struct device *dev) return 0; } -static int nmk_i2c_resume(struct device *dev) +static int nmk_i2c_resume_early(struct device *dev) { /* First go to the default state */ pinctrl_pm_select_default_state(dev); @@ -914,9 +913,6 @@ static int nmk_i2c_resume(struct device *dev) return 0; } -#else -#define nmk_i2c_suspend NULL -#define nmk_i2c_resume NULL #endif #if CONFIG_PM @@ -942,14 +938,8 @@ static int nmk_i2c_runtime_resume(struct device *dev) } #endif -/* - * We use noirq so that we suspend late and resume before the wakeup interrupt - * to ensure that we do the !pm_runtime_suspended() check in resume before - * there has been a regular pm runtime resume (via pm_runtime_get_sync()). - */ static const struct dev_pm_ops nmk_i2c_pm = { - .suspend_noirq = nmk_i2c_suspend, - .resume_noirq = nmk_i2c_resume, + SET_LATE_SYSTEM_SLEEP_PM_OPS(nmk_i2c_suspend_late, nmk_i2c_resume_early) SET_PM_RUNTIME_PM_OPS(nmk_i2c_runtime_suspend, nmk_i2c_runtime_resume, NULL)