From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=100.103.45.18 ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1796026539; b=iLWHh270xCP4xeC9D1OezRG8vwxnm5IMvUWZBrcsdk/j3JGaTfmYj0bEJDeBV+83jFVa BzKiXevd4odKTNxsq1qi7a39IUSxuG7sZAX+m/YerhozzS+e9RzkxM5Espgb3reIiY8NE TPs2DOYbtaDVceFILyeg7vs/7VmGLUIj8Cp79J+QNJvtaRjQqIZSLJK4D2I44sIb4WCdG WZxHotUId0SsZc9IQmXDgj6IcuOmeE6MRVZpJ9GN0BTC4TcDixwleGzIY26ab4z9QDPqz CwXk5wFRPDsAAdh4CkBOx1HdGUshC4rXG8K9XaHB2VAI7/tRUJcZsAqUlWqyug7Glbg== ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796026539; h=Received:DKIM-Signature:Received:From:Date:Subject:MIME-Version: Content-Type:Message-Id:References:In-Reply-To:To:Cc:X-Mailer: X-Developer-Signature:X-Developer-Key:X-Endpoint-Received: X-Original-From:Reply-To:Content-Transfer-Encoding; bh=iX1gELWlVllJRsMF5JhKx759AiLhkTSD7fE6uHYggUM=; b=CHaqEs/pJRvhpH8/lVqUx2WJ6uNtuP30GjpajCFkg0SvMV8T6P84GmqPnKrFDU+zd5Tp DtP+gzvzOh48oGOhurt48Lm195Wrl1rg8gvEqEA7XH8WIuccnkz/+bwGOmFqGuyEQpUAE R2pdMdIm/K3DL9gwMkorJT34s8QqxgdYcHfyYcEzZ2LQWkoYq9gTEdvWHJ3fYI63NeWzE LULq5w5nHoHpmkdUFUpFC/+gMnXyuthygAvTTabD/7f3Sb3KGEBlRWkZE8jtZrmAxkHZv Os9QgPjYL/oQ0ty5aLdBOjhNARcC5Rc38qt7veweTLX3qYKroyM2iHh3kHe4kWHWk6w== ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b="JWbAAy/L"; arc=pass header.oldest-pass=0 smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 10A59606A32F; Mon, 30 Nov 2026 08:15:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=JWbAAy/L Authentication-Results: smtp.kernel.org; arc=none smtp.remote-ip=100.80.115.77 ARC-Seal: i=1; d=kernel.org; s=arc20260519; a=rsa-sha256; cv=none; t=1796026538; b=To+MxsJ6MsKWndbP77zxCostP19lhbdOoSOMg2ULSG3SolYmdCh1kGmeMH3fstKRHnlU BNVRhk6GryMsry2GcJJ6tFZhpcSYsvYjQ4bjpgOzHBHnHxSqaRRiZ9IlEhV8lJPAtDwVi UPwmxgL5GNxp5agrqe1Q8qIbxa1utG8LrVNvLbBgwfUgcEf+ZawoWyOBEPrbrcZzOl4R/ UdHERIe/4Cf+EeGn9fKnHDwQtlYsXZHENI0GBWNWyol6Nj/mkrBrr1FAzuiJsTMJ9CAXu SJZyNbMV6NH6ogj3C8vy8pK48tAbDF7SaFrtWHUQwZgaF0wtz0PaxzZS8C/l7d0otcw== ARC-Message-Signature: i=1; d=kernel.org; s=arc20260519; a=rsa-sha256; c=relaxed/relaxed; t=1796026538; h=DKIM-Signature:Received:From:Date:Subject:MIME-Version:Content-Type: Message-Id:References:In-Reply-To:To:Cc:X-Mailer: X-Developer-Signature:X-Developer-Key:X-Endpoint-Received: X-Original-From:Reply-To:Content-Transfer-Encoding; bh=iX1gELWlVllJRsMF5JhKx759AiLhkTSD7fE6uHYggUM=; b=FG1yfiU2Yd3lbGR6RRDJOQryoZXbGtvMfkeH1g6s8plTaM1G+eQxrQ7CToINmhJ0rXm/ CAGBxXQWQ5C6Mo7HLiFB/7cYhQbZ1syipSosS4pcofflc6/GKssyrO/LFJ5tTjfBo0T3v 44N6KtxsSITq7wvTe9zE+ztxOLI7awl9qKAmcIaC7gp1ni4Se7pRx7FcHfMno7GZtcDD8 AGdlSMGN3JPxl7ttGZRl33hPUF/r0FIfvxX+RNaEzysoqnNdOLkavHihfsSVvoaGLL+qp YmCNc0Kqi2v6F6trXUkuIxG1bcaPqgqlDPZ8ekZPzsoedBj/hxujEtuO16WNBX+ijIw== ARC-Authentication-Results: i=1; smtp.kernel.org; arc=none smtp.remote-ip=100.80.115.77 Received: from lkml.kernel.org (nexus.subspace.kernel.org [100.80.115.77]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.kernel.org (Postfix) with ESMTPS id 757671F00899; Mon, 30 Nov 2026 08:15:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796026538; bh=iX1gELWlVllJRsMF5JhKx759AiLhkTSD7fE6uHYggUM=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To; b=JWbAAy/LqvT9mX089hGf4zfYpbMlkjs/ZC4BxqYuLXEwnUYLz0v23vinoOM0vsKKH 5FzWUrGcXvQqnh/+ejPz20BqGbBkcGGm1dkX29JL0ZTtifSZFMGho7+RBBnLuoBzRV eRAUbZ0/9HQvnOATRRzfbdE+/9ajIRBJ2kSa1sbGbLZQjkLcH3fzmWancPx0s0p69u wPjLVQczCbhLI0/lRe5sa1VV8+4Kc1sIF39qba7Pjp2ZLxUOiwUkUJM7ARi2pNohUp xMjtVajDl+Kh/k2FT2ttEMHH2UbGBI+SIAkV9ITcoSkVpFDggEsCkXNTaYzo3Ez7zo Jssxv3bzzSvpA== Received: from nexus.subspace.kernel.org (localhost [IPv6:::1]) by lkml.kernel.org (Postfix) with ESMTP id EE0674E73D; Mon, 30 Nov 2026 08:15:30 +0000 (UTC) From: Vyacheslav Yurkov via B4 Relay Date: Mon, 30 Nov 2026 08:15:27 +0000 Subject: [PATCH v12 1/2] dt-bindings: clock: Add gpio-enabled-clock X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Message-Id: <20261130-feature-clock-guard-v12-1-d0978ad15207@bruker.com> References: <20261130-feature-clock-guard-v12-0-d0978ad15207@bruker.com> In-Reply-To: <20261130-feature-clock-guard-v12-0-d0978ad15207@bruker.com> To: Michael Turquette , Stephen Boyd , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Brian Masney , Brian Masney , Jerome Brunet , Jyri Sarha Cc: linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org, devicetree@vger.kernel.org, Vyacheslav Yurkov , Vyacheslav Yurkov X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1796026529; l=2403; i=V.Yurkov.EXT@bruker.com; s=20260318; h=from:subject:message-id; bh=we1kUeCss3EbgxQ4klfGLkXKnDuQxNJ3wKfPkyr46ow=; b=ViVr9MwInzVm1nzwtWkXg+ANctM8aWMqF10NK2HIdD/iaY/8mQr+5YgATjnCspFdPtmZv3CL1 LRYRAiUciF4Ap+B2enFtFihtLLdnwRdtt6exWX/Oc2nG5SoB/AqmHao X-Developer-Key: i=V.Yurkov.EXT@bruker.com; a=ed25519; pk=snJmgYVOKlp7aQtK9tWnEI7QTYxpPpJJvxdVsnxA7Fk= X-Endpoint-Received: by B4 Relay for V.Yurkov.EXT@bruker.com/20260318 with auth_id=686 X-Original-From: Vyacheslav Yurkov Reply-To: V.Yurkov.EXT@bruker.com Content-Transfer-Encoding: 7bit From: Vyacheslav Yurkov Some clocks are switched on and off by hardware outside software control, which reports through a GPIO whether the clock is currently running. Software cannot enable such a clock, but its consumers must not use it before the GPIO indicates that it is running. Add a binding for a clock that passes its parent clock through unchanged and is considered enabled only while a GPIO signal is asserted. The parent clock determines the rate. The status GPIO is given by enabled-gpios, and poll-timeout-us bounds how long a consumer waits for the clock to become available. Signed-off-by: Vyacheslav Yurkov --- Our use case: peripheral clocks generated by FPGA PLLs, with the PLL-lock signals routed to GPIOs of the SoC. --- .../bindings/clock/gpio-enabled-clock.yaml | 53 ++++++++++++++++++++++ 1 file changed, 53 insertions(+) diff --git a/Documentation/devicetree/bindings/clock/gpio-enabled-clock.yaml b/Documentation/devicetree/bindings/clock/gpio-enabled-clock.yaml new file mode 100644 index 000000000000..0eb028130929 --- /dev/null +++ b/Documentation/devicetree/bindings/clock/gpio-enabled-clock.yaml @@ -0,0 +1,53 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/clock/gpio-enabled-clock.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: GPIO Enabled Clock + +maintainers: + - Vyacheslav Yurkov + +properties: + compatible: + const: gpio-enabled-clock + + clocks: + maxItems: 1 + + "#clock-cells": + const: 0 + + clock-output-names: + maxItems: 1 + + enabled-gpios: + description: GPIO that indicates whether the clock is enabled or disabled. + maxItems: 1 + + poll-timeout-us: + description: Maximum time to wait for the enabled GPIO to be asserted. + +required: + - compatible + - "#clock-cells" + - clocks + - clock-output-names + - enabled-gpios + - poll-timeout-us + +additionalProperties: false + +examples: + - | + #include + + clock { + compatible = "gpio-enabled-clock"; + #clock-cells = <0>; + clocks = <&pll>; + clock-output-names = "gpio-enabled-clock"; + enabled-gpios = <&gpio0 4 GPIO_ACTIVE_HIGH>; + poll-timeout-us = <20>; + }; -- 2.34.1