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 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 86297C3DA79 for ; Thu, 29 Dec 2022 23:20:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=9zNocBykAKPDuk8kGuSfwqIflBla6mn3M/IsT2z1rFM=; b=04qOFNu6uKm6Fb HMI8chba/MjE9Cua7Rag614w+5NZXMAxq+fv2OJf4YPx84cW9jF+C38QGoVzptvGNLz41KBNNqe3R 3MeM62kljvmeiFnnGTWnRhS9+yQ87TAPNU3kcZfQd8qNT/QqzAo7MkTXfJ6H4pYBrAvVhLX10pXsr ZwL/RKuHUw+j/LQ/b2q4cHUUjB+Fy/F4iZgzHhptDJ8oem+aG2vBc1CgOBtiPOn6s6jdHElUvopX8 JOl1gi8tusfWvawHb41wWTa3ASqaFTroHBSK0/wIS0uGgh21lhzZb81QhzPpUmv3KnLNY77VG5Lbf +uxRH7MzGdZZPq2mcY4A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pB2Ax-0035O2-5V; Thu, 29 Dec 2022 23:19:03 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pB2Aj-0035DZ-1f for linux-arm-kernel@lists.infradead.org; Thu, 29 Dec 2022 23:18:51 +0000 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 9C1032F4; Thu, 29 Dec 2022 15:19:23 -0800 (PST) Received: from slackpad.lan (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id B21A43F663; Thu, 29 Dec 2022 15:18:40 -0800 (PST) Date: Thu, 29 Dec 2022 23:17:03 +0000 From: Andre Przywara To: Samuel Holland Cc: Alexandre Belloni , Chen-Yu Tsai , Jernej Skrabec , Maxime Ripard , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-rtc@vger.kernel.org, linux-sunxi@lists.linux.dev Subject: Re: [PATCH] rtc: sun6i: Always export the internal oscillator Message-ID: <20221229231703.19f5eda7@slackpad.lan> In-Reply-To: <20221229215319.14145-1-samuel@sholland.org> References: <20221229215319.14145-1-samuel@sholland.org> Organization: Arm Ltd. X-Mailer: Claws Mail 4.1.0 (GTK 3.24.31; x86_64-slackware-linux-gnu) MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221229_151849_278272_8D97C31C X-CRM114-Status: GOOD ( 23.33 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Thu, 29 Dec 2022 15:53:19 -0600 Samuel Holland wrote: Hi Samuel, > On all variants of the hardware, the internal oscillator is one possible > parent for the AR100 clock. It needs to be exported so we can model that > relationship correctly in the devicetree. So do you plan to use this third clock on any SoCs that don't export it yet, like the R40 or V3s, or the older SoCs? This would then create a non-compatible DT change, wouldn't it? Since existing/older kernels cannot resolve clock index 2? Or would that not be used by kernels, or would not be fatal? Cheers, Andre > Fixes: c56afc1844d6 ("rtc: sun6i: Expose internal oscillator through device tree") > Signed-off-by: Samuel Holland > --- > This patch should be applied before [1] so this patch can be backported. > [1]: https://lore.kernel.org/linux-rtc/20221229184011.62925-2-samuel@sholland.org/ > > drivers/rtc/rtc-sun6i.c | 16 ++++------------ > 1 file changed, 4 insertions(+), 12 deletions(-) > > diff --git a/drivers/rtc/rtc-sun6i.c b/drivers/rtc/rtc-sun6i.c > index ed5516089e9a..7038f47d77ff 100644 > --- a/drivers/rtc/rtc-sun6i.c > +++ b/drivers/rtc/rtc-sun6i.c > @@ -136,7 +136,6 @@ struct sun6i_rtc_clk_data { > unsigned int fixed_prescaler : 16; > unsigned int has_prescaler : 1; > unsigned int has_out_clk : 1; > - unsigned int export_iosc : 1; > unsigned int has_losc_en : 1; > unsigned int has_auto_swt : 1; > }; > @@ -271,10 +270,8 @@ static void __init sun6i_rtc_clk_init(struct device_node *node, > /* Yes, I know, this is ugly. */ > sun6i_rtc = rtc; > > - /* Only read IOSC name from device tree if it is exported */ > - if (rtc->data->export_iosc) > - of_property_read_string_index(node, "clock-output-names", 2, > - &iosc_name); > + of_property_read_string_index(node, "clock-output-names", 2, > + &iosc_name); > > rtc->int_osc = clk_hw_register_fixed_rate_with_accuracy(NULL, > iosc_name, > @@ -315,13 +312,10 @@ static void __init sun6i_rtc_clk_init(struct device_node *node, > goto err_register; > } > > - clk_data->num = 2; > + clk_data->num = 3; > clk_data->hws[0] = &rtc->hw; > clk_data->hws[1] = __clk_get_hw(rtc->ext_losc); > - if (rtc->data->export_iosc) { > - clk_data->hws[2] = rtc->int_osc; > - clk_data->num = 3; > - } > + clk_data->hws[2] = rtc->int_osc; > of_clk_add_hw_provider(node, of_clk_hw_onecell_get, clk_data); > return; > > @@ -361,7 +355,6 @@ static const struct sun6i_rtc_clk_data sun8i_h3_rtc_data = { > .fixed_prescaler = 32, > .has_prescaler = 1, > .has_out_clk = 1, > - .export_iosc = 1, > }; > > static void __init sun8i_h3_rtc_clk_init(struct device_node *node) > @@ -379,7 +372,6 @@ static const struct sun6i_rtc_clk_data sun50i_h6_rtc_data = { > .fixed_prescaler = 32, > .has_prescaler = 1, > .has_out_clk = 1, > - .export_iosc = 1, > .has_losc_en = 1, > .has_auto_swt = 1, > }; _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel