From patchwork Thu May 31 09:56:43 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandre Belloni X-Patchwork-Id: 923284 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=linux-rtc-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=bootlin.com Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 40xNDP3g56z9s01 for ; Thu, 31 May 2018 19:57:25 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754494AbeEaJ5W (ORCPT ); Thu, 31 May 2018 05:57:22 -0400 Received: from mail.bootlin.com ([62.4.15.54]:44964 "EHLO mail.bootlin.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754488AbeEaJ5T (ORCPT ); Thu, 31 May 2018 05:57:19 -0400 Received: by mail.bootlin.com (Postfix, from userid 110) id 9074B207F0; Thu, 31 May 2018 11:57:17 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mail.bootlin.com X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,SHORTCIRCUIT, URIBL_BLOCKED shortcircuit=ham autolearn=disabled version=3.4.0 Received: from localhost (unknown [37.71.171.242]) by mail.bootlin.com (Postfix) with ESMTPSA id 0117120DB0; Thu, 31 May 2018 11:56:51 +0200 (CEST) From: Alexandre Belloni To: linux-rtc@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Alexandre Belloni Subject: [PATCH 2/2] rtc: ds1685: Add range Date: Thu, 31 May 2018 11:56:43 +0200 Message-Id: <20180531095643.8581-2-alexandre.belloni@bootlin.com> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180531095643.8581-1-alexandre.belloni@bootlin.com> References: <20180531095643.8581-1-alexandre.belloni@bootlin.com> Sender: linux-rtc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rtc@vger.kernel.org Useful range is 2000-2099 because leap year fails on centuries. Signed-off-by: Alexandre Belloni --- drivers/rtc/rtc-ds1685.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/rtc/rtc-ds1685.c b/drivers/rtc/rtc-ds1685.c index e6390475380f..5c0db6c8134c 100644 --- a/drivers/rtc/rtc-ds1685.c +++ b/drivers/rtc/rtc-ds1685.c @@ -2043,6 +2043,10 @@ ds1685_rtc_probe(struct platform_device *pdev) rtc_dev->ops = &ds1685_rtc_ops; + /* Century bit is useless because leap year fails in 1900 and 2100 */ + rtc_dev->range_min = RTC_TIMESTAMP_BEGIN_2000; + rtc_dev->range_max = RTC_TIMESTAMP_END_2099; + /* Maximum periodic rate is 8192Hz (0.122070ms). */ rtc_dev->max_user_freq = RTC_MAX_USER_FREQ;