Received: by 2002:ab2:6816:0:b0:1f9:5764:f03e with SMTP id t22csp2288993lqo; Mon, 20 May 2024 00:29:55 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWFOoP8T54UM18+1WWGzY/IARwtUCvwZHAyTmL7t+BauVIZCl5QSepltd6trdL8FYAggpPqNJetEYUYuJ6EuNxZtklm+ApvHWv96Xyr7A== X-Google-Smtp-Source: AGHT+IGr9qi3FcOzfNNJXWWEq7WwmnkIa+vSGXA6ELfSLKZUrK71SeqboS8yUzz1GtcmZ/c5qtky X-Received: by 2002:ad4:4528:0:b0:6a1:68e9:5700 with SMTP id 6a1803df08f44-6a168e958damr239101166d6.6.1716190195721; Mon, 20 May 2024 00:29:55 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716190195; cv=pass; d=google.com; s=arc-20160816; b=gMpWcRqKMZzSqKJ5EKFT+Hy4LtowuADw36aVwxqGIz5mZ2y2YC/Jz4eDoW1FMwYZlO qsXt7osFHEKQC3WY3RYNfL4d1OgxguDBZz4pFbsWOGf/iS4d/6y7X4qFMS+tsoJTJxXV 3gJVQBTAO/YynrH+VK6qlHQpmYwGZGvuobAh5XaSM3T5/E34iK33b3R/VCsERuBUCZ9/ RRHUSroKK/SS/V4MH5fcQs+8sZcTPYKFEtF7NhZfb+CcjO3Z0vLv6s51k9U3zH7iOneC Er//17DFfxDH5mepwzkpZeawkfd9IEDjpv1MIPKhII4DFCy0Cs8WAGRI8kTQp8lKh0/v 9JUA== 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=JY3KwEk46bphTIoZreI5JeOgzMG0VkSA7b2r2+muyVg=; fh=yJG0a4sP0Py0VcRO0FoZ7y1L5tvgkoSbJk2nY3Z9ahc=; b=YBBQLczjqtszBrZ3CtwlXtTu5ifucesmms8+8PmegW2ELRIXmDDQOKKG9ubKpHkHtQ R5yn4SbhScRa2EzOj9eoT5VyMZq5SWREN0UPcdzMoBgJiQvUd5AvBi+I4z/7PhIWp/Ur GiN7th8D6k/lK+afAASVm5otXTjeKcj3nYKnqRU4HTVMgHth1rMqXy3XHgIORe4vJl9x CFyZ8Cp/+JwjNDY3e8o6tK/SU2b+sXXW6026AusWm5IO1esDkS57vy5XOzOvr84MR/Yf RSPFDKcpw4mndnQMzbmlKjxXkADKngiDDUjRNkFwSbzFYeRqKrelcwO9B9xhiC9KfRr5 XbLg==; 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-183458-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-183458-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id 6a1803df08f44-6aaf719b085si12383086d6.145.2024.05.20.00.29.55 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 May 2024 00:29:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-183458-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; 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-183458-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-183458-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 3D0681C21338 for ; Mon, 20 May 2024 07:29:55 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7B5B91CAB5; Mon, 20 May 2024 07:29:35 +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 836181B960; Mon, 20 May 2024 07:29:33 +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=1716190175; cv=none; b=B9lAmdSSAH2i+bN2d24t7cliAVcckSdR1ax4UoPcu9IWBgKkwfSx85H3R79n4FqPmSjSYU3wrMSL1x5/gxdObzZK93UAmSxWncgpdTlFetzWoLGvTXYn9hga0aCSWaerQs0u0yRuz+YHc4rMQRudLb5SGtlpanC7z8eMWPgLWDg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716190175; c=relaxed/simple; bh=4aojkFZC7sCdR6e90XG+sUyXzKpg7q4F9CqGRb/pFkM=; h=From:To:Subject:Date:Message-Id:In-Reply-To:References; b=Uq9i9Yd+YFWP1sTeiktfOW9FAia4etZ/BYuChrwHBlm4cTNeO2HhmO1+SbkPVjQf4sDhF7ml94woDZW6ar6U8ORO6xawJvY2uxkg1kNrY286TQlpV7vgn41W1ZUiVey+dYWMniv+7I0ZsgEhh1oyfiJwctkxrgvk+tgWz2qdcYE= 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 00478201946; Mon, 20 May 2024 09:29:32 +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 A82E420194D; Mon, 20 May 2024 09:29:31 +0200 (CEST) Received: from localhost.localdomain (shlinux2.ap.freescale.net [10.192.224.44]) by aprdc01srsp001v.ap-rdc01.nxp.com (Postfix) with ESMTP id 3A768180226C; Mon, 20 May 2024 15:29:29 +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 v4 5/5] clk: imx: clk-audiomix: Corrent parent clock for earc_phy and audpll Date: Mon, 20 May 2024 15:09:23 +0800 Message-Id: <1716188963-16175-6-git-send-email-shengjiu.wang@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1716188963-16175-1-git-send-email-shengjiu.wang@nxp.com> References: <1716188963-16175-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 3d15405cedb8..4ae0cf916d78 100644 --- a/drivers/clk/imx/clk-imx8mp-audiomix.c +++ b/drivers/clk/imx/clk-imx8mp-audiomix.c @@ -155,6 +155,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; @@ -172,14 +181,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