Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751575AbeABFKl (ORCPT + 1 other); Tue, 2 Jan 2018 00:10:41 -0500 Received: from mail-pg0-f67.google.com ([74.125.83.67]:37932 "EHLO mail-pg0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751506AbeABFKi (ORCPT ); Tue, 2 Jan 2018 00:10:38 -0500 X-Google-Smtp-Source: ACJfBovEu+t3YAKGQWPy7FgAmdEtO8F78JqrfHIa7mQJbJP7aoE84Rhso/+sFtdl8M+Cr3v3qTpLng== From: Baolin Wang To: a.zummo@towertech.it, alexandre.belloni@free-electrons.com, corbet@lwn.net Cc: arnd@arndb.de, broonie@kernel.org, linux-rtc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, baolin.wang@linaro.org Subject: [RFC PATCH 4/4] rtc: sc27xx: Add the get_range interface Date: Tue, 2 Jan 2018 13:10:08 +0800 Message-Id: <2240e08e757926ff01d3b73596b0a8c9e29f2530.1514869622.git.baolin.wang@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <9ab56bdcaeb52241e22b738d6babe7b01728f64c.1514869621.git.baolin.wang@linaro.org> References: <9ab56bdcaeb52241e22b738d6babe7b01728f64c.1514869621.git.baolin.wang@linaro.org> In-Reply-To: <9ab56bdcaeb52241e22b738d6babe7b01728f64c.1514869621.git.baolin.wang@linaro.org> References: <9ab56bdcaeb52241e22b738d6babe7b01728f64c.1514869621.git.baolin.wang@linaro.org> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: Add the get_range interface for sc27xx RTC driver to tell the RTC core what is the valid range for RTC hardware device. Signed-off-by: Baolin Wang --- drivers/rtc/rtc-sc27xx.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/drivers/rtc/rtc-sc27xx.c b/drivers/rtc/rtc-sc27xx.c index d544d52..97b1120 100644 --- a/drivers/rtc/rtc-sc27xx.c +++ b/drivers/rtc/rtc-sc27xx.c @@ -536,12 +536,22 @@ static int sprd_rtc_alarm_irq_enable(struct device *dev, unsigned int enabled) return ret; } +static int sprd_rtc_read_range(struct device *dev, time64_t *max_hw_secs, + time64_t *min_hw_secs) +{ + *min_hw_secs = 0; + *max_hw_secs = (((time64_t)(SPRD_RTC_DAY_MASK * 24) + 23) * 60 + 59) * 60 + 59; + + return 0; +} + static const struct rtc_class_ops sprd_rtc_ops = { .read_time = sprd_rtc_read_time, .set_time = sprd_rtc_set_time, .read_alarm = sprd_rtc_read_alarm, .set_alarm = sprd_rtc_set_alarm, .alarm_irq_enable = sprd_rtc_alarm_irq_enable, + .read_range = sprd_rtc_read_range, }; static irqreturn_t sprd_rtc_handler(int irq, void *dev_id) -- 1.7.9.5