From patchwork Tue Jan 2 05:10:08 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "\(Exiting\) Baolin Wang" X-Patchwork-Id: 123092 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp8567249qgn; Mon, 1 Jan 2018 21:10:51 -0800 (PST) X-Google-Smtp-Source: ACJfBoueJjwrP+dq4QujykqvYl1BD7dEbR3q6FKjnz3v6nrfR2nqA9tC5Lg9HQsnRo8xGD1tbNuw X-Received: by 10.84.210.109 with SMTP id z100mr45000098plh.364.1514869851149; Mon, 01 Jan 2018 21:10:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1514869851; cv=none; d=google.com; s=arc-20160816; b=ZAmly158/qOTKmOqoN2XAwNKaa0rOyZnODwYjAxFsPrGM7O/U4SifazX/UHm3Q/L2V tuuGp29E7Gr2usKvZ5xZnWPApaK7VkNsYB9n6+xJpjGBtH6L+JzgeTfE4qvaH7wWW69x lCC0TysNdSi9wolGidLopUWIZJ5ARo+Kh0MSsae4Jxx7IEtdJo0bk0hKoZ60eEuKuo5F Oh6ueUGquKstWPEkwnD2X/LDYK+jqpeTiolRhro2mx08zQIjyGSr970KNZM3MjE9FMQZ MAbU4tBbhEiTf2Nse5k0RktxHXdzWglhaAsEXCMA54VbMAN0lkVpsC3L89577gGw3c2H 6eMg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=DqIEPV1qa7N5g3oC1Diirx4TZ+IKpCUeroYOX9JuUD0=; b=OVNVNETPVATif7PT69cMlmUG6FhitMDHlEu0OZH6j0iGRTGBf/FOsVtXJnwQWdhaPf g6iT0WcEmRh+1x6rSFQQvPohXA6JORCNXivR9RsNtOBB3VRVG7zq/7zyddcui0rohdES CFVwmgv74V5+RzVmEucEIasYqWetFeuUyI3xiQfuxhWOLB98/RdvEcFCAd1M3NebHgZD 5VCxBedVOMdvV+nGzC9jk2L8lfsoch+mVRHAzcn/jc0IejDsDgQ/Uk4kidszQ1h6N0hM zZRqH4TaNz/Nf4W+NB0t8NdgmVfRRtSBauUHAlvz1x8elvX3fHTJ3CFyucOch8EDJqbe BN7A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Sp/fARVE; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y11si27541101plg.702.2018.01.01.21.10.50; Mon, 01 Jan 2018 21:10:51 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Sp/fARVE; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751575AbeABFKl (ORCPT + 28 others); 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 Received: by mail-pg0-f67.google.com with SMTP id t67so2256129pgc.5 for ; Mon, 01 Jan 2018 21:10:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=DqIEPV1qa7N5g3oC1Diirx4TZ+IKpCUeroYOX9JuUD0=; b=Sp/fARVE+4/QAqBG+v3OTs6UzQp2QauYtE0jP57XDYtp6cvVubI+Hf6HXh8AeEvN4p hML/89c4v1Na+f1tfJ0qSmO4+5u7Q2RNAqvZ0t9ZneCpgNqmwn+V77r2oyftucNIoZPC r68RlYw/3Jyu00DryhUnU63Ndbt0raJ2kW6c8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:in-reply-to:references; bh=DqIEPV1qa7N5g3oC1Diirx4TZ+IKpCUeroYOX9JuUD0=; b=eBLFwTcMOmJhGCLRgwITHjPWCye7OuaKYY85oqLcXPHib9k6YwL94+pBghvNv0swda E8IJs21leaa3exQ/NUD2vAUZCvhcmgONt+m04BN1LprZdQ8G44nZw6Fu4SpXu/HIktDf CbBFRmJnxhiSxdKT4taSeDolr7+kooAu/5PRy78bRgWoNuQmJKRlSaAl+FStXPqft583 tZZQG658YtCWYXWmTsGD1FHR4F2wSXihp6cb7t3v1WAVKkDMZYosaxGC/SHQw75XHKR3 b7yyjuxLDyrbfFx4juALhor6HSj8wDbUWhCRoy3ufr2twWO1RdOGbrIkAbKi6FXVhWEh XFLA== X-Gm-Message-State: AKGB3mIFNqszaw1HLofcaI2acvK/spDs6cmHgdW6iOAAgI1PM3YQc65d gYZZ3ytNZZf1j6jDdc7sMKZI2Q== X-Received: by 10.99.143.87 with SMTP id r23mr38115847pgn.188.1514869837531; Mon, 01 Jan 2018 21:10:37 -0800 (PST) Received: from baolinwangubtpc.spreadtrum.com ([117.18.48.82]) by smtp.gmail.com with ESMTPSA id 6sm63989675pgf.54.2018.01.01.21.10.34 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 01 Jan 2018 21:10:37 -0800 (PST) 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 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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(+) -- 1.7.9.5 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)