Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp5128317pxu; Thu, 10 Dec 2020 13:45:30 -0800 (PST) X-Google-Smtp-Source: ABdhPJyonjaMpHVQitrZFdUUNXT95/a7RTnxo1VjKT7WkKZJ+gyh4nFDu2gyi19/m9CiDHDQPxhX X-Received: by 2002:aa7:d74d:: with SMTP id a13mr8940508eds.78.1607636730618; Thu, 10 Dec 2020 13:45:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607636730; cv=none; d=google.com; s=arc-20160816; b=SQPDR9SInA8SgOSwIMVxQYECYlG8+mIKuJ8nFeS3ktiP17nxGKOelL1gUpfQv6NlKH M74PiWbSl1+UarS1WOD2ofC/kX/dEeUYmD5odXj4C3o/TrPv4Uv7TCEnDEEpv7lTQkTL 6McD3owb0StzATOg9NovOAVj8n2Y/ucw/g3yzO7OYJ/k4V1kHcO0Kofp2vX1qpcznzN5 imZrxQjaOvjbCsIXBkPwvsy87Nkw8MTdkh4yrBAEu/2nJ6q2xsvgiISA87H09dZ/6URH 2WfMNHuOezAphDwHmoQaWbCIVVtxzAUR3Xedc+ML6iIrzG3rXFTWdDaHmgSC8YZDX9GY HJwA== 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 :references:in-reply-to:message-id:date:subject:cc:to:from; bh=Yv2R3MNetmDD0Sd0F7M8JcwFctGhARd+olUxBePr1kM=; b=yCs8TjlyiHSr4uWuW9mJmmfjqzUsew7bWr8hEAZQptqITHTw/6QXlWgeFlzwWlDqbG AAlbr/3UZCTNegg1jl0errNfahnmAgx0j2qBRkm1p504vh5lxygwFqVJN0XEp7oLFebl ngcqNdzTnVrBT86/b+x+gZqdUiiYi4i1RcKOAioy0NdbMuhua6OTNEeT4aRolUq9F+Tm UNu0ZeyHOQPzY1n619ZVYV+xIEb6cWS/4vgXk2XOt1qcjv6kQ2VwMd1s8dkHnasft+F7 hA3v6J861KbAmxf4WitL2Fb2fxU4koYN9pABcbfBnFEHyQ1TQz1oWMGMA98F/zedcNsx cMNg== 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dj1si3544100edb.346.2020.12.10.13.45.07; Thu, 10 Dec 2020 13:45:30 -0800 (PST) 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2405076AbgLJVlw (ORCPT + 99 others); Thu, 10 Dec 2020 16:41:52 -0500 Received: from mail.kernel.org ([198.145.29.99]:38696 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2404896AbgLJV1b (ORCPT ); Thu, 10 Dec 2020 16:27:31 -0500 From: Krzysztof Kozlowski Authentication-Results: mail.kernel.org; dkim=permerror (bad message/signature format) To: Chanwoo Choi , Krzysztof Kozlowski , Bartlomiej Zolnierkiewicz , Michael Turquette , Stephen Boyd , Rob Herring , Lee Jones , Sebastian Reichel , Liam Girdwood , Mark Brown , Andy Gross , Bjorn Andersson , Alessandro Zummo , Alexandre Belloni , linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org, devicetree@vger.kernel.org, linux-pm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-rtc@vger.kernel.org Cc: Iskren Chernev , Matheus Castello , Sebastian Krzyszkowiak , Angus Ainslie , Hans de Goede Subject: [RFC 14/18] rtc: max77686: Do not enforce (incorrect) interrupt trigger type Date: Thu, 10 Dec 2020 22:25:30 +0100 Message-Id: <20201210212534.216197-14-krzk@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201210212534.216197-1-krzk@kernel.org> References: <20201210212534.216197-1-krzk@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Interrupt line can be configured on different hardware in different way, even inverted. Therefore driver should not enforce specific trigger type - edge falling - but instead rely on Devicetree to configure it. The Maxim 77686 datasheet describes the interrupt line as active low with a requirement of acknowledge from the CPU therefore the edge falling is not correct. The interrupt line is shared between PMIC and RTC driver, so using level sensitive interrupt is here especially important to avoid races. With an edge configuration in case if first PMIC signals interrupt followed shortly after by the RTC, the interrupt might not be yet cleared/acked thus the second one would not be noticed. Signed-off-by: Krzysztof Kozlowski --- This patch should wait till DTS changes are merged, as it relies on proper Devicetree. --- drivers/rtc/rtc-max77686.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/rtc/rtc-max77686.c b/drivers/rtc/rtc-max77686.c index d51cc12114cb..eae7cb9faf1e 100644 --- a/drivers/rtc/rtc-max77686.c +++ b/drivers/rtc/rtc-max77686.c @@ -717,8 +717,8 @@ static int max77686_init_rtc_regmap(struct max77686_rtc_info *info) add_rtc_irq: ret = regmap_add_irq_chip(info->rtc_regmap, info->rtc_irq, - IRQF_TRIGGER_FALLING | IRQF_ONESHOT | - IRQF_SHARED, 0, info->drv_data->rtc_irq_chip, + IRQF_ONESHOT | IRQF_SHARED, + 0, info->drv_data->rtc_irq_chip, &info->rtc_irq_data); if (ret < 0) { dev_err(info->dev, "Failed to add RTC irq chip: %d\n", ret); -- 2.25.1