Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp6587725rwl; Thu, 29 Dec 2022 16:07:15 -0800 (PST) X-Google-Smtp-Source: AMrXdXsp+rP+M5vF0pU2gPFfRGoVqpfj4VYl6oGNEGtiVQkDH+vtil35Q9SRafs22g196QkvejyN X-Received: by 2002:a05:6402:f28:b0:46d:cf78:8c62 with SMTP id i40-20020a0564020f2800b0046dcf788c62mr26337484eda.27.1672358834983; Thu, 29 Dec 2022 16:07:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672358834; cv=none; d=google.com; s=arc-20160816; b=o7cfl9RPJwUVr/Ho39qXgk9VzoSGS0r/SluXzpkP5VVYloGE68e4wG1tt8hFZapKc1 CHve2LKvmOrgw1X0x5pvNG3d9xlzbrp6nKleWsnTiVCJIfzrgiD61+S4V9u9UqzzijlE FhydGVGmKNfvoEMJNGZVQQ+YRsTZE73f66nT/+t8g9S3vdd1+LPxQmkpw8PPb2FJTN91 99tcjxwIv3rBq0SWFKoMqJPr4sapC+lZBo66/97I601t2uF411lvIk9P/GAlGiU9KyRn UAnjcY2oxQtAeK/g7Jdcn8f6CgOBXnrIw6IkTkqoqWOc5iS47LINNuG8PLpoLvJKTSm/ KUGQ== 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=sdnGe523i0WpSnSoJTF7Y3iAQzu2WvS8YJ1XQXerpio=; b=q1gNGNdWOfDwCK3fWWZOWYYTBgVErLUsJwybBcB4DEKYN/yCTsCrSoUWMrMdviSKu1 riAJWBhmv1zwZHHza58o/z2/xIlieCPPuPHutnktNigFzBu/aUrLmtAc86Q6D+vIah/e KyC7DKwLhfdtGQL8oTjhLZgcDgu1Cg0P119CtYyQ/USchk6a+M7uMmfUrdQo3k6P3xk/ AYitnTvmUSfZKK3l+L5OwRPaVMmIwJ4oChYDOkfI/AhsPQhJSpVp3CdB5Gwibq94FzB5 tdH2JsUuch3FpaFnkSnKnsKJOrylqqnNu7rAgXQjPR9QeIgSaySwoTSVrHLM2ulH9jNC qlAw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e8-20020aa7d7c8000000b0046f9bcabfe6si15388811eds.601.2022.12.29.16.06.53; Thu, 29 Dec 2022 16:07:14 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S233993AbiL2XSz (ORCPT + 61 others); Thu, 29 Dec 2022 18:18:55 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39070 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230297AbiL2XSo (ORCPT ); Thu, 29 Dec 2022 18:18:44 -0500 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 927B516582; Thu, 29 Dec 2022 15:18:42 -0800 (PST) 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 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.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, > };