Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp1075557rwl; Sun, 25 Dec 2022 13:30:35 -0800 (PST) X-Google-Smtp-Source: AMrXdXuk3B6NsWlEDjYBXpXR1sNCqfYpko5ae4/z+34Ndfn5tlMhN1hTnYQATIuaBBv2R6TkPrZg X-Received: by 2002:aa7:d04f:0:b0:46f:97fb:1321 with SMTP id n15-20020aa7d04f000000b0046f97fb1321mr14204537edo.35.1672003835614; Sun, 25 Dec 2022 13:30:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672003835; cv=none; d=google.com; s=arc-20160816; b=bFWX0qpmx/8R+cj4f6OolcQFuBVJHbNa79Ge75zgGMexVpoWJeb1RWYXNNoRhElS3w YG1AqhIeFYiiwWnJsiyFQlAtM7p8UUgrY1yTIu4x93rHs4iZodRwd1//gzj3buC1PPCf skv3yUl7Ii8bMvrYZes3lMDMUDwRjayv4Kv27ZUlekFaRBcYjx1C0qI/AxY8QnvOfpwj HtFBGzLujxvseNWD1dCvP2DP88j9G3q1x1Cqw9GrRNKdy2yRF1+0ZLmsugNxOx9zav3Y h6NWgqpQmqXEswCsKrIDOxb+JbKYXjtu8jUIDNicwaZC4hBHo3J4Bsj1xYs0+PXo0NzD XiFA== 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=u624ykL0rVa4TXbrwRaAQyInF1fSqtT2CkhukAfQEcQ=; b=wVtZ9xTpHwKcQ0hghMIII9N/7rQzxjAgBU9gaHaoXT74bOtT+ZnJpEmkoOgMnOyo8O PYIKP7zl4ByAneb07lLI1ue7XQIrfqHgT6kDug6gUxdG8vWyWYNXttwo858d7cNQ+sd3 DYnRI6snXEZOywz3xkUbIce4HkCKjI5QP0vgbVMAbcT/O6B0KPdZXEUZ5l43rFWoiYbW 4MeAr1HAGtm7dWXfZ6PxIDXehZHXc3UwuEQJlZoSubBucRljC7kkfhkhOxlgS+wsX7ND Q3CAOv/YIzY/XrlNAitu9JIZXln7un0SAm9XL79OjVIKf5fh4nUV9tmCr+xuvlcZpPIh Iy0g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@googlemail.com header.s=20210112 header.b="f/MsTWFf"; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=googlemail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id p19-20020a056402155300b00482e80ee6dfsi4338236edx.54.2022.12.25.13.30.20; Sun, 25 Dec 2022 13:30:35 -0800 (PST) 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=@googlemail.com header.s=20210112 header.b="f/MsTWFf"; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=googlemail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231424AbiLYV0z (ORCPT + 66 others); Sun, 25 Dec 2022 16:26:55 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38784 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231140AbiLYV0o (ORCPT ); Sun, 25 Dec 2022 16:26:44 -0500 Received: from mail-ej1-x62e.google.com (mail-ej1-x62e.google.com [IPv6:2a00:1450:4864:20::62e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 55BF010F7; Sun, 25 Dec 2022 13:26:43 -0800 (PST) Received: by mail-ej1-x62e.google.com with SMTP id qk9so23046653ejc.3; Sun, 25 Dec 2022 13:26:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20210112; 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=u624ykL0rVa4TXbrwRaAQyInF1fSqtT2CkhukAfQEcQ=; b=f/MsTWFfmvfxD5qcKbMT7oSwdnOKOaRdPUMvgkI2Jq8dI4tvIFNTeHhXg9Bwd/ruae tzb+0N1eg5KRzMTTLUa+3EGQAe4FBSiyKw0PN09VvPKBp5z2cEQdgN1n/RZ67Pi3DxgX zqVP99Ebigki9FcU1vJEllBPWjXQoe1LCQ1giR/X5qmveAWPNFNdMtGyd80NfY9mcmXl 3YLoCn9h46stJVIgEukqaVwNM1AdsRrfOIHJHEbf2Z0R5rvnaR45bf7qxlW9rFZBoARu FTTr6DSfpszUmwVcM86NR9YW2Pvu10+gfzhcstH/oSgc2s1aIe4uq2SAQ4UwHla9mnzq DcoQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=u624ykL0rVa4TXbrwRaAQyInF1fSqtT2CkhukAfQEcQ=; b=oyp7jjSD6SHvw7qvkLa9Wp8eTlvS2SRhhPODwquePJw5ZwYiy5HaMsUrjOTJ8HBLgO XgWZoqrxrP5S7jX1+qr//isNYKms0AOmI008J/XGtRAmeuiEOn9OQoYvrEBG1idKRZP5 qtVoQRi6/84gOgWwX+EUl0IRKfmO9clKj11255g+TZJrKmuY/Bqf6xQlVtz6/UlECsvG a+UEol4zzRDoVONvj9+s7faPd42/1z7E+oY2WGWXIu+IAnB729y6MHWq4qa5p9VAbaDa r501EgBeLzwOeYlRKiEtU7rH+m3QPhci5YiqomcB/MzIs1Sad3YvX4iGqJ+Ndc228eqL hWXw== X-Gm-Message-State: AFqh2kq81TbVQ5pJwP+OZZmq+pRUranK+ECw+24mcSp4k1bv3ypWmITk LlBBeo/zEn3VTEcJxKllXZtpqyZ9nrk= X-Received: by 2002:a17:907:d604:b0:7ad:d62d:9d31 with SMTP id wd4-20020a170907d60400b007add62d9d31mr13566696ejc.67.1672003601830; Sun, 25 Dec 2022 13:26:41 -0800 (PST) Received: from localhost.localdomain (dynamic-2a01-0c23-c49f-b200-0000-0000-0000-0e63.c23.pool.telefonica.de. [2a01:c23:c49f:b200::e63]) by smtp.googlemail.com with ESMTPSA id ku22-20020a170907789600b007c10d47e748sm4062567ejc.36.2022.12.25.13.26.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 25 Dec 2022 13:26:41 -0800 (PST) From: Martin Blumenstingl To: linux-amlogic@lists.infradead.org Cc: linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, jbrunet@baylibre.com, Martin Blumenstingl Subject: [PATCH v1 2/4] clk: meson: dualdiv: switch from .round_rate to .determine_rate Date: Sun, 25 Dec 2022 22:26:30 +0100 Message-Id: <20221225212632.2760126-3-martin.blumenstingl@googlemail.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20221225212632.2760126-1-martin.blumenstingl@googlemail.com> References: <20221225212632.2760126-1-martin.blumenstingl@googlemail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham 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 clk_ops.round_rate will be removed at some point. It's replacement is .determine_rate. Switch clk-dualdiv over to use .determine_rate. Signed-off-by: Martin Blumenstingl --- drivers/clk/meson/clk-dualdiv.c | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/drivers/clk/meson/clk-dualdiv.c b/drivers/clk/meson/clk-dualdiv.c index c5ca23a5e3e8..feae49a8f6dc 100644 --- a/drivers/clk/meson/clk-dualdiv.c +++ b/drivers/clk/meson/clk-dualdiv.c @@ -86,18 +86,23 @@ __dualdiv_get_setting(unsigned long rate, unsigned long parent_rate, return (struct meson_clk_dualdiv_param *)&table[best_i]; } -static long meson_clk_dualdiv_round_rate(struct clk_hw *hw, unsigned long rate, - unsigned long *parent_rate) +static int meson_clk_dualdiv_determine_rate(struct clk_hw *hw, + struct clk_rate_request *req) { struct clk_regmap *clk = to_clk_regmap(hw); struct meson_clk_dualdiv_data *dualdiv = meson_clk_dualdiv_data(clk); - const struct meson_clk_dualdiv_param *setting = - __dualdiv_get_setting(rate, *parent_rate, dualdiv); + const struct meson_clk_dualdiv_param *setting; - if (!setting) - return meson_clk_dualdiv_recalc_rate(hw, *parent_rate); + setting = __dualdiv_get_setting(req->rate, req->best_parent_rate, + dualdiv); + if (setting) + req->rate = __dualdiv_param_to_rate(req->best_parent_rate, + setting); + else + req->rate = meson_clk_dualdiv_recalc_rate(hw, + req->best_parent_rate); - return __dualdiv_param_to_rate(*parent_rate, setting); + return 0; } static int meson_clk_dualdiv_set_rate(struct clk_hw *hw, unsigned long rate, @@ -122,7 +127,7 @@ static int meson_clk_dualdiv_set_rate(struct clk_hw *hw, unsigned long rate, const struct clk_ops meson_clk_dualdiv_ops = { .recalc_rate = meson_clk_dualdiv_recalc_rate, - .round_rate = meson_clk_dualdiv_round_rate, + .determine_rate = meson_clk_dualdiv_determine_rate, .set_rate = meson_clk_dualdiv_set_rate, }; EXPORT_SYMBOL_GPL(meson_clk_dualdiv_ops); -- 2.39.0