From patchwork Fri Jul 2 22:51:40 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Blumenstingl X-Patchwork-Id: 12356761 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.7 required=3.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED,DKIM_SIGNED,DKIM_VALID,FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id EECEFC07E96 for ; Fri, 2 Jul 2021 22:54:23 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id A78F5613B6 for ; Fri, 2 Jul 2021 22:54:23 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A78F5613B6 Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=googlemail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=Sffy+8pWT9hQFiDtZlmN9aBpoM+gi6aKqFzawSZWxSA=; b=mqvTEhLtFJ0SEQ Kar9saUGUIoesVpD/0yjoO9mYnaFcezpsiim2xiL/3IGO1mgp1Px0e/ARHlFEN6qS2RcFydxcU32u Gm0Dn723d1qlzQfMmdLC8AFXdvqF3WX3aYJsorwhryZxMqxfQn0iuuKv7LH7n47z4LtAWH/w3iC67 eLNGXXb2px5NJxOmZNrQ15DMGfh3t3ti2lZU7pzlcm5xZsjNcciXfubfeDTLG7McLm0GUTdL2PBLk YXW9Yfxf8W4drVacsqM49KrKlaacVQcCekYqYL6uvXciD90WujnuKMV313MCE1gpEiwfVEnHMRR7Z MR7WhtCGHje02CG/HWCQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1lzS17-004C2d-WB; Fri, 02 Jul 2021 22:52:14 +0000 Received: from mail-ej1-x62b.google.com ([2a00:1450:4864:20::62b]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1lzS0u-004Bz4-VR for linux-arm-kernel@lists.infradead.org; Fri, 02 Jul 2021 22:52:02 +0000 Received: by mail-ej1-x62b.google.com with SMTP id bg14so18604217ejb.9 for ; Fri, 02 Jul 2021 15:52:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=faNXvR3tx7KD+s7khCjZtAZqhs7ILrjagiLN5169MA8=; b=uDJCglXnuDw53LtC8KWzaQ83KG071Y8VkDrMy1Qy8tMYbffgHLiXZlmUUZiHIjtVp5 lhn3l6NJ5byXjBsyDlDbAuI6kJ99htHY2t7BF1zuYFY49bB7Ih0QlmnW733yBf1iI7rN 6WLwaQpzQSCpzu2H6wvomIFX3H0tXGoVtg+uZTBp/eLZzoptXVHvNoCTBnVEkhwmNt5n C/U3MkgYhBAPlaRHQKREloxHzwBfesjDtFU6BWg8K+y1VelqryEDpazd0vv6JFtySK7X IstacKz3/ejDkdTBalE5rANV3daRc5ASPPqmzonGubj8CLKcMVSu2p5H9iZ6W7tp8nOJ lkTQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=faNXvR3tx7KD+s7khCjZtAZqhs7ILrjagiLN5169MA8=; b=HRumRN+oHdFjvLIRdcVzwfTrA5nmsRmInxPnAaaB7X2j/LQ2967HYdl/4XRPQftLtv uhK7Vb+IhctpmFO2OrnNxazEaujd6E84Q5iQ11v/vawgY0lxVoGQ+AzRzIIoV+Sdu63l 8AKpamdQHOloOVezZdChDPkHKjR5qBzFvFXXGhbEDtInHrMrW2MrYaNJd07gkF17brhA RT5opzYAAnatkHR4JCsnBqNvA5EOg5v3oWPpBCvbIoAiQ8TqhAWaqUDEkH4Riq02ZhZ8 g0rZioxk9gtFFdHD0jwwmDrWMbFNoHx9sF4tU5uUmeqrnGXZRtxlaUsYxptitKGTEezh gAbg== X-Gm-Message-State: AOAM530QZgrx/qG2HQAL+HLQ3L8NuadlJsAbKRHpXLfQRSgI6y7pzovM 7odZF8iClN3DQAXJR69HDAI= X-Google-Smtp-Source: ABdhPJwtzWyis2mfuY/taJOWeS/vOPZB1y7JjZJkpRVbpg/Yfy0fom9pRY11N/LQRFPXjnDFZK9t2Q== X-Received: by 2002:a17:907:60d6:: with SMTP id hv22mr2030745ejc.78.1625266319554; Fri, 02 Jul 2021 15:51:59 -0700 (PDT) Received: from localhost.localdomain (dynamic-095-117-063-046.95.117.pool.telefonica.de. [95.117.63.46]) by smtp.googlemail.com with ESMTPSA id r17sm1866964edt.33.2021.07.02.15.51.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Jul 2021 15:51:59 -0700 (PDT) From: Martin Blumenstingl To: linux-clk@vger.kernel.org, sboyd@kernel.org Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Martin Blumenstingl Subject: [PATCH v1 1/6] clk: divider: Implement and wire up .determine_rate by default Date: Sat, 3 Jul 2021 00:51:40 +0200 Message-Id: <20210702225145.2643303-2-martin.blumenstingl@googlemail.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210702225145.2643303-1-martin.blumenstingl@googlemail.com> References: <20210702225145.2643303-1-martin.blumenstingl@googlemail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210702_155201_051757_DCB52FFE X-CRM114-Status: GOOD ( 16.60 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org .determine_rate is meant to replace .round_rate. The former comes with a benefit which is especially relevant on 32-bit systems: since .determine_rate uses an "unsigned long" (compared to a "signed long" which is used by .round_rate) the maximum value on 32-bit systems increases from 2^31 (or approx. 2.14GHz) to 2^32 (or approx. 4.29GHz). Implement .determine_rate in addition to .round_rate so drivers that are using clk_divider_{ro_,}ops can benefit from this by default. Keep the .round_rate callback for now since some drivers rely on clk_divider_ops.round_rate being implemented. Signed-off-by: Martin Blumenstingl --- drivers/clk/clk-divider.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/drivers/clk/clk-divider.c b/drivers/clk/clk-divider.c index 87ba4966b0e8..f6b2bf558486 100644 --- a/drivers/clk/clk-divider.c +++ b/drivers/clk/clk-divider.c @@ -446,6 +446,27 @@ static long clk_divider_round_rate(struct clk_hw *hw, unsigned long rate, divider->width, divider->flags); } +static int clk_divider_determine_rate(struct clk_hw *hw, + struct clk_rate_request *req) +{ + struct clk_divider *divider = to_clk_divider(hw); + + /* if read only, just return current value */ + if (divider->flags & CLK_DIVIDER_READ_ONLY) { + u32 val; + + val = clk_div_readl(divider) >> divider->shift; + val &= clk_div_mask(divider->width); + + return divider_ro_determine_rate(hw, req, divider->table, + divider->width, + divider->flags, val); + } + + return divider_determine_rate(hw, req, divider->table, divider->width, + divider->flags); +} + int divider_get_val(unsigned long rate, unsigned long parent_rate, const struct clk_div_table *table, u8 width, unsigned long flags) @@ -501,6 +522,7 @@ static int clk_divider_set_rate(struct clk_hw *hw, unsigned long rate, const struct clk_ops clk_divider_ops = { .recalc_rate = clk_divider_recalc_rate, .round_rate = clk_divider_round_rate, + .determine_rate = clk_divider_determine_rate, .set_rate = clk_divider_set_rate, }; EXPORT_SYMBOL_GPL(clk_divider_ops); @@ -508,6 +530,7 @@ EXPORT_SYMBOL_GPL(clk_divider_ops); const struct clk_ops clk_divider_ro_ops = { .recalc_rate = clk_divider_recalc_rate, .round_rate = clk_divider_round_rate, + .determine_rate = clk_divider_determine_rate, }; EXPORT_SYMBOL_GPL(clk_divider_ro_ops); From patchwork Fri Jul 2 22:51:41 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Blumenstingl X-Patchwork-Id: 12356763 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.9 required=3.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED,DKIM_SIGNED,DKIM_VALID,FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, UNWANTED_LANGUAGE_BODY,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 31024C07E97 for ; Fri, 2 Jul 2021 22:54:24 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id EC7FA613C0 for ; Fri, 2 Jul 2021 22:54:23 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org EC7FA613C0 Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=googlemail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=hwJ7h5nFrdNZlrfroxjYhFJ/72d0W8UvsRWuwMr3OqQ=; b=2CAzKOXDGidpsC UqIyPOveiFutUv3bJmSHQtf8Y5Op8lMRyAwoPPE90LYLfHxGrIXZtvxPkgNQEDSAuoxv6pNyXPbk4 rIHa4/kY9ALyokRmXP2Egu2kuSgvLCgrlOU+/U+BaeNAu3qnsl0dd+NgoWOy/xSoYHQOt2Mru3S63 QeKbj7KjEP7WvcNKRVjKERLHBaE+mBPT2Ifx93UuBgM0O3hF3IeAmsKsGvUbITdP1c6ZlDHdpiNJV QfUrWFePPx5gESgPu9ZPnf0KQs5POZw0H3c2eMz+loYD9Vu6YGE/UCKCqZqcMARKWxEwPZJkzW4u8 QULTmoS3/U06L1rzgNIA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1lzS1H-004C3g-TK; Fri, 02 Jul 2021 22:52:24 +0000 Received: from mail-ej1-x629.google.com ([2a00:1450:4864:20::629]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1lzS0v-004BzI-RS for linux-arm-kernel@lists.infradead.org; Fri, 02 Jul 2021 22:52:03 +0000 Received: by mail-ej1-x629.google.com with SMTP id ga42so1337629ejc.6 for ; Fri, 02 Jul 2021 15:52:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=8Yd46gkoCwEb4bTGA5aRlP58DFHDPO3UuhUys68/ZC8=; b=bkClNSNE2jrZuxkwQFwvzqYVpbVaVUkuUQfC20fX85VHhdo9i4PbgIHjOP06E+SXJN OV9CdGtHQw0729surn/NPaP5dg4mXUp8lbTxTQ5hJpp7CBp+W7W6L97Fat8zsO3pA4eu u7xtNP6Shb/NKJVto8qDdeI2oa4KNYqTGDVZSolIIxIOfRQC0az+8KeNuW0ziVDdeLPN zX7A33eTJFTS9Q1ubW/6xySa1/ymvqICSENj7NWoBw+Fdc0QclPy1jtPYdTiNikglloD 0L1dyC1G07QqYrOnbHTP0YQ64gVmZP9LZJeN9W/m7akvG0FbcTmU+pJr+OyekcpH5aq0 8uOA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=8Yd46gkoCwEb4bTGA5aRlP58DFHDPO3UuhUys68/ZC8=; b=iDRU+ofcIcKdnqdSWJJzDCQWQjKa4Z3AF2oZC+0IR6Y149pkxFmU2l+GAHKmJMJHrV dSjfY3MoJ29juW+Qg/ZQkmCIUTCeiv4EJ3Tl2XtI9/bL0muguCWS1O/uTBFc5svjB+qf so8dwaQRhyawEIHNFrZgSkucV2IV/+iHR1YswpzAFk0JdvB2kbe7OyiNDuAzt4hbLvbF vc2/o4K51qJz8VwMhMU3bUTp09M4/zjXqhB7sUHe0y7f+pRsUZZ4/aOIGd3kpLP/Xg6z wPUkAPA2tzwqtCfF2tcV9FvmjZWGiklSp2QHQ3xq2sq8b6AMa8mmjclB3XOOvaybaEWm VaLA== X-Gm-Message-State: AOAM533gS/BQh9AWks6lz666HC7a0hV0sgZ8rtEFuZtjn1kjGd9ER5GD bqf4d090jwI3mzklvuEw6a0= X-Google-Smtp-Source: ABdhPJyf+1YH/WcpezdktAW8H6mMs6mfjeqZzfgwQ8aed0fcIxRyHYH8d9w3oilIshsRCQSPuOaCYA== X-Received: by 2002:a17:907:72ce:: with SMTP id du14mr2006899ejc.529.1625266320484; Fri, 02 Jul 2021 15:52:00 -0700 (PDT) Received: from localhost.localdomain (dynamic-095-117-063-046.95.117.pool.telefonica.de. [95.117.63.46]) by smtp.googlemail.com with ESMTPSA id r17sm1866964edt.33.2021.07.02.15.51.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Jul 2021 15:52:00 -0700 (PDT) From: Martin Blumenstingl To: linux-clk@vger.kernel.org, sboyd@kernel.org Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Martin Blumenstingl , Guenter Roeck , Abel Vesa , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team Subject: [PATCH v1 2/6] clk: imx: clk-divider-gate: Switch to clk_divider.determine_rate Date: Sat, 3 Jul 2021 00:51:41 +0200 Message-Id: <20210702225145.2643303-3-martin.blumenstingl@googlemail.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210702225145.2643303-1-martin.blumenstingl@googlemail.com> References: <20210702225145.2643303-1-martin.blumenstingl@googlemail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210702_155201_930160_6B3C0743 X-CRM114-Status: GOOD ( 15.57 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org .determine_rate is meant to replace .round_rate in CCF in the future. Switch over to .determine_rate now that clk_divider_ops has gained support for that. Cc: Guenter Roeck Cc: Abel Vesa Cc: Shawn Guo Cc: Sascha Hauer Cc: Pengutronix Kernel Team Cc: Fabio Estevam Cc: NXP Linux Team Signed-off-by: Martin Blumenstingl Reviewed-by: Abel Vesa --- drivers/clk/imx/clk-divider-gate.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/clk/imx/clk-divider-gate.c b/drivers/clk/imx/clk-divider-gate.c index 0322a843d245..26b210cba9be 100644 --- a/drivers/clk/imx/clk-divider-gate.c +++ b/drivers/clk/imx/clk-divider-gate.c @@ -64,10 +64,10 @@ static unsigned long clk_divider_gate_recalc_rate(struct clk_hw *hw, div->flags, div->width); } -static long clk_divider_round_rate(struct clk_hw *hw, unsigned long rate, - unsigned long *prate) +static int clk_divider_determine_rate(struct clk_hw *hw, + struct clk_rate_request *req) { - return clk_divider_ops.round_rate(hw, rate, prate); + return clk_divider_ops.determine_rate(hw, req); } static int clk_divider_gate_set_rate(struct clk_hw *hw, unsigned long rate, @@ -154,12 +154,12 @@ static int clk_divider_is_enabled(struct clk_hw *hw) static const struct clk_ops clk_divider_gate_ro_ops = { .recalc_rate = clk_divider_gate_recalc_rate_ro, - .round_rate = clk_divider_round_rate, + .determine_rate = clk_divider_determine_rate, }; static const struct clk_ops clk_divider_gate_ops = { .recalc_rate = clk_divider_gate_recalc_rate, - .round_rate = clk_divider_round_rate, + .determine_rate = clk_divider_determine_rate, .set_rate = clk_divider_gate_set_rate, .enable = clk_divider_enable, .disable = clk_divider_disable, From patchwork Fri Jul 2 22:51:42 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Blumenstingl X-Patchwork-Id: 12356767 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.9 required=3.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED,DKIM_SIGNED,DKIM_VALID,FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, UNWANTED_LANGUAGE_BODY,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 56633C07E96 for ; Fri, 2 Jul 2021 22:54:34 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 0DF85613C8 for ; Fri, 2 Jul 2021 22:54:34 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0DF85613C8 Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=googlemail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=gIJ6aT6Xz+3aHZVI5uXchPeRnaGSkQ0OXS4vXNX6xrI=; b=TYnKluIe9F17fO Unf4+OiLTVQhzkruO8dPi8vfsUWXCF8lZ3DzIKwoxgY8nFxpa7ma3poA8kN8cV48iQDcfkW/0UCSs rIY/H14C/4HQEtzru4ZjXaLmSH8OlimXKCeffnEsLtmiVNmDMFwxpFfHAz4SI+u/TNzHH8Yy7TlPw h5H1SDpqqlq2PdJolNnv+bifMS/hEKiB0/GfPre8WnfPsMriJ6NNYlceJ13LhVLkov15CxN3m07Er UUyeAnrdn5D8D/C5lDXvTclFYaC3fXjb2RBGTJ1tIATUxYwTkYTS4TEzjP5GLKlJAAxUz7Qx28L80 oKH6qHqgVsMekL9pA0NA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1lzS1T-004C5U-S7; Fri, 02 Jul 2021 22:52:36 +0000 Received: from mail-ej1-x633.google.com ([2a00:1450:4864:20::633]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1lzS0w-004BzW-Lg; Fri, 02 Jul 2021 22:52:04 +0000 Received: by mail-ej1-x633.google.com with SMTP id gn32so18684412ejc.2; Fri, 02 Jul 2021 15:52:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=mzYXAwF64f/gxWVFvm1N2KLW8QBmOTpV3947N44jc8k=; b=CTn+N6FlnVuDYOdettXBeZiSaNynHJ17hYZHXx3sAgms7Lb5hfK7zuvSjEMiH2Ebn2 0DJJQqpoH2AEzPIvkIIXgd3Rn1Dxxk2W0rlW7LaQoXA/rz4KTvh+pLWu20RRzl6g0Zov Nko+cf1eCkXWv5X6CMLloxIzofX5B7Vzjy1npTMTQL/F5VQVZW09oBNCK2tFhryQykeW wMMgBvU7Tdg5krmOsn+33yZAmDGR70B9zFnFXF52QWtHz0fCJoX5e+1nzqDzsF07z7dm Q0uc8U5YR4LhLxzeCoaK8TxxTjKU3bKj7bSSPh/76riXlEyVKqAyPKPWRXjfTGgBBqYS KPaQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=mzYXAwF64f/gxWVFvm1N2KLW8QBmOTpV3947N44jc8k=; b=TNAHkt36daiGc+AT/h+Qy8DauqbjNT7OkXrPa0WwA0rZPdJWO5zV5cuXTCciLmMXHV d9QtJvqHR1jHG//qJcJQFiM+TueoFXg7ny+XtMfR6HIfm1ZfzUOCsL8ARKWljjf9jXMw LjA30WSfVzrH590pzOe/HGwFcHsfueP2/7TRMxeuCA/nlehUdzyOwKiIjdX5NN8l5ZrH z7N4b9g4eX1Ucnn68qwkhwnaHq8nulFjT1W/JMw25TmDnmpLT3BX+p8xnCmAdrVdSv7E /pMg968MCN6Ek8ugnqEYHVLvpE6Q7BhVYDFvzk06hHzvWJQOwFQQ8mTnnwwnZ4lBtY/q AvMw== X-Gm-Message-State: AOAM531Fe6RwRr3tHJ7x+a7KF2/Rj4mNDRI0wLPNdl6NgDXoT7PQtKej xYYyY9ogDnk1ObGo9te2wqY= X-Google-Smtp-Source: ABdhPJwk/IGv7QwyMAJhvJkCoFiMgOpxbkig7bE7F5RSHG2SeyHQsaLmNT8gNJw08Pk5Gn+zfd0bzg== X-Received: by 2002:a17:907:3f8b:: with SMTP id hr11mr1983938ejc.381.1625266321267; Fri, 02 Jul 2021 15:52:01 -0700 (PDT) Received: from localhost.localdomain (dynamic-095-117-063-046.95.117.pool.telefonica.de. [95.117.63.46]) by smtp.googlemail.com with ESMTPSA id r17sm1866964edt.33.2021.07.02.15.52.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Jul 2021 15:52:01 -0700 (PDT) From: Martin Blumenstingl To: linux-clk@vger.kernel.org, sboyd@kernel.org Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Martin Blumenstingl , Marek Szyprowski , Nicolas Saenz Julienne , Florian Fainelli , Ray Jui , Scott Branden , bcm-kernel-feedback-list@broadcom.com, linux-rpi-kernel@lists.infradead.org Subject: [PATCH v1 3/6] clk: bcm2835: Switch to clk_divider.determine_rate Date: Sat, 3 Jul 2021 00:51:42 +0200 Message-Id: <20210702225145.2643303-4-martin.blumenstingl@googlemail.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210702225145.2643303-1-martin.blumenstingl@googlemail.com> References: <20210702225145.2643303-1-martin.blumenstingl@googlemail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210702_155202_783893_D203769F X-CRM114-Status: GOOD ( 13.70 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org .determine_rate is meant to replace .round_rate in CCF in the future. Switch over to .determine_rate now that clk_divider_ops has gained support for that. Cc: Marek Szyprowski Cc: Nicolas Saenz Julienne Cc: Florian Fainelli Cc: Ray Jui Cc: Scott Branden Cc: bcm-kernel-feedback-list@broadcom.com Cc: linux-rpi-kernel@lists.infradead.org Signed-off-by: Martin Blumenstingl Tested-by: Marek Szyprowski --- drivers/clk/bcm/clk-bcm2835.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/drivers/clk/bcm/clk-bcm2835.c b/drivers/clk/bcm/clk-bcm2835.c index 1ac803e14fa3..a254512965eb 100644 --- a/drivers/clk/bcm/clk-bcm2835.c +++ b/drivers/clk/bcm/clk-bcm2835.c @@ -805,11 +805,10 @@ static int bcm2835_pll_divider_is_on(struct clk_hw *hw) return !(cprman_read(cprman, data->a2w_reg) & A2W_PLL_CHANNEL_DISABLE); } -static long bcm2835_pll_divider_round_rate(struct clk_hw *hw, - unsigned long rate, - unsigned long *parent_rate) +static int bcm2835_pll_divider_determine_rate(struct clk_hw *hw, + struct clk_rate_request *req) { - return clk_divider_ops.round_rate(hw, rate, parent_rate); + return clk_divider_ops.determine_rate(hw, req); } static unsigned long bcm2835_pll_divider_get_rate(struct clk_hw *hw, @@ -901,7 +900,7 @@ static const struct clk_ops bcm2835_pll_divider_clk_ops = { .unprepare = bcm2835_pll_divider_off, .recalc_rate = bcm2835_pll_divider_get_rate, .set_rate = bcm2835_pll_divider_set_rate, - .round_rate = bcm2835_pll_divider_round_rate, + .determine_rate = bcm2835_pll_divider_determine_rate, .debug_init = bcm2835_pll_divider_debug_init, }; From patchwork Fri Jul 2 22:51:43 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Blumenstingl X-Patchwork-Id: 12356765 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.7 required=3.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED,DKIM_SIGNED,DKIM_VALID,FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D0BBEC07E95 for ; Fri, 2 Jul 2021 22:54:32 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 99F79613C8 for ; Fri, 2 Jul 2021 22:54:32 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 99F79613C8 Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=googlemail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=JJgpn6hDYJ4GL4n7jv/fquomaFIogt0NItxfwDnKrj0=; b=CAPKfue0s6D5Rt mYPRr4iIJCzzbiIDWnwKybqoTyKgPOYP27IiCldTK70AX6PaIym/gQh5GyZ8JuLC7V/LXpaUpesYf ndErmyW7Usc1QcaH05PZiXJothhoEjdxrkNalUyc1Mqg45fctqk01R6VTdZGfxKqcybYSq6+QD5r2 3CcHrucWcwkwj5at4M5ckXH5q9QaQodPbAqiJCWqSpQGEmM9El9goGyYjGdibrSW4eL4qGIAyeU0G j39gOHieaEnesVyNxrd0VkGZslYJNAFvI/peSiAyvYuXCHYEBZAqrUIXS0lkkOKunr4/zcRMLk6Mz wIue0dtIOyRR86SzJiyQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1lzS1e-004C7Q-OY; Fri, 02 Jul 2021 22:52:47 +0000 Received: from mail-ej1-x62b.google.com ([2a00:1450:4864:20::62b]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1lzS0x-004Bzq-16 for linux-arm-kernel@lists.infradead.org; Fri, 02 Jul 2021 22:52:04 +0000 Received: by mail-ej1-x62b.google.com with SMTP id ga42so1337700ejc.6 for ; Fri, 02 Jul 2021 15:52:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=CUXIdV7IyIYLsaimkDpH07CvQJHcqNP5b8K6Nj4IrE4=; b=FCo1WJAAgMsJncjryBYDadhLVfBG08rP33YJnoPHG90FhHsz357vFHnIzBo1nLcjNR lH0eZWtHZtimnegirn9Y0rXLi4kQ4+xX+KulK73EWQ3DBEz6rl0SvUfd/V/Rh1lQSN1F Zb1MhTGoDljyVuvLlqIGvIm6af09vb1ongwRsIfrxnANCuMYJl/QupK1i36K+JgERmzf cl/JJUQ7WblSFFRaxZr0hYpoMIYyTzDQ/ozQGqO3W375dYqJxbsbVIaURxsPvNHjBplK WtGTwcVRwErEGHG2B2GL08fqqlW+IOBQd4lJIa3sk107tUmbgopKw+mC/oyf0OVmlXq5 pqyA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=CUXIdV7IyIYLsaimkDpH07CvQJHcqNP5b8K6Nj4IrE4=; b=OiKFTiAAfZGzZi2RBpUaYdqgG0zkLuwtNvEXypHhNZSkxBO2VQYFQK3YyavGA4WQOn CT0yDAieBmx4xcKMr/38sUk0C5xdMyiqEyUq8fXU/2nDLzi82T9PFQO56rLe3lCjzug2 C7L9qJ9a+gklNbHMeiRrdsuluxiD+OrkcEyqBiqZK8dQou/84+5mLSyiP9xPB3TY1RBa ZFlbcCNhoHGAtxLaHZSRMqnJI4zwa3qsySPNR9oh3IYzctIe8EV4EN5WQIx0tTFb+xcu 6ugK5Jqo5UC6EZtYncEdurdJsnhGsntQcpOwm6ali+RnQrOAoepVztKZQ/sNOXfSE+5K 1Paw== X-Gm-Message-State: AOAM530R3g54uLpIg90IoNu3LYbDz1VfxQ5RcYgicNeNtbUpWo4w/0Gu l0RrCXO8z18nnCH/tvSwnOY= X-Google-Smtp-Source: ABdhPJzx45XAEdaPMlRXfsxl9nOpf+kJ9KYEYm3S8JI9izdhcVTWhCQMQwzh//FMvriJE+pnPJYJZw== X-Received: by 2002:a17:906:4fc7:: with SMTP id i7mr2113939ejw.46.1625266321918; Fri, 02 Jul 2021 15:52:01 -0700 (PDT) Received: from localhost.localdomain (dynamic-095-117-063-046.95.117.pool.telefonica.de. [95.117.63.46]) by smtp.googlemail.com with ESMTPSA id r17sm1866964edt.33.2021.07.02.15.52.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Jul 2021 15:52:01 -0700 (PDT) From: Martin Blumenstingl To: linux-clk@vger.kernel.org, sboyd@kernel.org Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Martin Blumenstingl , Maxime Coquelin , Alexandre Torgue , linux-stm32@st-md-mailman.stormreply.com Subject: [PATCH v1 4/6] clk: stm32f4: Switch to clk_divider.determine_rate Date: Sat, 3 Jul 2021 00:51:43 +0200 Message-Id: <20210702225145.2643303-5-martin.blumenstingl@googlemail.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210702225145.2643303-1-martin.blumenstingl@googlemail.com> References: <20210702225145.2643303-1-martin.blumenstingl@googlemail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210702_155203_143765_147E3558 X-CRM114-Status: GOOD ( 14.29 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org .determine_rate is meant to replace .round_rate in CCF in the future. Switch over to .determine_rate now that clk_divider_ops has gained support for that. Cc: Maxime Coquelin Cc: Alexandre Torgue Cc: linux-stm32@st-md-mailman.stormreply.com Signed-off-by: Martin Blumenstingl --- drivers/clk/clk-stm32f4.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/clk/clk-stm32f4.c b/drivers/clk/clk-stm32f4.c index 18117ce5ff85..22267fb3e92e 100644 --- a/drivers/clk/clk-stm32f4.c +++ b/drivers/clk/clk-stm32f4.c @@ -709,10 +709,10 @@ static unsigned long stm32f4_pll_div_recalc_rate(struct clk_hw *hw, return clk_divider_ops.recalc_rate(hw, parent_rate); } -static long stm32f4_pll_div_round_rate(struct clk_hw *hw, unsigned long rate, - unsigned long *prate) +static int stm32f4_pll_div_determine_rate(struct clk_hw *hw, + struct clk_rate_request *req) { - return clk_divider_ops.round_rate(hw, rate, prate); + return clk_divider_ops.determine_rate(hw, req); } static int stm32f4_pll_div_set_rate(struct clk_hw *hw, unsigned long rate, @@ -738,7 +738,7 @@ static int stm32f4_pll_div_set_rate(struct clk_hw *hw, unsigned long rate, static const struct clk_ops stm32f4_pll_div_ops = { .recalc_rate = stm32f4_pll_div_recalc_rate, - .round_rate = stm32f4_pll_div_round_rate, + .determine_rate = stm32f4_pll_div_determine_rate, .set_rate = stm32f4_pll_div_set_rate, }; From patchwork Fri Jul 2 22:51:44 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Blumenstingl X-Patchwork-Id: 12356769 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.7 required=3.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED,DKIM_SIGNED,DKIM_VALID,FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4CBA1C07E95 for ; Fri, 2 Jul 2021 22:54:49 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 1B5CA611F2 for ; Fri, 2 Jul 2021 22:54:49 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1B5CA611F2 Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=googlemail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=XqAQZF56zK/mdgEnTOMa1s/JqRbC55J9F0v+/ybnPUU=; b=tyeNXUL9YxE+fN lyJtpS0xhezu3mnF6sqe08dJc531cMUbbZ7krq6s9psaeNlp2hESBngTtsXA4VyqGYkziSM6SMJrY Y1STrmUV7Bi1bXSdqo67vF1jUITwBqRZPX7ExVZYTw7FcJE/HlYXMK1Wa1BpgidgF5+ojPv6lYc8t aGqVy2kA5aEdC2+g9ysLaGVCE21/WcwJYV8Clr5ciECZsN7FHQn8xh6WzFhD4iNLvSdvkPRdE22kL QsJmPfoedEnGNeoGDSHpdpvnEQdGigqxgsFFUpSrxWULIIPEkxIpMy0WYJPXzvV9jkSyXwiku4Kih VR9/k4piCioWYKL4Cx0A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1lzS1s-004CBk-D6; Fri, 02 Jul 2021 22:53:00 +0000 Received: from mail-ed1-x529.google.com ([2a00:1450:4864:20::529]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1lzS0y-004C0E-2F for linux-arm-kernel@lists.infradead.org; Fri, 02 Jul 2021 22:52:05 +0000 Received: by mail-ed1-x529.google.com with SMTP id w17so15215836edd.10 for ; Fri, 02 Jul 2021 15:52:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=tDqwwsMfqU+YTlX7nUA9tYQ0qz5qpRvsVLjs65oq6sA=; b=sbTABOINWnDkV7vqSAeBZOUUoZpNOwfwP79uIslNUGhI91o+/Q4W6MsptPiwDzodlK sINPa2ZHyLT1HwzTODHAum01LuqZbaInErlXG7CevVLWVmZu4MUwaLJAPPj4sbeYw3bD 86Plh23LYm51clZTBeLad+71Brt6Da7XcmLBgSV+XH8jxy/BH/ZwMQdyQlEeAUIo81Jo Q9OgDvoy7hw8ro12l9CZeS+ikGB9JNyGMQgoiBLOOd3kHA/S+tsYDPQV9jC7Mxe1Bysr 8beHTmLQWhxetmSaU6lzv5WvDxVIzCZsZgZvqrp1lHE0L9IxmJB4hjwnayAtEG/tAIkJ FL6w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=tDqwwsMfqU+YTlX7nUA9tYQ0qz5qpRvsVLjs65oq6sA=; b=Yv54yl+qx6uoVgzbfAHonSJRHx05MWD9ImuDKAUezLu53UI1G7lJMlZjB9FJe1O8D8 PH/ELPdsqEV7MkJ+Ojv7m3MEl1/bjfgAlcj3drsaNog0R5DrW7gmVwVDAyWzacGLg6E2 h93eejb6bBWY2NGKWsxOCNRkdhzXefYlHClQXsq1EiGjDTO+s5ly7axXtxXROInSxo2s LJEGzh+oVdg31KowRROdBK0gGIM/HG3wkWwmiNPWItE4zZLxFyBfczmLCddgbm3667+u Hgl+GD4eXB8gwFI6L71KqLuIVS5zG1icLyjXfVS4FMKYyYIfQvA5B+GDVAgzoozz06YT +7Sg== X-Gm-Message-State: AOAM532Zrx6hPs4Igb3J8rj1ZQTao6/PoFYxz4b1Z3NF/goE4G+my4rc nxxz54RxQe35N9nOHHRy1ts= X-Google-Smtp-Source: ABdhPJzbCHHCDX0VLPouL6nXL312RmrkyTgGK9KxV9CLAe8LLwMi9WKTcs1bnCOfwl8adqw1x5NUJQ== X-Received: by 2002:aa7:d34f:: with SMTP id m15mr2067164edr.155.1625266322654; Fri, 02 Jul 2021 15:52:02 -0700 (PDT) Received: from localhost.localdomain (dynamic-095-117-063-046.95.117.pool.telefonica.de. [95.117.63.46]) by smtp.googlemail.com with ESMTPSA id r17sm1866964edt.33.2021.07.02.15.52.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Jul 2021 15:52:02 -0700 (PDT) From: Martin Blumenstingl To: linux-clk@vger.kernel.org, sboyd@kernel.org Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Martin Blumenstingl , Maxime Coquelin , Alexandre Torgue , linux-stm32@st-md-mailman.stormreply.com Subject: [PATCH v1 5/6] clk: stm32h7: Switch to clk_divider.determine_rate Date: Sat, 3 Jul 2021 00:51:44 +0200 Message-Id: <20210702225145.2643303-6-martin.blumenstingl@googlemail.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210702225145.2643303-1-martin.blumenstingl@googlemail.com> References: <20210702225145.2643303-1-martin.blumenstingl@googlemail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210702_155204_151997_61270A40 X-CRM114-Status: GOOD ( 14.29 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org .determine_rate is meant to replace .round_rate in CCF in the future. Switch over to .determine_rate now that clk_divider_ops has gained support for that. Cc: Maxime Coquelin Cc: Alexandre Torgue Cc: linux-stm32@st-md-mailman.stormreply.com Signed-off-by: Martin Blumenstingl --- drivers/clk/clk-stm32h7.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/clk/clk-stm32h7.c b/drivers/clk/clk-stm32h7.c index 0ea7261d15e0..1a701eada0c1 100644 --- a/drivers/clk/clk-stm32h7.c +++ b/drivers/clk/clk-stm32h7.c @@ -845,10 +845,10 @@ static unsigned long odf_divider_recalc_rate(struct clk_hw *hw, return clk_divider_ops.recalc_rate(hw, parent_rate); } -static long odf_divider_round_rate(struct clk_hw *hw, unsigned long rate, - unsigned long *prate) +static int odf_divider_determine_rate(struct clk_hw *hw, + struct clk_rate_request *req) { - return clk_divider_ops.round_rate(hw, rate, prate); + return clk_divider_ops.determine_rate(hw, req); } static int odf_divider_set_rate(struct clk_hw *hw, unsigned long rate, @@ -875,7 +875,7 @@ static int odf_divider_set_rate(struct clk_hw *hw, unsigned long rate, static const struct clk_ops odf_divider_ops = { .recalc_rate = odf_divider_recalc_rate, - .round_rate = odf_divider_round_rate, + .determine_rate = odf_divider_determine_rate, .set_rate = odf_divider_set_rate, }; From patchwork Fri Jul 2 22:51:45 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Blumenstingl X-Patchwork-Id: 12356771 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.7 required=3.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED,DKIM_SIGNED,DKIM_VALID,FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id F200DC07E95 for ; Fri, 2 Jul 2021 22:55:00 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id B364B613FB for ; Fri, 2 Jul 2021 22:55:00 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B364B613FB Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=googlemail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=XxBGhxHQRwkfDcvET23BGho7bUS1NLsww0zKztcdQCU=; b=3IzazBi8b9DTIb f1DpvrRfPdkpoCJclsyup4QMfiXc/wrlXQLJ+1AdUaz7KW9iDMRjkYZv4q53/hjunCJ2g10c7k9u3 L+cn7PXfzDpmrAGYaDtYCgTOYXxLaC0BASUB64CEr+7CwCgT9sVuKR3XVRgdpwhwNfvce3MQujqHS K+YyRzcojyQn+LBskWX/LmcLrFqiPGjBjK4tkPax1zVTrekfQea4cMUjNOI4FU7SR7rub69lQfVRl AjPahxIzjv948TWfNg+u6WcBv/foUgQ9x2egcXFXiWeSBOstf6pntAsZtUSiaSrCtK1x5OTP+vj7Q pmmsqJpjvWs4ns44KJMw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1lzS25-004CGW-KD; Fri, 02 Jul 2021 22:53:13 +0000 Received: from mail-ed1-x530.google.com ([2a00:1450:4864:20::530]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1lzS0y-004C0h-OR for linux-arm-kernel@lists.infradead.org; Fri, 02 Jul 2021 22:52:06 +0000 Received: by mail-ed1-x530.google.com with SMTP id m1so15215625edq.8 for ; Fri, 02 Jul 2021 15:52:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=741oOKm9Y/CN6pZlsJDyA+wQ24ovzGnQR0XtQiJk4V0=; b=cvI1oGQdong/J6jo2Uvf7v7DwJpDQsEHB76D+A5tSKdsRTiJif1apV6Sc6OKruoHcU O1/6bF7h9IxRqm62vZco6/cmJpD/7zNoo+570lV7tmFWpN3KK59H61v7GPJ1NwYmNRxc B4DyHUGOv33SNJn9E9Uaw9b1cpVyfMNcIfm7b5VpM0i0hH3DWHNzgWtPJyXHd93SUuKY zACpIEWgQHAPFuJEHII5AefZ3zJcEFSKYpRj095dYUNZ25Zx0pSIJf7k7/WW+t5JB0Nv NvUCL5BLafsHKspqJ+DSaHkHCDQA5p9qfT7K7IPiGwsdudWC3ueuvUWGQMiFtV8raqAy LUlQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=741oOKm9Y/CN6pZlsJDyA+wQ24ovzGnQR0XtQiJk4V0=; b=eUizMmr+OtCs2nipep4G+so8iBpdEG0SbfZK/IRAD8T4FP91Abtrx3arp0uiKl9ivF 8Ds+BGVDsOPZgOs6U4uu6sGzCi5oFesggVMexOAOYnRPwGENpXqQ6Wmavsv4i+dN4Dmc BMWXA1XfZ2K+d8suNyr1ROpndM7mBTDzjXOOcFH6jm8Hf7Q1mBZSBMA4JCyt9qTWERio TBRkKsQ2+9qlDg1DBElH+cWR/uoJCCUfH+bAxwF6xFiK4CszfdODuMwbPMHokFUVSzsV otS52xWNW2jujO7UWDI6tprs3aaqFSLbYgC9LqGjnAE6xKroqp6bH2wdP6xW6vZY7Pw5 VsIA== X-Gm-Message-State: AOAM533StXrZGXybYft/ziKIyQ+rUun+FcKEw4apNpQsW5fjgPY/a3a/ lYIIGi06DQNo3bALP3HJzMA= X-Google-Smtp-Source: ABdhPJyw33dANIX/Wgn1Qh4aloRjh0gEEBdoN1t3F9c93El0LTh594GXs/thf0NjLPIuBtUz7hwutA== X-Received: by 2002:a05:6402:214:: with SMTP id t20mr2212183edv.20.1625266323359; Fri, 02 Jul 2021 15:52:03 -0700 (PDT) Received: from localhost.localdomain (dynamic-095-117-063-046.95.117.pool.telefonica.de. [95.117.63.46]) by smtp.googlemail.com with ESMTPSA id r17sm1866964edt.33.2021.07.02.15.52.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Jul 2021 15:52:03 -0700 (PDT) From: Martin Blumenstingl To: linux-clk@vger.kernel.org, sboyd@kernel.org Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Martin Blumenstingl , Maxime Coquelin , Alexandre Torgue , linux-stm32@st-md-mailman.stormreply.com Subject: [PATCH v1 6/6] clk: stm32mp1: Switch to clk_divider.determine_rate Date: Sat, 3 Jul 2021 00:51:45 +0200 Message-Id: <20210702225145.2643303-7-martin.blumenstingl@googlemail.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210702225145.2643303-1-martin.blumenstingl@googlemail.com> References: <20210702225145.2643303-1-martin.blumenstingl@googlemail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210702_155204_840457_2133786C X-CRM114-Status: GOOD ( 14.19 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org .determine_rate is meant to replace .round_rate in CCF in the future. Switch over to .determine_rate now that clk_divider_ops has gained support for that. Cc: Maxime Coquelin Cc: Alexandre Torgue Cc: linux-stm32@st-md-mailman.stormreply.com Signed-off-by: Martin Blumenstingl --- drivers/clk/clk-stm32mp1.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/drivers/clk/clk-stm32mp1.c b/drivers/clk/clk-stm32mp1.c index 256575bd29b9..4bd1fe7d8af4 100644 --- a/drivers/clk/clk-stm32mp1.c +++ b/drivers/clk/clk-stm32mp1.c @@ -1076,14 +1076,10 @@ static int clk_divider_rtc_set_rate(struct clk_hw *hw, unsigned long rate, static int clk_divider_rtc_determine_rate(struct clk_hw *hw, struct clk_rate_request *req) { - unsigned long best_parent_rate = req->best_parent_rate; + if (req->best_parent_hw == clk_hw_get_parent_by_index(hw, HSE_RTC)) + return clk_divider_ops.determine_rate(hw, req); - if (req->best_parent_hw == clk_hw_get_parent_by_index(hw, HSE_RTC)) { - req->rate = clk_divider_ops.round_rate(hw, req->rate, &best_parent_rate); - req->best_parent_rate = best_parent_rate; - } else { - req->rate = best_parent_rate; - } + req->rate = req->best_parent_rate; return 0; }