Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp1454442pxv; Fri, 23 Jul 2021 08:41:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy17G3v+H9o73y5MOZzimtLt/njtefUBCyQwSzAnmu04ns+ApZ0J4GW3hAkSW4UyTnj6wpK X-Received: by 2002:a5d:9d07:: with SMTP id j7mr4404085ioj.33.1627054877879; Fri, 23 Jul 2021 08:41:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627054877; cv=none; d=google.com; s=arc-20160816; b=thV965cb6z9Qa3zStt25ZIqkAA2B6AWDxsjpaN4othwG9YlXuuIXeAvJGOc9H8i3aC dKOiXg4gEVQ8Ltn+/PFAegXebxoJn6a2pxCv3mKs18d8hkDq/yVPvqQvnyD0YJTeQkYB SBPm0S84hexPwqSJL3noICUJfEzajLLE+Vi6JM40M6b96YPqX0B/PoYxsCAK/IUUsd5x ANU4k1B/L/Z9pX6NHqYZ5ca0lyl9XPEs7YegI/+b3KHf2LjqSvupX/ISd8cEwRa65jMa mWWfqyZN4wG2BMpGpLVDMmHskZNygob2LYPGtp+JXxJyyiLRqw4+tGYnpAZ4hVDsiJQM RTwQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:message-id:date:subject :cc:to:from; bh=RTJxmWjagjGW0QILlslS2WWhppKEJhm+reMNhdacEps=; b=eqwA+oWgr1KL6glYZ00xPmP6L320Tm+viHpLT2Kno1rX2tMAklAPvVcw7qojXOLYaf 544ZUNiEC0cwKasU6a9v2dzzDhGWaSnUiCC9lKHbr7QuomiZlB9Q2Ypcx7Y471VQt/4r mmorPiZ1U4zKkjM7jVV8md9Yhj+OyNBj469U1m+NwWRYugfLViQFNAUWuxyiwYXZ5oOc brGpat+JqBJIBlBQ1Y7To2sPPmYv5oPVRVZysv4kW4x8Z5spKqliW7Gh1bC6vj7/XLDe zerZbFT1fZWrvydhRed/i0bLEB1jmdkNLLmAFhuMctMuvRvEs52H5iedOtAPbDvfLoVB 9kKQ== 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 h17si22111007jav.110.2021.07.23.08.41.05; Fri, 23 Jul 2021 08:41:17 -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 S235694AbhGWO7I (ORCPT + 99 others); Fri, 23 Jul 2021 10:59:08 -0400 Received: from foss.arm.com ([217.140.110.172]:47780 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235668AbhGWO66 (ORCPT ); Fri, 23 Jul 2021 10:58:58 -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 75D46139F; Fri, 23 Jul 2021 08:39:31 -0700 (PDT) Received: from localhost.localdomain (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 6240F3F73D; Fri, 23 Jul 2021 08:39:29 -0700 (PDT) From: Andre Przywara To: Maxime Ripard , Chen-Yu Tsai , Jernej Skrabec 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: [PATCH v8 07/11] rtc: sun6i: Add Allwinner H616 support Date: Fri, 23 Jul 2021 16:38:34 +0100 Message-Id: <20210723153838.6785-8-andre.przywara@arm.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20210723153838.6785-1-andre.przywara@arm.com> References: <20210723153838.6785-1-andre.przywara@arm.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The H616 RTC changes its day storage to the newly introduced linear day scheme, so pair the new compatible string with this feature flag. The clock part is missing an external 32768 Hz oscillator input pin, for future expansion we must thus ignore any provided clock for now. Signed-off-by: Andre Przywara --- drivers/rtc/rtc-sun6i.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/drivers/rtc/rtc-sun6i.c b/drivers/rtc/rtc-sun6i.c index ef2b1027ce4c..db65273c6f59 100644 --- a/drivers/rtc/rtc-sun6i.c +++ b/drivers/rtc/rtc-sun6i.c @@ -392,6 +392,23 @@ 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); +static const struct sun6i_rtc_clk_data sun50i_h616_rtc_data = { + .rc_osc_rate = 16000000, + .fixed_prescaler = 32, + .has_prescaler = 1, + .has_out_clk = 1, + .export_iosc = 1, + .no_ext_losc = 1, +}; + +static void __init sun50i_h616_rtc_clk_init(struct device_node *node) +{ + sun6i_rtc_clk_init(node, &sun50i_h616_rtc_data); +} + +CLK_OF_DECLARE_DRIVER(sun50i_h616_rtc_clk, "allwinner,sun50i-h616-rtc", + sun50i_h616_rtc_clk_init); + /* * The R40 user manual is self-conflicting on whether the prescaler is * fixed or configurable. The clock diagram shows it as fixed, but there @@ -799,6 +816,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.6