Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp259594rwl; Thu, 23 Mar 2023 15:58:05 -0700 (PDT) X-Google-Smtp-Source: AKy350a9KHKxWU7U5egcyFVVjICoJKZ/Mg4rRlW6/aEgXbutbTLBP4xoXeIkRwzNvb4+l+wPSni+ X-Received: by 2002:a17:902:e84e:b0:1a0:41eb:fdb3 with SMTP id t14-20020a170902e84e00b001a041ebfdb3mr618559plg.10.1679612284780; Thu, 23 Mar 2023 15:58:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679612284; cv=none; d=google.com; s=arc-20160816; b=1G9EPQo/3dD/WLpNfuhTpWu3ol4l4TqpzO2sPs+7MOdOB+husMCE6aN/pVqsx35WR7 oe9ux8xNS0F1L1J9almi4OXm501zD3+FGulz43+YZXR5is+V1n2IFJ8sC4hxSNZctpOP Z7W6Ghd8Fezofnu7Wo99U0BwglHOZRobfyQTno+5sHQRi+4xYrvphCU14SayF1XI+s+l H8xhIPslcs7ccUiI/zcSlAJkvXpXCjrlB6w+P7318YTLi17AF3FDPKcpLcEaOWW7mWO+ Lg7LNYFeIwSye8M5EGcYeh1I9sDTFwQXLyKO01O8vjI2Uqoyn1NQP0OlqLTsHrGbWu0J gX6g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=dwzADQniZ1WNKPleXotCSep6PL7MAO9u3e2Lj6vkwpY=; b=mqvKQMonleDPS0zYXfU0X7sgoVMBjZrCLW+3yuCGkdUj2SMgfmlRUTh/+ivVPDIUH5 jCEqC3reFrNBbbu7gJ4DZBq+4RW2gxoJPh4MFWkLSCe3FuuTScmoSTsPYRkwTI8qLWps Ym+p7KIkSylZTMcA0PG3zdQ+V2cUfcSadfUjDDxeCfKuOy8laPtoqhnN47EZj+PQR+F8 LWQVoSkoQ838sSYMMhZWaCjQWChhtr19iH9uLyNuDWTzMad0xjymF3lt2R62aAw/fyPi IdTR680EYgHARo4RIyTY5mxLStm0TGsqqsBUvNozUC2f6/ARvEthl1d2+ioHIX4LiZWY cIPA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=WLgLJsY4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w8-20020a63f508000000b004ff6eee715bsi19953594pgh.460.2023.03.23.15.57.52; Thu, 23 Mar 2023 15:58:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=WLgLJsY4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231710AbjCWWv6 (ORCPT + 99 others); Thu, 23 Mar 2023 18:51:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47466 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231596AbjCWWvs (ORCPT ); Thu, 23 Mar 2023 18:51:48 -0400 Received: from mail-io1-xd31.google.com (mail-io1-xd31.google.com [IPv6:2607:f8b0:4864:20::d31]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EA08D2CC78; Thu, 23 Mar 2023 15:51:43 -0700 (PDT) Received: by mail-io1-xd31.google.com with SMTP id p17so80013ioj.10; Thu, 23 Mar 2023 15:51:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1679611903; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=dwzADQniZ1WNKPleXotCSep6PL7MAO9u3e2Lj6vkwpY=; b=WLgLJsY4lIu9scZZcqsQQ6Sz8ntBRk+sXuRTKwSgb3DiniWkIOUieBrTIM57f25oEx 5nBbUfPHDHIG6L8EQuDrZYcglLKg1UQ+KvFn7uJanaY8QCypPJNMR6CndCXmwWUwZrBi AK7j1vZa0u7HPq9t7A8NQ6MUfpyD2mTRUURPuc6I/B3/rWkWQC4EEDDFy+iCcL2Q5tja Z/NM41rKoun0LJJaCEQA4O0xhh9x443XRtE0KG5pO92ORfhhGd4+QmGX3XSydkKzjb6v 6D4zo5SqatR8pHLJuMi5R1RLfOz7G596wQou7aAmU0yVxfvNsQtecpt24JV82uQ5ygMa UeBQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679611903; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=dwzADQniZ1WNKPleXotCSep6PL7MAO9u3e2Lj6vkwpY=; b=SWXTYffFhQDtGp6o8QUYcRR7wOT+ctifXs43iSQ+NTxlmA+hVIr3B7kw67Mn5mvTRp c2Wslep+bCGoPkrxNy+Xm80zRbXxbwdMmoLLUNsoQwqaQOBznHUZNqSxlIwYtFsRD1K0 lDA+tFsxwh8+kIIwqoQhZNE/RYvvd1M29DnB+xegA/h47z0c/eTPkirXZ0J7HJ7z/BYj FJW0NEoY+7Xb9f/c7NpmCfjLIFREZNtoSsbUKKBpWqRvHFtHJ26n4E4o/jUMRg52vYox NvJ2BPz1pqLuHMcLEUUL09mT8F3bbubhwoJujBy+fBhlTcMGRup2gcliLKeidj3N9Qse CDQw== X-Gm-Message-State: AO0yUKWZYO1vwuHs4fzCcCLedh+agwxxpHIxu0yxAtSbAtfF2ln+BTZb EXlHu19uHlNFlijoUb2iIa7aI5WjLqc= X-Received: by 2002:a5e:9813:0:b0:750:a574:7c3c with SMTP id s19-20020a5e9813000000b00750a5747c3cmr603659ioj.1.1679611902844; Thu, 23 Mar 2023 15:51:42 -0700 (PDT) Received: from aford-IdeaCentre-A730.lan ([2601:447:d001:897f:f38d:f05d:4666:1249]) by smtp.gmail.com with ESMTPSA id f102-20020a0284ef000000b0040631e8bf89sm6266988jai.38.2023.03.23.15.51.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Mar 2023 15:51:42 -0700 (PDT) From: Adam Ford To: linux-clk@vger.kernel.org Cc: aford@beaconembedded.com, Adam Ford , Peng Fan , Fabio Estevam , Abel Vesa , Michael Turquette , Stephen Boyd , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , NXP Linux Team , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH V3 1/4] clk: imx: composite-8m: Add support to determine_rate Date: Thu, 23 Mar 2023 17:51:25 -0500 Message-Id: <20230323225128.117061-2-aford173@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230323225128.117061-1-aford173@gmail.com> References: <20230323225128.117061-1-aford173@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=0.1 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Similar to imx/clk-composite-93 and imx/clk-divider-gate, the imx8m_clk_composite_divider_ops can support determine_rate. Without this the parent clocks are set to a fixed value, and if a consumer needs a slower reate, the clock is divided, but the division is only as good as the parent clock rate. With this added, the system can attempt to adjust the parent rate if the proper flags are set which can lead to a more precise clock value. Signed-off-by: Adam Ford Reviewed-by: Peng Fan Reviewed-by: Fabio Estevam --- V3: Change name clk_divider_determine_rate to imx8m_clk_divider_determine_rate to match naming convention V2: No Change diff --git a/drivers/clk/imx/clk-composite-8m.c b/drivers/clk/imx/clk-composite-8m.c index cbf0d7955a00..3b63e47f088f 100644 --- a/drivers/clk/imx/clk-composite-8m.c +++ b/drivers/clk/imx/clk-composite-8m.c @@ -119,10 +119,17 @@ static int imx8m_clk_composite_divider_set_rate(struct clk_hw *hw, return ret; } +static int clk_divider_determine_rate(struct clk_hw *hw, + struct clk_rate_request *req) +{ + return clk_divider_ops.determine_rate(hw, req); +} + static const struct clk_ops imx8m_clk_composite_divider_ops = { .recalc_rate = imx8m_clk_composite_divider_recalc_rate, .round_rate = imx8m_clk_composite_divider_round_rate, .set_rate = imx8m_clk_composite_divider_set_rate, + .determine_rate = clk_divider_determine_rate, }; static u8 imx8m_clk_composite_mux_get_parent(struct clk_hw *hw) -- 2.34.1