Received: by 2002:ab2:6a05:0:b0:1f8:1780:a4ed with SMTP id w5csp2593697lqo; Tue, 14 May 2024 03:42:10 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVWHuCvPdhWQnsSFjYyq+w0zKePQhqQygdzfcETe+6QZpkLcTKa1AjlzshGjwDzMON+FtU2KMF9lL/L76dX7+V1ODs49HiJ0GtScVm2gQ== X-Google-Smtp-Source: AGHT+IEpotqAS3BOLnSpUczaiMQRelJWoUha2Aw+H5IDOc1ZkaheIh9v23kmv4jSAY+UNb6h8zcX X-Received: by 2002:a05:6512:ac9:b0:518:9c8e:f172 with SMTP id 2adb3069b0e04-5220fb6aee2mr9579016e87.18.1715683329995; Tue, 14 May 2024 03:42:09 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715683329; cv=pass; d=google.com; s=arc-20160816; b=z/lHoBQTlNzxz7YP0BiE0x8pk1aPfjcBDCVseN1bVEcFSwJTYGeW3zUu7JTrQXjWnp KpruxaJkcSgeKtJ4eR2KKhM+6Wc/d4Mqv5tgBpbpgOElfbFlk9KWA5Xoz7gf2YjL3Z2N cR3aynPlEv7j91iqLmj5VXrr8mSo4kML8DlEnj/QtGkK+QGY46skbfhVbDKtvr0b5wTo ht7gKCiVfRs7wSy/FQ47Gk/FCk/cKKos+rDJPpRojJyMxUGSit4qqb23U0dKYhIFMxIE +HBFEjSafjh0chsEYeG+Yze8kt94skl+ie3oWv1P6wkz55GcFTx179dJpbQnGJguZxG3 L+xw== 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=Qe319uxD5N5WETTnXk95uv6l3pSSvBNkmHJFAMNVLPI=; fh=yJG0a4sP0Py0VcRO0FoZ7y1L5tvgkoSbJk2nY3Z9ahc=; b=VvdwLmZE/D4sK5xN/LCgke3zqpsm2Tey7yzvrMJ0GR7UaGvH5Y5uQDaK+WcfOWBkiQ krkDoz8ob3eMzDYcF2/g+ytGfAmDa4HNtKEg4puo5ZbcgTG1At3s6Q45ycLdMrF/SO2k 64Tz6XZEQIg10UESRNjcNbPo1CN1yn7ozklgrg/DZ8QzHujkNOzuw1XCTJIt7nPbe8eL 4ENTJzx5e2c09qyGhkYE2Qirq1v5wVxvZ0j9fSbCeYHL1/whzgevfJDfaezoHlbO1BtQ 1KnklsYdaMwGd+00aj8QmQH00pro6yhntkVOnzZc6z1QlJCln6BOe4N3Rhi+lT4Hze7o vyhg==; 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-178543-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-178543-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. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id 4fb4d7f45d1cf-5733c3626b5si6170245a12.486.2024.05.14.03.42.09 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 May 2024 03:42:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-178543-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; 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-178543-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-178543-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 9F4D81F20CD4 for ; Tue, 14 May 2024 10:42:09 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5338D13D89B; Tue, 14 May 2024 10:08:07 +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 57BF258AC4; Tue, 14 May 2024 10:08:05 +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=1715681286; cv=none; b=o5g+z3a3k5lbUR513lL3tC4SCH4fv7SQIPZSdx+g3orQSFheKdxZ2kCQBC66XGufPhM2FfGAVKWLHtn7MQ/9gg/KgaLDOFQvtoqYHnUioHC7pBLCF/VhlNI68C/Y4C2IZ9SmQbknuIH3WzbP380N9Nl8qdRV7HKZFmyXdFNoOq8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715681286; c=relaxed/simple; bh=SECeU/hWqv/TiUa66e4a5CsD04TBkyJmeXiGLL2YMfk=; h=From:To:Subject:Date:Message-Id:In-Reply-To:References; b=BvHXHo7ujonxC5LUXDLvRyoFvfdRA1OotRU5KnA6X/Yf+oWmsXyqQoHEWwwLYIiGfoRUrVXzbOZLEk0Z+ukzrgEhyvkNF+r3YtnwYZusLrrCBveT97m/AjatVaE1VJzAopHoi5LAPrwn1DRO3xYBrCj2SgaIJn/qAH46XrqCn8c= 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 EC3DD1A18FA; Tue, 14 May 2024 11:53:01 +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 A4AE01A191F; Tue, 14 May 2024 11:53:01 +0200 (CEST) Received: from localhost.localdomain (shlinux2.ap.freescale.net [10.192.224.44]) by aprdc01srsp001v.ap-rdc01.nxp.com (Postfix) with ESMTP id 5D7F5180222C; Tue, 14 May 2024 17:52:59 +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 v3 4/6] clk: imx: clk-audiomix: Add CLK_SET_RATE_PARENT flags for clocks Date: Tue, 14 May 2024 17:33:28 +0800 Message-Id: <1715679210-9588-5-git-send-email-shengjiu.wang@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1715679210-9588-1-git-send-email-shengjiu.wang@nxp.com> References: <1715679210-9588-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 b381d6f784c8..466b5b0d665c 100644 --- a/drivers/clk/imx/clk-imx8mp-audiomix.c +++ b/drivers/clk/imx/clk-imx8mp-audiomix.c @@ -269,12 +269,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); @@ -317,7 +317,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); @@ -326,7 +327,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