From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9D558EB64DC for ; Mon, 3 Jul 2023 09:29:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229549AbjGCJ3R (ORCPT ); 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 Precedence: bulk List-ID: X-Mailing-List: linux-clk@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]]