From patchwork Mon Sep 21 15:47:02 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sudeep Holla X-Patchwork-Id: 53971 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f200.google.com (mail-lb0-f200.google.com [209.85.217.200]) by patches.linaro.org (Postfix) with ESMTPS id 24A2922B04 for ; Mon, 21 Sep 2015 15:48:33 +0000 (UTC) Received: by lbcao8 with SMTP id ao8sf39763281lbc.1 for ; Mon, 21 Sep 2015 08:48:31 -0700 (PDT) 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:in-reply-to:references:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe; bh=38YAinJptmndA23O7QWGorlnxLsv0vkjvtMZ0DJhuEs=; b=AJYXJr9zOhDFGd7h5NSX+FInAwK0x1W2ObIf/UVGDjLYtF42mgnGtxsO6hSxpfZ7ur yNvU0qRwNC/5osZ8+J96tR5NB2dred72WgiO3km/f4mD/FZq5Ikq1Kt3Fnyab5KtpWh8 p0GLpeGMA1IoYJQwPfYbakkm/zyjq6vVq1+/b3hz+vwBdbBAX4h58zW6oUHqyUMl/3zA CbVYsUYp3Qizq+1tjGE91lpuaCCrN9lsVORbb77EhJZ1DJfKWCG1TPqCd0fla1lC/nBG 9De1jqDHXC6iWoyXW+jxRXtSFLqY9WDMXmFKJM92AOwef3acD/J+LFTivMpXCIAjlRIo g9Bg== X-Gm-Message-State: ALoCoQnw8zsI1mmTZKF2yrn7a1khTGR7WokOBZLwTpaQ+j55ieZT0NXQZ3TGtDwf7EFnGNINqEmG X-Received: by 10.112.63.165 with SMTP id h5mr3456595lbs.18.1442850511853; Mon, 21 Sep 2015 08:48:31 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.45.73 with SMTP id k9ls491422lam.19.gmail; Mon, 21 Sep 2015 08:48:31 -0700 (PDT) X-Received: by 10.112.184.137 with SMTP id eu9mr7793536lbc.21.1442850511674; Mon, 21 Sep 2015 08:48:31 -0700 (PDT) Received: from mail-la0-f48.google.com (mail-la0-f48.google.com. [209.85.215.48]) by mx.google.com with ESMTPS id z9si16406914lbu.161.2015.09.21.08.48.31 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 21 Sep 2015 08:48:31 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.48 as permitted sender) client-ip=209.85.215.48; Received: by lagj9 with SMTP id j9so71237034lag.2 for ; Mon, 21 Sep 2015 08:48:31 -0700 (PDT) X-Received: by 10.25.82.10 with SMTP id g10mr1562272lfb.56.1442850511415; Mon, 21 Sep 2015 08:48:31 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.59.35 with SMTP id w3csp1784218lbq; Mon, 21 Sep 2015 08:48:30 -0700 (PDT) X-Received: by 10.68.200.40 with SMTP id jp8mr26251305pbc.16.1442850507699; Mon, 21 Sep 2015 08:48:27 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id dd6si38668670pad.84.2015.09.21.08.48.24; Mon, 21 Sep 2015 08:48:27 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932724AbbIUPsR (ORCPT + 30 others); Mon, 21 Sep 2015 11:48:17 -0400 Received: from foss.arm.com ([217.140.101.70]:54018 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932476AbbIUPsN (ORCPT ); Mon, 21 Sep 2015 11:48:13 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id E7C7F53D; Mon, 21 Sep 2015 08:48:17 -0700 (PDT) Received: from e103737-lin.cambridge.arm.com (e103737-lin.cambridge.arm.com [10.1.207.150]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 2E3133F2E5; Mon, 21 Sep 2015 08:48:12 -0700 (PDT) From: Sudeep Holla To: linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Sudeep Holla , Thomas Gleixner , "Rafael J. Wysocki" , Alessandro Zummo , Alexandre Belloni , rtc-linux@googlegroups.com Subject: [PATCH 06/17] rtc: ds1343: remove misuse of IRQF_NO_SUSPEND flag Date: Mon, 21 Sep 2015 16:47:02 +0100 Message-Id: <1442850433-5903-7-git-send-email-sudeep.holla@arm.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1442850433-5903-1-git-send-email-sudeep.holla@arm.com> References: <1442850433-5903-1-git-send-email-sudeep.holla@arm.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: sudeep.holla@arm.com X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.48 as permitted sender) smtp.mailfrom=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , The IRQF_NO_SUSPEND flag is used to identify the interrupts that should be left enabled so as to allow them to work as expected during the suspend-resume cycle, but doesn't guarantee that it will wake the system from a suspended state, enable_irq_wake is recommended to be used for the wakeup. This patch removes the use of IRQF_NO_SUSPEND flags and uses newly introduce PM wakeup APIs dev_pm_{set,clear}_wake_irq. Cc: Alessandro Zummo Cc: Alexandre Belloni Cc: rtc-linux@googlegroups.com Signed-off-by: Sudeep Holla --- drivers/rtc/rtc-ds1343.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/drivers/rtc/rtc-ds1343.c b/drivers/rtc/rtc-ds1343.c index 79a06dd3c185..615ce5c370eb 100644 --- a/drivers/rtc/rtc-ds1343.c +++ b/drivers/rtc/rtc-ds1343.c @@ -21,6 +21,7 @@ #include #include #include +#include #include #define DS1343_DRV_VERSION "01.00" @@ -663,15 +664,15 @@ static int ds1343_probe(struct spi_device *spi) if (priv->irq >= 0) { res = devm_request_threaded_irq(&spi->dev, spi->irq, NULL, - ds1343_thread, - IRQF_NO_SUSPEND | IRQF_ONESHOT, + ds1343_thread, IRQF_ONESHOT, "ds1343", priv); if (res) { priv->irq = -1; dev_err(&spi->dev, "unable to request irq for rtc ds1343\n"); } else { - device_set_wakeup_capable(&spi->dev, 1); + device_init_wakeup(&spi->dev, true); + dev_pm_set_wake_irq(&spi->dev, spi->irq); } } @@ -692,6 +693,8 @@ static int ds1343_remove(struct spi_device *spi) priv->irqen &= ~RTC_AF; mutex_unlock(&priv->mutex); + dev_pm_clear_wake_irq(&spi->dev); + device_init_wakeup(&spi->dev, false); devm_free_irq(&spi->dev, spi->irq, priv); }