Received: by 2002:ab2:6816:0:b0:1f9:5764:f03e with SMTP id t22csp2289344lqo; Mon, 20 May 2024 00:30:50 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUxpB/FoCFw7WM3VSQgDPEYv0EUAU8vOyrGuxrGrrMRKLcfKGzWe4Tt5BxupH7DoW0DOryCoHGaC/0+WN0wcUYa6Srgk3Yfg49MOD3V9w== X-Google-Smtp-Source: AGHT+IGTheldNi5YUT+y9AfsAguJJgj0Z4nPggRzz1ZZkm+wyqGEdAtwJDQ6HJ2mqMoaAPyq5ATE X-Received: by 2002:a17:90a:d202:b0:2b4:32c0:d7d7 with SMTP id 98e67ed59e1d1-2bd60426cbamr7096175a91.16.1716190250034; Mon, 20 May 2024 00:30:50 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716190250; cv=pass; d=google.com; s=arc-20160816; b=ya3OWnQM7s0wKvQEwJAuUIKXIXoX4v/wkgaSkqrvi795cSeXNUtCUQQgZh0nHohHbW xb+9k0YZTD7c1dd3N5ovxdEnx0QAZwHmbTG/2xDeEFWxZ+pLbz3AXSU6ucrCGTPXZe6n 8H73+AIpwSfVVN0DVOos8emIEnYqivZcl6ml58GdiFZk/66Je6vfxqlafpVAG8Epfld/ DyjEwOzvmWFUzeSN7viW7cnbYXeon6Ziqoxp5aBpT6Qig44pGwKJLLS0T2L+q2AbZLrl gEMeBZelBS1/7bKlnl0L6pE9isU9+0V1gC923CeA3092KWyupQ6ic2GzEJakyvthiDf6 guUg== 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=So/a4WB+rE/6rG0wBA9s/w1eMz8uo90XO4sxUchbMBI=; fh=yJG0a4sP0Py0VcRO0FoZ7y1L5tvgkoSbJk2nY3Z9ahc=; b=jEsoDtkdn3rRl9I5by71rdr6FGfYXE8Bw24/OegeKWC8Hq5Q8EvH/9prv0hjcJsdfI 0h0ABcyE1/HSmCX+9FCmRnZ0E6asftkByb85BnYLxhAjoZ6InMOAOSllx3M9o82at0qf 9IT6wxUkxGO0BjzQPawbaYLfe/46v8DJR1OIck1g5RQrrkxuaTH+QnOVH91BCDlbFcI+ FKmlIRvjC1OvJGwPXQ0oNxJBTTqf1h/t87XkAt3kE4pSKbWgckFNUUTPWjWHU39dpW/c 0QnkRVRKoz+Qs8VmdRUpOssHQqwW1OOXl/OwyCoeVf07q0ZNCGQw269CHwO/BLQreVrA PJsA==; 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-183461-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-183461-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id 41be03b00d2f7-634119043a9si21601150a12.597.2024.05.20.00.30.49 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 May 2024 00:30:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-183461-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; 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-183461-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-183461-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 3C3DD281DCE for ; Mon, 20 May 2024 07:30:35 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3AD3836AEF; Mon, 20 May 2024 07:29:40 +0000 (UTC) Received: from inva020.nxp.com (inva020.nxp.com [92.121.34.13]) (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 386F322626; Mon, 20 May 2024 07:29:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=92.121.34.13 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716190179; cv=none; b=ojGmHh0zSU+NA7kaud8bQ9qldNwD23uSX4Bowld+kSo0blSeGbzdCgz8zBZZZYjT6me7u99sP8Q9B5IWIPvxahXyTNGJjw2BBMffHHZhk25h70Gxi67L95CxrefszhmtLv0gbsyRzkDsey8F+Lm6sQAWSsOWx+P8sNYJ7KxOBdc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716190179; c=relaxed/simple; bh=X8Y9zpe3xHraeXqs1+RHxyAPG/U8FB+IkN2/HUGcAZc=; h=From:To:Subject:Date:Message-Id:In-Reply-To:References; b=gaW18Un/a7ZZbDu5QcMl/086SNpdYIN5Ykc9QZ+J5RVQuWiHD6+whUaG8qgnJUJp19QqO5rGxEVpRKNb1CgAhHgEAxcQC0mLam713R2BIirq8LHQUu3tvk8Td5pxIgNe2vUMkP2ZcMm3c+UJba8/IuMUg9Oc9924axlqcniya98= 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.13 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 inva020.nxp.com (localhost [127.0.0.1]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 4634E1A1A13; Mon, 20 May 2024 09:29:30 +0200 (CEST) Received: from aprdc01srsp001v.ap-rdc01.nxp.com (aprdc01srsp001v.ap-rdc01.nxp.com [165.114.16.16]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id EE4621A1A0B; Mon, 20 May 2024 09:29: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 97D9D181D0F8; Mon, 20 May 2024 15:29:27 +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 4/5] clk: imx: clk-audiomix: Add CLK_SET_RATE_PARENT flags for clocks Date: Mon, 20 May 2024 15:09:22 +0800 Message-Id: <1716188963-16175-5-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: 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 --- 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 d2eaabe431cd..3d15405cedb8 100644 --- a/drivers/clk/imx/clk-imx8mp-audiomix.c +++ b/drivers/clk/imx/clk-imx8mp-audiomix.c @@ -326,12 +326,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); @@ -374,7 +374,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); @@ -383,7 +384,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