Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp5653699pxb; Sun, 7 Nov 2021 17:17:04 -0800 (PST) X-Google-Smtp-Source: ABdhPJxMTBZe36l4xB4ewPjKT277kBk6LDy2l481BjsNvxDUPTdWSrASfbSpIi/Yo08PFpEcA+Hn X-Received: by 2002:a05:6e02:1048:: with SMTP id p8mr51189935ilj.174.1636334224046; Sun, 07 Nov 2021 17:17:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1636334224; cv=none; d=google.com; s=arc-20160816; b=U2Xx3NyaUHvSTNxWymERysKF5UyK8Bv6ZtSv4qQiGVhdZTW2WGRU640g++rpPSi47D tHoQsn8dddlNMUZcuBFWonBEFMEdPvZV1SOKIy0usL/puj7pXbCfCkijapVfTAjz2beA /yimRyWV9JhyDd4DIs64zM+C2J2bxg1DpJ9ZrmBAz0pUscKStLi4ehGrzkfiicJ7o+VT cxg0/N2E0DAhuJPQxVK8Fj4mICyEx0V2aGUzqkDpSJES4abfY/mdqli4m9BFvN0f6deu BEnJvEIDzwtw3fmeyzkPIXAuUsPLKFzQFGlbBZiAUC2C1jD003zVLHeUIJ7xCrMXqpvn BkEA== 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=tr4dJ0jHz3eOvrVm/gIyKyd/beNVnTWX0lC5dO+1xF0=; b=LscDln1muAz0PLfrBOuYC0zGc1+bz67I6sh7Ynnr2/gjUmDMS0T7vPQ3oLfttNqkMm 6Ds0FDJ9Xcwk14fItKobT1ryzPbzNHcEzvEw3cIsAIrvAoID1tHMzcR8C4iCAfReKCmF AMjKTGD+5JnpTPL8OsjecwyoFDSDiI8pWrVqjqM3l5G9uuLWjDxAtSmhK2ey+1raPB1I MxOC1ITqij2sgUyxkeb2wUSm28HP6+tg1CnpnMz31JwFi3k9WgQdkWRf4SGKk+qYz3x5 4ihll2MsSzyQ2LhlOMjBmBmVgigLTbPsPvxOwXApYmHIh34lOsw2r7PV5qHNyYRX6eFN KHAg== 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 w12si32122909iov.5.2021.11.07.17.16.51; Sun, 07 Nov 2021 17:17:04 -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 S236721AbhKGW5v (ORCPT + 99 others); Sun, 7 Nov 2021 17:57:51 -0500 Received: from relay7-d.mail.gandi.net ([217.70.183.200]:38465 "EHLO relay7-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236701AbhKGW5s (ORCPT ); Sun, 7 Nov 2021 17:57:48 -0500 Received: (Authenticated sender: alexandre.belloni@bootlin.com) by relay7-d.mail.gandi.net (Postfix) with ESMTPSA id C3DD220007; Sun, 7 Nov 2021 22:55:03 +0000 (UTC) From: Alexandre Belloni To: Alessandro Zummo , Alexandre Belloni Cc: linux-rtc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 03/12] rtc: rv3032: let the core handle the alarm resolution Date: Sun, 7 Nov 2021 23:54:48 +0100 Message-Id: <20211107225458.111068-3-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 Let the RTC core know the resolution of the alarm is a minute. Signed-off-by: Alexandre Belloni --- drivers/rtc/rtc-rv3032.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/drivers/rtc/rtc-rv3032.c b/drivers/rtc/rtc-rv3032.c index a3c73179ecb1..c3bee305eacc 100644 --- a/drivers/rtc/rtc-rv3032.c +++ b/drivers/rtc/rtc-rv3032.c @@ -311,14 +311,6 @@ static int rv3032_set_alarm(struct device *dev, struct rtc_wkalrm *alrm) u8 ctrl = 0; int ret; - /* The alarm has no seconds, round up to nearest minute */ - if (alrm->time.tm_sec) { - time64_t alarm_time = rtc_tm_to_time64(&alrm->time); - - alarm_time += 60 - alrm->time.tm_sec; - rtc_time64_to_tm(alarm_time, &alrm->time); - } - ret = regmap_update_bits(rv3032->regmap, RV3032_CTRL2, RV3032_CTRL2_AIE | RV3032_CTRL2_UIE, 0); if (ret) @@ -958,6 +950,7 @@ static int rv3032_probe(struct i2c_client *client) rv3032_trickle_charger_setup(&client->dev, rv3032); set_bit(RTC_FEATURE_BACKUP_SWITCH_MODE, rv3032->rtc->features); + set_bit(RTC_FEATURE_ALARM_RES_MINUTE, rv3032->rtc->features); rv3032->rtc->range_min = RTC_TIMESTAMP_BEGIN_2000; rv3032->rtc->range_max = RTC_TIMESTAMP_END_2099; -- 2.31.1