Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp5840221pxb; Sun, 7 Nov 2021 21:48:07 -0800 (PST) X-Google-Smtp-Source: ABdhPJzf1mvaTfG7CyN8EOrSpl8cxCo7uddoC9t+0Cbut3CQUr67tHN8X+7YDi/3za2QG8BFpuxR X-Received: by 2002:a17:906:369a:: with SMTP id a26mr92666798ejc.539.1636350487212; Sun, 07 Nov 2021 21:48:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1636350487; cv=none; d=google.com; s=arc-20160816; b=xwryUuM9Y16RU/+8FjI6mzp6kwhXT85OxzYqk0Y6KiQk/mdLvfHe2OqxvCR+wZMa6F ywWuDM49hAxGAUzz0o0Ck8EqK4rzzvgBQuPlnLAuSlzprEj/qpwJ7bAfi2IGBv5j8LPP ozjXnJkwZIbmmQKOKm94yj/8yfXY2LB9jnLajiBbmr16KdrI8qkOK9Ef4V+SimTERnwE MnEocBH8kC2Ahp5WRS10e2NAEwk3xBuOWK85IqGoPm2ItLwL+t96kGhMUEm2W1t3J7tZ ctFasZDwllsB565nsDnZ4ybmrw6pbUSJ4bjlUnC4jvi2mZZsx+3D+7LxpGNNm78WYr6M Y1CA== 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=qZK4R3wQk5OM06q+g0rA9dMqTaKpjbvKnbEe9ebxgBE=; b=M24cH9QpvIto3NhyuF7n0mrSJIVh35wd2NjAXEU+6KEFUwi5RVsCtcZGqOiOkUlNg9 AUOKNVex3r7x7j95Wk4kYgMRM+B+LAZwKhte4xoLwjOV+zF0c0/j2wFDScfxnPceJLhi 17fQagR48ee4ST64Sn61OEZrWRQM1inxjaZqHLzWKUxLfPyNjZ7Z51PNvvZWk7ENmY+Q /WroGwbj4gK7i1LIK/p1jixD0d+377JAykesekpboKaQCcMtmTa7bvxSOfVGKSSzHO4h D6oo6bMyusVNG+31lWVCOYDfCuFVW4Kj6Zvw2U8PBVfLgV7YL1gaVW2h4UTZ81zCS/4X /New== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a23si24085146edu.3.2021.11.07.21.47.23; Sun, 07 Nov 2021 21:48:07 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236826AbhKGW6E (ORCPT + 99 others); Sun, 7 Nov 2021 17:58:04 -0500 Received: from relay1-d.mail.gandi.net ([217.70.183.193]:41627 "EHLO relay1-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236728AbhKGW5x (ORCPT ); Sun, 7 Nov 2021 17:57:53 -0500 Received: (Authenticated sender: alexandre.belloni@bootlin.com) by relay1-d.mail.gandi.net (Postfix) with ESMTPSA id 5EAE0240006; Sun, 7 Nov 2021 22:55:08 +0000 (UTC) From: Alexandre Belloni To: Alessandro Zummo , Alexandre Belloni Cc: linux-rtc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 08/12] rtc: rx8025: let the core handle the alarm resolution Date: Sun, 7 Nov 2021 23:54:53 +0100 Message-Id: <20211107225458.111068-8-alexandre.belloni@bootlin.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20211107225458.111068-1-alexandre.belloni@bootlin.com> References: <20211107225458.111068-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 Tell the RTC core UIE are not supported because the resolution of the alarm is a minute. Signed-off-by: Alexandre Belloni --- drivers/rtc/rtc-rx8025.c | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/drivers/rtc/rtc-rx8025.c b/drivers/rtc/rtc-rx8025.c index 617b044c66f0..6941e0518290 100644 --- a/drivers/rtc/rtc-rx8025.c +++ b/drivers/rtc/rtc-rx8025.c @@ -358,17 +358,6 @@ static int rx8025_set_alarm(struct device *dev, struct rtc_wkalrm *t) if (client->irq <= 0) return -EINVAL; - /* - * Hardware alarm precision is 1 minute! - * round up to nearest minute - */ - if (t->time.tm_sec) { - time64_t alarm_time = rtc_tm_to_time64(&t->time); - - alarm_time += 60 - t->time.tm_sec; - rtc_time64_to_tm(alarm_time, &t->time); - } - ald[0] = bin2bcd(t->time.tm_min); if (rx8025->ctrl1 & RX8025_BIT_CTRL1_1224) ald[1] = bin2bcd(t->time.tm_hour); @@ -579,8 +568,8 @@ static int rx8025_probe(struct i2c_client *client, rx8025->rtc->max_user_freq = 1; - /* the rx8025 alarm only supports a minute accuracy */ - rx8025->rtc->uie_unsupported = 1; + set_bit(RTC_FEATURE_ALARM_RES_MINUTE, rx8025->rtc->features); + clear_bit(RTC_FEATURE_UPDATE_INTERRUPT, rx8025->rtc->features); err = devm_rtc_register_device(rx8025->rtc); if (err) -- 2.31.1