Received: by 2002:ab2:6991:0:b0:1f7:f6c3:9cb1 with SMTP id v17csp893848lqo; Wed, 8 May 2024 20:19:29 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVbX0bFf7YTVz/LfOvXkfRe96YaCwCzawDojftU+sP7no9gzm/6gitHxsRZnEaZxe9pLgrOPjhfWPq1vSkcTuaHG8/M5P5aLP2EIdWzBg== X-Google-Smtp-Source: AGHT+IH5qPT6RioX4MbxI2w7EJhANL2qVEYbd5s/gsJ0FSa1xBkVSznfOoqOHdLFQnYjD51gYFyd X-Received: by 2002:a50:a69c:0:b0:572:404f:5199 with SMTP id 4fb4d7f45d1cf-5731d9b62aemr2702954a12.5.1715224769381; Wed, 08 May 2024 20:19:29 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715224769; cv=pass; d=google.com; s=arc-20160816; b=txGty2a+nlo+ltBOOLfswqXsSl5HXDnJIEJslBAMTSVWa3vkhfL73H4dQ86z6C3FAa rclSTSo8IXNX0s/nBKYgcAwjzs0MmMwZvAvU9poVVERHsR+Iw0ivljFv+5yEaUhsZUMp FhhpoaYQboDcwDwQnfbDwsDGY/3piRnqT040xcFsgEpSA7Kl80751hjobluE86f8g9r5 2TeReUGpKh+TxF5vSUUBL7D1Q/CZ25/em58mbAB0bJI6kl5lL7rx59Oy7moDxrzfqFR7 Dno28HD3BHqByRF3J8VSqVVEPgr2PkjKjVCvLCHh4ugknbqozCZqYcx2mtK5w0Tr80wJ 8XDA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-subscribe:list-id:precedence:references :in-reply-to:message-id:date:subject:to:from; bh=ZZNkv7WAxpoMtMtTVguQLgbHFaeUevYj1gPgHFTgvIU=; fh=GPNlrx+KEFkEzYtXZ6NEdM3tzm0co+FAcNkYSnNdsYQ=; b=SxWao0fqqLOmeI4G4KZtbGPIzEZfd4yV/LuuXRJfK9O9zijFSb4v3sdy2DDef5SjnO tXHyq7Hpd7zO0EA9xF3iHs6sJOrbmerIYjx47e+IFq3dxKRPtrRf90JAJ4RSzIXosJ8/ igqAgNpqno7FKybBUXO+AsA6H8aG1UOSp6cBJVzhu+XL6bKtlofA1Eft631Ae6r+igLG 4szTVNWQkfkFvX6de7wenDmkRm8pYSXGoWTksolZhQrxXCxehOWzjoNxN6cAm6ZGOpOF GlfQaKFdMqGFSttAwYnE7IK8KLHVj5uhxQpOC157EiZ+UreMgehLauIMik1n1EaMMOu5 Sw9A==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=nxp.com dmarc=pass fromdomain=nxp.com); spf=pass (google.com: domain of linux-kernel+bounces-174087-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-174087-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id 4fb4d7f45d1cf-5733c373808si299284a12.594.2024.05.08.20.19.29 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 May 2024 20:19:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-174087-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=nxp.com dmarc=pass fromdomain=nxp.com); spf=pass (google.com: domain of linux-kernel+bounces-174087-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-174087-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com 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 am.mirrors.kernel.org (Postfix) with ESMTPS id 211D61F224A6 for ; Thu, 9 May 2024 03:19:29 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 27DB51482F6; Thu, 9 May 2024 03:18:46 +0000 (UTC) Received: from inva021.nxp.com (inva021.nxp.com [92.121.34.21]) (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 2DA7F14831D; Thu, 9 May 2024 03:18:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=92.121.34.21 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715224725; cv=none; b=EQxzC89jJfq1nH+0wLK9ZpMqvDVfmORWQ4HVa1voWRXUdm6z6125L9RcyrExuSJ30TbRC8wSeh7bTNyT2bP7uRakOa28EgWHpgCOndanujrecrRd48eltgR5PvnFeP8dnvgc/vcUiSpOLqe+kIUnekzPyjo8QmB8H6tGCeZf3W8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715224725; c=relaxed/simple; bh=VGDmCzZ+i4TZSCedBs+r4B2MJ2hukWvZ1niBtixa1e4=; h=From:To:Subject:Date:Message-Id:In-Reply-To:References; b=CR58TTkFKcPLhyRzpsxWB/fUScq7vDlmIBWXoDleQLhwISevroRxFgMF7EkRDc5Z6vB9NmQ56APUDGQStB6Y4pfYi0gU6pN1E3UsHFbO+2h8W7Zh2vrbQW7jSe3qTa2VrcGrLoaKlgAkjekZK5YERi6DZ+RHwGkJch2VehLRSjE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com; spf=pass smtp.mailfrom=nxp.com; arc=none smtp.client-ip=92.121.34.21 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=nxp.com Received: from inva021.nxp.com (localhost [127.0.0.1]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 90A97200AA9; Thu, 9 May 2024 05:18:42 +0200 (CEST) Received: from aprdc01srsp001v.ap-rdc01.nxp.com (aprdc01srsp001v.ap-rdc01.nxp.com [165.114.16.16]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 456D42007D5; Thu, 9 May 2024 05:18:42 +0200 (CEST) Received: from localhost.localdomain (shlinux2.ap.freescale.net [10.192.224.44]) by aprdc01srsp001v.ap-rdc01.nxp.com (Postfix) with ESMTP id 2B099181D0FC; Thu, 9 May 2024 11:18:40 +0800 (+08) From: Shengjiu Wang To: lgirdwood@gmail.com, broonie@kernel.org, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org, shengjiu.wang@gmail.com, linux-sound@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Xiubo.Lee@gmail.com, festevam@gmail.com, nicoleotsuka@gmail.com, perex@perex.cz, tiwai@suse.com, alsa-devel@alsa-project.org, linuxppc-dev@lists.ozlabs.org Subject: [PATCH 3/4] ASoC: fsl_xcvr: Support reparent pll clocks for phy_clk Date: Thu, 9 May 2024 10:57:39 +0800 Message-Id: <1715223460-32662-4-git-send-email-shengjiu.wang@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1715223460-32662-1-git-send-email-shengjiu.wang@nxp.com> References: <1715223460-32662-1-git-send-email-shengjiu.wang@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: When there are 'pll8k' and 'pll11k' clock existing, the clock source of 'phy_clk' can be changed for different sample rate requirement. Signed-off-by: Shengjiu Wang --- sound/soc/fsl/fsl_xcvr.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/sound/soc/fsl/fsl_xcvr.c b/sound/soc/fsl/fsl_xcvr.c index c46f64557a7f..0ffa10e924ef 100644 --- a/sound/soc/fsl/fsl_xcvr.c +++ b/sound/soc/fsl/fsl_xcvr.c @@ -15,6 +15,7 @@ #include #include "fsl_xcvr.h" +#include "fsl_utils.h" #include "imx-pcm.h" #define FSL_XCVR_CAPDS_SIZE 256 @@ -33,6 +34,8 @@ struct fsl_xcvr { struct clk *pll_ipg_clk; struct clk *phy_clk; struct clk *spba_clk; + struct clk *pll8k_clk; + struct clk *pll11k_clk; struct reset_control *reset; u8 streams; u32 mode; @@ -362,6 +365,8 @@ static int fsl_xcvr_en_aud_pll(struct fsl_xcvr *xcvr, u32 freq) freq = xcvr->soc_data->spdif_only ? freq / 5 : freq; clk_disable_unprepare(xcvr->phy_clk); + fsl_asoc_reparent_pll_clocks(dev, xcvr->phy_clk, + xcvr->pll8k_clk, xcvr->pll11k_clk, freq); ret = clk_set_rate(xcvr->phy_clk, freq); if (ret < 0) { dev_err(dev, "Error while setting AUD PLL rate: %d\n", ret); @@ -1287,6 +1292,9 @@ static int fsl_xcvr_probe(struct platform_device *pdev) return PTR_ERR(xcvr->pll_ipg_clk); } + fsl_asoc_get_pll_clocks(dev, &xcvr->pll8k_clk, + &xcvr->pll11k_clk); + xcvr->ram_addr = devm_platform_ioremap_resource_byname(pdev, "ram"); if (IS_ERR(xcvr->ram_addr)) return PTR_ERR(xcvr->ram_addr); -- 2.34.1