Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id AB511C38142 for ; Mon, 23 Jan 2023 20:02:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231130AbjAWUCl (ORCPT ); Mon, 23 Jan 2023 15:02:41 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33758 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232911AbjAWUCb (ORCPT ); Mon, 23 Jan 2023 15:02:31 -0500 Received: from relay4-d.mail.gandi.net (relay4-d.mail.gandi.net [217.70.183.196]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 55D06360A3; Mon, 23 Jan 2023 12:02:30 -0800 (PST) Received: (Authenticated sender: alexandre.belloni@bootlin.com) by mail.gandi.net (Postfix) with ESMTPSA id 824FFE000B; Mon, 23 Jan 2023 20:02:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1674504148; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=lZoBZM9hdVyL6nx8DGe06qdlPCrvXzgiMdMYi/92dwk=; b=H2y2d+CAk8+YdLqlBVdLuNxyasiJThl/vidlmRFzQqxu6bdwAgDvpdIMd5ZyTEYJ68J+aQ E9M1C6Ygux9REMJS/tlMOs+1gXnq4yYYKsgmXgOdf3wN5mWEG2SE7qQrdxKL8YVweWC/hG pgfwXzJO/sGPIShoH8LRYfN23AYyuyaixih+H/5TrIrSNW5/Q1LHkLtP/sg14fXDwARlJi 0dcAG0XIoI148fJ2MmubSE1GOAEb8MgF/sv/XZhZw9Z9mrOY0s+TklM+SERNbUKg5DyNI7 zMdpADH100NLW47V9LlJ6TDbJ3sqg5eCUav1UpxEoDRygxy4jg6U4iQm9AM1bA== From: alexandre.belloni@bootlin.com To: Alessandro Zummo , Alexandre Belloni Cc: linux-rtc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 06/12] rtc: pcf85063: use IRQ flags obtained from fwnode Date: Mon, 23 Jan 2023 21:02:11 +0100 Message-Id: <20230123200217.1236011-6-alexandre.belloni@bootlin.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230123200217.1236011-1-alexandre.belloni@bootlin.com> References: <20230123200217.1236011-1-alexandre.belloni@bootlin.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Alexandre Belloni Allow the IRQ type to be passed from the device tree if available as there may be components changing the trigger type of the interrupt between the RTC and the IRQ controller. Signed-off-by: Alexandre Belloni --- drivers/rtc/rtc-pcf85063.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/rtc/rtc-pcf85063.c b/drivers/rtc/rtc-pcf85063.c index 754e03984f98..71a456355981 100644 --- a/drivers/rtc/rtc-pcf85063.c +++ b/drivers/rtc/rtc-pcf85063.c @@ -621,9 +621,14 @@ static int pcf85063_probe(struct i2c_client *client) clear_bit(RTC_FEATURE_ALARM, pcf85063->rtc->features); if (config->has_alarms && client->irq > 0) { + unsigned long irqflags = IRQF_TRIGGER_LOW; + + if (dev_fwnode(&client->dev)) + irqflags = 0; + err = devm_request_threaded_irq(&client->dev, client->irq, NULL, pcf85063_rtc_handle_irq, - IRQF_TRIGGER_LOW | IRQF_ONESHOT, + irqflags | IRQF_ONESHOT, "pcf85063", pcf85063); if (err) { dev_warn(&pcf85063->rtc->dev, -- 2.39.1