diff mbox series

[v3] media: dt-bindings: Convert Analog Devices ad5820 to DT schema

Message ID 20250414-b4-ad5820-dt-yaml-v3-1-39bbb5db7b2b@ixit.cz (mailing list archive)
State New
Headers show
Series [v3] media: dt-bindings: Convert Analog Devices ad5820 to DT schema | expand

Commit Message

David Heidelberg April 14, 2025, 4:04 p.m. UTC
From: David Heidelberg <david@ixit.cz>

Convert the Analog Devices ad5820 to DT schema format.

Added the io-channel-cells property, because it's already used by the
Nokia N900 device-tree and defines ad5820 as having only single output.

Acked-by: Pavel Machek <pavel@ucw.cz>
Signed-off-by: David Heidelberg <david@ixit.cz>
---
Changes in v3:
- Removed documentation of io-channel-cells property. Now it's 1:1 to
  the original binding. The reference to it from the Nokia N900 dts
  was removed in the -next.
- Link to v2: https://lore.kernel.org/r/20250314-b4-ad5820-dt-yaml-v2-1-287958c3c07c@ixit.cz

Changes in v2:
- added MAINTAINERS entry for the binding
- documented why io-channel-cells got added into the binding.
- dropped io-channel-cells in required properties.
- adjusted example indentation to 4 spaces.
- Link to v1: https://lore.kernel.org/r/20250209203940.159088-1-david@ixit.cz
---
 .../devicetree/bindings/media/i2c/ad5820.txt       | 28 ----------
 .../devicetree/bindings/media/i2c/adi,ad5820.yaml  | 59 ++++++++++++++++++++++
 MAINTAINERS                                        |  1 +
 3 files changed, 60 insertions(+), 28 deletions(-)


---
base-commit: b425262c07a6a643ebeed91046e161e20b944164
change-id: 20250314-b4-ad5820-dt-yaml-3220bf2f1e40

Best regards,

Comments

Rob Herring (Arm) April 15, 2025, 10:35 p.m. UTC | #1
On Mon, Apr 14, 2025 at 06:04:01PM +0200, David Heidelberg wrote:
> Convert the Analog Devices ad5820 to DT schema format.
> 
> Added the io-channel-cells property, because it's already used by the

You mean #io-channel-cells?

> Nokia N900 device-tree and defines ad5820 as having only single output.
> 
> Acked-by: Pavel Machek <pavel@ucw.cz>
> Signed-off-by: David Heidelberg <david@ixit.cz>
> ---
> Changes in v3:
> - Removed documentation of io-channel-cells property. Now it's 1:1 to
>   the original binding. The reference to it from the Nokia N900 dts
>   was removed in the -next.

Added or removed? I'm confused.

> - Link to v2: https://lore.kernel.org/r/20250314-b4-ad5820-dt-yaml-v2-1-287958c3c07c@ixit.cz
> 
> Changes in v2:
> - added MAINTAINERS entry for the binding
> - documented why io-channel-cells got added into the binding.
> - dropped io-channel-cells in required properties.
> - adjusted example indentation to 4 spaces.
> - Link to v1: https://lore.kernel.org/r/20250209203940.159088-1-david@ixit.cz
> ---
>  .../devicetree/bindings/media/i2c/ad5820.txt       | 28 ----------
>  .../devicetree/bindings/media/i2c/adi,ad5820.yaml  | 59 ++++++++++++++++++++++
>  MAINTAINERS                                        |  1 +
>  3 files changed, 60 insertions(+), 28 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/media/i2c/ad5820.txt b/Documentation/devicetree/bindings/media/i2c/ad5820.txt
> deleted file mode 100644
> index 5764cbedf9b73387ad1bfa9acf99c643f959b84a..0000000000000000000000000000000000000000
> --- a/Documentation/devicetree/bindings/media/i2c/ad5820.txt
> +++ /dev/null
> @@ -1,28 +0,0 @@
> -* Analog Devices AD5820 autofocus coil
> -
> -Required Properties:
> -
> -  - compatible: Must contain one of:
> -		- "adi,ad5820"
> -		- "adi,ad5821"
> -		- "adi,ad5823"
> -
> -  - reg: I2C slave address
> -
> -  - VANA-supply: supply of voltage for VANA pin
> -
> -Optional properties:
> -
> -   - enable-gpios : GPIO spec for the XSHUTDOWN pin. The XSHUTDOWN signal is
> -active low, a high level on the pin enables the device.
> -
> -Example:
> -
> -       ad5820: coil@c {
> -               compatible = "adi,ad5820";
> -               reg = <0x0c>;
> -
> -               VANA-supply = <&vaux4>;
> -               enable-gpios = <&msmgpio 26 GPIO_ACTIVE_HIGH>;
> -       };
> -
> diff --git a/Documentation/devicetree/bindings/media/i2c/adi,ad5820.yaml b/Documentation/devicetree/bindings/media/i2c/adi,ad5820.yaml
> new file mode 100644
> index 0000000000000000000000000000000000000000..93349e7daf262fc8939f984fbe93cf064a0cbaf8
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/media/i2c/adi,ad5820.yaml
> @@ -0,0 +1,59 @@
> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/media/i2c/adi,ad5820.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Analog Devices AD5820 autofocus coil
> +
> +maintainers:
> +  - Pavel Machek <pavel@ucw.cz>
> +
> +description:
> +  The AD5820 is a current sink driver designed for precise control of
> +  voice coil motors (VCMs) in camera autofocus systems.
> +
> +allOf:
> +  - $ref: /schemas/iio/iio.yaml#

You have the ref, so #io-channel-cells is allowed, but you need to say 
what the value for it should be for *this* binding. IOW, you still need 
to list it explicitly.

> +
> +properties:
> +  compatible:
> +    enum:
> +      - adi,ad5820
> +      - adi,ad5821
> +      - adi,ad5823
> +
> +  reg:
> +    maxItems: 1
> +
> +  enable-gpios:
> +    maxItems: 1
> +    description:
> +      GPIO spec for the XSHUTDOWN pin. The XSHUTDOWN signal is active low,
> +      a high level on the pin enables the device.
> +
> +  VANA-supply:
> +    description: supply of voltage for VANA pin
> +
> +required:
> +  - compatible
> +  - reg
> +  - VANA-supply
> +
> +unevaluatedProperties: false
> +
> +examples:
> +  - |
> +    #include <dt-bindings/gpio/gpio.h>
> +
> +    i2c {
> +        #address-cells = <1>;
> +        #size-cells = <0>;
> +        coil@c {
> +            compatible = "adi,ad5820";
> +            reg = <0x0c>;
> +
> +            enable-gpios = <&msmgpio 26 GPIO_ACTIVE_HIGH>;
> +            VANA-supply = <&vaux4>;
> +        };
> +    };
> diff --git a/MAINTAINERS b/MAINTAINERS
> index af3537005de35dfd0ded11bdc2b9c63e10c70e93..366ed4905fc9b32862a4fd665cf5f4e09fafc989 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -17274,6 +17274,7 @@ M:	Pavel Machek <pavel@kernel.org>
>  M:	Sakari Ailus <sakari.ailus@iki.fi>
>  L:	linux-media@vger.kernel.org
>  S:	Maintained
> +F:	Documentation/devicetree/bindings/media/i2c/adi,ad5820.yaml
>  F:	drivers/media/i2c/ad5820.c
>  F:	drivers/media/i2c/et8ek8
>  
> 
> ---
> base-commit: b425262c07a6a643ebeed91046e161e20b944164
> change-id: 20250314-b4-ad5820-dt-yaml-3220bf2f1e40
> 
> Best regards,
> -- 
> David Heidelberg <david@ixit.cz>
>
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/media/i2c/ad5820.txt b/Documentation/devicetree/bindings/media/i2c/ad5820.txt
deleted file mode 100644
index 5764cbedf9b73387ad1bfa9acf99c643f959b84a..0000000000000000000000000000000000000000
--- a/Documentation/devicetree/bindings/media/i2c/ad5820.txt
+++ /dev/null
@@ -1,28 +0,0 @@ 
-* Analog Devices AD5820 autofocus coil
-
-Required Properties:
-
-  - compatible: Must contain one of:
-		- "adi,ad5820"
-		- "adi,ad5821"
-		- "adi,ad5823"
-
-  - reg: I2C slave address
-
-  - VANA-supply: supply of voltage for VANA pin
-
-Optional properties:
-
-   - enable-gpios : GPIO spec for the XSHUTDOWN pin. The XSHUTDOWN signal is
-active low, a high level on the pin enables the device.
-
-Example:
-
-       ad5820: coil@c {
-               compatible = "adi,ad5820";
-               reg = <0x0c>;
-
-               VANA-supply = <&vaux4>;
-               enable-gpios = <&msmgpio 26 GPIO_ACTIVE_HIGH>;
-       };
-
diff --git a/Documentation/devicetree/bindings/media/i2c/adi,ad5820.yaml b/Documentation/devicetree/bindings/media/i2c/adi,ad5820.yaml
new file mode 100644
index 0000000000000000000000000000000000000000..93349e7daf262fc8939f984fbe93cf064a0cbaf8
--- /dev/null
+++ b/Documentation/devicetree/bindings/media/i2c/adi,ad5820.yaml
@@ -0,0 +1,59 @@ 
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/media/i2c/adi,ad5820.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Analog Devices AD5820 autofocus coil
+
+maintainers:
+  - Pavel Machek <pavel@ucw.cz>
+
+description:
+  The AD5820 is a current sink driver designed for precise control of
+  voice coil motors (VCMs) in camera autofocus systems.
+
+allOf:
+  - $ref: /schemas/iio/iio.yaml#
+
+properties:
+  compatible:
+    enum:
+      - adi,ad5820
+      - adi,ad5821
+      - adi,ad5823
+
+  reg:
+    maxItems: 1
+
+  enable-gpios:
+    maxItems: 1
+    description:
+      GPIO spec for the XSHUTDOWN pin. The XSHUTDOWN signal is active low,
+      a high level on the pin enables the device.
+
+  VANA-supply:
+    description: supply of voltage for VANA pin
+
+required:
+  - compatible
+  - reg
+  - VANA-supply
+
+unevaluatedProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/gpio/gpio.h>
+
+    i2c {
+        #address-cells = <1>;
+        #size-cells = <0>;
+        coil@c {
+            compatible = "adi,ad5820";
+            reg = <0x0c>;
+
+            enable-gpios = <&msmgpio 26 GPIO_ACTIVE_HIGH>;
+            VANA-supply = <&vaux4>;
+        };
+    };
diff --git a/MAINTAINERS b/MAINTAINERS
index af3537005de35dfd0ded11bdc2b9c63e10c70e93..366ed4905fc9b32862a4fd665cf5f4e09fafc989 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -17274,6 +17274,7 @@  M:	Pavel Machek <pavel@kernel.org>
 M:	Sakari Ailus <sakari.ailus@iki.fi>
 L:	linux-media@vger.kernel.org
 S:	Maintained
+F:	Documentation/devicetree/bindings/media/i2c/adi,ad5820.yaml
 F:	drivers/media/i2c/ad5820.c
 F:	drivers/media/i2c/et8ek8