From: Vyacheslav Yurkov Date: Sun, 26 Jul 2026 17:40:24 +0000 Subject: [PATCH v4 1/2] dt-bindings: Add GPIO-locked fixed clock MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20260726-feature-clock-guard-v4-1-e9c8b372b71c@bruker.com> References: <20260726-feature-clock-guard-v4-0-e9c8b372b71c@bruker.com> In-Reply-To: <20260726-feature-clock-guard-v4-0-e9c8b372b71c@bruker.com> To: Michael Turquette , Stephen Boyd , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Brian Masney 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=1785087629; l=2332; i=V.Yurkov.EXT@bruker.com; s=20260318; h=from:subject:message-id; bh=lEBBaq3E08r1z3XCBu4u0DwQeFjgZxqKA/fT/ORUbSw=; b=GLa/f5iqOYIqXGwqg0b+hes392rQs7icNjvSOzhfMLLYcXgEjweC4PeQ4JXMenBHP8B2Gadlp OoAxaI4pPhmBIc0D2RVoN5R4/Yty63jmGnxDJSH/jcu2paCjvKoXWVA 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 List-Id: B4 Relay Submissions Some hardware designs provide fixed-frequency clocks generated outside software control, such as by FPGA-resident PLLs. While the clock rate is fixed, a separate GPIO signal indicates whether the clock source is locked and producing a valid output. Describe a GPIO-locked fixed clock provider that exposes a fixed-rate clock whose availability depends on one or more GPIO lock-status signals. Signed-off-by: Vyacheslav Yurkov Signed-off-by: Vyacheslav Yurkov --- .../bindings/clock/gpio-locked-fixed-clock.yaml | 59 ++++++++++++++++++++++ 1 file changed, 59 insertions(+) diff --git a/Documentation/devicetree/bindings/clock/gpio-locked-fixed-clock.yaml b/Documentation/devicetree/bindings/clock/gpio-locked-fixed-clock.yaml new file mode 100644 index 000000000000..4d17889c51ad --- /dev/null +++ b/Documentation/devicetree/bindings/clock/gpio-locked-fixed-clock.yaml @@ -0,0 +1,59 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/clock/gpio-locked-fixed-clock.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: GPIO Locked Fixed Clock + +maintainers: + - Vyacheslav Yurkov + +properties: + compatible: + const: gpio-locked-fixed-clock + + "#clock-cells": + const: 0 + + clocks: + description: Input clocks whose validity is monitored by this provider. + + clock-output-names: + description: Names of the clock provided by this controller. + maxItems: 1 + + locked-gpios: + description: | + GPIOs to check the lock state. + minItems: 1 + maxItems: 32 + +required: + - compatible + - "#clock-cells" + +anyOf: + - required: + - clocks + - required: + - locked-gpios + +additionalProperties: false + +examples: + - | + #include + + clk_gpio_locked: gpio-locked-fixed-clock { + compatible = "gpio-locked-fixed-clock"; + #clock-cells = <0>; + + clocks = <&clk0 0>, <&pll 0>; + + locked-gpios = <&gpio0 4 GPIO_ACTIVE_HIGH>, + <&gpio0 5 GPIO_ACTIVE_HIGH>, + <&gpio1 2 GPIO_ACTIVE_LOW>; + + clock-output-names = "clkout0"; + }; -- 2.34.1