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 38749C54E5D for ; Tue, 19 Mar 2024 00:31:53 +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:From:References:CC:To: Subject:MIME-Version:Date:Message-ID:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=XYra2ehTa7SYBy7YbkW94gJPbRbNq31xAQhBBhrOF4U=; b=Ca0aaEZxk0kpmp EyHyulU/mo0TVIshIapsqpDPu95s9VofJHZWSAkUUPi5kabHnsDmdw/yN7DH1SPKeAfla4ANfwZar Cf2gseJCenOQrz1fezj6mC/pOVzwlcymaSU6iBIszRy6MIH9TZ+bgeHaquKWqhWO7wDWem76qZaIq HMtWTkS4H8lmedbn7D8mT0fMeyYyMIaw+GwBX3lczMuiGhoMvhI61P9rV7F/r95sZJxQTq+vn+sqd 5yeBeseiDsXwU/PKPMGENIDQl6RkYxJigYqeb0kc3dSHZtYLckoxksumWTSL1BsjuPFUTEz5H2uM5 TNeoql55mvG473u6/GgQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rmNOG-0000000Ah6Y-1XBQ; Tue, 19 Mar 2024 00:31:40 +0000 Received: from mx1.sberdevices.ru ([37.18.73.165]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rmNOC-0000000Ah2D-2oTD; Tue, 19 Mar 2024 00:31:38 +0000 Received: from p-infra-ksmg-sc-msk01 (localhost [127.0.0.1]) by mx1.sberdevices.ru (Postfix) with ESMTP id A3E89100007; Tue, 19 Mar 2024 03:31:32 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.sberdevices.ru A3E89100007 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=salutedevices.com; s=mail; t=1710808292; bh=+YwZKtSaR+pjRPk6L9WeQ8b6BmPf9L3Et32PnbS21HY=; h=Message-ID:Date:MIME-Version:Subject:To:From:Content-Type:From; b=loU4GwByqN5/mXr3sPY0IbEQ4WiTXG4iuIV6E5c3JKFJ/oFTF3Fzaai6uOXUIM1Rw S1fSzLqsApsfzp8jo7HYC9+BOGIS8I3NrCTUCvrzVfQM3HYw/j4ZFdbWj0YbZ3OLdQ +zIP6iUk6FSerAYZld7gbxkexFedcYtmDstikVEbgxnx4UJ0hrf3RIeXZ0apeZi4JK bVi7aoShiICvR4VJm1iNeDP/6sIYEO+/vvkI6qMQSP3apoA0PVlwGprRyKGsvf6KBl fDiXZR6veUjw0+oGU/IaJ4Pc9lMNRvA4QhH2RZqK/+a1Rz6LGE50X6SUCSOBF9Y7yW klLSoot5ABQVQ== Received: from smtp.sberdevices.ru (p-i-exch-sc-m02.sberdevices.ru [172.16.192.103]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.sberdevices.ru (Postfix) with ESMTPS; Tue, 19 Mar 2024 03:31:31 +0300 (MSK) Received: from [172.28.224.29] (100.64.160.123) by p-i-exch-sc-m02.sberdevices.ru (172.16.192.103) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.40; Tue, 19 Mar 2024 03:31:30 +0300 Message-ID: <158343f2-23af-4260-b631-922d81afce88@salutedevices.com> Date: Tue, 19 Mar 2024 03:30:45 +0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 13/25] ASoC: dt-bindings: meson: axg-pdm: document 'sysrate' property Content-Language: en-US To: Jerome Brunet CC: Krzysztof Kozlowski , Neil Armstrong , Michael Turquette , Stephen Boyd , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Philipp Zabel , Kevin Hilman , Martin Blumenstingl , Liam Girdwood , Mark Brown , Linus Walleij , Jaroslav Kysela , Takashi Iwai , , , , , , , , , References: <20240314232201.2102178-1-jan.dakinevich@salutedevices.com> <20240314232201.2102178-14-jan.dakinevich@salutedevices.com> <1jil1nhjwd.fsf@starbuckisacylon.baylibre.com> <6feba9ff-8bbf-4494-93f0-732679bc4032@salutedevices.com> <1j1q87hkq2.fsf@starbuckisacylon.baylibre.com> <1jwmpzg1hq.fsf@starbuckisacylon.baylibre.com> From: Jan Dakinevich In-Reply-To: <1jwmpzg1hq.fsf@starbuckisacylon.baylibre.com> X-Originating-IP: [100.64.160.123] X-ClientProxiedBy: p-i-exch-sc-m02.sberdevices.ru (172.16.192.103) To p-i-exch-sc-m02.sberdevices.ru (172.16.192.103) X-KSMG-Rule-ID: 10 X-KSMG-Message-Action: clean X-KSMG-AntiSpam-Lua-Profiles: 184250 [Mar 18 2024] X-KSMG-AntiSpam-Version: 6.1.0.4 X-KSMG-AntiSpam-Envelope-From: YVDakinevich@sberdevices.ru X-KSMG-AntiSpam-Rate: 0 X-KSMG-AntiSpam-Status: not_detected X-KSMG-AntiSpam-Method: none X-KSMG-AntiSpam-Auth: dkim=none X-KSMG-AntiSpam-Info: LuaCore: 10 0.3.10 53c821b925e16276b831986eabc71d60ab82ee60, {Tracking_smtp_not_equal_from}, {Tracking_bl_eng_cat, c15}, {Tracking_from_domain_doesnt_match_to}, 127.0.0.199:7.1.2;sberdevices.ru:7.1.1,5.0.1;d41d8cd98f00b204e9800998ecf8427e.com:7.1.1;100.64.160.123:7.1.2;salutedevices.com:7.1.1;smtp.sberdevices.ru:7.1.1,5.0.1, FromAlignment: n, {Tracking_smtp_domain_mismatch}, {Tracking_smtp_domain_2level_mismatch}, {Tracking_white_helo}, ApMailHostAddress: 100.64.160.123 X-MS-Exchange-Organization-SCL: -1 X-KSMG-AntiSpam-Interceptor-Info: scan successful X-KSMG-AntiPhishing: Clean X-KSMG-LinksScanning: Clean X-KSMG-AntiVirus: Kaspersky Secure Mail Gateway, version 2.0.1.6960, bases: 2024/03/18 21:41:00 #24279760 X-KSMG-AntiVirus-Status: Clean, skipped X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240318_173137_115666_D682CC23 X-CRM114-Status: GOOD ( 25.14 ) 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 3/18/24 15:19, Jerome Brunet wrote: > > On Mon 18 Mar 2024 at 11:55, Jerome Brunet wrote: > >> On Sun 17 Mar 2024 at 18:52, Jan Dakinevich wrote: >> >>> On 3/15/24 13:22, Jerome Brunet wrote: >>>> >>>> On Fri 15 Mar 2024 at 11:00, Krzysztof Kozlowski wrote: >>>> >>>>> On 15/03/2024 00:21, Jan Dakinevich wrote: >>>>>> This option allow to redefine the rate of DSP system clock. >>>>> >>>>> And why is it suitable for bindings? Describe the hardware, not what you >>>>> want to do in the driver. >>>>> >>>>>> >>>>>> Signed-off-by: Jan Dakinevich >>>>>> --- >>>>>> Documentation/devicetree/bindings/sound/amlogic,axg-pdm.yaml | 4 ++++ >>>>>> 1 file changed, 4 insertions(+) >>>>>> >>>>>> diff --git a/Documentation/devicetree/bindings/sound/amlogic,axg-pdm.yaml b/Documentation/devicetree/bindings/sound/amlogic,axg-pdm.yaml >>>>>> index df21dd72fc65..d2f23a59a6b6 100644 >>>>>> --- a/Documentation/devicetree/bindings/sound/amlogic,axg-pdm.yaml >>>>>> +++ b/Documentation/devicetree/bindings/sound/amlogic,axg-pdm.yaml >>>>>> @@ -40,6 +40,10 @@ properties: >>>>>> resets: >>>>>> maxItems: 1 >>>>>> >>>>>> + sysrate: >>>>>> + $ref: /schemas/types.yaml#/definitions/uint32 >>>>>> + description: redefine rate of DSP system clock >>>>> >>>>> No vendor prefix, so is it a generic property? Also, missing unit >>>>> suffix, but more importantly I don't understand why this is a property >>>>> of hardware. >>>> >>>> +1. >>>> >>>> The appropriate way to set rate of the clock before the driver take over >>>> is 'assigned-rate', if you need to customize this for different >>>> platform. >>>> >>> >>> It would be great, but it doesn't work. Below, is what I want to see: >>> >>> assigned-clocks = >>> <&clkc_audio AUD2_CLKID_PDM_SYSCLK_SEL>, >>> <&clkc_audio AUD2_CLKID_PDM_SYSCLK_DIV>; >>> assigned-clock-parents = >>> <&clkc_pll CLKID_FCLK_DIV3>, >>> <0>; >>> assigned-clock-rates = >>> <0>, >>> <256000000>; >>> >>> But regardles of this declaration, PDM's driver unconditionally sets >>> sysclk'rate to 250MHz and throws away everything that was configured >>> before, reparents audio2_pdm_sysclk_mux to hifi_pll and changes >>> hifi_pll's rate. >>> >>> This value 250MHz is declared here: >>> >>> static const struct axg_pdm_cfg axg_pdm_config = { >>> .filters = &axg_default_filters, >>> .sys_rate = 250000000, >>> }; >>> >>> The property 'sysrate' is intended to redefine hardcoded 'sys_rate' >>> value in 'axg_pdm_config'. >> >> What is stopping you from removing that from the driver and adding >> assigned-rate to 250M is the existing platform ? > > ... Also, considering how PDM does work, I'm not sure I get the point of > the doing all this to go from 250MHz to 256Mhz. > The point is to use fclk_div3 clock as source for PDM's sysclock and keep hiff_pll clock free for TDM. Because, I can get 256MHz from any hifi_pll and fclk_div3, but only hifi_pll is able to provide accurate 48kHz (after several divider). > PDM value is sampled at ~75% of the half period. That clock basically > feeds a counter and the threshold is adjusted based on the clock rate. > > So there is no need to change the rate. Changing it is only necessary > when the captured audio rate is extremely slow (<8kHz) and the counter > may overflow. The driver already adjust this automatically. > > So changing the input rate from 250MHz to 256MHz should not make any > difference. > Thank you for the explanation. >> >>> >>>> Then you don't have to deal with it in the device driver. >>>> >>>>> >>>>> Best regards, >>>>> Krzysztof >>>> >>>> > > -- Best regards Jan Dakinevich _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel