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: 4414871 Return-Path: X-Original-To: patchwork-linux-samsung-soc@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 6D2579F1D6 for ; Tue, 24 Jun 2014 23:57:01 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 8B6B4202E9 for ; Tue, 24 Jun 2014 23:57:00 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A499D20120 for ; Tue, 24 Jun 2014 23:56:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752853AbaFXX47 (ORCPT ); Tue, 24 Jun 2014 19:56:59 -0400 Received: from mail-yh0-f74.google.com ([209.85.213.74]:38411 "EHLO mail-yh0-f74.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752381AbaFXX46 (ORCPT ); Tue, 24 Jun 2014 19:56:58 -0400 Received: by mail-yh0-f74.google.com with SMTP id b6so109780yha.1 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=OkH2vtEVyF7fpCzItj+zYrkwhJr/HjsNqtd+Mf8KsaHdndh0cJLfXyCue37mN7xYSW R9crnKae9vE2W77QRfE0HOAdMZm3QgSinevfWC8aj7DwapnvQ3sB3CFU/elV85Rd3ilw xkV7x3sIx+f4niBNaVY0G3zhe8ikozFbuOQOYUBKCyFy0fP9bdk/vmyEl5q2iTILqTJy shqbHxKAVA+j37CDy4p7qPgyemlGU8zUSg1MUEXXr/mxRvspkVI4HyaSmJKXP2qeXaPZ lrNPFZtRdheKfERL/WiteWoUDLe6GUmFSHDqSBRYy2Gkw0UTTLwAEtq6oKoq2zpPOCLO FAfA== X-Gm-Message-State: ALoCoQk+Ss9jKgg04+EMdkJ8CdeZvKhUl5tcYwOufALPnR+5+nyo1AhCPf33kVMlckcsI2NKqhFJ 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 Cc: Tomasz Figa , javier.martinez@collabora.co.uk, Vincent Palatin , Doug Anderson , linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org 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 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 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 };