From patchwork Tue Jun 24 23:54:52 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Douglas Anderson X-Patchwork-Id: 4414851 Return-Path: X-Original-To: patchwork-linux-samsung-soc@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 D4AC0BEEAA for ; Tue, 24 Jun 2014 23:55:01 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 029D32035D for ; Tue, 24 Jun 2014 23:55:01 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 108C0202D1 for ; Tue, 24 Jun 2014 23:55:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752949AbaFXXy7 (ORCPT ); Tue, 24 Jun 2014 19:54:59 -0400 Received: from mail-ie0-f201.google.com ([209.85.223.201]:63505 "EHLO mail-ie0-f201.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752256AbaFXXy6 (ORCPT ); Tue, 24 Jun 2014 19:54:58 -0400 Received: by mail-ie0-f201.google.com with SMTP id lx4so271430iec.4 for ; Tue, 24 Jun 2014 16:54:58 -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=EMEtQeIXaMOdxCpVbBGCVajAPZi0pWZxXg9b38Clu2A=; b=KNUOW2qRb8fpQgTg4C+ELeLHWY2ij+8i/bHJy9wHrpmGDJ+78dZy8a3ljuPnJrQZPA Q70CXK0s8FsACOkrRPshdIEHMOewsu38VpD+8ffLf2U10qQP4fcAHVTMpyuSTLWwHiUe Kb+f9uARSsrvjzGbpj21dnV+NhIExXvqYd2HVb3Hzk6oGlM0Bain14SMGrffz1NnJJ1P y3NdMr3yacLCk7pwUareqFYreLx4Ssbg88Nkr5WuZzavlM2+edJ0mM6xx9/Ju2AsKQIz daQcKd/gtqR+vIFs++obnjNHf+RfrDa+Jiiyrw9kC+Foblft/XcrVmdmVh45n7lBhjUR pVrA== X-Gm-Message-State: ALoCoQmTkAkRLe5t3vcgehC+WZjPcUOsEJioHC5TERNrvo//IzapVA6HCjAozff0pLDGt7YXYOwG X-Received: by 10.50.73.35 with SMTP id i3mr2758902igv.2.1403654097975; Tue, 24 Jun 2014 16:54:57 -0700 (PDT) Received: from corp2gmr1-1.hot.corp.google.com (corp2gmr1-1.hot.corp.google.com [172.24.189.92]) by gmr-mx.google.com with ESMTPS id y50si164412yhk.4.2014.06.24.16.54.57 for (version=TLSv1.1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 24 Jun 2014 16:54:57 -0700 (PDT) Received: from tictac.mtv.corp.google.com (tictac.mtv.corp.google.com [172.22.72.141]) by corp2gmr1-1.hot.corp.google.com (Postfix) with ESMTP id C83AA31C832; Tue, 24 Jun 2014 16:54:57 -0700 (PDT) Received: by tictac.mtv.corp.google.com (Postfix, from userid 121310) id 675C380914; Tue, 24 Jun 2014 16:54:57 -0700 (PDT) From: Doug Anderson To: Wolfram Sang , Kukjin Kim Cc: Tomasz Figa , javier.martinez@collabora.co.uk, ch.naveen@samsung.com, Doug Anderson , jg1.han@samsung.com, jdelvare@suse.de, sjg@google.com, paul.gortmaker@windriver.com, standby24x7@gmail.com, sachin.kamat@linaro.org, linux-i2c@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2] i2c: exynos5: Properly use the "noirq" variants of suspend/resume Date: Tue, 24 Jun 2014 16:54:52 -0700 Message-Id: <1403654093-24134-1-git-send-email-dianders@chromium.org> X-Mailer: git-send-email 2.0.0.526.g5318336 Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham 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 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..348b1cd 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); +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,