Received: by 2002:a05:6500:2018:b0:1fb:9675:f89d with SMTP id t24csp524014lqh; Fri, 31 May 2024 08:23:43 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXfjg6dB+3rDdu2p4jYIRy5qzdsCOb7K0TOtRNQSnUXBEHIQ3dMi0chaYr/YdArZxH17/g2PBFUNZ0UmfN4BDlmT9TcQgRaPWxWqOPVew== X-Google-Smtp-Source: AGHT+IE+fqZzcS+a92PKO7XwWTzeSXcGLzAr95uoTstoyUH804OiiFFbTO9GJTDeRZgGnHav3squ X-Received: by 2002:a17:90a:c210:b0:2bd:e917:232c with SMTP id 98e67ed59e1d1-2c1dc5d7f4fmr1965293a91.48.1717169022769; Fri, 31 May 2024 08:23:42 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717169022; cv=pass; d=google.com; s=arc-20160816; b=f5JNxPWuYcvyccbnf1ZT2O1qQ7U5Lb8DwTAqXxm8DWcDQ/zaz8XJfPXy3vo2FPtfYA wwM12onLIGna7x9Ew8IgQs6VZ/YbhwusRBrqbddksQY2Xhm+F8C9O7gphyEttJsUlAZ9 GIv0Jh7DO+FOyOLa2T5pbN16E3c6wDidbt6ZRUdzTUo9ClbnVfN0cF1tE0+zaMqC1f6S IG/mJA6DHTS5GBejHPshbbLsLfBOAOywf2Nlg2Vq7ZPRLrWK60pJ7nbcUvKGDub/tc96 YbLJdVaA3toNl7esRK1rc5pA6l8YtGWQqtWKZV57pwQYO4alAueYd7KV1ICB98OPyGql i6rA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=thread-index:thread-topic:content-transfer-encoding:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:subject :references:in-reply-to:message-id:cc:to:from:date:dkim-signature :dkim-filter; bh=4gJOT2TZM2vOr96kCkDrX091SaTjqssoW8NSELgeEzE=; fh=VXt/LUKEEDJ8djAr3t5+Le8CaT+r2l2/AEkIeZg16NU=; b=M2q31z7IIsFpQzlldfytT4A7bTwtyxi6dvseYV5Ej8sQ/INXx1HimuRG/ta0U+FZtu B1TuUfoSs4QJM5+RJ5+pfB371Dk3BlMzkpnct0i52LBprQh3hFOf2kAntbWKMoSbJ9dl RMpblJFq4BeMJsAxDtDXVzrHLHXRprM9Ll4OV+uLbzNwmpNXYg+SaSk/XHVYEtQqMmSU yl53EuTFCqoK0XV7qGIaE/ub3aS7DAI95RKbNmPGImPCIBbW3N57rCbQH1oWFENaAn6x 6IQ86HnsklapPWnozti6X6BM7HgdfTja97CWQEBmGsfpLyXtqSSwafns1BhuYyNu//2C ga4A==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@savoirfairelinux.com header.s=DFC430D2-D198-11EC-948E-34200CB392D2 header.b=dOdOJWcE; arc=pass (i=1 spf=pass spfdomain=savoirfairelinux.com dkim=pass dkdomain=savoirfairelinux.com); spf=pass (google.com: domain of linux-kernel+bounces-197000-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-197000-linux.lists.archive=gmail.com@vger.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 98e67ed59e1d1-2c1dcf80deasi1305459a91.12.2024.05.31.08.23.42 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 31 May 2024 08:23:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-197000-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=@savoirfairelinux.com header.s=DFC430D2-D198-11EC-948E-34200CB392D2 header.b=dOdOJWcE; arc=pass (i=1 spf=pass spfdomain=savoirfairelinux.com dkim=pass dkdomain=savoirfairelinux.com); spf=pass (google.com: domain of linux-kernel+bounces-197000-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-197000-linux.lists.archive=gmail.com@vger.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 BF01EB28E39 for ; Fri, 31 May 2024 14:48:33 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D27585C8FC; Fri, 31 May 2024 14:48:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=savoirfairelinux.com header.i=@savoirfairelinux.com header.b="dOdOJWcE" Received: from mail.savoirfairelinux.com (mail.savoirfairelinux.com [208.88.110.44]) (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 B7849558B9; Fri, 31 May 2024 14:48:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=208.88.110.44 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717166899; cv=none; b=dcXnRmyOsBSObhrvm+twPMK3O6K1QhI6rUbkyfTmZ3xYzMwOQ5Ll6BLunEGAIbZyTSneYvxni4nIozA1PLxLI/rbUEGYXCnlFWju4qu30BqUKBgDgB41QjzFSxVwIdPD40M1ndmpTUbxm7GbPQx4Z9JEbjfviqmPhGY8ClpcL5o= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717166899; c=relaxed/simple; bh=fbwm0L2czEYAPW6jgiLOul/mhTB+DhMoOqJhXVu2zTE=; h=Date:From:To:Cc:Message-ID:In-Reply-To:References:Subject: MIME-Version:Content-Type; b=rrKaydUEi/LUozKBFB5nIa3ZSK5GVxKAZyl8xrosHfrwHe0oEiZv43i4jjMnO4ojN/3NJbD4D/K+JmFv7CX0LqTYqiwyrZlqL8+uVz33TlGz/153DjEQL1XHsgwToW91rNDCGJmtb8jl6mgseafFWxJeY57RQlT4sUANkVtJrOo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=savoirfairelinux.com; spf=pass smtp.mailfrom=savoirfairelinux.com; dkim=pass (2048-bit key) header.d=savoirfairelinux.com header.i=@savoirfairelinux.com header.b=dOdOJWcE; arc=none smtp.client-ip=208.88.110.44 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=savoirfairelinux.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=savoirfairelinux.com Received: from localhost (localhost [127.0.0.1]) by mail.savoirfairelinux.com (Postfix) with ESMTP id 36E239C53DB; Fri, 31 May 2024 10:48:14 -0400 (EDT) Received: from mail.savoirfairelinux.com ([127.0.0.1]) by localhost (mail.savoirfairelinux.com [127.0.0.1]) (amavis, port 10032) with ESMTP id OWmkbaQti6vx; Fri, 31 May 2024 10:48:13 -0400 (EDT) Received: from localhost (localhost [127.0.0.1]) by mail.savoirfairelinux.com (Postfix) with ESMTP id 328EF9C584C; Fri, 31 May 2024 10:48:13 -0400 (EDT) DKIM-Filter: OpenDKIM Filter v2.10.3 mail.savoirfairelinux.com 328EF9C584C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=savoirfairelinux.com; s=DFC430D2-D198-11EC-948E-34200CB392D2; t=1717166893; bh=4gJOT2TZM2vOr96kCkDrX091SaTjqssoW8NSELgeEzE=; h=Date:From:To:Message-ID:MIME-Version; b=dOdOJWcEsLtRJnvmZHrd7joAl03hH1oLp9K4prLenwv82raBUOBImRW4hxEktPxXA EYyPIxUtmyJFKap11cje6hg71HRxQKTFEn+8oTyaqpLhSw6XWZxobCVOr3RKeAyNtn x6bfE1KhLhAnYzMWhEc/DwzKbfQ6CZQfBckFeP4mRXK/MV0SUpO+GcklsYZTOkb+Kj XL15epmwTYJ2exGvzlIFi0qyvm+CXfbfeb9JdK32vJSszSUNpgKPGzrW/RVr/BK9LU LjYSQyTy1TVR+0E/uNLt0Vox/0OiDrYus5FMBOIThFzilOQk0WOgkuVJgf6kRhLJTK 1VeDckfjArpdQ== X-Virus-Scanned: amavis at mail.savoirfairelinux.com Received: from mail.savoirfairelinux.com ([127.0.0.1]) by localhost (mail.savoirfairelinux.com [127.0.0.1]) (amavis, port 10026) with ESMTP id 7DO2Pw_eVkH3; Fri, 31 May 2024 10:48:13 -0400 (EDT) Received: from mail.savoirfairelinux.com (mail.savoirfairelinux.com [192.168.48.237]) by mail.savoirfairelinux.com (Postfix) with ESMTP id E7B269C53DB; Fri, 31 May 2024 10:48:12 -0400 (EDT) Date: Fri, 31 May 2024 10:48:12 -0400 (EDT) From: Elinor Montmasson To: Mark Brown 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 Message-ID: <1200863744.706237.1717166892907.JavaMail.zimbra@savoirfairelinux.com> In-Reply-To: <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> <826f6c22-d1f1-42ce-a8d1-2d5cb894a970@sirena.org.uk> Subject: Re: [PATCHv4 7/9] ASoC: fsl-asoc-card: add DT clock "cpu_sysclk" with generic codec Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Mailer: Zimbra 8.8.15_GA_4581 (ZimbraWebClient - GC112 (Linux)/8.8.15_GA_4581) Thread-Topic: ASoC: fsl-asoc-card: add DT clock "cpu_sysclk" with generic codec Thread-Index: KvvrpDg7ywtOAT1UfAfWnw0nFmtERw== From: "Mark Brown" Sent: Friday, 31 May, 2024 15:05:28 > 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 = clk_get(&pdev->dev, "cpu_sysclk"); >> >> >> + if (!IS_ERR(cpu_sysclk)) { >> >> >> + priv->cpu_priv.sysclk_freq[TX] = clk_get_rate(cpu_sysclk); >> >> >> + priv->cpu_priv.sysclk_freq[RX] = priv->cpu_priv.sysclk_freq[TX]; >> >> >> + clk_put(cpu_sysclk); >> >> >> + } > >> >> > I don't really understand the goal here - this is just reading whatever >> >> > 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 DT. >> > >> >> 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 parameter. >> >> 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. It's not specifically the audio clock, I am merely using this in the machine driver to let the user the possibility to configure the CPU DAI sysclock frequency. The CPU DAI and codec drivers already manage their own clocks. I agree it is confused, I am trying to expose a driver option for this generic compatible without really knowing a use case where it would be needed. With the S/PDIF it isn't needed, so I should probably remove this commit.