Received: by 2002:ab2:7855:0:b0:1f9:5764:f03e with SMTP id m21csp893792lqp; Thu, 23 May 2024 03:21:21 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUdL+jxa16SMsSbGsfGUNdCn+IjXPWbQyylXgRBprNTyD+DzAkL5A31cbtSz1w4dw649LZXwEf1sM1gnHxy49xey12M3+EUQSeLjXf5dg== X-Google-Smtp-Source: AGHT+IHa7otTvaFgAJgD7A+Y5rFNg3/ncaa43dWCDmb1otOpnICJvGPCNFqQRYBKqEC1cS2ScUec X-Received: by 2002:a05:6870:63a6:b0:22e:dd56:a72d with SMTP id 586e51a60fabf-24c68d600d3mr5298951fac.26.1716459680981; Thu, 23 May 2024 03:21:20 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716459680; cv=pass; d=google.com; s=arc-20160816; b=X4QtVQsKvV1xRY0qwTMaaOoxZVfdwhQLhTS5Uu20BDz7E4F11rKvqLrhgyD1GkBEdy ueCY6XjamEn9F+oCe7xnrU0QMVxAuPjE4FYx+WwdohOIL21K1T6Z3OgBxerL8zKq3lGx lKhTXSQgGyPvapgpNggGIRbdq7yLEb117+wW/fUS5YiYWRC6ZMDPJd3a6www1NUxWygK JYwlWD2eMNc9bpOx6Em5jL5qgiMcxZHKiQVBRCZ6GvcuN9eWiaWicsWwFHXkU45jnddH z9rlqk1Jz3FD4cAYejWe6f38HbzcZ6jy0tBTjyziDnwqsFpyGEvc967YXS/wbPqAjiD5 OekQ== 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=wemfKnnYjLgPGtXV/bmaBkUTC+S9D5UPRU1FO8COJGY=; fh=yJG0a4sP0Py0VcRO0FoZ7y1L5tvgkoSbJk2nY3Z9ahc=; b=qGVsgEv6Pw47wojKIEjxWjpQduDWJFBkUMkLgb/ppRzVH5uZQcu0MWVqIK1rCsee5G T3qVbcKBqOC7Eh6ORURdZd6RK4d5c1qriY4yB6wjjYD/vMAecgexiWL2T5NINP69xDn5 a4u3cUX8DhtjERM9STI/PYz3MNl5JtzT2v8gptu6CGYiie47tiGi0jLTnGi1UzYTFFyy COp2zIrXGcuBvf8NZMCj2MtqoT5s+H8j20B4C9ZwVJUhw9iCjeXbMxyjljq5Z+GZXjsR O1lDCFj9yv/BlWIvw9N50Yp3HuTK7CEdmvNYXEwxOxAc9ubUz8qNR+6xWC+2OpWtVPzL obKw==; 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-187324-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-187324-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id d2e1a72fcca58-6f4d2b43335si1476954b3a.353.2024.05.23.03.21.20 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 May 2024 03:21:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-187324-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; arc=pass (i=1 spf=pass spfdomain=nxp.com dmarc=pass fromdomain=nxp.com); spf=pass (google.com: domain of linux-kernel+bounces-187324-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-187324-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id D0BD8B221AB for ; Thu, 23 May 2024 10:20:54 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 38F8F145B3C; Thu, 23 May 2024 10:20:14 +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 0AE241411F7; Thu, 23 May 2024 10:20:11 +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=1716459613; cv=none; b=HBvZUM/dq70rK1SGZ83y8yHwJIa3W9NmgL75DxJR0eapYfZTK9/Dqf4Z0w3Hgxg9qElx/yKrpWMJqMFzuaDtBd4u5/EUZhcs0LE3m5lPtmUaSedx5uEuj78dHRXm7Xp26JX6ilCDE8SGKX8WdiCocn5fZRAtZonge3aCvHSg7as= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716459613; c=relaxed/simple; bh=o2RSnqAl1n6HIZ7Qb2E++l4JEnrLrtueMVPN4W/wUqU=; h=From:To:Subject:Date:Message-Id:In-Reply-To:References; b=LXnS/nwmPDVr6wyqfnYVKEyMJD8K0EXypkAR++8Y7266+JW6k1oJrBWDgDKWlP/2Jp2sEFT/xQjIi4J9W6LYYMWOTR+pmqXrfqnS813xCckGjYfORBk3OgtEYHem2Y5VUkpQnT2pMRyxsrt2kVLIBvh+UYJLFd2jET8/uL0jtHI= 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 6B225201299; Thu, 23 May 2024 12:20:10 +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 20FF4201292; Thu, 23 May 2024 12:20:10 +0200 (CEST) Received: from localhost.localdomain (shlinux2.ap.freescale.net [10.192.224.44]) by aprdc01srsp001v.ap-rdc01.nxp.com (Postfix) with ESMTP id C9E571820F59; Thu, 23 May 2024 18:20:07 +0800 (+08) From: Shengjiu Wang To: abelvesa@kernel.org, peng.fan@nxp.com, mturquette@baylibre.com, sboyd@kernel.org, robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org, shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, marex@denx.de, linux-clk@vger.kernel.org, imx@lists.linux.dev, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, p.zabel@pengutronix.de, shengjiu.wang@gmail.com Subject: [PATCH v5 5/5] clk: imx: clk-audiomix: Corrent parent clock for earc_phy and audpll Date: Thu, 23 May 2024 17:59:50 +0800 Message-Id: <1716458390-20120-6-git-send-email-shengjiu.wang@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1716458390-20120-1-git-send-email-shengjiu.wang@nxp.com> References: <1716458390-20120-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: According to Reference Manual of i.MX8MP The parent clock of "earc_phy" is "sai_pll_out_div2", The parent clock of "audpll" is "osc_24m". Add CLK_GATE_PARENT() macro for usage of specifying parent clock. Fixes: 6cd95f7b151c ("clk: imx: imx8mp: Add audiomix block control") Signed-off-by: Shengjiu Wang --- drivers/clk/imx/clk-imx8mp-audiomix.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/drivers/clk/imx/clk-imx8mp-audiomix.c b/drivers/clk/imx/clk-imx8mp-audiomix.c index cef01f1fa0b4..01ac923a10ee 100644 --- a/drivers/clk/imx/clk-imx8mp-audiomix.c +++ b/drivers/clk/imx/clk-imx8mp-audiomix.c @@ -156,6 +156,15 @@ static const struct clk_parent_data clk_imx8mp_audiomix_pll_bypass_sels[] = { PDM_SEL, 2, 0 \ } +#define CLK_GATE_PARENT(gname, cname, pname) \ + { \ + gname"_cg", \ + IMX8MP_CLK_AUDIOMIX_##cname, \ + { .fw_name = pname, .name = pname }, NULL, 1, \ + CLKEN0 + 4 * !!(IMX8MP_CLK_AUDIOMIX_##cname / 32), \ + 1, IMX8MP_CLK_AUDIOMIX_##cname % 32 \ + } + struct clk_imx8mp_audiomix_sel { const char *name; int clkid; @@ -173,14 +182,14 @@ static struct clk_imx8mp_audiomix_sel sels[] = { CLK_GATE("earc", EARC_IPG), CLK_GATE("ocrama", OCRAMA_IPG), CLK_GATE("aud2htx", AUD2HTX_IPG), - CLK_GATE("earc_phy", EARC_PHY), + CLK_GATE_PARENT("earc_phy", EARC_PHY, "sai_pll_out_div2"), CLK_GATE("sdma2", SDMA2_ROOT), CLK_GATE("sdma3", SDMA3_ROOT), CLK_GATE("spba2", SPBA2_ROOT), CLK_GATE("dsp", DSP_ROOT), CLK_GATE("dspdbg", DSPDBG_ROOT), CLK_GATE("edma", EDMA_ROOT), - CLK_GATE("audpll", AUDPLL_ROOT), + CLK_GATE_PARENT("audpll", AUDPLL_ROOT, "osc_24m"), CLK_GATE("mu2", MU2_ROOT), CLK_GATE("mu3", MU3_ROOT), CLK_PDM, -- 2.34.1