Received: by 2002:ab2:6f44:0:b0:1fd:c486:4f03 with SMTP id l4csp110989lqq; Wed, 12 Jun 2024 19:08:45 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWv4CZEXaD7IuU2rux+y2OtAAHSPdKUhOA46aI1AJ4uI8fIquJPzA9tbwRoMsl4SlZU+wiNAveajehdbave77QKZxfEBy1mZgiW2BibeA== X-Google-Smtp-Source: AGHT+IEH+8WQUhc+kUAeFCwe8xTyVN7pq6FlEuDHlvQcsuKQ0jodOrI4Fo8oXQ6aPvrHz5gf2Q2z X-Received: by 2002:a05:6102:3969:b0:48c:33c7:822e with SMTP id ada2fe7eead31-48d91e47505mr3479040137.26.1718244525026; Wed, 12 Jun 2024 19:08:45 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718244525; cv=pass; d=google.com; s=arc-20160816; b=jz0deNCCXm0u3+MB+PhhnK7mI+XyVXGk/by17QIp04C7CKjP+CgbHPpXSg96ZJDDgA 03Cpt/DhPZr6TPm9eqRtsyLghIL15pz+nXbQCp2cGKbFMsbraY+TXe05mubGMZOSyMVu DwJ1/H+lNUfPGUxSbk1UpuPNlA1ZvJsg21R+P+tV4sg0Cc7YCKFe7drsF7z8Azf4uZOk DjkYQDJB+3Vbs+1IwEAvym3Ne5OUxNLPWfumUdywRHZQYd6tSBUUBMra4Ez43kG+dV9y tCSYvDlvu2c1cXDBJb7lkVf3A/Z6/G0YPxVvdmTR/mPSBir7jIX28ZEtWGrLXsTJ+jq1 5rQw== 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=zrvWXxVYb4mZdHVz+80cOrXSCFjdyVRlJSlKw0CA7vGUKT4vnKNrSZGHAhxCgh8XAo AzESyOyV1nF0tTTZK/HeM0eOplo48h0GCYQ6uN2eRd8coYYRi/AB763sp30x+3IjSyYp 6+qJ9oO/pfzZjJ8qO6IM2wugNgzvEpxU4L8IMyraGLOQItsG6O431aMSs4+avWdCskMz jUTiMpzwmIJcHkJwsaaT+aef+7AtqjgKNBJXQGw5Vlge2hn7rHX6XEPk7VHF0wffZh0I +gcJ2l1D3Crqhn5QM1KBeO7dLM96zriRDNbMILqU39tv18wEkxRO/spYI7WA/SurkPxL GfoQ==; 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-212481-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-212481-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. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id af79cd13be357-798abd106d3si40327685a.424.2024.06.12.19.08.44 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Jun 2024 19:08:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-212481-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; 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-212481-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-212481-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 BA4E21C20DBE for ; Thu, 13 Jun 2024 02:08:44 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0DE3A12BF02; Thu, 13 Jun 2024 02:08:10 +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 0CB3B84DEA; Thu, 13 Jun 2024 02:08:08 +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=1718244489; cv=none; b=i7wamg4HvXizlW+oazgAUJxzwmUZThPj5Zc5YNDYk3mAMOKaXJb/iU6kLS/yRoydrarKyTKjEF3TE0ag0YKgOKUJWvUKFjjGuDeO4d7YqSF5gtqZgfMYBRHjrmKidQYztWEi66MKoaI+6+LgarQvb6glvrDgB0H44De0pAC+TYw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718244489; c=relaxed/simple; bh=sbl5X0446SNrZyzdSpjYqjhRmR8nZOs6R/E130gj5SI=; h=From:To:Subject:Date:Message-Id:In-Reply-To:References; b=bnu6KqAvXC7kbkXoRjsDI2PNichaghhizr1lqolgZWJd4Ei3Iu4AHTXwYABth4f9x8MzHCSsBLhOGmQfStuXI4VV1MbtmYTG87rNketSLO4Mg9dxdY0dnCZFro107IehlJgl9+dHoovlJ96eolmCHlotMe10jdrz4wbTbS3i7Rk= 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 ADDEB1A1503; Thu, 13 Jun 2024 04:08:06 +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 5DCCB1A0AB5; Thu, 13 Jun 2024 04:08:06 +0200 (CEST) Received: from localhost.localdomain (shlinux2.ap.freescale.net [10.192.224.44]) by aprdc01srsp001v.ap-rdc01.nxp.com (Postfix) with ESMTP id 07996181D0FD; Thu, 13 Jun 2024 10:08:03 +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 v7 4/5] clk: imx: clk-audiomix: Add CLK_SET_RATE_PARENT flags for clocks Date: Thu, 13 Jun 2024 09:51:21 +0800 Message-Id: <1718243482-18552-5-git-send-email-shengjiu.wang@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1718243482-18552-1-git-send-email-shengjiu.wang@nxp.com> References: <1718243482-18552-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