Received: by 2002:a89:413:0:b0:1fd:dba5:e537 with SMTP id m19csp647302lqs; Fri, 14 Jun 2024 01:00:25 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXtDVH4QP6Gfl3E5nYktA/IkttW+Pumf/KE4Lz+SbMlZIia6NDt759jZpYcw+F4VOk//yoWs0gpaVE7BN/57Q7etv5Op8w32l+Mfeiu/A== X-Google-Smtp-Source: AGHT+IHKn/MhOWoYL6EfielFKnRzmWgdKiP8WH2V8DXUfIVvRNvqXdlzUTyU4Fjlm+7khjnqcuyg X-Received: by 2002:a05:620a:404b:b0:795:89c0:7f37 with SMTP id af79cd13be357-798d26a2806mr225849985a.68.1718352025630; Fri, 14 Jun 2024 01:00:25 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718352025; cv=pass; d=google.com; s=arc-20160816; b=UGQheyHWBF4cKRcpl8UbZO5emppvTYfp+mLEP4DmLgmFQJJBox/Ggcfq6Y/HgXdYy9 Gs0j6S/cZxhujhvFNT/yfTmHXlXRKNRsS1CVPwxYMqwDlRU2GSW/Sel2ynkc//FeSn15 JUNy9pKGe3mW7W0vNH3iQ+0itTradbntU5cwddhpFr3Kv4d5E90hp5dEcJCcT/MmvaBs A6CtVT2guF3tonfZBiuXfqEIRlC58u56WZlRWggJQxgF2OEsDLXCl1pQ14CJ3bOExAWk 2WrCbHnIHfmAethTdQeBAvfNcy100v/5W/rYYRc+eFJjVRaMOx684vVshgkOE+nFLKjk LXqQ== 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=dx1F22AD+eagSUy3gsUNepfF/Z7YLIG/8Gx1yAyzSUc=; fh=hlaO54Y51C9KJIZLtE98iv/ncrPmJ9RabI5lLtWETi8=; b=Oscj0UKgcVctaOjybAkh7I8cuApV+WVN6CKmNdBLsl4CuA1YNSWhpMHnYvEYbhrGIg 9B8GVLtB7Fv6nrpIrVFb17PeclVSHgVLsy1WlbSfQSeSITnkUhb7eu6kaR09PZXEKEaG jC9IdGOV2T3v4tCxiRGBHet55YFuKgNfyHnUqS1KzgcSrScY2HtDc4h7RqNYvmFfbkry 4orifCbfxnjPLK5FztgrNvrA6jYE5cTtAYZXOHUMYYexfhN2Oefp80d8E8fLCvbVYQf/ NYmmQRUeg+ZQajwm/IpwBXupRXOsmkZEGjGwBU9mMCIqK7Y269p0o845jFpZ6YDJqTb6 WRWA==; 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-214495-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-214495-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 af79cd13be357-798abd16542si317626985a.391.2024.06.14.01.00.25 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 Jun 2024 01:00:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-214495-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-214495-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-214495-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 2233A1C21D20 for ; Fri, 14 Jun 2024 08:00:24 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2D065186E50; Fri, 14 Jun 2024 07:59:21 +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 1E1EF183091; Fri, 14 Jun 2024 07:59:19 +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=1718351960; cv=none; b=RfD9g5mm/WI139/k29sWLoV+FMmlrXE+XHdmxNBEAEx3+BA+0EeKDtMwgzk6DRfL9eiFl7k+TYPyiQr4cg6b4MSD9fIobNBtSzEA2vw2avz97x5x4jGWCnY1WmqeRofOeatFlisEgfgpPJWngr290Of1ly83CQal+61GpMwdWH8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718351960; c=relaxed/simple; bh=sbl5X0446SNrZyzdSpjYqjhRmR8nZOs6R/E130gj5SI=; h=From:To:Subject:Date:Message-Id:In-Reply-To:References; b=o360nF/vhNt4zFMKj4y2HgDyuuwOV5djhqRMwkMR6PoCwvI3Pb3hBkIGKK9lwNA95aMHbs8d9QaKzlEDbCep01QPYHwK+soa0mNEUR0KzRu8NLHXgE+UuMwymUw6e3V2SitFX32YhTBGk5EjpAZt2DWu+C1fy3DUV7U2BBQIkls= 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 3661D2016E3; Fri, 14 Jun 2024 09:59:12 +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 DDB562016E6; Fri, 14 Jun 2024 09:59:11 +0200 (CEST) Received: from localhost.localdomain (shlinux2.ap.freescale.net [10.192.224.44]) by aprdc01srsp001v.ap-rdc01.nxp.com (Postfix) with ESMTP id 1896C1820F77; Fri, 14 Jun 2024 15:59:10 +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 v8 4/5] clk: imx: clk-audiomix: Add CLK_SET_RATE_PARENT flags for clocks Date: Fri, 14 Jun 2024 15:42:02 +0800 Message-Id: <1718350923-21392-5-git-send-email-shengjiu.wang@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1718350923-21392-1-git-send-email-shengjiu.wang@nxp.com> References: <1718350923-21392-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 517b1f88661b..7fd336a96cfe 100644 --- a/drivers/clk/imx/clk-imx8mp-audiomix.c +++ b/drivers/clk/imx/clk-imx8mp-audiomix.c @@ -328,12 +328,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); @@ -376,7 +376,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); @@ -385,7 +386,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