Received: by 2002:a05:7412:3b8b:b0:fc:a2b0:25d7 with SMTP id nd11csp221189rdb; Thu, 8 Feb 2024 04:16:40 -0800 (PST) X-Google-Smtp-Source: AGHT+IFkpz0EG1/YlrO+xG5lRHW/DhQ1v4trYbs9afA4eloQN+SMBiIrnltfDxhI9Rn/X9MVwk7K X-Received: by 2002:a17:90a:9d85:b0:296:ec0d:3dac with SMTP id k5-20020a17090a9d8500b00296ec0d3dacmr3914181pjp.28.1707394599877; Thu, 08 Feb 2024 04:16:39 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707394599; cv=pass; d=google.com; s=arc-20160816; b=NeQ7F3cJgyXg+lQj6mRNYMAWam3CR4/ybzbcgmLNltq4AyTfeIfHRsRQOL/9C5JnrS vT265ZzNc6PQFVez366KR2zct2t3dDBNsu8FaYEXGG2ZAlS+E4A7jr4Q8a53Pe7i1dFS q4qAGnT27oBgJ0OoB+IPggA8BSQ1P7zZejJqiej2emEKwd527dQyageevMrty8uTJTPz iwIaMAO0iPl0oqPArWr/mfUWv/pQs+SmiVv56CSEZVKEuokbcuIEo0tnvNINU/FaRLY9 cRljepAMOYPhAiox6Ct6e3V8gwbIc+V2uyuWFXtGQWg3JWspdHk8PAp9zYgjypLMxnWS NMnA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=zoEyq3FYdI1C8Np8epDBnAKdysIRnI2KAqwmmgpvx/s=; fh=YBME5ufygcNcJ1WOmL70xvv+oJnTDX6CPfTMT7Qe3kg=; b=S/7iWIOA4NTyjLjzVQEa4WsOhzHCAHXvJ+1MOamJsCokxTo7xmBLKnOMukmH/hmwxu EMFE3K7vHRSAjZWX+DhpHuCQQ1cFVQdkA5a7bcdlZcFnyrx6DCry7iswvcTBoJD5HlN6 gW2kN218tAjLjvNYYXqyOBqefWDeG28VtpU8vzi9p6ME7nXuQEHSvyMgbnoh320XO1F7 Pw2S3wnqYlkY4blNJhDgqQCqXDLaaxB57jP1xj+DNQPvYHVa26nFPRcAzc7ktjjL1Bfv 9Gte4Gd5wZtlL5yf3TPVSBnrJEXD5SWguwJ73peArje/clfpTlKSCKLznpZ2f4UzS0Q2 +UhA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=mSnsdIyB; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-58035-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-58035-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org X-Forwarded-Encrypted: i=2; AJvYcCUz2ESlcLbtOKidTdamoBOrGWhlpYaeMhld71GMCY8e5rIGp2oSf7Hy3hJwGT+hpiOGV589yMU157TeJI/E7u+3wUPNOg0f6p2C+GDF7A== Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id z7-20020a17090acb0700b00295f9a8b2e5si1230595pjt.32.2024.02.08.04.16.39 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Feb 2024 04:16:39 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-58035-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=mSnsdIyB; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-58035-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-58035-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 86271283D11 for ; Thu, 8 Feb 2024 12:16:39 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6D8A871B55; Thu, 8 Feb 2024 12:16:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="mSnsdIyB" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8BEC06F531; Thu, 8 Feb 2024 12:16:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707394591; cv=none; b=B+kSOoFYep52Pt5OgWktHttS5wsAs5Mprv9VcEolQuzFYkjIbT6pvt94n/411BMzls31dHN+fo5zcZ8x+TsXKsVigUFRE2C6+XeZtSL5wGBdl5hXLv1YZoBgRpv/l5uXHlHzBBRbN9eprwyrz4CaRFTBDt8pD+1+uuU5ic4z9Jo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707394591; c=relaxed/simple; bh=USkxMo00wu+oAG8dbi0UUhcAygROpPKwwkXbpptKPw0=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=i0JakIhWGeXUojq+zflFb26cwJxskQQPSgEQpCfH2BzkMv0QmrB0TPBP9Z8XyGZ2A48s4TPrQLn8hku3zZOwHmlEJcs6+MyTuGCIiFgcAL5LfXckzZ1rykfONpOtRWxPZBQCyuXAeHLcvn1sLZ2lyyYvmSwSgZRtEwYjFKXNpwU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=mSnsdIyB; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 64826C433F1; Thu, 8 Feb 2024 12:16:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1707394590; bh=USkxMo00wu+oAG8dbi0UUhcAygROpPKwwkXbpptKPw0=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=mSnsdIyBgjtrpmx4IO6IAxNTOBoAYUpwNNlSLkBDFRnlYsNjH6LMU1HMJ9mrpFb75 /2cZcLMxIxfdsFyq3dzzxkFBVmCZj8wEvJO5olQyLjIDdYyI7cJ8GP555tVOQNl6uD TXMtm9Nafx5RjDeopn5SJdGpdshEIZ+wmtBNcJU0Q1xYd/hS5eawcY2mjSd3siFvEg kJC7o74B+5/K5POXR5b0Tsbt7roheh+iUaNazrmA+c/NYYEX3MgYRRnswxeMiycbfZ tQt3o5/vBBmHR8FNOTEz+GFJEhpvcn7aYFZ1/ByDQB9Vk9B9nmyFYa+7Vui4p/HIBh RLqvn9ug3AY/Q== Date: Thu, 8 Feb 2024 13:16:27 +0100 From: Maxime Ripard To: Frank Oltmanns Cc: Michael Turquette , Stephen Boyd , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland , Guido =?utf-8?Q?G=C3=BCnther?= , Purism Kernel Team , Ondrej Jirman , Neil Armstrong , Jessica Zhang , Sam Ravnborg , Maarten Lankhorst , Thomas Zimmermann , David Airlie , Daniel Vetter , Rob Herring , Krzysztof Kozlowski , Conor Dooley , linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org Subject: Re: [PATCH v2 3/6] clk: sunxi-ng: nkm: Support minimum and maximum rate Message-ID: References: <20240205-pinephone-pll-fixes-v2-0-96a46a2d8c9b@oltmanns.dev> <20240205-pinephone-pll-fixes-v2-3-96a46a2d8c9b@oltmanns.dev> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="g5pwkiip3azj2ftk" Content-Disposition: inline In-Reply-To: <20240205-pinephone-pll-fixes-v2-3-96a46a2d8c9b@oltmanns.dev> --g5pwkiip3azj2ftk Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Feb 05, 2024 at 04:22:26PM +0100, Frank Oltmanns wrote: > According to the Allwinner User Manual, the Allwinner A64 requires > PLL-MIPI to run at 500MHz-1.4GHz. Add support for that to ccu_nkm. >=20 > Signed-off-by: Frank Oltmanns > --- > drivers/clk/sunxi-ng/ccu_nkm.c | 13 +++++++++++++ > drivers/clk/sunxi-ng/ccu_nkm.h | 2 ++ > 2 files changed, 15 insertions(+) >=20 > diff --git a/drivers/clk/sunxi-ng/ccu_nkm.c b/drivers/clk/sunxi-ng/ccu_nk= m.c > index 1168d894d636..7d135908d6e0 100644 > --- a/drivers/clk/sunxi-ng/ccu_nkm.c > +++ b/drivers/clk/sunxi-ng/ccu_nkm.c > @@ -181,6 +181,12 @@ static unsigned long ccu_nkm_round_rate(struct ccu_m= ux_internal *mux, > if (nkm->common.features & CCU_FEATURE_FIXED_POSTDIV) > rate *=3D nkm->fixed_post_div; > =20 > + if (nkm->min_rate && rate < nkm->min_rate) > + rate =3D nkm->min_rate; > + > + if (nkm->max_rate && rate > nkm->max_rate) > + rate =3D nkm->max_rate; > + This is provided by the clock range already. If you call clk_hw_set_rate_range, it should work just fine. Maxime --g5pwkiip3azj2ftk Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYKAB0WIQRcEzekXsqa64kGDp7j7w1vZxhRxQUCZcTGGwAKCRDj7w1vZxhR xfpFAQDl1iMbvaT5VL0H8/WZy4Wj8WN7EQPe6yGsH1gHJm+SJwEA2hmsuOH5dUHZ 3CUtUEMx4fGkAxCIbucEMa+tx6gRUgI= =MjMG -----END PGP SIGNATURE----- --g5pwkiip3azj2ftk--