Received: by 2002:ab2:6816:0:b0:1f9:5764:f03e with SMTP id t22csp808756lqo; Fri, 17 May 2024 02:05:58 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWOUDy332U/QIyFPq54llC/lRQinLv05opAdSevZgaksj4Iw3CbTXLt+yQkGEKUtEibdvFRihwHcClbkZ+xGAbfRRmtOgNOGaMpn/NplQ== X-Google-Smtp-Source: AGHT+IGfV4wa5b+FHNcK4CPt/Mjw8S90Wrbb+tf6wzOpyzEYcVlIXu6MP8Npc86gFQDEH9pyqGiE X-Received: by 2002:a17:90b:4f4e:b0:2a5:16c2:8551 with SMTP id 98e67ed59e1d1-2b6cc76d83fmr22308625a91.19.1715936758500; Fri, 17 May 2024 02:05:58 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715936758; cv=pass; d=google.com; s=arc-20160816; b=YMr/p7oXyUsabrt0881TxShtAAa1LbBmG+MGljr3n0/dq1AqSBvb+lVMG0J3bgornY p3amva5Z+xIoZSI+FPMIZ398i8aoLNhO6KRl8oW1tdPS9ldoM6Ba3NbTcSzfkfFepW9q kzCi7BX/eveeRWjT0uRrq4PQlH1SRgrU7nI1IveCF3xcZqzxlYyW2Da9XcTnfD5tWVg7 pLOvnqAMfaDoO45hW6LQ/TNrW5xeYTCGM8QNz0MV5vK+CDZWKIYhsm1qEnPMjtAH5p2w yuaUNZukSh+RwEI21MnyvKwKbyBrZp1ifVIlf3uhi/PsqVEUb8V8MzVVqDd5ompdz5TH criQ== 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=eDu4DXcZYZmRMzTsE23CtiqrrOlfxWxDABDYJj8qWVA=; fh=VXt/LUKEEDJ8djAr3t5+Le8CaT+r2l2/AEkIeZg16NU=; b=Hyyjll1hWC6CjWn3Z3Xi/pSdNdSOzIGNwaQ5jTCRDUQbfW6ZaO+BCRaFHZUDHxSY8f R1vadX83MnrjDrMbsDrCZRZy3MO3iXvcaxcHtBjDgl5b9WltTYaMchzvw4VePmWge+Xj V+QLKQz4f7PsYdUGkjkVtt2E/ixY8psBk8Vu6xYuVo4VJCJGlEoglHNULkkw1Rg/lbJL k26eMJZ0ZvCI1jx4VyvMSh5tOclaONHE4gPy2qV2gwUHyNk48dReSFeNZDebCJFoSolg swrbtxv1ftatoqLtNeF5uJwQt5p680Pd125OxaqZRDnbl5o9xmcANB1U6LI/l0ueLRTG vrkw==; 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=yJbKu2bb; arc=pass (i=1 spf=pass spfdomain=savoirfairelinux.com dkim=pass dkdomain=savoirfairelinux.com); spf=pass (google.com: domain of linux-kernel+bounces-181893-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-181893-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id 98e67ed59e1d1-2b628869502si18999421a91.10.2024.05.17.02.05.58 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 May 2024 02:05:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-181893-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@savoirfairelinux.com header.s=DFC430D2-D198-11EC-948E-34200CB392D2 header.b=yJbKu2bb; arc=pass (i=1 spf=pass spfdomain=savoirfairelinux.com dkim=pass dkdomain=savoirfairelinux.com); spf=pass (google.com: domain of linux-kernel+bounces-181893-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-181893-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id DE3A62825EE for ; Fri, 17 May 2024 09:05:57 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id EF3FC1EB48; Fri, 17 May 2024 09:05:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=savoirfairelinux.com header.i=@savoirfairelinux.com header.b="yJbKu2bb" 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 0291F1AAA5; Fri, 17 May 2024 09:05:44 +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=1715936747; cv=none; b=I5C4OFYxtRjkF8rBb0sSXM9iH1UimlSEXV0c+yuzBApxvB3ng2PC2tl7/b95wh8x24h983keDKW2lolSAsc5ecEUOF6HyyEFgnKcOTVewNht4FyQ1du+uQS13XThgjh8Mtri3i8MnvF32TfUPbGP9Nw/JokcIq76ni42RJssS7U= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715936747; c=relaxed/simple; bh=Cg9MTPT9tWRh/8PAEQ/0bLqgcKcVgIar/eyWrNXcBzY=; h=Date:From:To:Cc:Message-ID:In-Reply-To:References:Subject: MIME-Version:Content-Type; b=pEchBRsDV5kjm1sEYVtRIkgErr1ZNkPQP88S8hnVLaX6oMEyCWYSSqEOJOOsS5z2QJF8kp6oQkjCqxJk7dLuvRNy/k6Vq1C/agrP/6q0vyUgWskdAUdnuY+P/f61ec93EMTa0DHoYvsBIskx2ZOyrOGQlj8qV3j/cGs3/gIplUs= 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=yJbKu2bb; 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 BE8889C585F; Fri, 17 May 2024 05:05:36 -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 OzTJfta_rJ3O; Fri, 17 May 2024 05:05:36 -0400 (EDT) Received: from localhost (localhost [127.0.0.1]) by mail.savoirfairelinux.com (Postfix) with ESMTP id 157C59C591E; Fri, 17 May 2024 05:05:36 -0400 (EDT) DKIM-Filter: OpenDKIM Filter v2.10.3 mail.savoirfairelinux.com 157C59C591E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=savoirfairelinux.com; s=DFC430D2-D198-11EC-948E-34200CB392D2; t=1715936736; bh=eDu4DXcZYZmRMzTsE23CtiqrrOlfxWxDABDYJj8qWVA=; h=Date:From:To:Message-ID:MIME-Version; b=yJbKu2bbAaZIR1lR4fB9rs8ae78l/ej/Pp4GgndaChfrPjM47VvPNd7mTV47IFukQ X//+44ZJ4DRw9DkSHZQf+v4uy4/XKYtuUAaLvLFOebJCl7icu265xkvxy38LLcQmS7 Uyg52oLkXf5YOc/GhiY3eH6K1tqG//Rc45iBqqEkBeuftfDcDzCCis0t5jONcc0Oyu HuRL8xxkCfNNH2TA3XiBbsjIWxvlyZmJi19c0PW2BlDRhMuiH8f3EfoiH8ednXXhWm KV3s2SR/VuND91x4ULBGel4DWWFLJ+utgH1gix+qQFlQ/twAETDwd9o1xrq4N0stDE CWzLmI6/TPfag== 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 8CeRVN1p2hdp; Fri, 17 May 2024 05:05:35 -0400 (EDT) Received: from mail.savoirfairelinux.com (mail.savoirfairelinux.com [192.168.48.237]) by mail.savoirfairelinux.com (Postfix) with ESMTP id B02AA9C585F; Fri, 17 May 2024 05:05:35 -0400 (EDT) Date: Fri, 17 May 2024 05:05:35 -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: <822567441.349330.1715936735603.JavaMail.zimbra@savoirfairelinux.com> In-Reply-To: References: <20240515135411.343333-1-elinor.montmasson@savoirfairelinux.com> <20240515135411.343333-8-elinor.montmasson@savoirfairelinux.com> 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: iBqosQBSuRfSSp+1CUZcAzEUlctHMQ== From: "Mark Brown" Sent: Thursday, 16 May, 2024 14:13:19 > On Wed, May 15, 2024 at 03:54:09PM +0200, Elinor Montmasson wrote: > >> Add an optional DT clock "cpu_sysclk" to get the CPU DAI system-clock >> frequency when using the generic codec. >> It is set for both Tx and Rx. >> The way the frequency value is used is up to the CPU DAI driver >> implementation. > >> + 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. Best regards, Elinor Montmasson