Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp269838ybg; Mon, 1 Jun 2020 00:27:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwHZX+qFmY49YrW33s70F6YesFo9LzToImcrrLGkSmzmRZ7zs9cFlDgUrEuJZ310Qz7nqqg X-Received: by 2002:a50:e1c5:: with SMTP id m5mr20574080edl.47.1590996442483; Mon, 01 Jun 2020 00:27:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590996442; cv=none; d=google.com; s=arc-20160816; b=ZVCv4jHBQ1obEU34TlMwv6cehNPpfl3BWzwCehJqh6ZnTZ+I008GGtN4B0/vOZF53K dlcFAwr9zcl3V8h2Vs2WDa0tocvXn4QyVFAMgsDtmVjgkTo8aRfPDJOv0vrEswXckQKF uP+UjXKGm4h6RrV69RdWESj8dCNq8n8655U/SPv9il9MOSRGqRq3/oxVqupOUTP5plsI 0/FgenRAieI6O34QKvecsnycalBdQ4c81aTMv6lW0BLdsJXkr85uhJTK1IwMDS4oYQ0N qn5z633xSrRFCQSou4ePT6ZOcOTv993nLpq912abT6KIa5Kh1HwUx05K49HyerftI+2i Eb2Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from; bh=PSZ70/u+bdkDkSYxrzngXYm+izh6kqBwkMDTfFe43Uw=; b=b0TcZUZLfuyhwLV/3qXhbRLl8NFeye+ygvAikQbBJAOlclS18lq6FimVZ8rJshPla4 J+OMwg4tLX45nplQKHUuJ3T+CNZ3AkunDTWGikEMI/EkZz0eJTfDcR9c6iY8diCCSIkF nciAGFFOhGklRS+7+tpuS/DHe5RuV12xJ3D++p1tumz3Up+d/jEM6Z4Bt48QaQdWkLo8 LH70BsnVpmhakLtLfg5cXF7Jr3Gwxq63o+ceAQquR1C4gjl1AWtoMgaRdeD9oiYhmdYs YZOLzIY0VbzN1n5Ic4MVIy3M2RnmxtNs+gz5DdZEwZj18Wjkk0FUbMhJT23yzda86ev1 kaZQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i25si10192856eja.118.2020.06.01.00.26.59; Mon, 01 Jun 2020 00:27:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728089AbgFAHYn (ORCPT + 99 others); Mon, 1 Jun 2020 03:24:43 -0400 Received: from inva020.nxp.com ([92.121.34.13]:34320 "EHLO inva020.nxp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725283AbgFAHYm (ORCPT ); Mon, 1 Jun 2020 03:24:42 -0400 Received: from inva020.nxp.com (localhost [127.0.0.1]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 8017C1A0677; Mon, 1 Jun 2020 09:24:40 +0200 (CEST) Received: from invc005.ap-rdc01.nxp.com (invc005.ap-rdc01.nxp.com [165.114.16.14]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id C0BCE1A0655; Mon, 1 Jun 2020 09:24:37 +0200 (CEST) Received: from localhost.localdomain (mega.ap.freescale.net [10.192.208.232]) by invc005.ap-rdc01.nxp.com (Postfix) with ESMTP id 630EA40280; Mon, 1 Jun 2020 15:24:34 +0800 (SGT) From: Ran Wang To: Alexandre Belloni , Alessandro Zummo , Li Biwen Cc: linux-rtc@vger.kernel.org, linux-kernel@vger.kernel.org, Ran Wang Subject: [PATCH v2] rtc: fsl-ftm-alarm: fix freeze(s2idle) failed to wake Date: Mon, 1 Jun 2020 15:19:14 +0800 Message-Id: <20200601071914.36444-1-ran.wang_1@nxp.com> X-Mailer: git-send-email 2.17.1 X-Virus-Scanned: ClamAV using ClamSMTP Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Use dev_pm_set_wake_irq() instead of flag IRQF_NO_SUSPEND to enable wakeup system feature for both freeze(s2idle) and mem(deep). Signed-off-by: Ran Wang --- Change in v2: - Remove wakeup-source control since the irq should be able to wakeup. And this is not the case that RTC interrupt line is not connected directly to SoC. drivers/rtc/rtc-fsl-ftm-alarm.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/rtc/rtc-fsl-ftm-alarm.c b/drivers/rtc/rtc-fsl-ftm-alarm.c index 756af62..6775205 100644 --- a/drivers/rtc/rtc-fsl-ftm-alarm.c +++ b/drivers/rtc/rtc-fsl-ftm-alarm.c @@ -21,6 +21,7 @@ #include #include #include +#include #define FTM_SC_CLK(c) ((c) << FTM_SC_CLK_MASK_SHIFT) @@ -274,7 +275,7 @@ static int ftm_rtc_probe(struct platform_device *pdev) } ret = devm_request_irq(&pdev->dev, irq, ftm_rtc_alarm_interrupt, - IRQF_NO_SUSPEND, dev_name(&pdev->dev), rtc); + 0, dev_name(&pdev->dev), rtc); if (ret < 0) { dev_err(&pdev->dev, "failed to request irq\n"); return ret; @@ -287,6 +288,9 @@ static int ftm_rtc_probe(struct platform_device *pdev) rtc->rtc_dev->ops = &ftm_rtc_ops; device_init_wakeup(&pdev->dev, true); + ret = dev_pm_set_wake_irq(&pdev->dev, irq); + if (ret) + dev_err(&pdev->dev, "failed to enable irq wake\n"); ret = rtc_register_device(rtc->rtc_dev); if (ret) { -- 2.7.4