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 gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (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 1B0EAC4332F for ; Mon, 14 Nov 2022 09:05:55 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id E475210E25F; Mon, 14 Nov 2022 09:05:54 +0000 (UTC) Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by gabe.freedesktop.org (Postfix) with ESMTPS id B2CFA10E085 for ; Mon, 14 Nov 2022 09:05:51 +0000 (UTC) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 0AC7E60F67; Mon, 14 Nov 2022 09:05:51 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2AA65C433C1; Mon, 14 Nov 2022 09:05:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1668416750; bh=D7WS1/Iq9HsSGiJfZeeNpWeUbfN2wCTKHRwR1waF5b8=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=gu23KWX+hkd2VrW8L8cgRL+RvzQoNmHr4ZHYqyx7b9ggw62j+4gl+srj7mMWbYEWO eMq9AeoWeTXuHN/JCWdPJOC4s9/SfymP7ivydCT3Rc5lzvj0XxUfCGvOXg+FUovve3 mBjFDbEU8fbv5pZjeBcZG4yoTG+UTWC2w0hMhrdGaf5jiuivlIjmg6M0icdu4BayDd QORZ6I5Y6XZL3p7KDrZaQgns3WiyBQD5S5uJ7AJ3isJBuf/JmKGDVf410NdJ4z5Krb lm/rhmS+2/v3szQ2Sg6geE8bZDNcFgYVQt+IzZj3PeuYYzaH8viYNnTeheDKRc95zq VsYSZrpR3L72Q== Date: Mon, 14 Nov 2022 09:05:34 +0000 From: Lee Jones To: Linus Walleij Subject: Re: [PATCH v2 35/65] clk: ux500: sysctrl: Add a determine_rate hook Message-ID: References: <20221018-clk-range-checks-fixes-v2-0-f6736dec138e@cerno.tech> <20221018-clk-range-checks-fixes-v2-35-f6736dec138e@cerno.tech> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Ulf Hansson , Prashant Gaikwad , Alexandre Belloni , Liam Girdwood , Michael Turquette , Sekhar Nori , Alexandre Torgue , dri-devel@lists.freedesktop.org, Jaroslav Kysela , Paul Cercueil , Max Filippov , Thierry Reding , linux-phy@lists.infradead.org, linux-stm32@st-md-mailman.stormreply.com, Abel Vesa , Kishon Vijay Abraham I , Geert Uytterhoeven , Samuel Holland , Chunyan Zhang , Takashi Iwai , linux-tegra@vger.kernel.org, Jernej Skrabec , Jonathan Hunter , Chen-Yu Tsai , NXP Linux Team , Orson Zhai , linux-mips@vger.kernel.org, Luca Ceresoli , linux-sunxi@lists.linux.dev, linux-rtc@vger.kernel.org, linux-clk@vger.kernel.org, Charles Keepax , alsa-devel@alsa-project.org, Manivannan Sadhasivam , linux-kernel@vger.kernel.org, Sascha Hauer , linux-actions@lists.infradead.org, Richard Fitzgerald , Mark Brown , linux-mediatek@lists.infradead.org, Maxime Ripard , Baolin Wang , Matthias Brugger , Pengutronix Kernel Team , linux-arm-kernel@lists.infradead.org, AngeloGioacchino Del Regno , Alessandro Zummo , Stephen Boyd , patches@opensource.cirrus.com, Peter De Schrijver , Nicolas Ferre , Andreas =?iso-8859-1?Q?F=E4rber?= , linux-renesas-soc@vger.kernel.org, Dinh Nguyen , Vinod Koul , Maxime Coquelin , David Lechner , Shawn Guo , Claudiu Beznea Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" On Fri, 11 Nov 2022, Linus Walleij wrote: > On Thu, Nov 10, 2022 at 2:05 PM Ulf Hansson wrote: > > On Thu, 10 Nov 2022 at 12:39, Linus Walleij wrote: > > > > > > On Thu, Nov 10, 2022 at 12:29 PM Ulf Hansson wrote: > > > > On Fri, 4 Nov 2022 at 14:32, Maxime Ripard wrote: > > > > > > > > > > The UX500 sysctrl "set_parent" clocks implement a mux with a set_parent > > > > > hook, but doesn't provide a determine_rate implementation. > > > > > > > > > > This is a bit odd, since set_parent() is there to, as its name implies, > > > > > change the parent of a clock. However, the most likely candidate to > > > > > trigger that parent change is a call to clk_set_rate(), with > > > > > determine_rate() figuring out which parent is the best suited for a > > > > > given rate. > > > > > > > > > > The other trigger would be a call to clk_set_parent(), but it's far less > > > > > used, and it doesn't look like there's any obvious user for that clock. > > > > > > > > If I recall correctly, that is the use case we did target for these > > > > types of clocks. See sound/soc/ux500/ux500_ab85xx.c, for example. > > > > > > Hm I am trying to get that driver to work ... from time to time. > > > It's just that ALSA SoC DT has changed to much that it turns out > > > into a complete rewrite :/ > > > > > > So in sound/soc/ux500/mop500_ab8500.c > > > I see this: > > > > > > status = clk_set_parent(drvdata->clk_ptr_intclk, clk_ptr); > > > if (status) > > > (...) > > > > > > and there is elaborate code to switch between "SYSCLK" and > > > "ULPCLK" (ulta-low power clock). Just like you say... however > > > a clock named SYSCLK or ULPCLK does not appear in the > > > code in drivers/clk/ux500 or any DT bindings so... it seems to > > > be non-working for the time being. > > > > It's definitely not working, but the corresponding clocks ("ulpclk", > > "intclk", "audioclk", etc) are being registered in ab8500_reg_clks(). > > > > What seems to be missing is a DT conversion for these clocks, so they > > can be consumed properly. Right? > > Yeps that and a few more things, I have a scratch rewrite here: > https://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-stericsson.git/log/?h=ux500-audio-rewrite > > I remember Lee said he had audio working with the mainline kernel > on Snowball at one point, unfortunately I think that was before we > started with the DT conversions and then we probably broke it. That was also 100 years ago. :) But yes, it used to work at one point. -- Lee Jones [李琼斯] From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C909C23A8 for ; Mon, 14 Nov 2022 09:05:50 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2AA65C433C1; Mon, 14 Nov 2022 09:05:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1668416750; bh=D7WS1/Iq9HsSGiJfZeeNpWeUbfN2wCTKHRwR1waF5b8=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=gu23KWX+hkd2VrW8L8cgRL+RvzQoNmHr4ZHYqyx7b9ggw62j+4gl+srj7mMWbYEWO eMq9AeoWeTXuHN/JCWdPJOC4s9/SfymP7ivydCT3Rc5lzvj0XxUfCGvOXg+FUovve3 mBjFDbEU8fbv5pZjeBcZG4yoTG+UTWC2w0hMhrdGaf5jiuivlIjmg6M0icdu4BayDd QORZ6I5Y6XZL3p7KDrZaQgns3WiyBQD5S5uJ7AJ3isJBuf/JmKGDVf410NdJ4z5Krb lm/rhmS+2/v3szQ2Sg6geE8bZDNcFgYVQt+IzZj3PeuYYzaH8viYNnTeheDKRc95zq VsYSZrpR3L72Q== Date: Mon, 14 Nov 2022 09:05:34 +0000 From: Lee Jones To: Linus Walleij Cc: Ulf Hansson , Maxime Ripard , Stephen Boyd , Maxime Coquelin , Chen-Yu Tsai , Daniel Vetter , Nicolas Ferre , Thierry Reding , Jaroslav Kysela , Shawn Guo , Fabio Estevam , Claudiu Beznea , Michael Turquette , Dinh Nguyen , Paul Cercueil , Chunyan Zhang , Manivannan Sadhasivam , Andreas =?iso-8859-1?Q?F=E4rber?= , Jonathan Hunter , Abel Vesa , Charles Keepax , Alessandro Zummo , Peter De Schrijver , Orson Zhai , Alexandre Torgue , Prashant Gaikwad , Liam Girdwood , Alexandre Belloni , Samuel Holland , Matthias Brugger , Richard Fitzgerald , Vinod Koul , NXP Linux Team , Sekhar Nori , Kishon Vijay Abraham I , Takashi Iwai , David Airlie , Luca Ceresoli , Jernej Skrabec , Pengutronix Kernel Team , Baolin Wang , David Lechner , Sascha Hauer , Mark Brown , Max Filippov , Geert Uytterhoeven , linux-stm32@st-md-mailman.stormreply.com, alsa-devel@alsa-project.org, linux-mediatek@lists.infradead.org, linux-phy@lists.infradead.org, linux-mips@vger.kernel.org, linux-renesas-soc@vger.kernel.org, linux-actions@lists.infradead.org, linux-clk@vger.kernel.org, AngeloGioacchino Del Regno , patches@opensource.cirrus.com, linux-tegra@vger.kernel.org, linux-rtc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org Subject: Re: [PATCH v2 35/65] clk: ux500: sysctrl: Add a determine_rate hook Message-ID: References: <20221018-clk-range-checks-fixes-v2-0-f6736dec138e@cerno.tech> <20221018-clk-range-checks-fixes-v2-35-f6736dec138e@cerno.tech> Precedence: bulk X-Mailing-List: linux-sunxi@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: On Fri, 11 Nov 2022, Linus Walleij wrote: > On Thu, Nov 10, 2022 at 2:05 PM Ulf Hansson wrote: > > On Thu, 10 Nov 2022 at 12:39, Linus Walleij wrote: > > > > > > On Thu, Nov 10, 2022 at 12:29 PM Ulf Hansson wrote: > > > > On Fri, 4 Nov 2022 at 14:32, Maxime Ripard wrote: > > > > > > > > > > The UX500 sysctrl "set_parent" clocks implement a mux with a set_parent > > > > > hook, but doesn't provide a determine_rate implementation. > > > > > > > > > > This is a bit odd, since set_parent() is there to, as its name implies, > > > > > change the parent of a clock. However, the most likely candidate to > > > > > trigger that parent change is a call to clk_set_rate(), with > > > > > determine_rate() figuring out which parent is the best suited for a > > > > > given rate. > > > > > > > > > > The other trigger would be a call to clk_set_parent(), but it's far less > > > > > used, and it doesn't look like there's any obvious user for that clock. > > > > > > > > If I recall correctly, that is the use case we did target for these > > > > types of clocks. See sound/soc/ux500/ux500_ab85xx.c, for example. > > > > > > Hm I am trying to get that driver to work ... from time to time. > > > It's just that ALSA SoC DT has changed to much that it turns out > > > into a complete rewrite :/ > > > > > > So in sound/soc/ux500/mop500_ab8500.c > > > I see this: > > > > > > status = clk_set_parent(drvdata->clk_ptr_intclk, clk_ptr); > > > if (status) > > > (...) > > > > > > and there is elaborate code to switch between "SYSCLK" and > > > "ULPCLK" (ulta-low power clock). Just like you say... however > > > a clock named SYSCLK or ULPCLK does not appear in the > > > code in drivers/clk/ux500 or any DT bindings so... it seems to > > > be non-working for the time being. > > > > It's definitely not working, but the corresponding clocks ("ulpclk", > > "intclk", "audioclk", etc) are being registered in ab8500_reg_clks(). > > > > What seems to be missing is a DT conversion for these clocks, so they > > can be consumed properly. Right? > > Yeps that and a few more things, I have a scratch rewrite here: > https://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-stericsson.git/log/?h=ux500-audio-rewrite > > I remember Lee said he had audio working with the mainline kernel > on Snowball at one point, unfortunately I think that was before we > started with the DT conversions and then we probably broke it. That was also 100 years ago. :) But yes, it used to work at one point. -- Lee Jones [李琼斯] 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 1C7DBC4332F for ; Mon, 14 Nov 2022 09:10:52 +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:In-Reply-To:MIME-Version:References: 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=XVt29RAuy0o+ifXxWO8LyVyhsKMOfbiwcqeVL6BqIXs=; b=Y5K3zqM4tvr5PF k3+39ANEWjRGngICvJiqtb3f/t8N+2PUaULd4RKypUXTnHet8tF7Pmoh1n/aT+jwcjz9Wasa4Cb4W x1WXSB+h9v3bCZ4Gv8/uX4a3KF7O5CIOGIirpKVCxhIb5GHM1qvIti1bXZmaim+o4FVgs2fCcx2qO FHf/8tQ91k/SZhvPw1OgeShXj3ROXUEcT+RP+gyfbdLZKCLnRqcWL5EMaGNTKmRtKxM21DQgcPIkH teDfWMKDWKJKypKZbAYT++cnooaXpRtr78QAau9pJ5PEqgxQVUIohR6LFvX8b8V1lRef02ni51ydW YYR97vyR9BcmnkE8BB5g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1ouVUR-00H6gs-0w; Mon, 14 Nov 2022 09:10:51 +0000 Received: from dfw.source.kernel.org ([139.178.84.217]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1ouVPc-00H3SA-Br; Mon, 14 Nov 2022 09:05:54 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 0AC7E60F67; Mon, 14 Nov 2022 09:05:51 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2AA65C433C1; Mon, 14 Nov 2022 09:05:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1668416750; bh=D7WS1/Iq9HsSGiJfZeeNpWeUbfN2wCTKHRwR1waF5b8=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=gu23KWX+hkd2VrW8L8cgRL+RvzQoNmHr4ZHYqyx7b9ggw62j+4gl+srj7mMWbYEWO eMq9AeoWeTXuHN/JCWdPJOC4s9/SfymP7ivydCT3Rc5lzvj0XxUfCGvOXg+FUovve3 mBjFDbEU8fbv5pZjeBcZG4yoTG+UTWC2w0hMhrdGaf5jiuivlIjmg6M0icdu4BayDd QORZ6I5Y6XZL3p7KDrZaQgns3WiyBQD5S5uJ7AJ3isJBuf/JmKGDVf410NdJ4z5Krb lm/rhmS+2/v3szQ2Sg6geE8bZDNcFgYVQt+IzZj3PeuYYzaH8viYNnTeheDKRc95zq VsYSZrpR3L72Q== Date: Mon, 14 Nov 2022 09:05:34 +0000 From: Lee Jones To: Linus Walleij Cc: Ulf Hansson , Maxime Ripard , Stephen Boyd , Maxime Coquelin , Chen-Yu Tsai , Daniel Vetter , Nicolas Ferre , Thierry Reding , Jaroslav Kysela , Shawn Guo , Fabio Estevam , Claudiu Beznea , Michael Turquette , Dinh Nguyen , Paul Cercueil , Chunyan Zhang , Manivannan Sadhasivam , Andreas =?iso-8859-1?Q?F=E4rber?= , Jonathan Hunter , Abel Vesa , Charles Keepax , Alessandro Zummo , Peter De Schrijver , Orson Zhai , Alexandre Torgue , Prashant Gaikwad , Liam Girdwood , Alexandre Belloni , Samuel Holland , Matthias Brugger , Richard Fitzgerald , Vinod Koul , NXP Linux Team , Sekhar Nori , Kishon Vijay Abraham I , Takashi Iwai , David Airlie , Luca Ceresoli , Jernej Skrabec , Pengutronix Kernel Team , Baolin Wang , David Lechner , Sascha Hauer , Mark Brown , Max Filippov , Geert Uytterhoeven , linux-stm32@st-md-mailman.stormreply.com, alsa-devel@alsa-project.org, linux-mediatek@lists.infradead.org, linux-phy@lists.infradead.org, linux-mips@vger.kernel.org, linux-renesas-soc@vger.kernel.org, linux-actions@lists.infradead.org, linux-clk@vger.kernel.org, AngeloGioacchino Del Regno , patches@opensource.cirrus.com, linux-tegra@vger.kernel.org, linux-rtc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org Subject: Re: [PATCH v2 35/65] clk: ux500: sysctrl: Add a determine_rate hook Message-ID: References: <20221018-clk-range-checks-fixes-v2-0-f6736dec138e@cerno.tech> <20221018-clk-range-checks-fixes-v2-35-f6736dec138e@cerno.tech> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221114_010552_524881_E3E4F38D X-CRM114-Status: GOOD ( 37.44 ) X-BeenThere: linux-phy@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Linux Phy Mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 Sender: "linux-phy" Errors-To: linux-phy-bounces+linux-phy=archiver.kernel.org@lists.infradead.org T24gRnJpLCAxMSBOb3YgMjAyMiwgTGludXMgV2FsbGVpaiB3cm90ZToKCj4gT24gVGh1LCBOb3Yg MTAsIDIwMjIgYXQgMjowNSBQTSBVbGYgSGFuc3NvbiA8dWxmLmhhbnNzb25AbGluYXJvLm9yZz4g d3JvdGU6Cj4gPiBPbiBUaHUsIDEwIE5vdiAyMDIyIGF0IDEyOjM5LCBMaW51cyBXYWxsZWlqIDxs aW51cy53YW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B3YXMgYWxzbyAxMDAgeWVhcnMgYWdvLiA6KQoKQnV0IHll cywgaXQgdXNlZCB0byB3b3JrIGF0IG9uZSBwb2ludC4KCi0tIApMZWUgSm9uZXMgW+adjueQvOaW r10KCi0tIApsaW51eC1waHkgbWFpbGluZyBsaXN0CmxpbnV4LXBoeUBsaXN0cy5pbmZyYWRlYWQu b3JnCmh0dHBzOi8vbGlzdHMuaW5mcmFkZWFkLm9yZy9tYWlsbWFuL2xpc3RpbmZvL2xpbnV4LXBo eQo= 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 alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (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 A36FCC433FE for ; Tue, 15 Nov 2022 17:09:34 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id D3E731655; Tue, 15 Nov 2022 18:08:42 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz D3E731655 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1668532172; bh=D7WS1/Iq9HsSGiJfZeeNpWeUbfN2wCTKHRwR1waF5b8=; h=Date:From:To:Subject:References:In-Reply-To:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=TZgPozclpUw1gutqFvTtONjGM7eVvNcW3/1E5rv+9/hMdryLZQFA+JLK+kyg+O3Xr KAWmFO9m9+uNhIAtE+6IZf2sgkzzNwkifzTBvyD457HZAFtZj+EtPWOqJAV7T70QDA Xm/bvbUCmhZdo+c2u6Y8CRjpMxpRYUmpkZ8h14vc= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 7F19EF8016D; Tue, 15 Nov 2022 18:08:42 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 75152F80431; Mon, 14 Nov 2022 10:05:59 +0100 (CET) Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id A10BFF800B8 for ; Mon, 14 Nov 2022 10:05:53 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz A10BFF800B8 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="gu23KWX+" Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 0AC7E60F67; Mon, 14 Nov 2022 09:05:51 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2AA65C433C1; Mon, 14 Nov 2022 09:05:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1668416750; bh=D7WS1/Iq9HsSGiJfZeeNpWeUbfN2wCTKHRwR1waF5b8=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=gu23KWX+hkd2VrW8L8cgRL+RvzQoNmHr4ZHYqyx7b9ggw62j+4gl+srj7mMWbYEWO eMq9AeoWeTXuHN/JCWdPJOC4s9/SfymP7ivydCT3Rc5lzvj0XxUfCGvOXg+FUovve3 mBjFDbEU8fbv5pZjeBcZG4yoTG+UTWC2w0hMhrdGaf5jiuivlIjmg6M0icdu4BayDd QORZ6I5Y6XZL3p7KDrZaQgns3WiyBQD5S5uJ7AJ3isJBuf/JmKGDVf410NdJ4z5Krb lm/rhmS+2/v3szQ2Sg6geE8bZDNcFgYVQt+IzZj3PeuYYzaH8viYNnTeheDKRc95zq VsYSZrpR3L72Q== Date: Mon, 14 Nov 2022 09:05:34 +0000 From: Lee Jones To: Linus Walleij Subject: Re: [PATCH v2 35/65] clk: ux500: sysctrl: Add a determine_rate hook Message-ID: References: <20221018-clk-range-checks-fixes-v2-0-f6736dec138e@cerno.tech> <20221018-clk-range-checks-fixes-v2-35-f6736dec138e@cerno.tech> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Mailman-Approved-At: Tue, 15 Nov 2022 18:08:42 +0100 Cc: Ulf Hansson , Prashant Gaikwad , Alexandre Belloni , Liam Girdwood , Michael Turquette , Sekhar Nori , Alexandre Torgue , dri-devel@lists.freedesktop.org, Paul Cercueil , Max Filippov , Thierry Reding , linux-phy@lists.infradead.org, David Airlie , Fabio Estevam , linux-stm32@st-md-mailman.stormreply.com, Abel Vesa , Kishon Vijay Abraham I , Geert Uytterhoeven , Samuel Holland , Chunyan Zhang , Takashi Iwai , linux-tegra@vger.kernel.org, Jernej Skrabec , Jonathan Hunter , Chen-Yu Tsai , NXP Linux Team , Orson Zhai , linux-mips@vger.kernel.org, Luca Ceresoli , linux-sunxi@lists.linux.dev, linux-rtc@vger.kernel.org, linux-clk@vger.kernel.org, Charles Keepax , Daniel Vetter , alsa-devel@alsa-project.org, Manivannan Sadhasivam , linux-kernel@vger.kernel.org, Sascha Hauer , linux-actions@lists.infradead.org, Richard Fitzgerald , Mark Brown , linux-mediatek@lists.infradead.org, Maxime Ripard , Baolin Wang , Matthias Brugger , Pengutronix Kernel Team , linux-arm-kernel@lists.infradead.org, AngeloGioacchino Del Regno , Alessandro Zummo , Stephen Boyd , patches@opensource.cirrus.com, Peter De Schrijver , Nicolas Ferre , Andreas =?iso-8859-1?Q?F=E4rber?= , linux-renesas-soc@vger.kernel.org, Dinh Nguyen , Vinod Koul , Maxime Coquelin , David Lechner , Shawn Guo , Claudiu Beznea X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" On Fri, 11 Nov 2022, Linus Walleij wrote: > On Thu, Nov 10, 2022 at 2:05 PM Ulf Hansson wrote: > > On Thu, 10 Nov 2022 at 12:39, Linus Walleij wrote: > > > > > > On Thu, Nov 10, 2022 at 12:29 PM Ulf Hansson wrote: > > > > On Fri, 4 Nov 2022 at 14:32, Maxime Ripard wrote: > > > > > > > > > > The UX500 sysctrl "set_parent" clocks implement a mux with a set_parent > > > > > hook, but doesn't provide a determine_rate implementation. > > > > > > > > > > This is a bit odd, since set_parent() is there to, as its name implies, > > > > > change the parent of a clock. However, the most likely candidate to > > > > > trigger that parent change is a call to clk_set_rate(), with > > > > > determine_rate() figuring out which parent is the best suited for a > > > > > given rate. > > > > > > > > > > The other trigger would be a call to clk_set_parent(), but it's far less > > > > > used, and it doesn't look like there's any obvious user for that clock. > > > > > > > > If I recall correctly, that is the use case we did target for these > > > > types of clocks. See sound/soc/ux500/ux500_ab85xx.c, for example. > > > > > > Hm I am trying to get that driver to work ... from time to time. > > > It's just that ALSA SoC DT has changed to much that it turns out > > > into a complete rewrite :/ > > > > > > So in sound/soc/ux500/mop500_ab8500.c > > > I see this: > > > > > > status = clk_set_parent(drvdata->clk_ptr_intclk, clk_ptr); > > > if (status) > > > (...) > > > > > > and there is elaborate code to switch between "SYSCLK" and > > > "ULPCLK" (ulta-low power clock). Just like you say... however > > > a clock named SYSCLK or ULPCLK does not appear in the > > > code in drivers/clk/ux500 or any DT bindings so... it seems to > > > be non-working for the time being. > > > > It's definitely not working, but the corresponding clocks ("ulpclk", > > "intclk", "audioclk", etc) are being registered in ab8500_reg_clks(). > > > > What seems to be missing is a DT conversion for these clocks, so they > > can be consumed properly. Right? > > Yeps that and a few more things, I have a scratch rewrite here: > https://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-stericsson.git/log/?h=ux500-audio-rewrite > > I remember Lee said he had audio working with the mainline kernel > on Snowball at one point, unfortunately I think that was before we > started with the DT conversions and then we probably broke it. That was also 100 years ago. :) But yes, it used to work at one point. -- Lee Jones [李琼斯]