Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
112 changes: 112 additions & 0 deletions Documentation/devicetree/bindings/media/i2c/sony,imx662.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/media/i2c/sony,imx662.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Sony IMX662 CMOS Image Sensor

description:
The Sony IMX662 is a 1/2.8-inch CMOS image sensor with a pixel
array of 1936x1100 pixels, capable of 1920x1080 resolution at up
to 90 fps. It supports MIPI CSI-2 output with 2 or 4 data lanes,
RAW10/RAW12 output, and both colour and monochrome variants.

allOf:
- $ref: /schemas/media/video-interface-devices.yaml#

properties:
compatible:
enum:
- sony,imx662aaqr # Colour variant
- sony,imx662aamr # Monochrome variant

reg:
maxItems: 1
description: I2C device address

clocks:
maxItems: 1
description: Master clock input (xclk).

reset-gpios:
maxItems: 1
description: Sensor reset (XCLR) pin, active low (optional).

avdd-supply:
description: Analog 3.3V power supply (optional).

dvdd-supply:
description: Digital core 1.1V power supply (optional).

ovdd-supply:
description: Digital I/O 1.8V power supply (optional).

port:
$ref: /schemas/graph.yaml#/$defs/port-base
description: CSI-2 transmitter port
additionalProperties: false
properties:
endpoint:
$ref: /schemas/media/video-interfaces.yaml#
unevaluatedProperties: false
properties:
data-lanes:
description:
Number of MIPI CSI-2 data lanes. Supported values: 2, 4.
minItems: 2
maxItems: 4
items:
enum: [1, 2, 3, 4]

link-frequencies:
description:
Allowed MIPI link frequencies in Hz. The list may contain
one or more values; the driver selects the highest supported
frequency compatible with the number of data lanes.
minItems: 1
maxItems: 8
items:
enum: [297000000, 360000000, 445500000, 594000000,
720000000, 891000000, 1039500000, 1188000000]
required:
- data-lanes
- link-frequencies
required:
- endpoint

required:
- compatible
- reg
- clocks
- port

additionalProperties: false

examples:
- |
#include <dt-bindings/gpio/gpio.h>

i2c {
#address-cells = <1>;
#size-cells = <0>;

camera@1a {
compatible = "sony,imx662";
reg = <0x1a>;
clocks = <&clk24m>;
avdd-supply = <&reg_cam_avdd>;
dvdd-supply = <&reg_cam_dvdd>;
ovdd-supply = <&reg_cam_ovdd>;
reset-gpios = <&gpio3 4 GPIO_ACTIVE_LOW>;

port {
imx662_out: endpoint {
data-lanes = <1 2 3 4>;
link-frequencies = /bits/ 64 <360000000>;
remote-endpoint = <&imx662_in>;
};
};
};
};
...
1 change: 1 addition & 0 deletions arch/arm/boot/dts/overlays/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ dtbo-$(CONFIG_ARCH_BCM2835) += \
imx500.dtbo \
imx500-pi5.dtbo \
imx519.dtbo \
imx662.dtbo \
imx708.dtbo \
interludeaudio-analog.dtbo \
interludeaudio-digital.dtbo \
Expand Down
28 changes: 28 additions & 0 deletions arch/arm/boot/dts/overlays/README
Original file line number Diff line number Diff line change
Expand Up @@ -3114,6 +3114,34 @@ Params: rotation Mounting rotation of the camera sensor (0 or
but vcm=off will disable.


Name: imx662
Info: Sony IMX662 camera module.
Uses Unicam 1, which is the standard camera connector on most Pi
variants.
Load: dtoverlay=imx662,<param>
Params: 4lane Enable 4 CSI2 lanes. This requires a Compute
Module (1, 3, 4, or 5) or Pi 5.
clock-frequency Sets the clock frequency to match that used on
the board. Default 24MHz
mono Denote that the module is a mono sensor.
orientation Sensor orientation (0 = front, 1 = rear,
2 = external, default external)
rotation Mounting rotation of the camera sensor (0 or
180, default 0)
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).
vcm Enable a VCM focus drive on the sensor.
link-frequency Link frequency to use in Hz. Valid values of
297000000, 360000000, 445500000,
594000000 (default), 720000000, 891000000,
1039500000, and 1188000000.
Values above 594000000 are unlikely to work on
Pi0-4, and above 720000000 are not guaranteed to
work on Pi5.


Name: imx708
Info: Sony IMX708 camera module.
Uses Unicam 1, which is the standard camera connector on most Pi
Expand Down
121 changes: 121 additions & 0 deletions arch/arm/boot/dts/overlays/imx662-overlay.dts
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
// SPDX-License-Identifier: GPL-2.0-only
// Definitions for IMX662 camera module on VC I2C bus
/dts-v1/;
/plugin/;

#include <dt-bindings/gpio/gpio.h>

/{
compatible = "brcm,bcm2835";

fragment@0 {
target = <&i2c0if>;
__overlay__ {
status = "okay";
};
};

clk_frag: fragment@1 {
target = <&cam1_clk>;
clk: __overlay__ {
status = "okay";
clock-frequency = <24000000>;
};
};

fragment@2 {
target = <&i2c0mux>;
__overlay__ {
status = "okay";
};
};

reg_frag: fragment@3 {
target = <&cam1_reg>;
cam_reg: __overlay__ {
startup-delay-us = <300000>;
};
};

i2c_frag: fragment@100 {
target = <&i2c_csi_dsi>;
__overlay__ {
#address-cells = <1>;
#size-cells = <0>;
status = "okay";

#include "imx662.dtsi"

vcm: ad5398@c {
compatible = "adi,ad5398";
reg = <0x0c>;
status = "disabled";
VANA-supply = <&cam1_reg>;
};
};
};

csi_frag: fragment@101 {
target = <&csi1>;
csi: __overlay__ {
status = "okay";

port {
csi_ep: endpoint {
remote-endpoint = <&cam_endpoint>;
clock-lanes = <0>;
data-lanes = <1 2>;
clock-noncontinuous;
};
};
};
};

fragment@102 {
target = <&csi1>;
__dormant__ {
compatible = "brcm,bcm2835-unicam-legacy";
};
};

fragment@201 {
target = <&csi_ep>;
__dormant__ {
data-lanes = <1 2 3 4>;
};
};

fragment@202 {
target = <&cam_endpoint>;
__dormant__ {
data-lanes = <1 2 3 4>;
};
};

__overrides__ {
rotation = <&cam_node>,"rotation:0";
orientation = <&cam_node>,"orientation:0";
media-controller = <0>,"!102";
cam0 = <&i2c_frag>, "target:0=",<&i2c_csi_dsi0>,
<&csi_frag>, "target:0=",<&csi0>,
<&clk_frag>, "target:0=",<&cam0_clk>,
<&cam_node>, "clocks:0=",<&cam0_clk>,
<&reg_frag>, "target:0=",<&cam0_reg>,
<&cam_node>, "avdd-supply:0=",<&cam0_reg>,
<&vcm>, "VANA-supply:0=", <&cam0_reg>;
vcm = <&vcm>, "status=okay",
<&cam_node>,"lens-focus:0=", <&vcm>;
4lane = <0>, "+201+202";
clock-frequency = <&clk>,"clock-frequency:0";
link-frequency = <&cam_endpoint>,"link-frequencies#0";
mono = <&cam_node>,"compatible=sony,imx662aamr";
};
};

&cam_node {
status = "okay";
};

&cam_endpoint {
remote-endpoint = <&csi_ep>;
};
26 changes: 26 additions & 0 deletions arch/arm/boot/dts/overlays/imx662.dtsi
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
// Fragment that configures an imx662

cam_node: imx662@1a {
compatible = "sony,imx662aaqr";
reg = <0x1a>;
status = "disabled";

clocks = <&cam1_clk>;

avdd-supply = <&cam1_reg>; /* 2.8v */
dvdd-supply = <&cam_dummy_reg>; /* 1.8v */
ovdd-supply = <&cam_dummy_reg>;/* 1.2v */

rotation = <180>;
orientation = <2>;

port {
cam_endpoint: endpoint {
clock-lanes = <0>;
data-lanes = <1 2>;
clock-noncontinuous;
link-frequencies =
/bits/ 64 <594000000>;
};
};
};
1 change: 1 addition & 0 deletions arch/arm/configs/bcm2709_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -945,6 +945,7 @@ CONFIG_VIDEO_IMX415=m
CONFIG_VIDEO_IMX477=m
CONFIG_VIDEO_IMX500=m
CONFIG_VIDEO_IMX519=m
CONFIG_VIDEO_IMX662=m
CONFIG_VIDEO_IMX708=m
CONFIG_VIDEO_MIRA220=m
CONFIG_VIDEO_MT9V011=m
Expand Down
1 change: 1 addition & 0 deletions arch/arm/configs/bcmrpi_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -938,6 +938,7 @@ CONFIG_VIDEO_IMX415=m
CONFIG_VIDEO_IMX477=m
CONFIG_VIDEO_IMX500=m
CONFIG_VIDEO_IMX519=m
CONFIG_VIDEO_IMX662=m
CONFIG_VIDEO_IMX708=m
CONFIG_VIDEO_MIRA220=m
CONFIG_VIDEO_MT9V011=m
Expand Down
1 change: 1 addition & 0 deletions arch/arm64/configs/bcm2711_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -1041,6 +1041,7 @@ CONFIG_VIDEO_IMX415=m
CONFIG_VIDEO_IMX477=m
CONFIG_VIDEO_IMX500=m
CONFIG_VIDEO_IMX519=m
CONFIG_VIDEO_IMX662=m
CONFIG_VIDEO_IMX708=m
CONFIG_VIDEO_MIRA220=m
CONFIG_VIDEO_MT9V011=m
Expand Down
1 change: 1 addition & 0 deletions arch/arm64/configs/bcm2712_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -1043,6 +1043,7 @@ CONFIG_VIDEO_IMX415=m
CONFIG_VIDEO_IMX477=m
CONFIG_VIDEO_IMX500=m
CONFIG_VIDEO_IMX519=m
CONFIG_VIDEO_IMX662=m
CONFIG_VIDEO_IMX708=m
CONFIG_VIDEO_MIRA220=m
CONFIG_VIDEO_MT9V011=m
Expand Down
11 changes: 11 additions & 0 deletions drivers/media/i2c/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,17 @@ config VIDEO_IMX519
To compile this driver as a module, choose M here: the
module will be called IMX519.

config VIDEO_IMX662
tristate "Sony IMX662 sensor support"
depends on OF || COMPILE_TEST
select V4L2_CCI_I2C
help
This is a Video4Linux2 sensor driver for the Sony
IMX662 camera.

To compile this driver as a module, choose M here: the
module will be called imx662.

config VIDEO_IMX708
tristate "Sony IMX708 sensor support"
depends on I2C && VIDEO_DEV
Expand Down
1 change: 1 addition & 0 deletions drivers/media/i2c/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ obj-$(CONFIG_VIDEO_IMX415) += imx415.o
obj-$(CONFIG_VIDEO_IMX477) += imx477.o
obj-$(CONFIG_VIDEO_IMX500) += imx500.o
obj-$(CONFIG_VIDEO_IMX519) += imx519.o
obj-$(CONFIG_VIDEO_IMX662) += imx662.o
obj-$(CONFIG_VIDEO_IMX708) += imx708.o
obj-$(CONFIG_VIDEO_IR_I2C) += ir-kbd-i2c.o
obj-$(CONFIG_VIDEO_IRS1125) += irs1125.o
Expand Down
Loading
Loading