From patchwork Wed Jun 25 16:39:20 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Doug Anderson X-Patchwork-Id: 4421891 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 42BC4BEEAA for ; Wed, 25 Jun 2014 16:42:24 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 6E12720304 for ; Wed, 25 Jun 2014 16:42:23 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (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 8FB9D201CD for ; Wed, 25 Jun 2014 16:42:22 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1WzqEo-0004KJ-1o; Wed, 25 Jun 2014 16:39:58 +0000 Received: from mail-pb0-f73.google.com ([209.85.160.73]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1WzqEj-0004H9-JI for linux-arm-kernel@lists.infradead.org; Wed, 25 Jun 2014 16:39:55 +0000 Received: by mail-pb0-f73.google.com with SMTP id ma3so292304pbc.4 for ; Wed, 25 Jun 2014 09:39:32 -0700 (PDT) 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=/FX/L/kEjG9ToyTZ2+aVV4+rqhlQA1GkhwfJI8VYG7k=; b=igTQ99CY21OTYLCiibwKTtU2o08PgM/+1oIwVx4aY6P7fUuO8lWYTAuG2LYa0Vbhhj Y/XTowthpOOkvr01wl6/jY9pYieeTyOr5ggQpUMfKtChaci2xx1en79XJnjaWQLC1Rh6 IV/JgV4hJPAepyXcp6OTewYmB2/E2kEVru5you8WNsC9ds2myEAf+yB1j0ih30z19H+t F/2ej2JV8Uwelg2jKZrEtbsqFypRqMSOgZvZ607ynafpSw4rDNO8j1/dRhITxJns9F9A qFBg0015YVVBMSMOCx4bXlYk8liMjRerGZbhuM2GK1o9IfXdnECvCRzfuVPR7IDM0u5x EwEA== X-Gm-Message-State: ALoCoQlazCQ4cAZ9hoZ0ACNsID32Fl7PKSQUyssvKLoKvxurBOgLNXJ0YIIrlL97u8Xuq8qiRFbD X-Received: by 10.68.135.200 with SMTP id pu8mr4854663pbb.9.1403714372665; Wed, 25 Jun 2014 09:39:32 -0700 (PDT) Received: from corp2gmr1-2.hot.corp.google.com (corp2gmr1-2.hot.corp.google.com [172.24.189.93]) by gmr-mx.google.com with ESMTPS id c50si333248yhl.7.2014.06.25.09.39.32 for (version=TLSv1.1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 25 Jun 2014 09:39:32 -0700 (PDT) Received: from tictac.mtv.corp.google.com (tictac.mtv.corp.google.com [172.22.72.141]) by corp2gmr1-2.hot.corp.google.com (Postfix) with ESMTP id 77BE45A4415; Wed, 25 Jun 2014 09:39:32 -0700 (PDT) Received: by tictac.mtv.corp.google.com (Postfix, from userid 121310) id 177038081F; Wed, 25 Jun 2014 09:39:31 -0700 (PDT) From: Doug Anderson To: Wolfram Sang , Kukjin Kim Subject: [PATCH v3] i2c: exynos5: Properly use the "noirq" variants of suspend/resume Date: Wed, 25 Jun 2014 09:39:20 -0700 Message-Id: <1403714360-7581-1-git-send-email-dianders@chromium.org> X-Mailer: git-send-email 2.0.0.526.g5318336 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140625_093953_661573_FDD21979 X-CRM114-Status: GOOD ( 13.23 ) X-Spam-Score: -0.7 (/) Cc: linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, sjg@google.com, linux-kernel@vger.kernel.org, jg1.han@samsung.com, Doug Anderson , Tomasz Figa , standby24x7@gmail.com, paul.gortmaker@windriver.com, linux-i2c@vger.kernel.org, ch.naveen@samsung.com, javier.martinez@collabora.co.uk, jdelvare@suse.de, sachin.kamat@linaro.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 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=-1.9 required=5.0 tests=BAYES_00, T_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 The original code for the exynos i2c controller registered for the "noirq" variants. However during review feedback it was moved to SIMPLE_DEV_PM_OPS without anyone noticing that it meant we were no longer actually "noirq" (despite functions named exynos5_i2c_suspend_noirq and exynos5_i2c_resume_noirq). i2c controllers that might have wakeup sources on them seem to need to resume at noirq time so that the individual drivers can actually read the i2c bus to handle their wakeup. NOTE: I took the original review feedback from Wolfram and added poweroff, thaw, freeze, restore. This patch has only been compile-tested since I don't have all the patches needed to make my machine using this i2c driver actually suspend/resume. Signed-off-by: Doug Anderson Acked-by: Kukjin Kim --- Changes in v3: - Made the structure static. Changes in v2: - Added missing CONFIG_PM_SLEEP drivers/i2c/busses/i2c-exynos5.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/drivers/i2c/busses/i2c-exynos5.c b/drivers/i2c/busses/i2c-exynos5.c index 63d2292..f9447a4 100644 --- a/drivers/i2c/busses/i2c-exynos5.c +++ b/drivers/i2c/busses/i2c-exynos5.c @@ -789,8 +789,16 @@ static int exynos5_i2c_resume_noirq(struct device *dev) } #endif -static SIMPLE_DEV_PM_OPS(exynos5_i2c_dev_pm_ops, exynos5_i2c_suspend_noirq, - exynos5_i2c_resume_noirq); +static const struct dev_pm_ops exynos5_i2c_dev_pm_ops = { +#ifdef CONFIG_PM_SLEEP + .suspend_noirq = exynos5_i2c_suspend_noirq, + .resume_noirq = exynos5_i2c_resume_noirq, + .freeze_noirq = exynos5_i2c_suspend_noirq, + .thaw_noirq = exynos5_i2c_resume_noirq, + .poweroff_noirq = exynos5_i2c_suspend_noirq, + .restore_noirq = exynos5_i2c_resume_noirq, +#endif +}; static struct platform_driver exynos5_i2c_driver = { .probe = exynos5_i2c_probe,