From patchwork Tue Jun 24 23:56:54 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Doug Anderson X-Patchwork-Id: 4414931 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 19EC59F1D6 for ; Tue, 24 Jun 2014 23:59:40 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 3870D20379 for ; Tue, 24 Jun 2014 23:59:39 +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 A0761202E9 for ; Tue, 24 Jun 2014 23:59:37 +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 1WzaaZ-0004ux-66; Tue, 24 Jun 2014 23:57:23 +0000 Received: from mail-yh0-f73.google.com ([209.85.213.73]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1WzaaX-0004rn-3E for linux-arm-kernel@lists.infradead.org; Tue, 24 Jun 2014 23:57:21 +0000 Received: by mail-yh0-f73.google.com with SMTP id f10so109401yha.2 for ; Tue, 24 Jun 2014 16:56:57 -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=R9kVnk0PE6NPHe+k9QK8xLGT31yfhlkbSwBwRH/Wys4=; b=Irh/CIcqraTskIwhG2SqaExO9mTn03ujHTk84NU5XzJzbeoem7FZ44+8CY1v9HUiyn E1aLwA1+9me5QY4LDTeL9uAKoW/uWnAt2h6wHCiIUYEar4hOYn5GQjSgV9ZzObY15fLC xPxQe2cvNN1y/UamdGS6KUQzvmhHK/JEk6M2SvJjPbjtg4glOwK7IlYPXfrURxlD6GG0 j3JeV0P5JC1W0GR4yk5TZBgANxBdlTU70KpN6ARvsfv1aJiHrblBJyMRJ2ySPbZNKKb1 UTukBzsPRT6/0ceaoOORHh/C+grCia9eYX67X3OXc6CDHvVvHr8rH0Pqm5iRdfLrDbVJ CUQg== X-Gm-Message-State: ALoCoQl+9Lfmh0V0yN+/9nK0gdLk2NsIZ4mSf5LkndE1KX6mz9GWwufNZuHAHuZ21CHooLLE7AV7 X-Received: by 10.224.97.8 with SMTP id j8mr2325964qan.0.1403654217449; Tue, 24 Jun 2014 16:56: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 b39si166304yhj.0.2014.06.24.16.56.57 for (version=TLSv1.1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 24 Jun 2014 16:56: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 4E06431C2EC; Tue, 24 Jun 2014 16:56:57 -0700 (PDT) Received: by tictac.mtv.corp.google.com (Postfix, from userid 121310) id E25C780914; Tue, 24 Jun 2014 16:56:56 -0700 (PDT) From: Doug Anderson To: Wolfram Sang , Kukjin Kim , Ben Dooks Subject: [PATCH v2] i2c: s3c2410: resume the I2C controller earlier Date: Tue, 24 Jun 2014 16:56:54 -0700 Message-Id: <1403654214-25072-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-20140624_165721_208176_71CF0FAC X-CRM114-Status: GOOD ( 13.28 ) X-Spam-Score: -0.7 (/) Cc: linux-samsung-soc@vger.kernel.org, Vincent Palatin , linux-kernel@vger.kernel.org, Doug Anderson , Tomasz Figa , linux-i2c@vger.kernel.org, javier.martinez@collabora.co.uk, linux-arm-kernel@lists.infradead.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 From: Vincent Palatin When the wake-up is triggered by the PMIC RTC, the RTC driver is trying to read the PMIC interrupt status over I2C and fails because the I2C controller is not resumed yet. Let's resume the I2C controller earlier in the _noirq phase (as other hardwares are doing), so we can properly get the wake-up condition. Signed-off-by: Vincent Palatin Signed-off-by: Doug Anderson Reviewed-by: Javier Martinez Canillas Acked-by: Tomasz Figa --- Changes in v2: - Added missing freeze/thaw/poweroff/restore drivers/i2c/busses/i2c-s3c2410.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/i2c/busses/i2c-s3c2410.c b/drivers/i2c/busses/i2c-s3c2410.c index e828a1d..ecb389c 100644 --- a/drivers/i2c/busses/i2c-s3c2410.c +++ b/drivers/i2c/busses/i2c-s3c2410.c @@ -1267,7 +1267,7 @@ static int s3c24xx_i2c_suspend_noirq(struct device *dev) return 0; } -static int s3c24xx_i2c_resume(struct device *dev) +static int s3c24xx_i2c_resume_noirq(struct device *dev) { struct platform_device *pdev = to_platform_device(dev); struct s3c24xx_i2c *i2c = platform_get_drvdata(pdev); @@ -1285,7 +1285,11 @@ static int s3c24xx_i2c_resume(struct device *dev) static const struct dev_pm_ops s3c24xx_i2c_dev_pm_ops = { #ifdef CONFIG_PM_SLEEP .suspend_noirq = s3c24xx_i2c_suspend_noirq, - .resume = s3c24xx_i2c_resume, + .resume_noirq = s3c24xx_i2c_resume_noirq, + .freeze_noirq = s3c24xx_i2c_suspend_noirq, + .thaw_noirq = s3c24xx_i2c_resume_noirq, + .poweroff_noirq = s3c24xx_i2c_suspend_noirq, + .restore_noirq = s3c24xx_i2c_resume_noirq, #endif };