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: 24777 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ie0-f199.google.com (mail-ie0-f199.google.com [209.85.223.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 2823420143 for ; Mon, 17 Feb 2014 15:21:00 +0000 (UTC) Received: by mail-ie0-f199.google.com with SMTP id rl12sf3590508iec.10 for ; Mon, 17 Feb 2014 07:20:59 -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:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-unsubscribe; bh=bxaIGae2V2T+gSPZJ3mAYpU24QT75mB57L8DcjyAkGM=; b=RzPmNangb2EHAZf6wjDCRNOrP2zxzP97WXx169DGEqBLreE54JZ2iLaHbw5sx5p2Sa LhJeljHDz8Fb2geW5LzLY4qIvUNHVkXLcyAsY/Ixwa5OredteMhJd3XGPF/BSoCXhbmW hgWsUACWkZwxmAXN0Nlt6PPcsCsuEeqS/abwr2w+M58jgrI8i5oKPN6yKOeV+qh/7eFS IhS/poVcCs53XFMdGI4nLDuI3BUm1JPitvXaj5b9QqBg3oaiYDhsPn6O/tGtGUIYTG9d 0XMijpRlIh3pXQbPCEVZUP9s9OmXznb68yaDT1FD3TgO/AYytuDduL89zIIOaBinGSVa P0Ew== X-Gm-Message-State: ALoCoQn9HBo33XTxIYYE0X9fZ7seUYIhyZvTfs/G+L/yDbsY5PqMCxG7dhn3/sK1gXCQ2GktheQx X-Received: by 10.42.107.67 with SMTP id c3mr9588946icp.0.1392650459319; Mon, 17 Feb 2014 07:20:59 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.31.72 with SMTP id e66ls938803qge.67.gmail; Mon, 17 Feb 2014 07:20:59 -0800 (PST) X-Received: by 10.52.164.39 with SMTP id yn7mr11394206vdb.25.1392650459208; Mon, 17 Feb 2014 07:20:59 -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 yx7si4539722vcb.50.2014.02.17.07.20.59 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 17 Feb 2014 07:20:59 -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 hq11so12132251vcb.0 for ; Mon, 17 Feb 2014 07:20:59 -0800 (PST) X-Received: by 10.220.225.71 with SMTP id ir7mr329375vcb.50.1392650459131; Mon, 17 Feb 2014 07:20:59 -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 u4csp146482vcz; Mon, 17 Feb 2014 07:20:58 -0800 (PST) X-Received: by 10.112.149.199 with SMTP id uc7mr1037914lbb.70.1392650458148; Mon, 17 Feb 2014 07:20:58 -0800 (PST) Received: from mail-la0-f53.google.com (mail-la0-f53.google.com [209.85.215.53]) by mx.google.com with ESMTPS id kv5si25688670lbc.51.2014.02.17.07.20.57 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 17 Feb 2014 07:20:58 -0800 (PST) Received-SPF: neutral (google.com: 209.85.215.53 is neither permitted nor denied by best guess record for domain of ulf.hansson@linaro.org) client-ip=209.85.215.53; Received: by mail-la0-f53.google.com with SMTP id e16so11188644lan.40 for ; Mon, 17 Feb 2014 07:20:57 -0800 (PST) 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 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 --- 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)