linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Maxime Ripard <maxime@cerno.tech>
To: "Kévin L'hôpital" <kevin.lhopital@bootlin.com>
Cc: linux-media@vger.kernel.org, mchehab@kernel.org,
	robh+dt@kernel.org, mark.rutland@arm.com, wens@csie.org,
	yong.deng@magewell.com, p.zabel@pengutronix.de,
	devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	paul.kocialkowski@bootlin.com, thomas.petazzoni@bootlin.com
Subject: Re: [PATCH 7/7] [NOT FOR MERGE] ARM: dts: sun8i: a83t: bananapi-m3: Enable OV8865 camera
Date: Tue, 25 Aug 2020 16:40:22 +0200	[thread overview]
Message-ID: <20200825144022.mwkcqaqny7l5bab4@gilmour.lan> (raw)
In-Reply-To: <20200821145935.20346-8-kevin.lhopital@bootlin.com>

Hi,

On Fri, Aug 21, 2020 at 04:59:35PM +0200, Kévin L'hôpital wrote:
> The Bananapi M3 supports a camera module which includes an
> OV8865 sensor connected via the parallel CSI interface and
> an OV8865 sensor connected via MIPI CSI-2.
> 
> The I2C2 bus is shared by the two sensors as well as active-low
> reset signal but each sensor has it own shutdown line.
> 
> The I2c address for the OV8865 is 0x36.
> 
> The bus type is hardcoded to 4 due to the lack of available
> define usable in the device-tree.
> 
> Signed-off-by: Kévin L'hôpital <kevin.lhopital@bootlin.com>
>
> ---
>  arch/arm/boot/dts/sun8i-a83t-bananapi-m3.dts | 99 ++++++++++++++++++++
>  1 file changed, 99 insertions(+)
> 
> diff --git a/arch/arm/boot/dts/sun8i-a83t-bananapi-m3.dts b/arch/arm/boot/dts/sun8i-a83t-bananapi-m3.dts
> index 9d34eabba121..f7839094695e 100644
> --- a/arch/arm/boot/dts/sun8i-a83t-bananapi-m3.dts
> +++ b/arch/arm/boot/dts/sun8i-a83t-bananapi-m3.dts
> @@ -85,6 +85,38 @@
>  		};
>  	};
>  
> +	reg_ov8865_avdd: ov8865-avdd {
> +		compatible = "regulator-fixed";
> +		regulator-name = "ov8865-avdd";
> +		regulator-min-microvolt = <2800000>;
> +		regulator-max-microvolt = <2800000>;
> +		vin-supply = <&reg_dldo4>;
> +	};
> +
> +	reg_ov8865_dovdd: ov8865-dovdd {
> +		compatible = "regulator-fixed";
> +		regulator-name = "ov8865-dovdd";
> +		regulator-min-microvolt = <2800000>;
> +		regulator-max-microvolt = <2800000>;
> +		vin-supply = <&reg_dldo4>;
> +	};
> +
> +	reg_ov8865_afvdd: ov8865-afvdd {
> +		compatible = "regulator-fixed";
> +		regulator-name = "ov8865-afvdd";
> +		regulator-min-microvolt = <2800000>;
> +		regulator-max-microvolt = <2800000>;
> +		vin-supply = <&reg_dldo4>;
> +	};
> +
> +	reg_ov8865_vdd2: ov8865-vdd2 {
> +		compatible = "regulator-fixed";
> +		regulator-name = "ov8865-vdd2";
> +		regulator-min-microvolt = <1200000>;
> +		regulator-max-microvolt = <1200000>;
> +		vin-supply = <&reg_eldo1>;
> +	};
> +
>  	reg_usb1_vbus: reg-usb1-vbus {
>  		compatible = "regulator-fixed";
>  		regulator-name = "usb1-vbus";
> @@ -115,10 +147,59 @@
>  	cpu-supply = <&reg_dcdc3>;
>  };
>  
> +&ccu {
> +	assigned-clocks = <&ccu CLK_CSI_MCLK>;
> +	assigned-clock-parents = <&osc24M>;
> +	assigned-clock-rates = <24000000>;
> +};

Why do you need to use assigned-clocks here?

> +&csi {
> +	pinctrl-names = "default";
> +	status = "okay";
> +};

pinctrl-names alone is useless

> +
> +&csi_in {
> +	mipi_csi2_from_ov8865: endpoint {
> +		remote-endpoint = <&ov8865_to_mipi_csi2>;
> +		clock-lanes = <0>;
> +		data-lanes = <1 2 3 4>;
> +		bus-type = <4>;
> +	};
> +};
> +
>  &de {
>  	status = "okay";
>  };
>  
> +&i2c2 {
> +	pinctrl-names = "default";
> +	pinctrl-0 = <&i2c2_pe_pins>;
> +	status = "okay";
> +
> +	ov8865: camera@36 {
> +		compatible = "ovti,ov8865";
> +		reg = <0x36>;
> +		clocks = <&ccu CLK_CSI_MCLK>;
> +		clock-names ="xclk";
> +		AVDD-supply = <&reg_ov8865_avdd>;
> +		DOVDD-supply = <&reg_ov8865_dovdd>;
> +		VDD2-supply = <&reg_ov8865_vdd2>;
> +		AFVDD-supply = <&reg_ov8865_afvdd>;
> +		powerdown-gpios = <&pio 4 17 GPIO_ACTIVE_LOW>; /* PE17 */
> +		reset-gpios = <&pio 4 16 GPIO_ACTIVE_LOW>; /* PE16 */
> +		rotation = <180>;
> +
> +		port {
> +			ov8865_to_mipi_csi2: endpoint {
> +				remote-endpoint = <&mipi_csi2_from_ov8865>;
> +				data-lanes = <1 2 3 4>;
> +				clock-lanes = <0>;
> +				bus-type = <4>; /* V4L2_FWNODE_BUS_TYPE_CSI2_DPHY */
> +			};
> +		};
> +	};
> +};
> +
>  &ehci0 {
>  	/* Terminus Tech FE 1.1s 4-port USB 2.0 hub here */
>  	status = "okay";
> @@ -191,6 +272,11 @@
>  	status = "okay";
>  };
>  
> +&pio {
> +	pinctrl-names = "default";
> +	pinctrl-0 = <&csi_mclk_pin>;
> +};

I'm not sure why you'd need to use the MCLK pin as a hog, assigning it
to the camera device should be enough?

Maxime

  reply	other threads:[~2020-08-25 14:40 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-21 14:59 [PATCH 0/7] Support of MIPI CSI-2 for A83T and OV8865 camera Kévin L'hôpital
2020-08-21 14:59 ` [PATCH 1/7] media: sun6i-csi: Fix the bpp for 10-bit bayer formats Kévin L'hôpital
2020-08-24 16:55   ` Maxime Ripard
2020-08-25 15:23     ` Kévin L'hôpital
2020-08-25 15:50   ` Chen-Yu Tsai
2020-08-26  9:18     ` Kévin L'hôpital
2020-08-21 14:59 ` [PATCH 2/7] dt-bindings: media: i2c: Add documentation for ov8865 Kévin L'hôpital
2020-08-24 16:59   ` Maxime Ripard
2020-08-25 15:17     ` Kévin L'hôpital
2020-08-21 14:59 ` [PATCH 3/7] media: i2c: Add support for the OV8865 image sensor Kévin L'hôpital
2020-08-21 17:18   ` kernel test robot
2020-08-21 17:20   ` kernel test robot
2020-08-21 14:59 ` [PATCH 4/7] media: sunxi: sun6i-csi: Move the sun6i_csi_dev structure to the common header Kévin L'hôpital
2020-08-21 14:59 ` [PATCH 5/7] media: sunxi: sun6i-csi: Add support of MIPI CSI-2 for A83T Kévin L'hôpital
2020-08-25 14:37   ` Maxime Ripard
2020-08-26  9:17     ` Kévin L'hôpital
2020-08-27 15:41       ` Maxime Ripard
2020-08-28  7:32         ` Kévin L'hôpital
2020-08-21 14:59 ` [PATCH 6/7] ARM: dts: sun8i: a83t: Add support for the MIPI CSI-2 in CSI node Kévin L'hôpital
2020-08-21 14:59 ` [PATCH 7/7] [NOT FOR MERGE] ARM: dts: sun8i: a83t: bananapi-m3: Enable OV8865 camera Kévin L'hôpital
2020-08-25 14:40   ` Maxime Ripard [this message]
2020-08-26  8:58     ` Kévin L'hôpital
2020-08-27 15:38       ` Maxime Ripard
2020-08-28  7:31         ` Kévin L'hôpital
2020-08-24 16:52 ` [PATCH 0/7] Support of MIPI CSI-2 for A83T and " Maxime Ripard
2020-08-25 15:20   ` Kévin L'hôpital

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200825144022.mwkcqaqny7l5bab4@gilmour.lan \
    --to=maxime@cerno.tech \
    --cc=devicetree@vger.kernel.org \
    --cc=kevin.lhopital@bootlin.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=mchehab@kernel.org \
    --cc=p.zabel@pengutronix.de \
    --cc=paul.kocialkowski@bootlin.com \
    --cc=robh+dt@kernel.org \
    --cc=thomas.petazzoni@bootlin.com \
    --cc=wens@csie.org \
    --cc=yong.deng@magewell.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).