Skip to contentSkip to conversation

Add bindings for ams Mira220 cmos image sensor

PATCH In review philippe baetens 3 participants 4 messages Jul 1, 2025 – Jul 2, 2025

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH v3 1/2 Add bindings for ams Mira220 cmos image sensor

Mira220 is a global shutter NIR-enhanced image sensor made by AMS. Driver is submitted in the next patch of this series and verified on a raspberry pi.

---
Changes in v3:
- Improve commit message
- add mailing list for device tree.

Changes in v2:
- add maintainers and Documentation.yaml

---
 .../bindings/media/i2c/ams,mira220.yaml       | 125 ++++++++++++++++++
 MAINTAINERS                                   |   6 +
 2 files changed, 131 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/media/i2c/ams,mira220.yaml
Documentation/devicetree/bindings/media/i2c/ams,mira220.yaml new file +125 -0
new file mode 100644
index 000000000..21a55ff07
@@ -0,0 +1,125 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/media/i2c/ams,mira220.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: ams 2.2 MP NIR enhanced global shutter image sensor
+
+maintainers:
+  - Philippe Baetens <[email protected]>
+
+description: |-
+  2.2 MP NIR enhanced global shutter image sensor designed for 2D and 3D
+  consumer and industrial machine vision applications.
+  Due to its small size, configurability and high sensitivity both
+  in visual as well as NIR, the Mira220 is well suited for 2D and
+  3D applications, which include Active Stereo Vision,
+  Structured Light Vision for Robotics and AR/VR.
+
+properties:
+  compatible:
+    const: ams,mira220
+
+  reg:
+    maxItems: 1
+
+  clocks:
+    maxItems: 1
+
+  clock-names:
+    description: Input clock (38.4 MHz)
+    items:
+      - const: inck
+
+  vdig-supply:
+    description:
+      Digital I/O voltage supply, 1.35 volts
+
+  vana1-supply:
+    description:
+      Analog1 voltage supply, 2.8 volts
+
+  vana2-supply:
+    description:
+      Analog2 voltage supply, 1.8 volts
+
+  vddl-supply:
+    description:
+      Digital core voltage supply, 1.8 volts
+
+  reset-gpios:
+    description: Sensor reset (XCLR) GPIO
+    maxItems: 1
+
+  port:
+    $ref: /schemas/graph.yaml#/$defs/port-base
+    description: |
+      Video output port
+
+    properties:
+      endpoint:
+        $ref: /schemas/media/video-interfaces.yaml#
+        unevaluatedProperties: false
+
+        properties:
+          data-lanes:
+            anyOf:
+              - items:
+                  - const: 1
+                  - const: 2
+              - items:
+                  - const: 1
+                  - const: 2
+                  - const: 3
+                  - const: 4
+
+          link-frequencies: true
+
+        required:
+          - data-lanes
+          - link-frequencies
+
+    additionalProperties: false
+
+required:
+  - compatible
+  - reg
+  - clocks
+  - clock-names
+  - vdig-supply
+  - vana-supply
+  - vddl-supply
+  - port
+
+additionalProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/gpio/gpio.h>
+
+    i2c {
+        #address-cells = <1>;
+        #size-cells = <0>;
+
+        mira220: camera-sensor@1a {
+            compatible = "ams,mira220";
+            reg = <0x54>;
+
+            clocks = <&cam1_clk>;
+            clock-names = "xclk";
+
+            vana-supply = <&cam1_reg>;	/* 2.5v */
+            vdig-supply = <&cam_dummy_reg>;	/* 1.8v */
+            vddl-supply = <&cam_dummy_reg>;	/* 1.35v */
+
+            port {
+                mira220_ep: endpoint {
+                    clock-lanes = <0>;
+                    data-lanes = <1 2>;
+                    link-frequencies = /bits/ 64 <750000000>;
+                };
+            };
+        };
+    };
+...
MAINTAINERS +6 -0
index da34c7227..5cb93390f 100644
@@ -1330,6 +1330,12 @@ S:	Maintained
 F:	Documentation/devicetree/bindings/iio/light/ams,as73211.yaml
 F:	drivers/iio/light/as73211.c
 
+AMS MIRA220 DRIVER
+M:	Philippe Baetens <[email protected]>
+S:	Maintained
+F:	Documentation/devicetree/bindings/media/i2c/ams,mira220.yaml
+F:	drivers/media/i2c/mira220.c
+
 AMT (Automatic Multicast Tunneling)
 M:	Taehee Yoo <[email protected]>
 L:	[email protected]
Signature · 1 line
2.39.5
#1 lore raw
Quoted 9 lines · philippe baetens

Mira220 is a global shutter NIR-enhanced image sensor made by AMS. Driver is submitted in the next patch of this series and verified on a raspberry pi.

---
Changes in v3:
- Improve commit message
- add mailing list for device tree.

Quoted 9 lines

Changes in v2:
- add maintainers and Documentation.yaml

---
 .../bindings/media/i2c/ams,mira220.yaml       | 125 ++++++++++++++++++
 MAINTAINERS                                   |   6 +
 2 files changed, 131 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/media/i2c/ams,mira220.yaml

My bot found errors running 'make dt_binding_check' on your patch:

yamllint warnings/errors:

dtschema/dtc warnings/errors:
Documentation/devicetree/bindings/media/i2c/ams,mira220.example.dts:24.39-42.15: Warning (i2c_bus_reg): /example-0/i2c/camera-sensor@1a: I2C bus unit address format error, expected "54" /builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/media/i2c/ams,mira220.example.dtb: camera-sensor@1a (ams,mira220): 'vana-supply' does not match any of the regexes: '^pinctrl-[0-9]+$'
from schema $id: http://devicetree.org/schemas/media/i2c/ams,mira220.yaml#
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/media/i2c/ams,mira220.example.dtb: camera-sensor@1a (ams,mira220): clock-names:0: 'inck' was expected
from schema $id: http://devicetree.org/schemas/media/i2c/ams,mira220.yaml#

doc reference errors (make refcheckdocs):

See https://patchwork.ozlabs.org/project/devicetree-bindings/patch/aGP67H5_GxL4z2Nc@raspberrypi

The base for the series is generally the latest rc1. A different dependency should be noted in *this* patch.

If you already ran 'make dt_binding_check' and didn't see the above error(s), then make sure 'yamllint' is installed and dt-schema is up to date:

pip3 install dtschema --upgrade

Please check and re-submit after running the above command yourself. Note that DT_SCHEMA_FILES can be set to your schema file to speed up checking your schema. However, it must be unset to test all examples with your schema.

#2 lore raw
In reply to philippe baetens
Quoted 2 lines · philippe baetens

Mira220 is a global shutter NIR-enhanced image sensor made by AMS. Driver is submitted in the next patch of this series and verified on a raspberry pi.

Please wrap commit message according to Linux coding style / submission process (neither too early nor over the limit):
https://elixir.bootlin.com/linux/v6.4-rc1/source/Documentation/process/submitting-patches.rst#L597

Please use subject prefixes matching the subsystem. You can get them for example with 'git log --oneline -- DIRECTORY_OR_FILE' on the directory your patch is touching. For bindings, the preferred subjects are explained here:
https://www.kernel.org/doc/html/latest/devicetree/bindings/submitting-patches.html#i-for-patch-submitters

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

Quoted 2 lines

Fix your Git, so your identity uses same style. It is "Philippe Baetens", no?

Quoted 44 lines

---
Changes in v3:
- Improve commit message
- add mailing list for device tree.

Changes in v2:
- add maintainers and Documentation.yaml

---
 .../bindings/media/i2c/ams,mira220.yaml       | 125 ++++++++++++++++++
 MAINTAINERS                                   |   6 +
 2 files changed, 131 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/media/i2c/ams,mira220.yaml
Documentation/devicetree/bindings/media/i2c/ams,mira220.yaml new file +23 -0
new file mode 100644
index 000000000..21a55ff07
@@ -0,0 +1,125 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/media/i2c/ams,mira220.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: ams 2.2 MP NIR enhanced global shutter image sensor
+
+maintainers:
+  - Philippe Baetens <[email protected]>
+
+description: |-
+  2.2 MP NIR enhanced global shutter image sensor designed for 2D and 3D
+  consumer and industrial machine vision applications.
+  Due to its small size, configurability and high sensitivity both
+  in visual as well as NIR, the Mira220 is well suited for 2D and
+  3D applications, which include Active Stereo Vision,
+  Structured Light Vision for Robotics and AR/VR.
+
+properties:
+  compatible:
+    const: ams,mira220
+

Documentation/devicetree/bindings/media/i2c/ams,mira220.yaml line 33

Quoted 10 lines
Documentation/devicetree/bindings/media/i2c/ams,mira220.yaml new file +10 -0
+  reg:
+    maxItems: 1
+
+  clocks:
+    maxItems: 1
+
+  clock-names:
+    description: Input clock (38.4 MHz)
+    items:
+      - const: inck

Drop clock-names, redundant.

Quoted 14 lines
Documentation/devicetree/bindings/media/i2c/ams,mira220.yaml new file +14 -0
+
+  vdig-supply:
+    description:
+      Digital I/O voltage supply, 1.35 volts
+
+  vana1-supply:
+    description:
+      Analog1 voltage supply, 2.8 volts
+
+  vana2-supply:
+    description:
+      Analog2 voltage supply, 1.8 volts
+
+  vddl-supply:

Documentation/devicetree/bindings/media/i2c/ams,mira220.yaml line 57

Quoted 10 lines
Documentation/devicetree/bindings/media/i2c/ams,mira220.yaml new file +10 -0
+    description:
+      Digital core voltage supply, 1.8 volts
+
+  reset-gpios:
+    description: Sensor reset (XCLR) GPIO
+    maxItems: 1
+
+  port:
+    $ref: /schemas/graph.yaml#/$defs/port-base
+    description: |

Drop |

Quoted 10 lines
Documentation/devicetree/bindings/media/i2c/ams,mira220.yaml new file +10 -0
+      Video output port
+
+    properties:
+      endpoint:
+        $ref: /schemas/media/video-interfaces.yaml#
+        unevaluatedProperties: false
+
+        properties:
+          data-lanes:
+            anyOf:

Documentation/devicetree/bindings/media/i2c/ams,mira220.yaml line 77

Quoted 10 lines
Documentation/devicetree/bindings/media/i2c/ams,mira220.yaml new file +10 -0
+              - items:
+                  - const: 1
+                  - const: 2
+              - items:
+                  - const: 1
+                  - const: 2
+                  - const: 3
+                  - const: 4
+
+          link-frequencies: true

Drop, not needed.

Documentation/devicetree/bindings/media/i2c/ams,mira220.yaml line 83

Quoted 6 lines
Documentation/devicetree/bindings/media/i2c/ams,mira220.yaml new file +6 -0
+
+        required:
+          - data-lanes
+          - link-frequencies
+
+    additionalProperties: false

This goes after $ref

Quoted 14 lines
Documentation/devicetree/bindings/media/i2c/ams,mira220.yaml new file +14 -0
+
+required:
+  - compatible
+  - reg
+  - clocks
+  - clock-names
+  - vdig-supply
+  - vana-supply
+  - vddl-supply
+  - port
+
+additionalProperties: false
+
+examples:

Documentation/devicetree/bindings/media/i2c/ams,mira220.yaml line 107

Quoted 10 lines
Documentation/devicetree/bindings/media/i2c/ams,mira220.yaml new file +10 -0
+  - |
+    #include <dt-bindings/gpio/gpio.h>
+
+    i2c {
+        #address-cells = <1>;
+        #size-cells = <0>;
+
+        mira220: camera-sensor@1a {
+            compatible = "ams,mira220";
+            reg = <0x54>;

Does not match unit address.

Documentation/devicetree/bindings/media/i2c/ams,mira220.yaml line 109

Quoted 2 lines
Documentation/devicetree/bindings/media/i2c/ams,mira220.yaml new file +2 -0
+
+            clocks = <&cam1_clk>;

Best regards,
Krzysztof

#3 lore raw
In reply to philippe baetens
Quoted 5 lines · philippe baetens

Mira220 is a global shutter NIR-enhanced image sensor made by AMS. Driver is submitted in the next patch of this series and verified on a raspberry pi.

---

And also you totally broke the threading. Send patches in one command - git send-email - not two or more.

git format-patch -2 -v4 --cover-letter
git send-email ..... v4*

... or just use b4.

Best regards,
Krzysztof