[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <2045295.MUk6NRVmsd@kista>
Date: Sun, 25 Jul 2021 07:51:28 +0200
From: Jernej Škrabec <jernej.skrabec@...il.com>
To: Maxime Ripard <mripard@...nel.org>, Chen-Yu Tsai <wens@...e.org>,
Andre Przywara <andre.przywara@....com>
Cc: Rob Herring <robh@...nel.org>, Icenowy Zheng <icenowy@...c.io>,
Samuel Holland <samuel@...lland.org>,
linux-arm-kernel@...ts.infradead.org, linux-sunxi@...glegroups.com,
linux-sunxi@...ts.linux.dev, linux-kernel@...r.kernel.org,
Ondrej Jirman <megous@...ous.com>,
Alessandro Zummo <a.zummo@...ertech.it>,
Alexandre Belloni <alexandre.belloni@...tlin.com>,
linux-rtc@...r.kernel.org
Subject: Re: [PATCH v8 04/11] rtc: sun6i: Add support for linear day storage
Hi Andre!
Dne petek, 23. julij 2021 ob 17:38:31 CEST je Andre Przywara napisal(a):
> Newer versions of the Allwinner RTC, as for instance found in the H616
> SoC, no longer store a broken-down day/month/year representation in the
> RTC_DAY_REG, but just a linear day number.
> The user manual does not give any indication about the expected epoch
> time of this day count, but the BSP kernel uses the UNIX epoch, which
> allows easy support due to existing conversion functions in the kernel.
>
> Allow tagging a compatible string with a flag, and use that to mark
> those new RTCs. Then convert between a UNIX day number (converted into
> seconds) and the broken-down day representation using mktime64() and
> time64_to_tm() in the set_time/get_time functions.
>
> That enables support for the RTC in those new chips.
>
> Signed-off-by: Andre Przywara <andre.przywara@....com>
> ---
> drivers/rtc/rtc-sun6i.c | 66 +++++++++++++++++++++++++++--------------
> 1 file changed, 44 insertions(+), 22 deletions(-)
Reviewed-by: Jernej Skrabec <jernej.skrabec@...il.com>
Best regards,
Jernej
Powered by blists - more mailing lists