From patchwork Mon Jul 17 19:09:37 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Samuel Holland X-Patchwork-Id: 121568 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:c923:0:b0:3e4:2afc:c1 with SMTP id j3csp1311912vqt; Mon, 17 Jul 2023 12:50:07 -0700 (PDT) X-Google-Smtp-Source: APBJJlEiEdwg78ChBU908JQgK5C+sySDeQ2zx9D9W+skNy+WIN/Gb4w1IY/WbtRoqFLIYD8/ZrTL X-Received: by 2002:a17:907:1c9a:b0:991:f0dc:c930 with SMTP id nb26-20020a1709071c9a00b00991f0dcc930mr11686652ejc.16.1689623406874; Mon, 17 Jul 2023 12:50:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689623406; cv=none; d=google.com; s=arc-20160816; b=LrgqxYlXrSyShtArnQLFeJNGmdSHSHZJiS6UzGUUJ5CXcw3Dd+7G5fxEIS+RPN8XH7 fi/+bHJ47FwobUmgA8A0ExgfqCfCqUUBUfOMG1Dq3n1DT2wAdhLRUvPVdj/hsA42jQV9 c4u4ilFNgT0ePdqSm5eDcw97v37aagCbecthZ6w5ZsOeBK6hUQquEyTMsmEiJZ5JxA/S EFkdF88OX8XPBszUMZ67U5R/EmCB/oXuYID3TOLA2XAUdLVjtgoVrMe85oWenOTgr0AM SFqXJ7nFe4iRwshB8erfAqwKiPsOfkqpy3WULAwnlN1D7WF97LC3Gok4QQow25nyEyQ2 3AFQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=r6uasRoxo3I6LINUODhPvTsghfLDKOJtY1t6sJi/dUE=; fh=KaDEzVRP+zBFSuPT8OhPZhfQqkfbpMIUdVWnFX7D4JA=; b=bEtyIoSzfvvLTe5D8k2EadjY/KhMV+mclXGgHO9in6xp2DOavG13lnLjLxmq+2TDam qbGPCO2obNY7Df/2r/uKqpixZ56Ht12y0JqEfRW0u6Gh5noFMzgN+HrX/IQZ7rpyWY1l 7nzpBPmYIhTJE/YcNAk2eiLqMDi33VnUG5jQkONad3qcSA0ra2bUWro16u6RZMu+stb7 OWRD8sB2oyTr3l7DIxmJlKkLnga1Nkabg5rfgBAzeo03VqWoVulW8uW7/vUumStK7XUI XuBrMP1CJ2atJx3pM/b8jQ6sqrVO7PLCa0kmI1vM/okg0ZVCuyxM/s7gB6LQLsw/o9YQ t9fQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sifive.com header.s=google header.b=acUhxK3V; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=sifive.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id lr4-20020a170906fb8400b009936735754dsi64461ejb.897.2023.07.17.12.49.42; Mon, 17 Jul 2023 12:50:06 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@sifive.com header.s=google header.b=acUhxK3V; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=sifive.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229823AbjGQTJp (ORCPT + 99 others); Mon, 17 Jul 2023 15:09:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52638 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229968AbjGQTJn (ORCPT ); Mon, 17 Jul 2023 15:09:43 -0400 Received: from mail-pl1-x62c.google.com (mail-pl1-x62c.google.com [IPv6:2607:f8b0:4864:20::62c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BBAFF1B3 for ; Mon, 17 Jul 2023 12:09:41 -0700 (PDT) Received: by mail-pl1-x62c.google.com with SMTP id d9443c01a7336-1b8a8154f9cso30270595ad.1 for ; Mon, 17 Jul 2023 12:09:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sifive.com; s=google; t=1689620981; x=1692212981; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=r6uasRoxo3I6LINUODhPvTsghfLDKOJtY1t6sJi/dUE=; b=acUhxK3V3gNbKrBg9uaBK2XhWeW4iS1n2cUrofZsbkhBKvWfQLWgdfMomfQ/ilmg3e +Tkc7dwXhn8inu52vRP1PWUrSiscaqeySlATb4DfjV9PoA9Gbm8hJiApTKDXj0k30I0K Yfhl1u8d9LpUcYbaBGPpmjO7dsqEF0EBi3eofl7rbxca9JYbTmjCIP7AYssycOTJBdh0 tgFntY6IsCU0XBFGNgG2U5+/FfN/+1JqKIrS/mQni8QQBkxsShdSzbbnX3EuKE9+W8kl 7J1ls/7LCQf2rAmcCkrGCnOFN6gcJ3BOpf1h4fzzOMKvC+JB7y82lOOvyOqbpRN0o/oa l2qw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689620981; x=1692212981; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=r6uasRoxo3I6LINUODhPvTsghfLDKOJtY1t6sJi/dUE=; b=dQNy6JhcPuqX/mibLX3zs4KbMz2WmfmdcMgV+GACMsfXmw6ku1M50yBHtHXbJ+NmRd KE45SFkVjJOJ70tootnCOSluwOQWZTx/d/EEQMDZTCTK/HsIHS+CchyMNfXyo3dCBS5w 3Xr5rzOrOb1XMsAyoKgIRezhS7dxvsYl/kAqinymc3xW12DqC3E8uYpeYOVj3EZs3aL2 eMwdR0s0A/CGXyZJ+MmPTabOf9WrmmWtiKQpydSpjOizykpp5QKByrGc4IKDRyNKS6fP Ew4RqTIh7u/co306aRBrFII9nPNpil3ggldasbZt3fm+Q2infiBGc8YMGTBf6guvPdG+ pGyg== X-Gm-Message-State: ABy/qLY5yKb/lDJWpXLSIjyNYmBqTY4RjlWWLZwn8azUT+Sp6l5h0Ci9 qLmcpjAD1hERBb6XXyIw9GYA+w== X-Received: by 2002:a17:902:c405:b0:1b6:783d:9ba7 with SMTP id k5-20020a170902c40500b001b6783d9ba7mr14739448plk.27.1689620981198; Mon, 17 Jul 2023 12:09:41 -0700 (PDT) Received: from sw06.internal.sifive.com ([64.62.193.194]) by smtp.gmail.com with ESMTPSA id ix19-20020a170902f81300b001b9d335223csm250057plb.26.2023.07.17.12.09.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Jul 2023 12:09:40 -0700 (PDT) From: Samuel Holland To: Alessandro Zummo , Alexandre Belloni , Support Opensource Cc: Samuel Holland , linux-kernel@vger.kernel.org, linux-rtc@vger.kernel.org Subject: [PATCH] rtc: da9063: Mark the alarm IRQ as a wake IRQ Date: Mon, 17 Jul 2023 12:09:37 -0700 Message-Id: <20230717190937.1301509-1-samuel.holland@sifive.com> X-Mailer: git-send-email 2.40.1 MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1771698553216756878 X-GMAIL-MSGID: 1771698553216756878 This keeps the IRQ enabled during system suspend, if the RTC's wakeup source is enabled. Since the IRQ is not required to wake from shutdown, continue to add the wakeup source even if registering the wakeirq fails. See commit 029d3a6f2f3c ("rtc: da9063: add as wakeup source"). Signed-off-by: Samuel Holland --- drivers/rtc/rtc-da9063.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/rtc/rtc-da9063.c b/drivers/rtc/rtc-da9063.c index ee2efb496174..2f5d60622564 100644 --- a/drivers/rtc/rtc-da9063.c +++ b/drivers/rtc/rtc-da9063.c @@ -11,6 +11,7 @@ #include #include #include +#include #include #include #include @@ -496,6 +497,12 @@ static int da9063_rtc_probe(struct platform_device *pdev) dev_err(&pdev->dev, "Failed to request ALARM IRQ %d: %d\n", irq_alarm, ret); + ret = dev_pm_set_wake_irq(&pdev->dev, irq_alarm); + if (ret) + dev_warn(&pdev->dev, + "Failed to set IRQ %d as a wake IRQ: %d\n", + irq_alarm, ret); + device_init_wakeup(&pdev->dev, true); return devm_rtc_register_device(rtc->rtc_dev);