diff mbox

[v2] rtc: st-lpc: add range

Message ID 20180521204905.7113-1-alexandre.belloni@bootlin.com (mailing list archive)
State New, archived
Headers show

Commit Message

Alexandre Belloni May 21, 2018, 8:49 p.m. UTC
The RTC has a 64 bit counter.

Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
---
 drivers/rtc/rtc-st-lpc.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Patrice CHOTARD May 23, 2018, 7:24 a.m. UTC | #1
Hi Alexandre

On 05/21/2018 10:49 PM, Alexandre Belloni wrote:
> The RTC has a 64 bit counter.
> 
> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
> ---
>   drivers/rtc/rtc-st-lpc.c | 2 ++
>   1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/rtc/rtc-st-lpc.c b/drivers/rtc/rtc-st-lpc.c
> index 2f1ef2c28740..bee75ca7ff79 100644
> --- a/drivers/rtc/rtc-st-lpc.c
> +++ b/drivers/rtc/rtc-st-lpc.c
> @@ -258,6 +258,8 @@ static int st_rtc_probe(struct platform_device *pdev)
>   	platform_set_drvdata(pdev, rtc);
>   
>   	rtc->rtc_dev->ops = &st_rtc_ops;
> +	rtc->rtc_dev->range_max = U64_MAX;
> +	do_div(rtc->rtc_dev->range_max, rtc->clkrate);
>   
>   	ret = rtc_register_device(rtc->rtc_dev);
>   	if (ret) {
> 

Acked-by: Patrice Chotard <patrice.chotard@st.com>

Patrice
diff mbox

Patch

diff --git a/drivers/rtc/rtc-st-lpc.c b/drivers/rtc/rtc-st-lpc.c
index 2f1ef2c28740..bee75ca7ff79 100644
--- a/drivers/rtc/rtc-st-lpc.c
+++ b/drivers/rtc/rtc-st-lpc.c
@@ -258,6 +258,8 @@  static int st_rtc_probe(struct platform_device *pdev)
 	platform_set_drvdata(pdev, rtc);
 
 	rtc->rtc_dev->ops = &st_rtc_ops;
+	rtc->rtc_dev->range_max = U64_MAX;
+	do_div(rtc->rtc_dev->range_max, rtc->clkrate);
 
 	ret = rtc_register_device(rtc->rtc_dev);
 	if (ret) {