arm64: dts: qcom: sdm670-google-sargo: front camera support
v12 cover arm64: dts: qcom: sdm670-google-sargo: front camera support
This adds support for the IMX355 in devicetree and adds support for the Pixel 3a front camera.
Changes since v11 (https://lore.kernel.org/r/[email protected]):
- mention 24 MHz in mclk2 comment (3/3)
- drop applied patches (previously 1-4/7)
Changes since v10, 4/7 (https://lore.kernel.org/r/[email protected]):
- add data-lanes to dts (everyone's review retained) (7/7)
Changes since v9 (https://lore.kernel.org/r/[email protected]):
- reject zero data-lanes (4/7)
Changes since v8 (https://lore.kernel.org/r/[email protected]):
- allow clock-lanes, but make it optional (1/7)
Changes since v7 (https://lore.kernel.org/r/[email protected]):
- restrict data-lanes to 4 (4/7)
- include first patch (1/7)
- add back optional data-lanes in bindings (2/7)
- remove assert low on power on again (Bryan's review retained) (3/7)
- use dev_err_probe in power on (3/7)
- remove second error on probe power on (3/7)
- add review tags (2/7, 3/7, 7/7)
Changes since v6 (https://lore.kernel.org/r/[email protected]):
- remove NAK from Krzysztof (3/6)
- assert reset GPIO on probe (3/6)
- change delays in reset sequence (3/6)
- remove __maybe_unused from OF match table (3/6)
- fix alignment for arguments to devm_regulator_bulk_get_const (3/6)
- remove front camera pin configuration (6/6)
- remove clock-lanes from camss endpoint (1/6, 6/6)
- remove data-lanes from camera sensor endpoint (2/6, 6/6)
- remove blank line at top of binding (2/6)
- add review tags (2/6, 3/6, 5/6, 6/6)
Changes since v5 (https://lore.kernel.org/r/[email protected]):
- add Bryan to CC who added a Reviewed-by
Changes since v4 (https://lore.kernel.org/r/[email protected]):
- add NAK from Krzysztof (2/5)
- label the camss ports (3/5, 5/5)
- define endpoint properties correctly (1/5)
- use devm_regulator_bulk_get_const (2/5)
- remove clock-names (1/5, 5/5)
- set reset GPIO as active low (1/5, 2/5, 5/5)
- explicitly drive reset low at start of sequence (2/5)
- make data-lanes in endpoint optional and start at 1 (1/5, 5/5)
- add mclk3 pin (4/5)
- add Reviewed-by's (4/5)
Changes since v3 (https://lore.kernel.org/r/[email protected]):
- separate camera mclk pins and move to different patch (4/5, 5/5)
- remove polarity from rear camera pin (5/5)
- remove output-low from front camera pins (5/5)
- mention effects of dcf6fb89e6f7 ("media: qcom: camss: remove a check for unavailable CAMSS endpoint") (3/5)
- specify single clock-name without items nesting (1/5)
- rebase on 49c6ac166cf7 ("media: i2c: imx355: Replace client->dev
usage") and eaa7d46d9654 ("media: i2c: imx335: Use V4L2 sensor clock
helper") (2/5)
- do not use of_match_ptr for OF match table (2/5)
- remove redundant GPIO validity checks (2/5)
- describe endpoint data-lanes (1/5)
Changes since v2 (https://lore.kernel.org/r/[email protected]):
- use devm_v4l2_sensor_clk_get (2/4)
- require supplies and clock-names (1/4)
- move unevaluatedProperties down (1/4)
- disable clocks as last power-off action (2/4)
- use 0 in gpio pin power-supply (4/4)
Changes since v1 (https://lore.kernel.org/r/[email protected]):
- too much to have a complete list (1-4/4)
- squash camera orientation patch (4/4, previously 5/5)
- squash driver changes (2/4, previously 3/5)
- remove labelled endpoint node in sdm670.dtsi (3/4, 4/4)
- change init sequence to match other similar drivers (2/4)
- retrieve clock frequency from devicetree-defined clock (4/4)
- remove clock-frequency from dt-bindings (1/4)
- remove redundant descriptions of child nodes (1/4)
- switch initial drive of the reset GPIO to low (2/4)
- set mclk frequency to 19.2 MHz (4/4)
- add vdda-pll supply for camss (4/4)
- use common power on and off functions (2/4)
- use devm_clk_get_optional (2/4)
- remove extra layer when describing mclk pin (4/4)
- rename regulators (1/4, 2/4, 4/4)
Richard Acayan (3):
arm64: dts: qcom: sdm670: label the camss ports instead of endpoints
arm64: dts: qcom: sdm670: add camera mclk pins
arm64: dts: qcom: sdm670-google-sargo: add imx355 front camera
.../boot/dts/qcom/sdm670-google-sargo.dts | 100 ++++++++++++++++++ arch/arm64/boot/dts/qcom/sdm670.dtsi | 46 +++++--- 2 files changed, 131 insertions(+), 15 deletions(-)
Signature · 1 line
2.53.0
PATCH v12 1/3 arm64: dts: qcom: sdm670: label the camss ports instead of endpoints
Endpoints cannot be pre-defined since commit dcf6fb89e6f7 ("media: qcom:
camss: remove a check for unavailable CAMSS endpoint") was applied, probing all endpoint nodes and requiring them to have a remote. There is no sensible remote in the SoC devicetree because camera sensors are board-specific.
The ports are meant to be extended by a board devicetree in order to define fully configured endpoints and connect the ports to camera sensors. For nodes that are only meaningful if extended, labels are usually assigned. Label these ports so they can be extended directly.
--- arch/arm64/boot/dts/qcom/sdm670.dtsi | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-)
arch/arm64/boot/dts/qcom/sdm670.dtsi +3 -15
@@ -1776,28 +1776,16 @@ ports { #address-cells = <1>; #size-cells = <0>; - port@0 { + camss_port0: port@0 { reg = <0>; - - camss_endpoint0: endpoint { - status = "disabled"; - }; }; - port@1 { + camss_port1: port@1 { reg = <1>; - - camss_endpoint1: endpoint { - status = "disabled"; - }; }; - port@2 { + camss_port2: port@2 { reg = <2>; - - camss_endpoint2: endpoint { - status = "disabled"; - }; }; }; };
Signature · 1 line
2.53.0
PATCH v12 2/3 arm64: dts: qcom: sdm670: add camera mclk pins
In reply to Richard AcayanThe camera subsystem is added for the SoC common devicetree, but the mclk pins should also be common across the SoC. Add the mclk pins for the cameras.
--- arch/arm64/boot/dts/qcom/sdm670.dtsi | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+)
arch/arm64/boot/dts/qcom/sdm670.dtsi +28 -0
@@ -1196,6 +1196,34 @@ tlmm: pinctrl@3400000 { gpio-ranges = <&tlmm 0 0 151>; wakeup-parent = <&pdc>; + cam_mclk0_default: cam-mclk0-default-state { + pins = "gpio13"; + function = "cam_mclk"; + drive-strength = <2>; + bias-disable; + }; + + cam_mclk1_default: cam-mclk1-default-state { + pins = "gpio14"; + function = "cam_mclk"; + drive-strength = <2>; + bias-disable; + }; + + cam_mclk2_default: cam-mclk2-default-state { + pins = "gpio15"; + function = "cam_mclk"; + drive-strength = <2>; + bias-disable; + }; + + cam_mclk3_default: cam-mclk3-default-state { + pins = "gpio16"; + function = "cam_mclk"; + drive-strength = <2>; + bias-disable; + }; + cci0_default: cci0-default-state { pins = "gpio17", "gpio18"; function = "cci_i2c";
Signature · 1 line
2.53.0
PATCH v12 3/3 arm64: dts: qcom: sdm670-google-sargo: add imx355 front camera
In reply to Richard AcayanThe Sony IMX355 is the front camera on the Pixel 3a, mounted in portrait mode. It is connected to CSIPHY1 and CCI I2C1, and uses MCLK2. Add support for it.
--- .../boot/dts/qcom/sdm670-google-sargo.dts | 100 ++++++++++++++++++ 1 file changed, 100 insertions(+)
arch/arm64/boot/dts/qcom/sdm670-google-sargo.dts +100 -0
@@ -172,6 +172,34 @@ vreg_s2b_1p05: vreg-s2b-regulator { regulator-min-microvolt = <1050000>; regulator-max-microvolt = <1050000>; }; + + cam_front_ldo: cam-front-ldo-regulator { + compatible = "regulator-fixed"; + regulator-name = "cam_front_ldo"; + regulator-min-microvolt = <1352000>; + regulator-max-microvolt = <1352000>; + regulator-enable-ramp-delay = <135>; + + gpios = <&pm660l_gpios 4 GPIO_ACTIVE_HIGH>; + enable-active-high; + + pinctrl-0 = <&cam_front_ldo_pin>; + pinctrl-names = "default"; + }; + + cam_vio_ldo: cam-vio-ldo-regulator { + compatible = "regulator-fixed"; + regulator-name = "cam_vio_ldo"; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + regulator-enable-ramp-delay = <233>; + + gpios = <&pm660_gpios 13 GPIO_ACTIVE_HIGH>; + enable-active-high; + + pinctrl-0 = <&cam_vio_pin>; + pinctrl-names = "default"; + }; }; &apps_rsc {
@@ -392,6 +420,64 @@ vreg_bob: bob { }; }; +&camss { + vdda-phy-supply = <&vreg_l1a_1p225>; + vdda-pll-supply = <&vreg_s6a_0p87>; + + status = "okay"; +}; + +&camss_port1 { + camss_endpoint1: endpoint { + data-lanes = <0 1 2 3>; + remote-endpoint = <&cam_front_endpoint>; + }; +}; + +&cci { + pinctrl-0 = <&cci1_default>; + pinctrl-1 = <&cci1_sleep>; + pinctrl-names = "default", "sleep"; + + status = "okay"; +}; + +&cci_i2c1 { + camera@1a { + compatible = "sony,imx355"; + reg = <0x1a>; + + clocks = <&camcc CAM_CC_MCLK2_CLK>; + + /* + * The sensor can accept a 24 MHz clock, but 19.2 MHz has + * better driver compatibility. + */ + assigned-clocks = <&camcc CAM_CC_MCLK2_CLK>; + assigned-clock-rates = <19200000>; + + reset-gpios = <&tlmm 9 GPIO_ACTIVE_LOW>; + + avdd-supply = <&cam_front_ldo>; + dvdd-supply = <&cam_front_ldo>; + dovdd-supply = <&cam_vio_ldo>; + + pinctrl-0 = <&cam_mclk2_default>; + pinctrl-names = "default"; + + rotation = <270>; + orientation = <0>; + + port { + cam_front_endpoint: endpoint { + data-lanes = <1 2 3 4>; + link-frequencies = /bits/ 64 <360000000>; + remote-endpoint = <&camss_endpoint1>; + }; + }; + }; +}; + &gcc { protected-clocks = <GCC_QSPI_CORE_CLK>, <GCC_QSPI_CORE_CLK_SRC>,
@@ -490,6 +576,14 @@ &pm660_charger { status = "okay"; }; +&pm660_gpios { + cam_vio_pin: cam-vio-state { + pins = "gpio13"; + function = "normal"; + power-source = <0>; + }; +}; + &pm660_rradc { status = "okay"; };
@@ -508,6 +602,12 @@ led-0 { }; &pm660l_gpios { + cam_front_ldo_pin: cam-front-state { + pins = "gpio4"; + function = "normal"; + power-source = <0>; + }; + vol_up_pin: vol-up-state { pins = "gpio7"; function = "normal";
Signature · 1 line
2.53.0
Quoted 8 lines · Richard Acayan
This adds support for the IMX355 in devicetree and adds support for the Pixel 3a front camera.
Changes since v11 (https://lore.kernel.org/r/[email protected]):
- mention 24 MHz in mclk2 comment (3/3)
- drop applied patches (previously 1-4/7)[...]
Applied, thanks!
[1/3] arm64: dts: qcom: sdm670: label the camss ports instead of endpoints
commit: cbdf1a61dde22c226a776d60ea5bff260b94f653
[2/3] arm64: dts: qcom: sdm670: add camera mclk pins
commit: 86695909eab6bfa577bf68c615dbe852ba9c8197
[3/3] arm64: dts: qcom: sdm670-google-sargo: add imx355 front camera
commit: 8d3a34d7890faa4d968b16e29c5c80e559291fd2Best regards,
Signature · 1 line
Bjorn Andersson <[email protected]>