Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3576459pxj; Tue, 15 Jun 2021 04:08:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyCpFlgy0M2f32OKGXiGckULV2GB0WbpGg75fxY+p15sjTj1chM5MAI4fPFD3kwOcLcn7/t X-Received: by 2002:a02:2384:: with SMTP id u126mr13940545jau.143.1623755323032; Tue, 15 Jun 2021 04:08:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623755323; cv=none; d=google.com; s=arc-20160816; b=Z88tYQjjDnhA132kzZHtZuySfaF6+XIgbPsJwlnAB5aOCyQtv+wFLVj1dJaB0tZW46 BGjgfTljhfMXjvv4FmnsrD9Grnu/KJIWvPCu56OvpYccO2Zmo1Qge8XVMft7KUi4dE1F EAc2Xrb5+gwmmyNxDek08pUcqk14S6UtOeH+Tby08YkQFxG8W7VqLoGUZcMnGVeuophT rNF5OUDzsAkXhaEBuv5KU3EKL6lVgmowtVCYl8gyfYL87azP2o87kHGmo6rvjEdcpEKc 4L+VCqAATdYtWKdSr2cbZf+kpHUTYTcKgbniut+ena0d4dI8G51TnD8QgTwcMrvgqsT8 uAXg== 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=UlCyvxNQoE2uh8qeI7/AkNQcJL0HkY3ZirOZbLXy2Ic=; b=ZPX3jpWaKPIFcSb7TV3/psPTe2AjdXsD1Y4NS9YhIlFbFuEw4tyGHhps9Idq77rHVX 3MYCVrPRtzGyJUDcFwoQKofeK3/ze6bzXRPISJtPDp1QA3sGD5hyjO4p32UdIL/pIT05 L9P47OUiYYKdJGbznleQTduJaC9zL3MjJ9y0U4tyBfhkF2dWPp+PXhRroRf+6KZp9e5g EXIiD0C6s+dKVc05qF7b4h5aBJPlabBZ0vgVZhmhnU6EeI9bXYJMSmsjkY8nwvW2Uc0n sR3HVpGWrPAtaXPkJjXyk2XQznfN9ECIlKIrB4qIcO0jh62hEtBkd345eKImrD+A4Mhr tzoQ== 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 d19si19863789jak.23.2021.06.15.04.08.28; Tue, 15 Jun 2021 04:08:43 -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 S230059AbhFOLJl (ORCPT + 99 others); Tue, 15 Jun 2021 07:09:41 -0400 Received: from foss.arm.com ([217.140.110.172]:60548 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230317AbhFOLJU (ORCPT ); Tue, 15 Jun 2021 07:09:20 -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 EC2331042; Tue, 15 Jun 2021 04:07:15 -0700 (PDT) Received: from localhost.localdomain (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id D3C893F719; Tue, 15 Jun 2021 04:07:13 -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 v7 07/19] rtc: sun6i: Add Allwinner H616 support Date: Tue, 15 Jun 2021 12:06:24 +0100 Message-Id: <20210615110636.23403-8-andre.przywara@arm.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20210615110636.23403-1-andre.przywara@arm.com> References: <20210615110636.23403-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 1fabb3c69041..25dae50019af 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 @@ -797,6 +814,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