Received: by 2002:a05:6500:2018:b0:1fb:9675:f89d with SMTP id t24csp434039lqh; Fri, 31 May 2024 06:07:17 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXy4Tb4SvqGI3/ajCeKydNPFUxhp8MRSCIZOyuaZzj1sa4kXfSegyvthlBSHm3voDoTGO954K/kF1DQD62CQLORlEnXIEVMDgEhsROL9g== X-Google-Smtp-Source: AGHT+IENRJXlqRxB+IUBtGzuC5qI2uOEMWwCrrFcwJCscxjNPaz7lmNeYTtMWOg1adf8ygOPzdcj X-Received: by 2002:a05:6a21:99a5:b0:1af:acf6:f790 with SMTP id adf61e73a8af0-1b26f2c2bf1mr2271855637.48.1717160836943; Fri, 31 May 2024 06:07:16 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717160836; cv=pass; d=google.com; s=arc-20160816; b=Nci5nYaPsXCzyeQUDszvClc2hztEExwbvfRNU/ibIWnF5qkpCXSdnr5QkKzJg56bgi Ntuh7Rx8BwKH+n0FhBO2GkUfC/Q5ZNsZ4kKidiCSqR8qq6kzby2RdtDcNuqEm9LcOxo5 RxzwBmy3KVwVCsVVgdQCnZTKH+v+glRRsAbqhCbrEswgSxXPW0KdTip805DlqtgZORpe YDUvwK+ZXIrlyEEYgrsvykq3/SNTLZNvNW2qFlPhRUyY2tSsLifgmA+0Aa5zqMuYUnaw 8+mO1bHeuIhcsCm36B3BEl8WGyFHKXyhsFgGGXgFYNCw21nY84Wk4gH7wR8tu8wOcCln VRig== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=UcFdfRAy4tkAoNaKfGPhaO6BnJONS5cBclswIOt7xWs=; fh=LAl9jzQaRG6KnCQKOUrFjbA9OnwLnFHHVP2WNTDCQD4=; b=NlhaABBDjzguGuEpEep5kXL5hD0yr2rjDF1e5Uj0ywwaUmpC9ULLKEzFCgBb9QvzVw OPYDPQEY7YaVXXtf+PNYwGVm6hAPx2rA4MJHwMExo7cFiIpt+qAklUNyR3Yxuc03lhAk If71jjx6DyahNFinxi1NmOdtnAU1pyw7iTFdT55nab1ujYw3aKk7Fg2hOzc+MxDRSrKB s3RcXxUnKsyxm33Z0BnVVpIV9yIgn8/Q65kqspcjSydBjZykJUJErpaCcpjKuVwEn7B3 1bclyT0oqgBv+EfL0bPRarau7kw+tjwpyDlrXM7d7a1ccHWfMg5umg6+S5WtPiiwAjmI AHUg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="dsje7/cZ"; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-196834-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-196834-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id d2e1a72fcca58-70242d593d5si1508417b3a.336.2024.05.31.06.07.15 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 31 May 2024 06:07:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-196834-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="dsje7/cZ"; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-196834-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-196834-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 6DC69B232EA for ; Fri, 31 May 2024 13:05:46 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5200E158A12; Fri, 31 May 2024 13:05:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="dsje7/cZ" 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 6F8D91581FB; Fri, 31 May 2024 13:05:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717160735; cv=none; b=c2a0+v3RO0vNEHAOyZlXjXgb7f6xuBjv7BJG9XdeqK9HtljUL6/8zyZQwm2Z2cVpFFmDke9Sbve9UqF5CVzRJshr8cfF6R/CNpyPwz8ovjAOBj6eWd7OSbw5GdJhd0spECG+Zy8Sc8Eo2NUmIE/emLb5XbjzFmrJRndDANl5gvs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717160735; c=relaxed/simple; bh=dx7sosLdw/sMCS1kUDSuJ+V4bIgBHv6xTIsGonpSXe0=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=o2+svzElAIuJ7sCV2kABXd9gQJl+/yze23NKASOH6fTf3fPNiPW9WqwXtzY20+woxOE4ukpC1130/gCr36+T8hKem21m/UC/oJrIqWH4efzYLmXXXq/F2532QLmjQPibjzvJ5M57MMvLQchqTLKoY6lGuObuhwUdno4KmPKQtp4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=dsje7/cZ; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 20734C116B1; Fri, 31 May 2024 13:05:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1717160735; bh=dx7sosLdw/sMCS1kUDSuJ+V4bIgBHv6xTIsGonpSXe0=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=dsje7/cZyyF91s/HghOChQzu65qzn4qwHQZqMG+7mokDXR7Jfvm7kxU94sajwCuJJ 0uPm7PXp/wef7hqUDRdFjTZJQ+2CzrLr4Kx9J4ScNpsgNqIhHGLKwtond52tNpzA9F gtcvjFtw2rJ3AkXJE5CQR263VaNocoIdKMSy0mAFRvhtRQR5OsCRnh0jynSNMgW9qD QpWpnRN9bdws2ZYkuR3ZW5iyjv3Nk0gR/juI86Nn8hKyfMy2lIVCoyPk8LTXTIihOP MFhw/4yL/uqzYm6nmu2C5SptZZVEAsj/4fgQECPspdNjOkih6Bq/tfyhuAEfkIe0sB khJnx69J6Wa0Q== Date: Fri, 31 May 2024 14:05:28 +0100 From: Mark Brown To: Elinor Montmasson Cc: Liam Girdwood , Rob Herring , Krzysztof Kozlowski , Conor Dooley , shengjiu wang , Xiubo Lee , Fabio Estevam , Nicolin Chen , Jaroslav Kysela , Takashi Iwai , linux-sound , devicetree , linux-kernel , alsa-devel , linuxppc-dev Subject: Re: [PATCHv4 7/9] ASoC: fsl-asoc-card: add DT clock "cpu_sysclk" with generic codec Message-ID: <826f6c22-d1f1-42ce-a8d1-2d5cb894a970@sirena.org.uk> References: <20240515135411.343333-1-elinor.montmasson@savoirfairelinux.com> <20240515135411.343333-8-elinor.montmasson@savoirfairelinux.com> <822567441.349330.1715936735603.JavaMail.zimbra@savoirfairelinux.com> <1660761484.701255.1717159615755.JavaMail.zimbra@savoirfairelinux.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="t5IjrPd8avuXZPeL" Content-Disposition: inline In-Reply-To: <1660761484.701255.1717159615755.JavaMail.zimbra@savoirfairelinux.com> X-Cookie: Serving suggestion. --t5IjrPd8avuXZPeL Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, May 31, 2024 at 08:46:55AM -0400, Elinor Montmasson wrote: > From: "Mark Brown" > > On Fri, May 17, 2024 at 05:05:35AM -0400, Elinor Montmasson wrote: > >> From: "Mark Brown" > >> > On Wed, May 15, 2024 at 03:54:09PM +0200, Elinor Montmasson wrote: > >> >> + struct clk *cpu_sysclk =3D clk_get(&pdev->dev, "cpu_sysclk"); > >> >> + if (!IS_ERR(cpu_sysclk)) { > >> >> + priv->cpu_priv.sysclk_freq[TX] =3D clk_get_rate(cpu_sysclk); > >> >> + priv->cpu_priv.sysclk_freq[RX] =3D priv->cpu_priv.sysclk_freq[T= X]; > >> >> + clk_put(cpu_sysclk); > >> >> + } > >> > I don't really understand the goal here - this is just reading whate= ver > >> > frequency happens to be set in the hardware when the driver starts up > >> > which if nothing else seems rather fragile? > >> The driver allow to set the sysclk frequency > >> of the CPU DAI through `priv->cpu_priv.sysclk_freq` when calling > >> `fsl_asoc_card_hw_params()`. > >> Currently it is hard-coded per use-case in the driver. > >> My reasoning was that with a generic codec/compatible, there might > >> be use-cases needing to use this parameter, so I exposed it here via D= T. > >=20 > >> Is it a bad idea to expose this parameter ? This is not a requirement = for the > >> driver to work, most of the current compatibles do not use this parame= ter. > >> It is currently used only for `fsl,imx-audio-cs42888`. > >> In that case I can remove this commit. > > I'm having a hard time connecting your reply here with my comment. This > > isn't as far as I can see allowing the frequency to be explicitly > > configured, it's just using whatever value happens to be programmed in > > the clock when the driver starts. > In v3 I used parameters `cpu-sysclk-freq-rx/tx` to explicitly > set the frequency. > In its review Rob Herring said that the clock bindings should > be used, so that's why I changed it to use this `cpu_sysclk` clock. So you're trying to use this as the audio clock? There's no code that enables the clock which seems worrying, and I'd expect that if the device is using it's own clock the device would be querying it directly via the clock API rather than this. This all seems really confused. --t5IjrPd8avuXZPeL Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAmZZyxcACgkQJNaLcl1U h9Be4gf/YfLlU8GPgc+J8qnnUXsGMfa3hyDMKKjkChZ7Z2VgGlh61Y8j3nssb5sV qVQOuuv5hD2jNlTKEYoCiiHNIfmOe9GqRtYmsQkk/UYScO0NwovQ7UYpquVtkJFb qXgMXiPhACDh+wm1P4G3pHV9gVN/ZOLZcrPtwl2Rv1lK4j7rhZqbT/FD+9aeRu9p FpUiNfiwP6l6e8KIgPcDb8tBbqqnS/tLrE6xPk6EfflG+fJM9w3eUm4+tlf0uCcN QldOJ1GhYERqM69Sj1g7TWgh/0BZ59EVD8CtX9HPGC5SBYW7Kyf6ew79K8VCd/CR TxJMEZjB7AtvR8rBJYzqx8/I1/gToQ== =CcoA -----END PGP SIGNATURE----- --t5IjrPd8avuXZPeL--