openwrt/target/linux/bcm27xx/patches-5.15/950-0749-dtoverlays-Add-overlay-for-Omnivision-OV2311-image-s.patch

148 lines
3.9 KiB
Diff
Raw Normal View History

From f76b8590a1808ae27ce687b2ab5eedb3cd4b3149 Mon Sep 17 00:00:00 2001
From: Dave Stevenson <dave.stevenson@raspberrypi.com>
Date: Fri, 25 Feb 2022 18:16:26 +0000
Subject: [PATCH] dtoverlays: Add overlay for Omnivision OV2311 image
sensor
Adds an overlay for the OV2311 1600x1300 monochrome global
shutter image sensor.
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
---
arch/arm/boot/dts/overlays/Makefile | 1 +
arch/arm/boot/dts/overlays/README | 15 +++
arch/arm/boot/dts/overlays/ov2311-overlay.dts | 93 +++++++++++++++++++
3 files changed, 109 insertions(+)
create mode 100644 arch/arm/boot/dts/overlays/ov2311-overlay.dts
--- a/arch/arm/boot/dts/overlays/Makefile
+++ b/arch/arm/boot/dts/overlays/Makefile
@@ -139,6 +139,7 @@ dtbo-$(CONFIG_ARCH_BCM2835) += \
mmc.dtbo \
mpu6050.dtbo \
mz61581.dtbo \
+ ov2311.dtbo \
ov5647.dtbo \
ov7251.dtbo \
ov9281.dtbo \
--- a/arch/arm/boot/dts/overlays/README
+++ b/arch/arm/boot/dts/overlays/README
@@ -2421,6 +2421,21 @@ Params: speed Display
xohms Touchpanel sensitivity (X-plate resistance)
+Name: ov2311
+Info: Omnivision OV2311 camera module.
+ Uses Unicam 1, which is the standard camera connector on most Pi
+ variants.
+Load: dtoverlay=ov2311,<param>=<val>
+Params: rotation Mounting rotation of the camera sensor (0 or
+ 180, default 0)
+ orientation Sensor orientation (0 = front, 1 = rear,
+ 2 = external, default external)
+ media-controller Configure use of Media Controller API for
+ configuring the sensor (default on)
+ cam0 Adopt the default configuration for CAM0 on a
+ Compute Module (CSI0, i2c_vc, and cam0_reg).
+
+
Name: ov5647
Info: Omnivision OV5647 camera module.
Uses Unicam 1, which is the standard camera connector on most Pi
--- /dev/null
+++ b/arch/arm/boot/dts/overlays/ov2311-overlay.dts
@@ -0,0 +1,93 @@
+// SPDX-License-Identifier: GPL-2.0-only
+// Definitions for OV2311 camera module on VC I2C bus
+/dts-v1/;
+/plugin/;
+
+#include <dt-bindings/gpio/gpio.h>
+
+/{
+ compatible = "brcm,bcm2835";
+
+ i2c_frag: fragment@0 {
+ target = <&i2c_csi_dsi>;
+ __overlay__ {
+ #address-cells = <1>;
+ #size-cells = <0>;
+ status = "okay";
+
+ ov2311: ov2311@60 {
+ compatible = "ovti,ov2311";
+ reg = <0x60>;
+ status = "okay";
+
+ clocks = <&cam1_clk>;
+ clock-names = "xvclk";
+
+ avdd-supply = <&cam1_reg>;
+ dovdd-supply = <&cam_dummy_reg>;
+ dvdd-supply = <&cam_dummy_reg>;
+
+ rotation = <0>;
+ orientation = <2>;
+
+ port {
+ ov2311_0: endpoint {
+ remote-endpoint = <&csi1_ep>;
+ clock-lanes = <0>;
+ data-lanes = <1 2>;
+ link-frequencies =
+ /bits/ 64 <400000000>;
+ };
+ };
+ };
+ };
+ };
+
+ csi_frag: fragment@1 {
+ target = <&csi1>;
+ csi: __overlay__ {
+ status = "okay";
+ brcm,media-controller;
+
+ port {
+ csi1_ep: endpoint {
+ remote-endpoint = <&ov2311_0>;
+ data-lanes = <1 2>;
+ };
+ };
+ };
+ };
+
+ fragment@2 {
+ target = <&i2c0if>;
+ __overlay__ {
+ status = "okay";
+ };
+ };
+
+ fragment@3 {
+ target = <&i2c0mux>;
+ __overlay__ {
+ status = "okay";
+ };
+ };
+
+ clk_frag: fragment@4 {
+ target = <&cam1_clk>;
+ __overlay__ {
+ status = "okay";
+ clock-frequency = <24000000>;
+ };
+ };
+
+ __overrides__ {
+ rotation = <&ov2311>,"rotation:0";
+ orientation = <&ov2311>,"orientation:0";
+ media-controller = <&csi>,"brcm,media-controller?";
+ cam0 = <&i2c_frag>, "target:0=",<&i2c_vc>,
+ <&csi_frag>, "target:0=",<&csi0>,
+ <&clk_frag>, "target:0=",<&cam0_clk>,
+ <&ov2311>, "clocks:0=",<&cam0_clk>,
+ <&ov2311>, "avdd-supply:0=",<&cam0_reg>;
+ };
+};