Skip to contentSkip to conversation

media: i2c: Add AR0233 camera sensor driver

PATCH New Alexander Shiyan 1 participant 2 messages Oct 15, 2024

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

PATCH v2 1/2 media: i2c: Add AR0233 camera sensor driver

This is a new driver for the AR0233 1/2.5" CMOS digital image sensor from ON Semiconductor.

The initial version of the driver supports 12-bit output format and provides controls that cover common camera sensor use cases.

This been tested on Rockchip RK3568 ISP with DS90UB953 serializer and DS90UB954 deserializer.

---
v2: Fix Media-CI test warnings

---
 drivers/media/i2c/Kconfig  |   11 +
 drivers/media/i2c/Makefile |    1 +
 drivers/media/i2c/ar0233.c | 1174 ++++++++++++++++++++++++++++++++++++
 3 files changed, 1186 insertions(+)
 create mode 100644 drivers/media/i2c/ar0233.c
drivers/media/i2c/Kconfig +11 -0
index 8ba096b8ebca..327e68b5fe0b 100644
@@ -51,6 +51,17 @@ config VIDEO_ALVIUM_CSI2
 	  To compile this driver as a module, choose M here: the
 	  module will be called alvium-csi2.
 
+config VIDEO_AR0233
+	tristate "onsemi AR0233 sensor support"
+	depends on OF || COMPILE_TEST
+	select V4L2_CCI_I2C
+	help
+	  This is a Video4Linux2 sensor driver for the onsemi AR0233 camera
+	  sensor.
+
+	  To compile this driver as a module, choose M here: the
+	  module will be called ar0233.
+
 config VIDEO_AR0521
 	tristate "ON Semiconductor AR0521 sensor support"
 	help
drivers/media/i2c/Makefile +1 -0
index fbb988bd067a..055123335a28 100644
@@ -19,6 +19,7 @@ obj-$(CONFIG_VIDEO_AK7375) += ak7375.o
 obj-$(CONFIG_VIDEO_AK881X) += ak881x.o
 obj-$(CONFIG_VIDEO_ALVIUM_CSI2) += alvium-csi2.o
 obj-$(CONFIG_VIDEO_APTINA_PLL) += aptina-pll.o
+obj-$(CONFIG_VIDEO_AR0233) += ar0233.o
 obj-$(CONFIG_VIDEO_AR0521) += ar0521.o
 obj-$(CONFIG_VIDEO_BT819) += bt819.o
 obj-$(CONFIG_VIDEO_BT856) += bt856.o
drivers/media/i2c/ar0233.c new file +1174 -0

1,174 lines not on this page · raw message

Signature · 1 line
2.39.1
#1 lore raw

PATCH v2 2/2 media: dt-bindings: media: i2c: Add AR0233 camera sensor

Add device tree binding for the onsemi AR0233 CMOS camera sensor.

---
v2: No changes

---
 .../bindings/media/i2c/onnn,ar0233.yaml       | 122 ++++++++++++++++++
 1 file changed, 122 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/media/i2c/onnn,ar0233.yaml
Documentation/devicetree/bindings/media/i2c/onnn,ar0233.yaml new file +122 -0
new file mode 100644
index 000000000000..fa8a4e63a2a3
@@ -0,0 +1,122 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/media/i2c/onnn,ar0233.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: ON Semiconductor AR0233 MIPI CSI-2 sensor
+
+maintainers:
+  - Alexander Shiyan <[email protected]>
+
+description:
+  The AR0233 is a 1/2.5" CMOS digital image sensor with MIPI CSI-2 and
+  I2C-compatible control interface.
+
+properties:
+  compatible:
+    const: onnn,ar0233
+
+  reg:
+    maxItems: 1
+
+  clocks:
+    maxItems: 1
+
+  clock-names:
+    const: extclk
+
+  vaa-supply:
+    description:
+      Supply for the VAA analog voltage (2.8V).
+
+  vaapix-supply:
+    description:
+      Supply for the VAA_PIX pixel voltage (2.8V).
+
+  vddio-supply:
+    description:
+      Supply for the VDD_IO I/O digital voltage (1.8V/2.8V).
+
+  vddphy-supply:
+    description:
+      Supply for the VDD_PHY digital voltage (1.2V).
+
+  vdd-supply:
+    description:
+      Supply for the VDD core digital voltage (1.2V).
+
+  reset-gpios:
+    description: Reset GPIO, active low.
+    maxItems: 1
+
+  port:
+    $ref: /schemas/graph.yaml#/$defs/port-base
+    unevaluatedProperties: false
+    description:
+      Video output port.
+
+    properties:
+      endpoint:
+        $ref: /schemas/media/video-interfaces.yaml#
+        unevaluatedProperties: false
+
+        properties:
+          bus-type:
+            const: 4
+
+          data-lanes:
+            anyOf:
+              - items:
+                  - const: 1
+              - items:
+                  - const: 1
+                  - const: 2
+              - items:
+                  - const: 1
+                  - const: 2
+                  - const: 3
+                  - const: 4
+
+          link-frequencies: true
+
+        required:
+          - data-lanes
+          - link-frequencies
+
+required:
+  - compatible
+  - reg
+  - clocks
+  - clock-names
+  - port
+
+unevaluatedProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/gpio/gpio.h>
+    #include <dt-bindings/media/video-interfaces.h>
+
+    i2c {
+        #address-cells = <1>;
+        #size-cells = <0>;
+
+        camera@10 {
+            compatible = "onnn,ar0233";
+            reg = <0x10>;
+
+            clocks = <&clk27m>;
+            clock-names = "extclk";
+
+            reset-gpios = <&ser0 0 GPIO_ACTIVE_LOW>;
+
+            port {
+                ar0233_out: endpoint {
+                    data-lanes = <1 2>;
+                    link-frequencies = /bits/ 64 <375000000>;
+                    remote-endpoint = <&ub953_csi_in>;
+                };
+            };
+        };
+    };
Signature · 1 line
2.39.1