Received: by 2002:a05:6500:1b8f:b0:1fa:5c73:8e2d with SMTP id df15csp1029800lqb; Wed, 29 May 2024 19:49:58 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVhU7Apwmrp9RKwl5U3FPg9meTZXyyykVC2rEakWI5umQLXM/r6tFiW37ClSGy1xig5HqGne/lBAj2V0Uxxq2+Gg8RhrNNprbLZhNBFZQ== X-Google-Smtp-Source: AGHT+IHsXdJ1i4YxjL30Ywm8S3rCsvxDRihOXk/QhASuIPHS2CHy8C2V5X9kPlSgxpel1/PQ3pMI X-Received: by 2002:a92:c263:0:b0:36c:4a9c:70b8 with SMTP id e9e14a558f8ab-3747df4f3c2mr9778855ab.1.1717037398490; Wed, 29 May 2024 19:49:58 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717037398; cv=pass; d=google.com; s=arc-20160816; b=ilVgXiD6K0lmmzFXgdq7QkdrNc9/2PdZU33etTLEv4xK9hOy/QYMzlFkVWhCpUlCTb z7Zrbt7jmDuMSFeNzwmXWjxYtD7Uy9FOHr4Q3yJBa2XRFvbzHCmCNQQnaY83HahVFNL/ CwljH4LatXGmZmNMUXlL4OCst9I64mnkoZ1wX+KTF25alZku5hrv4fu1LWg4rammtLvU A0N8PcZbUlHPWHTbiUdHYdsUKaqYNtW0shDTjRQWlysEU2PujRjT3zKcttRz8DHSGedc HSHUTC70LcBVFcaxpA6PrDSQe7SdP6cRBX2qqcVguT5csDzgfkjWwQjYCIYyvlWGWIaD +n3A== 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=C0v451HvbefRcLc1KPWOpnbDLScpXw2XMZMuHwfnKE0=; fh=hlaO54Y51C9KJIZLtE98iv/ncrPmJ9RabI5lLtWETi8=; b=zs9JNJ9zYTgW2tgDF/ck8+7DLfQOtNJ0ouKJLvG3PxZUVofojUG4HK8y2Xwsh7TN6P ++RTc6380PP0m1TldUw4bzAYsI9rgGZD+Ga3e6Yy3Lq3LGPeIsFTRMCaUaBeQSFisSWO Gk0aZcluNDZpirIjG4Fn017gl/4amrg6poNuw+8ZStJCMGzPAYB6dsrhxNebd5ImAik8 8A1krCINpYBVQ7cQSKHdRTmO3YGatmEPEcLs1jLDHuoxVMIBECZEShYexrjC877XfUnI jRKo3TINu6UXoUpHzE2oLRIvus3mLWshhpb3w0aZoQC/s284l25X92lEKmxZh1lueN0v JbDg==; 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-194895-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-194895-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 41be03b00d2f7-6822779b9e8si11188377a12.391.2024.05.29.19.49.57 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 May 2024 19:49:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-194895-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-194895-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-194895-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 73B4FB22896 for ; Thu, 30 May 2024 02:48:17 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8A61F24B5B; Thu, 30 May 2024 02:47:33 +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 771A121A0D; Thu, 30 May 2024 02:47:31 +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=1717037253; cv=none; b=C6R1LmFILMEd4HST62sw/Gc21PJ9jtF5e8MpmQpbonca0zfhykjhM1ILlZmjt1UxSRA2hQS5NKtlrINbyCgVUwwRDYHIwkxaMSpfs1Tc3Ka98MlwnHpt5yWQ31z1C73gktkyxr3JilNl5jf4y8ypqRKJHs4qFiP+V51sS7IWj0Q= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717037253; c=relaxed/simple; bh=K6ify13TMCVePzFtFbttLg9jPajrP/iaO6VEAqKe/I0=; h=From:To:Subject:Date:Message-Id:In-Reply-To:References; b=HuiTLQ7hRLt3I22Qng/xdcoH4aQMFA+pH75VWOYf84iBa291QAoemQMlFMoHLNdzltSqOYvueW0Jb+GXPFK40JgHLW79xtbj62UFouTHEGbft4agPCDbtOnIIvR7bAVeTMTlkuy9XkP0EVbrs6NjhdkK/IVfGjptRp64wenZwbI= 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 C42672017F1; Thu, 30 May 2024 04:47:29 +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 78FAC2017EF; Thu, 30 May 2024 04:47:29 +0200 (CEST) Received: from localhost.localdomain (shlinux2.ap.freescale.net [10.192.224.44]) by aprdc01srsp001v.ap-rdc01.nxp.com (Postfix) with ESMTP id 29E84180222C; Thu, 30 May 2024 10:47:27 +0800 (+08) From: Shengjiu Wang To: p.zabel@pengutronix.de, 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, shengjiu.wang@gmail.com Subject: [PATCH v6 4/5] clk: imx: clk-audiomix: Add CLK_SET_RATE_PARENT flags for clocks Date: Thu, 30 May 2024 10:31:17 +0800 Message-Id: <1717036278-3515-5-git-send-email-shengjiu.wang@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1717036278-3515-1-git-send-email-shengjiu.wang@nxp.com> References: <1717036278-3515-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: Add CLK_SET_RATE_PARENT flags that when the device driver sets the child clock rate, parent clock frequency can be refined accordingly. Signed-off-by: Shengjiu Wang Reviewed-by: Peng Fan --- drivers/clk/imx/clk-imx8mp-audiomix.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/drivers/clk/imx/clk-imx8mp-audiomix.c b/drivers/clk/imx/clk-imx8mp-audiomix.c index a3dc2f3606ee..ad6eceb419cc 100644 --- a/drivers/clk/imx/clk-imx8mp-audiomix.c +++ b/drivers/clk/imx/clk-imx8mp-audiomix.c @@ -325,12 +325,12 @@ static int clk_imx8mp_audiomix_probe(struct platform_device *pdev) for (i = 0; i < ARRAY_SIZE(sels); i++) { if (sels[i].num_parents == 1) { hw = devm_clk_hw_register_gate_parent_data(dev, - sels[i].name, &sels[i].parent, 0, + sels[i].name, &sels[i].parent, CLK_SET_RATE_PARENT, base + sels[i].reg, sels[i].shift, 0, NULL); } else { hw = devm_clk_hw_register_mux_parent_data_table(dev, sels[i].name, sels[i].parents, - sels[i].num_parents, 0, + sels[i].num_parents, CLK_SET_RATE_PARENT, base + sels[i].reg, sels[i].shift, sels[i].width, 0, NULL, NULL); @@ -373,7 +373,8 @@ static int clk_imx8mp_audiomix_probe(struct platform_device *pdev) clk_hw_data->hws[IMX8MP_CLK_AUDIOMIX_SAI_PLL_BYPASS] = hw; hw = devm_clk_hw_register_gate(dev, "sai_pll_out", "sai_pll_bypass", - 0, base + SAI_PLL_GNRL_CTL, 13, + CLK_SET_RATE_PARENT, + base + SAI_PLL_GNRL_CTL, 13, 0, NULL); if (IS_ERR(hw)) { ret = PTR_ERR(hw); @@ -382,7 +383,8 @@ static int clk_imx8mp_audiomix_probe(struct platform_device *pdev) clk_hw_data->hws[IMX8MP_CLK_AUDIOMIX_SAI_PLL_OUT] = hw; hw = devm_clk_hw_register_fixed_factor(dev, "sai_pll_out_div2", - "sai_pll_out", 0, 1, 2); + "sai_pll_out", + CLK_SET_RATE_PARENT, 1, 2); if (IS_ERR(hw)) { ret = PTR_ERR(hw); goto err_clk_register; -- 2.34.1