Received: by 2002:ab2:7b86:0:b0:1f7:5705:b850 with SMTP id q6csp1171643lqh; Sun, 5 May 2024 21:18:05 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUoCjPJo7Ex75+qduC1/ekXwiTTWMC975sot/T+WiaKV/aygkYYQFKPLm/suNRecLHKkfcDhtmsI+Q4xgmawEOSIEpB73VQ0rTUIdtpOg== X-Google-Smtp-Source: AGHT+IEjymAgnGVtfVumHfD94QfZhEdyWFNq90JWL96GIm8VFcnJWSM9KR865aTn22mrnLrfFVNx X-Received: by 2002:a17:906:1951:b0:a59:aa0d:60 with SMTP id b17-20020a170906195100b00a59aa0d0060mr3119523eje.6.1714969084883; Sun, 05 May 2024 21:18:04 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714969084; cv=pass; d=google.com; s=arc-20160816; b=lAGfZgmyVAtrXSpPR7F/BRX/s5aCO9J9vev17dHDAIJAb15D4QZzykRF+U6sG+qjrg J2ifX/xoRcyEnKcD0it5h3IPoiDBGgJGsYhUIPGxCXcxgFvi1HCaFBj/9b064ttR7KHy 2zvXE1ajkFaj4AFic4ybf2YqBj44zaInVxN8rvX0Z32m9ZeKZOX4YjLetoXaXHKsO+eZ rTLeBAtNN46Lzzm+Mx/cAKTJQzaG4DgX6iOpJLNAnJ+q5NxqjJD1yD7RbHXKIu14B/Nw LamLmOZP1vLCLgzB+3IvlU3/pPHMDajYCSD1gPH9dRV9q3hzRuszH7mm0YpqgyWYQnBY VlqA== 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:cc:to:from; bh=+iOnDx4JwoS8iyv2QYH0+DVG7tGrjHCEEqYJfbioGgM=; fh=4/p6U1QvnJ3UqeHPvAOhlM+8EBJc/vWkdZCIGZtSJng=; b=YkKcWSPQNL6ZmLI1w8sYym+g89FCVQ3ukVzGT+7tcKrVMLVFvkT71S6H9IfwkGKoio +F5d9YbMcfXseWO3ErvqVTOuMRIiQJkWavSu9bYvdGX6xKs3xlKqVsqD+a/ZRub6TKhq zuyb/LYcchpXspDcnu+9clnwC7S/pEzjdMJNxfiR35WuXqrrU+D5+xlwCfBsGJ+lz+IU pOoIhd7MNxfMCE3cZwYy5x3jMRVbMdc+ReypLUOAJE1P5KWS1hC8qQfhuV7ZJTqyiK9i SVSgaWEEShvm/c2PLRB9kUEsHp1q3FKEeFfKlPTlQBanrPma7hN2boEbPJZtwpWXKq7h nV5w==; 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-169297-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-169297-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id fi10-20020a170906da0a00b00a59cac1fe57si959861ejb.766.2024.05.05.21.18.04 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 05 May 2024 21:18:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-169297-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; 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-169297-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-169297-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 am.mirrors.kernel.org (Postfix) with ESMTPS id 9C94E1F21BFA for ; Mon, 6 May 2024 04:18:04 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6AC18481AC; Mon, 6 May 2024 04:17:44 +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 6B40D43AD4; Mon, 6 May 2024 04:17:42 +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=1714969063; cv=none; b=eyLbKChgHk6Dlsz13nFdwhyYDvxC0eqlVu1jbMSfKXnMeKhSIlpe4EZQfWDwHxiiCL2KLu7PbpiE+8UufLxPuni2RSRoOjh/8N+5fKQ2FNpUQVlLFElb71qlW+aCBu8bfIj2GRfEy9qWJrALun8u9UEZevy7hzrK9lTGyHnQGrQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714969063; c=relaxed/simple; bh=cuF4ShSYVujALPJHLQ/c5Aoi2MpWdkwrNf8KpGKxWgc=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References; b=XdHd/6YNQ6fQFZgaAH3FP+kHEiwmFxumfvEqLi8IFGJhFhBYbuY6s/bxKVj2dfISynSHLavx8P+U+L3yCncmam/27M/WauvKBnrqS7JRNVk+zWJcoW/vgy+Zm82ZkWcw1mXQOjYRoJ5X9qXagUIVQFQPQ944QuIVouALqpx/xiQ= 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 49BA420095A; Mon, 6 May 2024 06:08:20 +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 F14A5200930; Mon, 6 May 2024 06:08:19 +0200 (CEST) Received: from localhost.localdomain (shlinux2.ap.freescale.net [10.192.224.44]) by aprdc01srsp001v.ap-rdc01.nxp.com (Postfix) with ESMTP id ABBE9181D0F9; Mon, 6 May 2024 12:08:17 +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, imx@lists.linux.dev, shengjiu.wang@gmail.com Cc: linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org Subject: [PATCH 3/4] clk: imx: clk-audiomix: Add CLK_SET_RATE_PARENT flags for clocks Date: Mon, 6 May 2024 11:49:18 +0800 Message-Id: <1714967359-27905-4-git-send-email-shengjiu.wang@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1714967359-27905-1-git-send-email-shengjiu.wang@nxp.com> References: <1714967359-27905-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 58630b521e67..6c888abcc6b5 100644 --- a/drivers/clk/imx/clk-imx8mp-audiomix.c +++ b/drivers/clk/imx/clk-imx8mp-audiomix.c @@ -348,12 +348,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); @@ -396,7 +396,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); @@ -405,7 +406,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