Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp1007558rwb; Thu, 8 Dec 2022 05:50:11 -0800 (PST) X-Google-Smtp-Source: AA0mqf6ZVWdwK3dd7og00mNL3C/HG19PXfFQrTDgU+pJmql/0/Ls7Jx48VD94SNxBB4eBhs2puPu X-Received: by 2002:a63:e84f:0:b0:477:7dc8:57a7 with SMTP id a15-20020a63e84f000000b004777dc857a7mr68218296pgk.498.1670507410873; Thu, 08 Dec 2022 05:50:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670507410; cv=none; d=google.com; s=arc-20160816; b=Or0MSVD6d07e+rxVqMWDE8br31mPvbK+PoQrxi7Rm3nTT11uyf9bWuj5Y96vR8pk/J aDwNm2MT0Ww0DNNoTJNZLq27T6x8lbEkiFWWtcbZnV9HyJJAmkjbjSq/a+h8/GPBStJV 3/vx813m1L7X8RMKRum9n5Tu5/Yx96GM2DFVLF41+qbusom9E7ANraFEuDw6cMoxZ5T3 yYA7xzSW2WF0SvFWNPQdQ4SDTPcjd2MK0skC0PURath4RBSM/fHx7GFispO5rQQLdi1L +ORq/MM/M9ED4YgiN5P6baENCDvD21+GlmrR1j6yrTbtkb7bUrBnxO12VPl+LfKTX3vj eA6Q== 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=C1HJFcHFIlttq8X4+SnBiiGEViFMdLrNmSB73bZRkfk=; b=qTJXm/LMZEHl87JnoDtjIeYMHTsw2Tk/9HUUEL+JU4LY+098WXf3T2HE/oED3GGy1T 2bXEs3bSJ6dYhvM7QaRVVOIBJZeHpUmkxGRKGEexlVMcagAZBvgJk6s0HXYpqh8gpLY8 GaLPkzg9OOJSSAIPkDli/HDng/T132HnEOeL769EHREGpBKCB/552AK67+7t6QFnznoC dFIZSa0wqFKPuuXtsGtthnDFann+YlRCIU/CMFBwm1Kix7n4lCRYF0JbAXGuEVbhRVFi KSll+Uo24sC+twHYKE2DmFKg/QDFBhToWGWgPQBEGvzz3ycUXqWHsIgvSD583Gu7RHAL 09DA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@phytec.de header.s=a4 header.b=Y2kVhgk0; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w4-20020a656944000000b00477e0e4d2fbsi23035458pgq.412.2022.12.08.05.50.01; Thu, 08 Dec 2022 05:50:10 -0800 (PST) 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=fail header.i=@phytec.de header.s=a4 header.b=Y2kVhgk0; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230130AbiLHNgw (ORCPT + 73 others); Thu, 8 Dec 2022 08:36:52 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49166 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229699AbiLHNgS (ORCPT ); Thu, 8 Dec 2022 08:36:18 -0500 Received: from mickerik.phytec.de (mickerik.phytec.de [91.26.50.163]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 931DC89AD1 for ; Thu, 8 Dec 2022 05:36:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; d=phytec.de; s=a4; c=relaxed/simple; q=dns/txt; i=@phytec.de; t=1670506574; x=1673098574; h=From:Sender:Reply-To:Subject:Date:Message-ID:To:CC:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=4mTJX+4tizOW8u7atOWh+4YTNETI5lpnDT3sT0CjBI4=; b=Y2kVhgk0YyN97zSIgeEZ7P4oVuEYTiuHyJJ+nq7iAgzPZeDiLoSVMOfnW+ZeEe5E UQgXH2hSgDcx0TIpZwYlaHQ2aZdU+RCXiK08j0VhV6f7vB9LYOgsX+IHCs9ZOB0y ECiXKMiynP11Ytp4WJC95Oz8rIpLLcGQXPohlY/Ycz8=; X-AuditID: ac14000a-83bf370000003940-38-6391e84e6c14 Received: from berlix.phytec.de (Unknown_Domain [172.25.0.12]) (using TLS with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mickerik.phytec.de (PHYTEC Mail Gateway) with SMTP id CB.A8.14656.E48E1936; Thu, 8 Dec 2022 14:36:14 +0100 (CET) Received: from augenblix2.phytec.de (172.25.0.11) by Berlix.phytec.de (172.25.0.12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.18; Thu, 8 Dec 2022 14:36:13 +0100 From: Wadim Egorov To: , , CC: , Subject: [PATCH] rtc: rv3028: Use IRQ flags obtained from device tree if available Date: Thu, 8 Dec 2022 14:36:05 +0100 Message-ID: <20221208133605.4193907-1-w.egorov@phytec.de> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [172.25.0.11] X-ClientProxiedBy: Florix.phytec.de (172.25.0.13) To Berlix.phytec.de (172.25.0.12) X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrHLMWRmVeSWpSXmKPExsWyRpKBR9fvxcRkgzndfBZLLl5lt2h/t4zd 4vKuOWwWx1ZfYXNg8Zi3ptpj+ryfTB6fN8kFMEdx2aSk5mSWpRbp2yVwZdx8s5S5YBVXRdcc gQbGeRxdjJwcEgImEm9X/2LtYuTiEBJYzCRxbM0PRpCEkMBjRomNfVogNpuAusSdDd+Aijg4 RATCJR53pIOEmQWsJR42/2EFsYUFgiTu79sJZrMIqEh87+kDs3kFLCXO/97BCrFLXmLmpe/s EHFBiZMzn7BAzJGXaN46mxnClpA4+OIFM8QJ8hIvLi1ngemddu41M4QdKnFk02qmCYwCs5CM moVk1CwkoxYwMq9iFMrNTM5OLcrM1ivIqCxJTdZLSd3ECApTEQauHYx9czwOMTJxMB5ilOBg VhLhXbZsYrIQb0piZVVqUX58UWlOavEhRmkOFiVx3vs9TIlCAumJJanZqakFqUUwWSYOTqkG xp2G+l6PT9ZKyZ3cJhfTvDG1Xb6UZXv2P954o5h9X9/wRHAzWdxmnX36d7Z0zy7e91eKZ8/U CDJtmGSxYpLFTf0NDUKfWTbeXHfv7I6fwhvk1FOjwj3fyr4qFJAym5Rx7d0S76d7Az9f3ZPh 8C3v3HuZKf8cXaQLS/yPGe7v5N8hwrpH4O1vWSWW4oxEQy3mouJEAOBe8/5BAgAA X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_PASS,SPF_PASS autolearn=unavailable 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 Make the interrupt pin of the RV3028 usable with GPIO controllers without level type IRQs support, such as the TI Davinci GPIO controller. Therefore, allow the IRQ type to be passed from the device tree if available. Based on commit d4785b46345c ("rtc: pcf2127: use IRQ flags obtained from device tree if available") Signed-off-by: Wadim Egorov --- drivers/rtc/rtc-rv3028.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/drivers/rtc/rtc-rv3028.c b/drivers/rtc/rtc-rv3028.c index dd170e3efd83..b0099e26e3b0 100644 --- a/drivers/rtc/rtc-rv3028.c +++ b/drivers/rtc/rtc-rv3028.c @@ -902,9 +902,20 @@ static int rv3028_probe(struct i2c_client *client) return PTR_ERR(rv3028->rtc); if (client->irq > 0) { + unsigned long flags; + + /* + * If flags = 0, devm_request_threaded_irq() will use IRQ flags + * obtained from device tree. + */ + if (dev_fwnode(&client->dev)) + flags = 0; + else + flags = IRQF_TRIGGER_LOW; + ret = devm_request_threaded_irq(&client->dev, client->irq, NULL, rv3028_handle_irq, - IRQF_TRIGGER_LOW | IRQF_ONESHOT, + flags | IRQF_ONESHOT, "rv3028", rv3028); if (ret) { dev_warn(&client->dev, "unable to request IRQ, alarms disabled\n"); -- 2.34.1