diff mbox series

[1/3] dt-bindings: power: reset: add gs101 poweroff bindings

Message ID 20240320020549.71810-1-alexey.klimov@linaro.org (mailing list archive)
State Handled Elsewhere, archived
Headers show
Series [1/3] dt-bindings: power: reset: add gs101 poweroff bindings | expand

Commit Message

Alexey Klimov March 20, 2024, 2:05 a.m. UTC
Signed-off-by: Alexey Klimov <alexey.klimov@linaro.org>
---
 .../power/reset/google,gs101-poweroff.yaml    | 54 +++++++++++++++++++
 1 file changed, 54 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/power/reset/google,gs101-poweroff.yaml

Comments

Krzysztof Kozlowski March 20, 2024, 7:14 a.m. UTC | #1
On 20/03/2024 03:05, Alexey Klimov wrote:
> Signed-off-by: Alexey Klimov <alexey.klimov@linaro.org>

Missing commit msg.

A nit, subject: drop second/last, redundant "bindings". The
"dt-bindings" prefix is already stating that these are bindings.
See also:
https://elixir.bootlin.com/linux/v6.7-rc8/source/Documentation/devicetree/bindings/submitting-patches.rst#L18

> ---
>  .../power/reset/google,gs101-poweroff.yaml    | 54 +++++++++++++++++++
>  1 file changed, 54 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/power/reset/google,gs101-poweroff.yaml
> 
> diff --git a/Documentation/devicetree/bindings/power/reset/google,gs101-poweroff.yaml b/Documentation/devicetree/bindings/power/reset/google,gs101-poweroff.yaml
> new file mode 100644
> index 000000000000..d704bf28294a
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/power/reset/google,gs101-poweroff.yaml
> @@ -0,0 +1,54 @@
> +# SPDX-License-Identifier: GPL-2.0
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/power/reset/google,gs101-poweroff.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Google GS101 poweroff driver

Bindings are not for drivers, but hardware.

> +
> +maintainers:
> +  - Alexey Klimov <alexey.klimov@linaro.org>
> +
> +description: |+
> +  This is a Google Tensor gs101 poweroff driver using custom regmap

Bindings are not for drivers, but hardware.

> +  to map the poweroff register. The poweroff itself is performed with
> +  a write to the poweroff register from a privileged mode. Since generic
> +  syscon does not support this, the specific one is required.
> +  The write to the poweroff register is defined by the register map pointed
> +  by syscon reference plus the offset with the value and mask defined
> +  in the poweroff node.
> +  Default will be little endian mode, 32 bit access only.
> +
> +properties:
> +  compatible:
> +    const: google,gs101-poweroff
> +
> +  mask:
> +    $ref: /schemas/types.yaml#/definitions/uint32
> +    description: Update only the register bits defined by the mask (32 bit).
> +
> +  offset:
> +    $ref: /schemas/types.yaml#/definitions/uint32
> +    description: Offset in the register map for the poweroff register (in bytes).
> +
> +  samsung,syscon-phandle:
> +    $ref: /schemas/types.yaml#/definitions/phandle

This does not look right. The poweroff handling is within PMU, not
somewhere else. Don't use syscons as a replacement of regular MMIO
addresses.



Best regards,
Krzysztof
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/power/reset/google,gs101-poweroff.yaml b/Documentation/devicetree/bindings/power/reset/google,gs101-poweroff.yaml
new file mode 100644
index 000000000000..d704bf28294a
--- /dev/null
+++ b/Documentation/devicetree/bindings/power/reset/google,gs101-poweroff.yaml
@@ -0,0 +1,54 @@ 
+# SPDX-License-Identifier: GPL-2.0
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/power/reset/google,gs101-poweroff.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Google GS101 poweroff driver
+
+maintainers:
+  - Alexey Klimov <alexey.klimov@linaro.org>
+
+description: |+
+  This is a Google Tensor gs101 poweroff driver using custom regmap
+  to map the poweroff register. The poweroff itself is performed with
+  a write to the poweroff register from a privileged mode. Since generic
+  syscon does not support this, the specific one is required.
+  The write to the poweroff register is defined by the register map pointed
+  by syscon reference plus the offset with the value and mask defined
+  in the poweroff node.
+  Default will be little endian mode, 32 bit access only.
+
+properties:
+  compatible:
+    const: google,gs101-poweroff
+
+  mask:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    description: Update only the register bits defined by the mask (32 bit).
+
+  offset:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    description: Offset in the register map for the poweroff register (in bytes).
+
+  samsung,syscon-phandle:
+    $ref: /schemas/types.yaml#/definitions/phandle
+    description:
+      Phandle to the PMU system controller node.
+
+required:
+  - compatible
+  - offset
+  - mask
+  - samsung,syscon-phandle
+
+additionalProperties: false
+
+examples:
+  - |
+    poweroff {
+        compatible = "google,gs101-poweroff";
+        samsung,syscon-phandle = <&pmu_syscon>;
+        offset = <0x10>;
+        mask = <0x42>;
+    };