From patchwork Thu Feb 13 14:09:05 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 24598 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-yh0-f70.google.com (mail-yh0-f70.google.com [209.85.213.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 6E4CD202E2 for ; Thu, 13 Feb 2014 14:09:21 +0000 (UTC) Received: by mail-yh0-f70.google.com with SMTP id c41sf24377998yho.1 for ; Thu, 13 Feb 2014 06:09:20 -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=f2L/Q3UztT7kI1BKgXAabynx4g1E5ccvvlGHHfEmil4=; b=LlIqDuaKf6LC5CzLzIjLoOYaQZ94+xIS+XPfOjuPEN+sDBuPFPQ3fScVNLqiS7BniA LGoRUpWNPAtnDIuGgHF1uWFAfL9Bd2+Qo1M9je/XiSoXwALSmSE4EJoPC5p9U2XZDMue 7UpM5Aekq2HhmG6+KUBP6qAwQ6JANwGClJZt0Nt3UFVinNjNnXh0NiuiVJo1G0uVTXB3 f9n1amReLPglAarNBWrfY5/p6iq3ZJrK/Ag94l3sp8BEox+hmbjsxWRtPgXB95wM4baY KttqD2eL69WeOZrIE7CllUg6Rr//5DKhQT8oc2rVDrTOFMg6JxsMRcEm62bhhtzALv0s fMQg== X-Gm-Message-State: ALoCoQlBgNDfeswc0125BDmkQjPB1nhfjAQToBoL3QxY2dRVRvz5zvTHeUW/mTys/6FRqfTP3HYL X-Received: by 10.58.187.6 with SMTP id fo6mr608412vec.34.1392300560560; Thu, 13 Feb 2014 06:09:20 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.48.38 with SMTP id n35ls3497751qga.68.gmail; Thu, 13 Feb 2014 06:09:20 -0800 (PST) X-Received: by 10.221.54.65 with SMTP id vt1mr179018vcb.46.1392300560447; Thu, 13 Feb 2014 06:09:20 -0800 (PST) Received: from mail-vc0-f169.google.com (mail-vc0-f169.google.com [209.85.220.169]) by mx.google.com with ESMTPS id zp2si677741vec.122.2014.02.13.06.09.20 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 13 Feb 2014 06:09:20 -0800 (PST) Received-SPF: neutral (google.com: 209.85.220.169 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.169; Received: by mail-vc0-f169.google.com with SMTP id hq11so8393127vcb.0 for ; Thu, 13 Feb 2014 06:09:20 -0800 (PST) X-Received: by 10.58.86.230 with SMTP id s6mr1120786vez.16.1392300560350; Thu, 13 Feb 2014 06:09:20 -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 u4csp28410vcz; Thu, 13 Feb 2014 06:09:19 -0800 (PST) X-Received: by 10.180.84.73 with SMTP id w9mr2765767wiy.58.1392300558714; Thu, 13 Feb 2014 06:09:18 -0800 (PST) Received: from mail-wi0-f176.google.com (mail-wi0-f176.google.com [209.85.212.176]) by mx.google.com with ESMTPS id l7si1270128wjz.113.2014.02.13.06.09.18 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 13 Feb 2014 06:09:18 -0800 (PST) Received-SPF: neutral (google.com: 209.85.212.176 is neither permitted nor denied by best guess record for domain of ulf.hansson@linaro.org) client-ip=209.85.212.176; Received: by mail-wi0-f176.google.com with SMTP id hi5so8646673wib.15 for ; Thu, 13 Feb 2014 06:09:18 -0800 (PST) X-Received: by 10.194.2.228 with SMTP id 4mr1076811wjx.83.1392300558104; Thu, 13 Feb 2014 06:09:18 -0800 (PST) Received: from localhost.localdomain ([85.235.11.236]) by mx.google.com with ESMTPSA id q15sm4823177wjw.18.2014.02.13.06.09.16 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 13 Feb 2014 06:09:17 -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 V2 15/17] i2c: nomadik: Convert to late and early system PM callbacks Date: Thu, 13 Feb 2014 15:09:05 +0100 Message-Id: <1392300547-23365-4-git-send-email-ulf.hansson@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1392300547-23365-1-git-send-email-ulf.hansson@linaro.org> References: <1392300547-23365-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.169 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 --- Changes in v2: Rebased on top of latest i2c-nomadik branch. --- 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 01b78df..80b0fd3 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)