Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp25903504rwd; Mon, 3 Jul 2023 02:39:53 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7FhYsxudDesmM0NU9nebKzZFdQ8oGcqyI0ufC35TgcBQjSu6+NhJNR3xv1wL+SLw7gD0+g X-Received: by 2002:a05:6870:b4a9:b0:1b0:b13:c18 with SMTP id y41-20020a056870b4a900b001b00b130c18mr10487531oap.3.1688377193624; Mon, 03 Jul 2023 02:39:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688377193; cv=none; d=google.com; s=arc-20160816; b=jQxgpKWbbbU4HW5TLsEibjrWBN5sXEzCMjk6BRxTRbHTMKj9eI7RPasR6mmhjNdtbX nPD0ukajtTWg9W1dJY7cwscB3bYFkDuxWEHgEXdQwnOQbWXlFO38gpMWGaRtd02KxDmz S03QDSvQwlzy5y6+vkCcwuXh0FITUQUBLMRLbttEaimvsuG+2L6wDpZ8TBQcMLD9PCxz hRBN846tgYZYVs8fxelL3QZ/NV59Y5tQNWs7CuuEhfADWS6LbJXKaOT7sXHmxU99JBlJ 0+EWgLBzdY5+h26KTlmzh3boQOoTaVXNM7uZfXoqzy7Vnwv7TJJiEqhQcCbwHvJB3maV 9NnQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:in-reply-to:subject :cc:to:from:references:dkim-signature; bh=zBBsuTVav6vfnGbrZf+Lz4bRJkmuMheylCTqMuDos48=; fh=x0Sr7i4tdKzpSyMcbWiDYTry/Z4x5er71rbOC3DCB9M=; b=d6WQX+8eRqxUVlZe1zN5HD5nL3LG/4hezxkPIes2dSu1dkT4w/TezHH4h0E5FLf9qn 38rcPDFC7/DCTHrKqEc3MClEfWwNEZ45FoLN9DFOALgiUQ1/Eeb3XGXBp+r9p2GDsgxx gHvIXVkGgQFMGGO8/IvMgeWDcfn//M2FiU+IXS2cS/my87DF+bphnmy95svkIdhMA9ba ef942WS5+EfHak2K4mf+MPnGSoLc2jKXXBAJEiP2AP5UjVmQKUHk8aAOxtnu7lH55FSY cWr8Jbh86QZAELYrv2YE/E6zEHe3w2yGWMoWngQziIaiOREqBjgkS8Mvp+Wyj6U5dm+3 mggA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oltmanns.dev header.s=MBO0001 header.b=SE+0JRdH; 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=NONE dis=NONE) header.from=oltmanns.dev Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id pg18-20020a17090b1e1200b0025c1ff9cd67si19989433pjb.184.2023.07.03.02.39.40; Mon, 03 Jul 2023 02:39:53 -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=@oltmanns.dev header.s=MBO0001 header.b=SE+0JRdH; 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=NONE dis=NONE) header.from=oltmanns.dev Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230341AbjGCJ3R (ORCPT + 99 others); Mon, 3 Jul 2023 05:29:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36542 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230206AbjGCJ3Q (ORCPT ); Mon, 3 Jul 2023 05:29:16 -0400 Received: from mout-p-102.mailbox.org (mout-p-102.mailbox.org [IPv6:2001:67c:2050:0:465::102]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DD5F218D; Mon, 3 Jul 2023 02:29:13 -0700 (PDT) Received: from smtp1.mailbox.org (smtp1.mailbox.org [10.196.197.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-102.mailbox.org (Postfix) with ESMTPS id 4Qvgbp2SrFz9snc; Mon, 3 Jul 2023 11:29:10 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oltmanns.dev; s=MBO0001; t=1688376550; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=zBBsuTVav6vfnGbrZf+Lz4bRJkmuMheylCTqMuDos48=; b=SE+0JRdHcYANbRAfup4b7XMw745p4opXWmIMTCefwWUXzM/Gu7Q5gvZbRjq2mHSr/1+/uC JEsbcAbcDcTTnSuIh2uxqJ87CS3uj2ybDl47j0yhFYBdhH6DiL5Lkz+xcfiKKGZE2HVO1H y8590C3vyeYHHMeCqdzptH3wSgPrHHaGX/xnYFlp+rH2BfXw72uA67MFmDIrlJq2tlALF1 0rorKXrMMH8n4hc22DkhOi7McBvtqzegVR7HOBg1oJV451l//enKeEcgXkP+NHBhVDp8lF vNruh85DGZ86zRaZngdXio2TMbdh8minYAYdTIOn9p4L+UMu1XIS49Pf2guwHA== References: <20230702-pll-mipi_set_rate_parent-v3-0-46dcb8aa9cbc@oltmanns.dev> <20230702-pll-mipi_set_rate_parent-v3-8-46dcb8aa9cbc@oltmanns.dev> From: Frank Oltmanns To: Maxime Ripard Cc: Michael Turquette , Stephen Boyd , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland , Andre Przywara , Roman Beranek , linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-kernel@vger.kernel.org Subject: Re: [PATCH v3 8/8] clk: sunxi-ng: a64: select closest rate for pll-video0 In-reply-to: Date: Mon, 03 Jul 2023 11:28:59 +0200 Message-ID: <878rbxs5r8.fsf@oltmanns.dev> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE 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 On 2023-07-03 at 09:50:05 +0200, Maxime Ripard wrote: > [[PGP Signed Part:Undecided]] > On Sun, Jul 02, 2023 at 07:55:27PM +0200, Frank Oltmanns wrote: >> @@ -541,7 +542,7 @@ static const char * const tcon1_parents[] = { "pll-video0", "pll-video1" }; >> static const u8 tcon1_table[] = { 0, 2, }; >> static struct ccu_div tcon1_clk = { >> .enable = BIT(31), >> - .div = _SUNXI_CCU_DIV(0, 4), >> + .div = _SUNXI_CCU_DIV_FLAGS(0, 4, CLK_DIVIDER_ROUND_CLOSEST), >> .mux = _SUNXI_CCU_MUX_TABLE(24, 2, tcon1_table), >> .common = { >> .reg = 0x11c, >> @@ -549,6 +550,7 @@ static struct ccu_div tcon1_clk = { >> tcon1_parents, >> &ccu_div_ops, >> CLK_SET_RATE_PARENT), >> + .features = CCU_FEATURE_CLOSEST_RATE, >> }, >> }; > > I'm not super comfortable with having to set it twice for dividers (or > composite clocks). Could we set CLK_DIVIDER_ROUND_CLOSEST automatically > if CCU_FEATURE_CLOSEST_RATE is set? You're of course right. If I'm not mistaken, I can use SUNXI_CCU_M_WITH_MUX_TABLE_GATE_CLOSEST that I introduced in div patch (PATCH 7). Otherwise I'll create a similar macro for use with tcon1. > > I'm guessing we would need it for muxes as well? > Yes, it's already in the mux and div patches. Best regards, Frank > > Maxime > > [[End of PGP Signed Part]]