Skip to content
Open
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
76 changes: 71 additions & 5 deletions Documentation/devicetree/bindings/media/i2c/sony,imx386.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,37 @@
$id: http://devicetree.org/schemas/media/i2c/sony,imx386.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Sony IMX386 image sensor
title: Sony IMX386 and IMX787 image sensors

maintainers:
- Derek Ross <derekross@gmail.com>

description:
Sony IMX386 12 MP Bayer CMOS sensor with a MIPI CSI-2 D-PHY output,
controlled over I2C. Its initialisation and readout modes are loaded from
a data file named by firmware-name.
controlled over I2C, and the IMX787 (the Pixel 9 Pro Fold's main camera),
which uses a MIPI CSI-2 C-PHY output and the same register map.
Their initialisation and readout modes are loaded from a data file named
by firmware-name.

allOf:
- $ref: /schemas/media/video-interface-devices.yaml#
- if:
properties:
compatible:
not:
contains:
const: sony,imx787
then:
properties:
vaux-supply: false
vaux2-supply: false
vana2-supply: false

properties:
compatible:
const: sony,imx386
enum:
- sony,imx386
- sony,imx787

reg:
maxItems: 1
Expand All @@ -29,7 +44,9 @@ properties:

reset-gpios:
maxItems: 1
description: XCLR, active low.
description:
XCLR, active low. On the IMX787 the line may be shared with the
module's AF/OIS controller.

vif-supply:
description: Interface (1.8 V) supply.
Expand All @@ -40,6 +57,18 @@ properties:
vana-supply:
description: Analog supply.

vana2-supply:
description: Second analog supply (IMX787), on after vana-supply.

vaux-supply:
description:
The module's AF/OIS controller's analog supply (IMX787), which the
module's power-up order switches on before the sensor's own.

vaux2-supply:
description:
The module's AF/OIS actuator supply (IMX787), on after vaux-supply.

vbb-supply:
description:
Board supply feeding the module's analog regulator, to be switched on
Expand Down Expand Up @@ -79,7 +108,12 @@ properties:
unevaluatedProperties: false

properties:
bus-type:
enum:
- 1 # MEDIA_BUS_TYPE_CSI2_CPHY (IMX787)
- 4 # MEDIA_BUS_TYPE_CSI2_DPHY
data-lanes:
description: D-PHY data lanes, or C-PHY trios.
minItems: 2
maxItems: 4
link-frequencies: true
Expand Down Expand Up @@ -129,3 +163,35 @@ examples:
};
};
};

- |
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/media/video-interfaces.h>
i2c {
#address-cells = <1>;
#size-cells = <0>;

camera@1a {
compatible = "sony,imx787";
reg = <0x1a>;
clocks = <&mclk>;
reset-gpios = <&gpp10 2 GPIO_ACTIVE_LOW>;
vif-supply = <&vddio_cam>;
vaux-supply = <&afois_vana>;
vaux2-supply = <&afois_vm>;
vana-supply = <&main_avdd1>;
vana2-supply = <&main_avdd2>;
vdig-supply = <&main_dvdd>;
firmware-name = "omamobile/camera/imx787-main.bin";
orientation = <1>;

port {
endpoint {
remote-endpoint = <&csis1_in>;
bus-type = <MEDIA_BUS_TYPE_CSI2_CPHY>;
data-lanes = <1 2 3>;
link-frequencies = /bits/ 64 <691200000>;
};
};
};
};
7 changes: 7 additions & 0 deletions drivers/media/i2c/ak7375.c
Original file line number Diff line number Diff line change
Expand Up @@ -350,6 +350,13 @@ static int __maybe_unused ak7375_vcm_resume(struct device *dev)
if (tries)
dev_info(dev, "answered after %u retries\n", tries);

/*
* The first position write right after leaving standby can be
* refused (NAK): seen on comet's ultrawide actuator, which then
* kept its reset position. Give it one control step's time.
*/
usleep_range(cdef->ctrl_delay_us, cdef->ctrl_delay_us + 10);

for (val = ak7375_dev->focus->val % cdef->ctrl_steps;
val <= ak7375_dev->focus->val;
val += cdef->ctrl_steps) {
Expand Down
Loading