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: 3663441 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 0CC799F1EE for ; Mon, 17 Feb 2014 15:23:07 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E7EED201DE for ; Mon, 17 Feb 2014 15:23:05 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 20EFE201F5 for ; Mon, 17 Feb 2014 15:23:04 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1WFQ12-0001JO-HG; Mon, 17 Feb 2014 15:21:53 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1WFQ0g-0001AH-LC; Mon, 17 Feb 2014 15:21:30 +0000 Received: from mail-la0-f50.google.com ([209.85.215.50]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1WFQ0Y-00017Y-FV for linux-arm-kernel@lists.infradead.org; Mon, 17 Feb 2014 15:21:24 +0000 Received: by mail-la0-f50.google.com with SMTP id ec20so11537833lab.9 for ; Mon, 17 Feb 2014 07:21:00 -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=beecIbeZWqWa64WU4WpjGr+EVHjVOiyssYsxzqmTzkXRED3yR/cn24LWkN6ytulSWT af0AH5WPnU5mpjt+CY2Lt49HFgUxxR7X+gAl0oUXSTGWSnLPKG5xFWkEtVVPMJ+cjwR7 U9d2cNXX9AQaqIDjOF9Vy3Jxuq9jM26cauN59cxC8xQ/vG96dmDULzi/QLTl+0hudngO Mj6WxZfOopfAV4557Lf0IIZSZQunXDibuH/Wsp29CuvJY9lqSI53CS7kGnB67WPmfKqL +KpRT+egpMwiDAcGuZo+OjGSeb9febw2K03Y8iwBVGErq7zC1KPQ/3H5rKeK2DdnDbcI dAMQ== X-Gm-Message-State: ALoCoQkU7o89EdzEUrSA2LlHsbxxqq6MRxRIcwXYAVMR7UVa2YPEK4Ad3uEUpvKO3uWvldaZlslB 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 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140217_102122_700458_95E5BCF4 X-CRM114-Status: GOOD ( 11.08 ) X-Spam-Score: -2.6 (--) Cc: Ulf Hansson , Mark Brown , Russell King , linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.8 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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)