[PATCH v11 1/2] dt-bindings: clock: Add gpio-enabled-clock

From: Vyacheslav Yurkov via B4 Relay

Date: Sat Nov 21 2026 - 08:29:20 EST


From: Vyacheslav Yurkov <V.Yurkov.EXT@xxxxxxxxxx>

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 <V.Yurkov.EXT@xxxxxxxxxx>
---
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 | 55 ++++++++++++++++++++++
1 file changed, 55 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..4861c87ae5e0
--- /dev/null
+++ b/Documentation/devicetree/bindings/clock/gpio-enabled-clock.yaml
@@ -0,0 +1,55 @@
+# 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 <V.Yurkov.EXT@xxxxxxxxxx>
+
+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: Timeout in microseconds for waiting for a GPIO signal.
+ default: 10
+ minimum: 10
+ maximum: 1000
+
+required:
+ - compatible
+ - "#clock-cells"
+ - clocks
+ - clock-output-names
+ - enabled-gpios
+
+additionalProperties: false
+
+examples:
+ - |
+ #include <dt-bindings/gpio/gpio.h>
+
+ 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