From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 81EB5C4338F for ; Sun, 25 Jul 2021 05:51:44 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5CA37603E7 for ; Sun, 25 Jul 2021 05:51:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230108AbhGYFLC (ORCPT ); Sun, 25 Jul 2021 01:11:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47342 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229460AbhGYFLB (ORCPT ); Sun, 25 Jul 2021 01:11:01 -0400 Received: from mail-ed1-x533.google.com (mail-ed1-x533.google.com [IPv6:2a00:1450:4864:20::533]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 993F9C061757; Sat, 24 Jul 2021 22:51:31 -0700 (PDT) Received: by mail-ed1-x533.google.com with SMTP id l6so5147514edc.5; Sat, 24 Jul 2021 22:51:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=YHRp36bG7u+FDs07iyp7QzfPeLS/I55OgAKDF8o9L94=; b=FZOPUJR1gQbr22sAT5Saa+mI22aj6qruvYvSs7/wIydCI6ebW1KtLYSILQMlvbenhB EjO8eU+szBhrfNefXbiPc1J3lIi5BV9cECBAdd0EhZMkNMQ4c5zJuYVrEHKTjGVcX3cK dKYDJs7neavGxXy8QYHzo12oBgHLhwLKivtOdyDH6kRbKKCIfKoWE5gAUEp5mxmu4jrI bfqGo+G00yWMtsC03MdGaMklz7VgAGPEH7brzWu/CC/IBGbJeuXzR1820u5TDq1O/hHP JoDY9kswbb1IZ0lbJIWW+56YREJWNcta7618eFGWNlHkDi9GJW8URzW+uKbhdfRtHsPY Yynw== 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:mime-version:content-transfer-encoding; bh=YHRp36bG7u+FDs07iyp7QzfPeLS/I55OgAKDF8o9L94=; b=DimHVUDU61ZcoY9SQB6knAEWQbJPStns6RT0SWSucItTe7TjzvuleA7H9Nmskd89ub Jp2hBxexxhOnsg+wKauRlpaM54LdbczYaZcFIlFgUCmAjmGvoB7d0Jzd/1r6mPOsGCom gQNp15uK/pyTwq7cOC8di92UWTqIdJSqdyNiETUfCkyObYD69iE+VNaNpAi0QBuYx21K MIYJAzKxyYkDOfnoK2GxVtGNFmyb3l9nV22k6+J2mLo6Rapdmyf1Yuc7M1DfU2+5PIt7 i6ncJ83FFF2C4w9G4YKt72kpNQql4/RHaMpeWF0HkDziUezvipM/jGdtSO5sFXBgzpzl IBlg== X-Gm-Message-State: AOAM533Zsp7LojjLE3EXt1P2xlQAvaBAC/1AT0bU8SIsePSrfBgqyl9e knzyqxiN9ZJZFgE5z990vBQ= X-Google-Smtp-Source: ABdhPJzBif2Cr3WzuHeQVHxcmoB882c4Z1w13ZVQVWoBKMdPjMB6SiODhbMqbZA2/zvIzxObdMgnCA== X-Received: by 2002:a05:6402:22c6:: with SMTP id dm6mr14793005edb.228.1627192290109; Sat, 24 Jul 2021 22:51:30 -0700 (PDT) Received: from kista.localnet (cpe-86-58-46-198.static.triera.net. [86.58.46.198]) by smtp.gmail.com with ESMTPSA id n17sm135390edr.84.2021.07.24.22.51.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 24 Jul 2021 22:51:29 -0700 (PDT) From: Jernej =?utf-8?B?xaBrcmFiZWM=?= To: Maxime Ripard , Chen-Yu Tsai , Andre Przywara Cc: Rob Herring , Icenowy Zheng , Samuel Holland , linux-arm-kernel@lists.infradead.org, linux-sunxi@googlegroups.com, linux-sunxi@lists.linux.dev, linux-kernel@vger.kernel.org, Ondrej Jirman , Alessandro Zummo , Alexandre Belloni , linux-rtc@vger.kernel.org Subject: Re: [PATCH v8 04/11] rtc: sun6i: Add support for linear day storage Date: Sun, 25 Jul 2021 07:51:28 +0200 Message-ID: <2045295.MUk6NRVmsd@kista> In-Reply-To: <20210723153838.6785-5-andre.przywara@arm.com> References: <20210723153838.6785-1-andre.przywara@arm.com> <20210723153838.6785-5-andre.przywara@arm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 > --- > drivers/rtc/rtc-sun6i.c | 66 +++++++++++++++++++++++++++-------------- > 1 file changed, 44 insertions(+), 22 deletions(-) Reviewed-by: Jernej Skrabec Best regards, Jernej