From patchwork Wed Apr 9 11:20:57 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sascha Hauer X-Patchwork-Id: 14044489 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [185.203.201.7]) (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 DFE5725C6FB for ; Wed, 9 Apr 2025 11:21:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.203.201.7 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744197672; cv=none; b=bvUzFvRZgDf7k2kIXQc93pNWIKdbyNv1avfCRdlrn+CDsBGTJhv4hkp0I+3mEaZkXH37aTnzekDEdz8VS8+eetTg62elRA6jRt3O8nVFm+Q9y5kgSn6G8mlcy+ALPv6FFtHU/K6fxIp2T6mUga/d2K3gJwzrgovlIPai8jlNiQ4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744197672; c=relaxed/simple; bh=N2EUklR/z9JFHYu0b2d1/TXgABpe7LjJhfgZXh/GMyc=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=SMZEOXPihy9qa7l6CxlZ5RDIGdwTujjHexSJJ0lNep5WH4V7kCTVcqsY3sa4ch1aofRxjq+qqRehHJ0rAvHU3k2asm1T06Q0dkXpLg9joBzx+J6oKQp/qdfdWEiACakv7I/g+mLHNhPF4OgJ80o0xMq9eInWG3YYdQJuiSECVXc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de; spf=pass smtp.mailfrom=pengutronix.de; arc=none smtp.client-ip=185.203.201.7 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pengutronix.de Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1u2TUH-0007PA-9L; Wed, 09 Apr 2025 13:20:57 +0200 Received: from dude02.red.stw.pengutronix.de ([2a0a:edc0:0:1101:1d::28]) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1u2TUH-0045qa-03; Wed, 09 Apr 2025 13:20:57 +0200 Received: from localhost ([::1] helo=dude02.red.stw.pengutronix.de) by dude02.red.stw.pengutronix.de with esmtp (Exim 4.96) (envelope-from ) id 1u2TUG-00GOXj-2t; Wed, 09 Apr 2025 13:20:56 +0200 From: Sascha Hauer Date: Wed, 09 Apr 2025 13:20:57 +0200 Subject: [PATCH v2 1/3] clk: make determine_rate optional for non reparenting clocks Precedence: bulk X-Mailing-List: linux-clk@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20250409-clk-cdce6214-v2-1-40b25b722ecb@pengutronix.de> References: <20250409-clk-cdce6214-v2-0-40b25b722ecb@pengutronix.de> In-Reply-To: <20250409-clk-cdce6214-v2-0-40b25b722ecb@pengutronix.de> To: Michael Turquette , Stephen Boyd , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, kernel@pengutronix.de, =?utf-8?q?Alvin_=C5=A0i?= =?utf-8?q?praga?= , Sascha Hauer X-Mailer: b4 0.12.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1744197656; l=1101; i=s.hauer@pengutronix.de; s=20230412; h=from:subject:message-id; bh=N2EUklR/z9JFHYu0b2d1/TXgABpe7LjJhfgZXh/GMyc=; b=hIBP+UScoMBWRCYLEk9HHnzdRJ9YbISosu3Wrjch0RkiSrY9ouWGybhCXVBPE9wUgKxj14gSc 1o7hjNQV8NQCVPSfk+L2ypoSpKszI/h7ShOkIRy6rGfUS+tQD0hZXAe X-Developer-Key: i=s.hauer@pengutronix.de; a=ed25519; pk=4kuc9ocmECiBJKWxYgqyhtZOHj5AWi7+d0n/UjhkwTg= X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: s.hauer@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-clk@vger.kernel.org With 326cc42f9fdc ("clk: Forbid to register a mux without determine_rate") it became mandatory to provide a determine_rate hook once a set_parent hook is provided. The determine_rate hook is only needed though when the clock reparents to set its rate. Clocks which do not reparent during set_rate do not need a determine_rate hook, so make the hook optional for clocks with the CLK_SET_RATE_NO_REPARENT flag. Signed-off-by: Sascha Hauer --- drivers/clk/clk.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c index 0565c87656cf5..07ae3652df6c1 100644 --- a/drivers/clk/clk.c +++ b/drivers/clk/clk.c @@ -3937,7 +3937,8 @@ static int __clk_core_init(struct clk_core *core) goto out; } - if (core->ops->set_parent && !core->ops->determine_rate) { + if (!(core->flags & CLK_SET_RATE_NO_REPARENT) && + core->ops->set_parent && !core->ops->determine_rate) { pr_err("%s: %s must implement .set_parent & .determine_rate\n", __func__, core->name); ret = -EINVAL;