From patchwork Mon Feb 17 15:20:53 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 321038 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 0C8072C00BE for ; Tue, 18 Feb 2014 02:21:00 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752214AbaBQPU7 (ORCPT ); Mon, 17 Feb 2014 10:20:59 -0500 Received: from mail-la0-f43.google.com ([209.85.215.43]:65122 "EHLO mail-la0-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752097AbaBQPU7 (ORCPT ); Mon, 17 Feb 2014 10:20:59 -0500 Received: by mail-la0-f43.google.com with SMTP id pv20so11295938lab.16 for ; Mon, 17 Feb 2014 07:20:57 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=bxaIGae2V2T+gSPZJ3mAYpU24QT75mB57L8DcjyAkGM=; b=czQ/UDdvGFd+8CtCckOPJ/AhPdOXTdeBYRGfwHi91gTR8N/jVThfARSExUhU6sr9fJ bNlZgpUgU8GuGvmLGnrgzURlNJyNZaYSqJnL34eHyzpCTm4m8ezAJLTLqU63Hlq5/t3N yE1Q/pbN7tQJ9mwK1EohiYXGUHSeDH6E0GWniK1oqg+BsU//+KTCBtsrFF/lZQTedFzZ Kk+RvmCxu8RBSiFW1VXGZdysatH5Isx/kZhp4Yxwic6FBiMbhxWDwv8WmFbdp5ObgKnd 5ocAfeH3HrrNoVUiOSB+17dXPnoZTYyru2SW91bY/CyMWYeY3jGahODzGGofUqlhlg34 gV6A== X-Gm-Message-State: ALoCoQk4l0TYz/UkCVGfa0mbRAL267UWpeMvN3rbSwsbPOV56K5qKwtqPNu6VFZJLVCEXfvds9kx X-Received: by 10.152.27.100 with SMTP id s4mr18281884lag.18.1392650457486; Mon, 17 Feb 2014 07:20:57 -0800 (PST) Received: from linaro-ulf.lan (90-231-160-185-no158.tbcn.telia.com. [90.231.160.185]) by mx.google.com with ESMTPSA id qx7sm19276114lbb.9.2014.02.17.07.20.55 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 17 Feb 2014 07:20:56 -0800 (PST) From: Ulf Hansson To: Alessandro Rubini , Linus Walleij , Wolfram Sang , linux-i2c@vger.kernel.org Cc: Russell King , linux-arm-kernel@lists.infradead.org, Mark Brown , Ulf Hansson Subject: [PATCH V3 15/17] i2c: nomadik: Convert to late and early system PM callbacks Date: Mon, 17 Feb 2014 16:20:53 +0100 Message-Id: <1392650453-14925-1-git-send-email-ulf.hansson@linaro.org> X-Mailer: git-send-email 1.7.9.5 Sender: linux-i2c-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-i2c@vger.kernel.org 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 3e08ba1..0a6d438 100644 --- a/drivers/i2c/busses/i2c-nomadik.c +++ b/drivers/i2c/busses/i2c-nomadik.c @@ -882,9 +882,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); @@ -897,7 +896,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); @@ -906,9 +905,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 @@ -946,14 +942,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)