Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2267666pxj; Sat, 22 May 2021 17:08:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJymDSaKpSFIajOo46flPQkuOZE2Y/9pxqqVDt7q/LR5bDQqhzD+fg/ShvwV755TeGQIr2IY X-Received: by 2002:aa7:df90:: with SMTP id b16mr4860640edy.361.1621728510053; Sat, 22 May 2021 17:08:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621728510; cv=none; d=google.com; s=arc-20160816; b=U5/3ocbzfR2NLWTrglkT047gZybyi79wJuSAmH1qF77KLLaZSThmoPW+oSdLqgV/OT JWdWeZsVAO19N3AUelNaO2W7plLa/qizvfWaaPEY3O38usIZAKjF+TKpUxCTKB4F2Vpy UHEnnaQQPausmkW/9A0umZtqGW+zt4mRyvvGVfyPVgOLxMmIYcB3QKpanQBUCUmffGWn YXL+vHEQksrJObqsCujF1eNibLjFVIe85GZTCU0h3bKBmc4DFgtYPMBlYk54hUIHr2kO A/bWKQ+VuksqtVdNuuCR9GEi1YNLqDoB02GexzLu/RqEQo106efZxZMuiB4rHGFAMm6s tIuQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :organization:references:in-reply-to:message-id:subject:cc:to:from :date; bh=h03fm2YbOicxyu+/oTzv8XTAsAo864W5v1EJ4uKw4sg=; b=Lj7sQXqeGBhUiRnI9TPQkr9iW/MKYuHftoepBDtWBJFrSixjkSfrLOxfY6AqArUvYf s/Z7B/0BsjAm0CXoT3GFJBsLTbNVbotjvdFXNoHzz3X8yP12buHQ/c0Eaac3T9wqx8MI UXalUvT0H+2U6PfVzle8ZtD0u3ztTdi9ZYniGwA1zsQrQ79jG57PeRz+MjC8tO5xc4Gu ZpCta04BywlUOIUzgexk11j/fjgJnGWFxJ2hkLieJD2fjT65IRkZjhHwR6+TKEuyjNqM qwMhU3XXgab8JF76lqa+34QtyWvYu3ulsuZK+2ac8iStNzShAmDforGJrPQOy9dWb0gc YR/A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id lf27si8607330ejc.495.2021.05.22.17.08.06; Sat, 22 May 2021 17:08:30 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231495AbhEWAIZ convert rfc822-to-8bit (ORCPT + 99 others); Sat, 22 May 2021 20:08:25 -0400 Received: from foss.arm.com ([217.140.110.172]:35646 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231479AbhEWAIY (ORCPT ); Sat, 22 May 2021 20:08:24 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 59FD81042; Sat, 22 May 2021 17:06:58 -0700 (PDT) Received: from slackpad.fritz.box (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 78D1A3F73B; Sat, 22 May 2021 17:06:56 -0700 (PDT) Date: Sun, 23 May 2021 01:06:43 +0100 From: Andre Przywara To: Jernej =?UTF-8?B?xaBrcmFiZWM=?= Cc: Maxime Ripard , Chen-Yu Tsai , Rob Herring , Icenowy Zheng , Samuel Holland , Ondrej Jirman , linux-arm-kernel@lists.infradead.org, linux-sunxi@googlegroups.com, linux-sunxi@lists.linux.dev, linux-kernel@vger.kernel.org, Alessandro Zummo , Alexandre Belloni , linux-rtc@vger.kernel.org Subject: Re: [PATCH v6 05/17] rtc: sun6i: Add Allwinner H616 support Message-ID: <20210523010643.7fdfd419@slackpad.fritz.box> In-Reply-To: <10265315.EKgO2cQaHd@kista> References: <20210519104152.21119-1-andre.przywara@arm.com> <20210519104152.21119-6-andre.przywara@arm.com> <10265315.EKgO2cQaHd@kista> Organization: Arm Ltd. X-Mailer: Claws Mail 3.17.1 (GTK+ 2.24.31; x86_64-slackware-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, 22 May 2021 09:29:26 +0200 Jernej Škrabec wrote: Hi, > Dne sreda, 19. maj 2021 ob 12:41:40 CEST je Andre Przywara napisal(a): > > The H616 RTC changes its day storage to the newly introduced linear day > > scheme, so pair the new compatible string with this feature flag. > > So far the clock parts seem to be the same as the H6, so combine the > > compatible string with the existing H6 support bits. > > There is one more difference - H616 alarm value is now broken down to days, > hours, minutes and seconds. That's a good point, that actually requires adjusting the driver in this respect as well. And contrary to what the manual says ("Counter Register will down count to zero"), and the previous RTCs do, those alarm registers now need to be set to the actual wakeup time, not the time left before wakeup. Will fix the driver accordingly. Thanks for the heads up! Cheers, Andre > > Best regards, > Jernej > > > > > Signed-off-by: Andre Przywara > > --- > > drivers/rtc/rtc-sun6i.c | 4 ++++ > > 1 file changed, 4 insertions(+) > > > > diff --git a/drivers/rtc/rtc-sun6i.c b/drivers/rtc/rtc-sun6i.c > > index 0228e9dfd969..ec0cd0ee539a 100644 > > --- a/drivers/rtc/rtc-sun6i.c > > +++ b/drivers/rtc/rtc-sun6i.c > > @@ -382,6 +382,8 @@ static void __init sun50i_h6_rtc_clk_init(struct > device_node *node) > > } > > CLK_OF_DECLARE_DRIVER(sun50i_h6_rtc_clk, "allwinner,sun50i-h6-rtc", > > sun50i_h6_rtc_clk_init); > > +CLK_OF_DECLARE_DRIVER(sun50i_h616_rtc_clk, "allwinner,sun50i-h616-rtc", > > + sun50i_h6_rtc_clk_init); > > > > /* > > * The R40 user manual is self-conflicting on whether the prescaler is > > @@ -773,6 +775,8 @@ static const struct of_device_id sun6i_rtc_dt_ids[] = { > > { .compatible = "allwinner,sun8i-v3-rtc" }, > > { .compatible = "allwinner,sun50i-h5-rtc" }, > > { .compatible = "allwinner,sun50i-h6-rtc" }, > > + { .compatible = "allwinner,sun50i-h616-rtc", > > + .data = (void *)RTC_LINEAR_DAY }, > > { /* sentinel */ }, > > }; > > MODULE_DEVICE_TABLE(of, sun6i_rtc_dt_ids); > > -- > > 2.17.5 > > > > > >