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 X-Spam-Level: X-Spam-Status: No, score=-14.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3DB8AC433F5 for ; Fri, 3 Sep 2021 14:53:10 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 0B2F060FC0 for ; Fri, 3 Sep 2021 14:53:10 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 0B2F060FC0 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=cerno.tech Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:Content-Type: List-Subscribe:List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: In-Reply-To:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date: Reply-To:Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date :Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=+5fq4nt/01rhsRqh0O1wsFHC/LHIAudHAvS4jJpc3hI=; b=ZOEN4h7R+kQr01YtCCIG5Vmoe1 2XjImHEiND/GeEVj/loNtBNJPqy2tDBTH9sGVhYsDh2wtIB7YKBnqVXNMGyBWr6HScbvd8Rak9aQR H+J72d5DY6/Udt0ptjDVKBvqBB4PP0G1WgT13aEzR6W6/FuLVwIDOkCSQWgQm+m+ZXvtdSzSMdrPT ela55HzRFJAVcWkk52WxDxm8I0DqimbOTQZqEdcdK3x9Zja3vR7GlKK3goVgDgldioeAu6rRz1XWm adIDm5LNxxEYqgdg5/7Jh/bEWAJomtqL7B/WYQFz+0l5rCHfZZwv7Z3YwM1ECbAvK0+ZCZw+XpSaV xsp67Ekw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mMAXO-00CEXW-T3; Fri, 03 Sep 2021 14:51:27 +0000 Received: from new4-smtp.messagingengine.com ([66.111.4.230]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mMAXL-00CEWV-9Y for linux-arm-kernel@lists.infradead.org; Fri, 03 Sep 2021 14:51:24 +0000 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailnew.nyi.internal (Postfix) with ESMTP id 45DC058057C; Fri, 3 Sep 2021 10:51:22 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Fri, 03 Sep 2021 10:51:22 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cerno.tech; h= date:from:to:cc:subject:message-id:references:mime-version :content-type:in-reply-to; s=fm3; bh=1XMPe8iSVpVx8Cy4Rs+Zsn6BV24 jRTi51ihDKEezAlg=; b=s54i0CSHC32QpU9LVaZenG7zxAeF9fqXlVzFb9rP/Jw GBVq8zthPFBL+qP8IAZEll5DMA6m6lbyxJYj0fLB4FnSNHnVnw682GrKhGrDyDsP C/1Ck/RmK6Wq/ARrEs0703xJc4ff2BH6gPP10Fgv2C2UrZfNuwoWmPjSAoj2bQ8T dHlaL/pPD02IZKdaF4wdLqYdc+4ADearbtA7gEA5saBTsMWYzVlzNV7gdE75gD9X AqpDMIaGl/iUB0zQwMII9rnVwycoSJEsl5xDYQF5biFkEKVYjUMLZjMO9aKwI4PM ZZZMD0Hi8h7h6x7gHb4DWaILUHZSiJexAcADdPrNj2A== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; bh=1XMPe8 iSVpVx8Cy4Rs+Zsn6BV24jRTi51ihDKEezAlg=; b=q84fAIbt/P/TwRgtp63e8R 7uk0bMq3ghd85bk2sN5Dz7RNvqW0E+qVR2/9vQ+9bqE849sm8hK8gmsaQ5/jKbyV yg5tU6GFTEYERyQXM4KAOaiiWRHnzxfE95GbyRjENF9AIzQX/PBcnotUP3ozA8Lp joDhvZKZfBVTwCf/dggUW7EaR/iiWnSHdOpdo7p/V8JsxZTVMwxV7KT2M5JaYDED VCvCrizRgmOHrVfPenpDj9dsKqIA5aHgrBLyePlF5kWyp9S0+GeCpP8PIUKsyePL Cuthulsqb8JKdyfZtvYxfOGq4s0rQkxHQrvEqw2ZvTd/wymlIV0EbkCNk2/EHX7A == X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddruddvjedgkedtucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvffukfhfgggtuggjsehgtderredttddvnecuhfhrohhmpeforgigihhm vgcutfhiphgrrhguuceomhgrgihimhgvsegtvghrnhhordhtvggthheqnecuggftrfgrth htvghrnhepleekgeehhfdutdeljefgleejffehfffgieejhffgueefhfdtveetgeehieeh gedunecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepmh grgihimhgvsegtvghrnhhordhtvggthh X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 3 Sep 2021 10:51:21 -0400 (EDT) Date: Fri, 3 Sep 2021 16:51:20 +0200 From: Maxime Ripard To: Samuel Holland Cc: Chen-Yu Tsai , Jernej Skrabec , Rob Herring , Michael Turquette , Stephen Boyd , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-clk@vger.kernel.org, linux-sunxi@lists.linux.dev, linux-kernel@vger.kernel.org Subject: Re: [RFC PATCH 6/7] [DO NOT MERGE] clk: sunxi-ng: Add support for H6 Message-ID: <20210903145120.lfb3dkq66m7fpfcv@gilmour> References: <20210901053951.60952-1-samuel@sholland.org> <20210901053951.60952-7-samuel@sholland.org> MIME-Version: 1.0 In-Reply-To: <20210901053951.60952-7-samuel@sholland.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210903_075123_459836_253FD2F8 X-CRM114-Status: GOOD ( 21.09 ) 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: multipart/mixed; boundary="===============4407374100575576352==" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org --===============4407374100575576352== Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="uovaxtoufzzanesn" Content-Disposition: inline --uovaxtoufzzanesn Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Sep 01, 2021 at 12:39:50AM -0500, Samuel Holland wrote: > H6 has IOSC calibration and an ext-osc32k input. >=20 > H6 has the osc32k mux and the rtc-32k mux, but no fanout mux. >=20 > Signed-off-by: Samuel Holland > --- > drivers/clk/sunxi-ng/sun50i-rtc-ccu.c | 49 +++++++++++++++++++++++++++ > drivers/rtc/rtc-sun6i.c | 17 ---------- > 2 files changed, 49 insertions(+), 17 deletions(-) >=20 > diff --git a/drivers/clk/sunxi-ng/sun50i-rtc-ccu.c b/drivers/clk/sunxi-ng= /sun50i-rtc-ccu.c > index 1dfa05c2f0e9..9603dc0d3d7b 100644 > --- a/drivers/clk/sunxi-ng/sun50i-rtc-ccu.c > +++ b/drivers/clk/sunxi-ng/sun50i-rtc-ccu.c > @@ -227,6 +227,16 @@ static SUNXI_CCU_MUX_DATA_WITH_GATE(osc32k_fanout_cl= k, "rtc-32k-fanout", > static SUNXI_CCU_M_FW_WITH_GATE(rtc_spi_clk, "rtc-spi", "ahb", > 0x310, 0, 5, BIT(31), 0); > =20 > +static struct ccu_common *sun50i_h6_rtc_ccu_clks[] =3D { > + &iosc_clk, > + &iosc_32k_clk, > + &ext_osc32k_gate_clk.common, > + &osc32k_clk.common, > + &osc24M_32k_clk.common, > + &rtc_32k_mux_clk.common, > + &osc32k_fanout_clk.common, > +}; > + > static struct ccu_common *sun50i_h616_rtc_ccu_clks[] =3D { > &iosc_clk, > &iosc_32k_clk, > @@ -246,6 +256,21 @@ static struct ccu_common *sun50i_r329_rtc_ccu_clks[]= =3D { > &rtc_spi_clk.common, > }; > =20 > +static struct clk_hw_onecell_data sun50i_h6_rtc_ccu_hw_clks =3D { > + .num =3D CLK_NUMBER, > + .hws =3D { > + [CLK_OSC32K] =3D &osc32k_clk.common.hw, > + [CLK_OSC32K_FANOUT] =3D &osc32k_fanout_clk.common.hw, > + [CLK_IOSC] =3D &iosc_clk.hw, > + > + [CLK_IOSC_32K] =3D &iosc_32k_clk.hw, > + [CLK_EXT_OSC32K_GATE] =3D &ext_osc32k_gate_clk.common.hw, > + [CLK_OSC24M_32K] =3D &osc24M_32k_clk.common.hw, > + [CLK_RTC_32K] =3D &rtc_32k_mux_clk.common.hw, > + [CLK_RTC_SPI] =3D NULL, > + }, > +}; > + > static struct clk_hw_onecell_data sun50i_h616_rtc_ccu_hw_clks =3D { > .num =3D CLK_NUMBER, > .hws =3D { > @@ -276,6 +301,13 @@ static struct clk_hw_onecell_data sun50i_r329_rtc_cc= u_hw_clks =3D { > }, > }; > =20 > +static const struct sunxi_ccu_desc sun50i_h6_rtc_ccu_desc =3D { > + .ccu_clks =3D sun50i_h6_rtc_ccu_clks, > + .num_ccu_clks =3D ARRAY_SIZE(sun50i_h6_rtc_ccu_clks), > + > + .hw_clks =3D &sun50i_h6_rtc_ccu_hw_clks, > +}; > + > static const struct sunxi_ccu_desc sun50i_h616_rtc_ccu_desc =3D { > .ccu_clks =3D sun50i_h616_rtc_ccu_clks, > .num_ccu_clks =3D ARRAY_SIZE(sun50i_h616_rtc_ccu_clks), > @@ -318,6 +350,23 @@ static void __init sunxi_rtc_ccu_init(struct device_= node *node, > of_sunxi_ccu_probe(node, reg, desc); > } > =20 > +static void __init sun50i_h6_rtc_ccu_setup(struct device_node *node) > +{ > + struct clk_init_data *init; > + > + have_iosc_calib =3D 1; > + > + /* Casting away the const from a pointer to a non-const anonymous objec= t... */ > + init =3D (struct clk_init_data *)osc32k_fanout_clk.common.hw.init; > + > + /* Fanout only has one parent: osc32k. */ > + init->num_parents =3D 1; > + > + sunxi_rtc_ccu_init(node, &sun50i_h6_rtc_ccu_desc); > +} Indeed, that's not great. Maybe we should just duplicate the sun50i_h6_rtc_ccu_desc (and osc32k_fanout_clk) to cover both cases? Maxime --uovaxtoufzzanesn Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYIAB0WIQRcEzekXsqa64kGDp7j7w1vZxhRxQUCYTI2aAAKCRDj7w1vZxhR xecbAP49H+UG4ucpEKF2f2+KbiVaGqfAk3QM8f3wrdf1wZDvggEA2UBSAM93M7QS KdumcYrBi5U57kkpIAChWZxuy29cRAg= =VzBj -----END PGP SIGNATURE----- --uovaxtoufzzanesn-- --===============4407374100575576352== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel --===============4407374100575576352==--