linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Cc: Paul Elder <paul.elder@ideasonboard.com>,
	linux-media@vger.kernel.org,
	Mauro Carvalho Chehab <mchehab@kernel.org>,
	Rob Herring <robh+dt@kernel.org>,
	Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
	Conor Dooley <conor+dt@kernel.org>,
	Hans Verkuil <hverkuil-cisco@xs4all.nl>,
	devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-mediatek@lists.infradead.org
Subject: Re: [PATCH 3/3] arm64: dts: mediatek: mt8365-pumpkin: Add overlays for thp7312 cameras
Date: Wed, 6 Sep 2023 11:32:37 +0300	[thread overview]
Message-ID: <20230906083237.GL7971@pendragon.ideasonboard.com> (raw)
In-Reply-To: <502fc7b1-a32d-6901-3a45-d2aa0e0c3849@linaro.org>

Hi Krzysztof,

On Wed, Sep 06, 2023 at 09:27:07AM +0200, Krzysztof Kozlowski wrote:
> On 06/09/2023 01:31, Paul Elder wrote:
> > Add overlays for the Pumpkin i350 to support THP7312 cameras.
> > 
> > Signed-off-by: Paul Elder <paul.elder@ideasonboard.com>
> > ---
> >  arch/arm64/boot/dts/mediatek/Makefile         |  4 +
> >  .../mt8365-pumpkin-common-thp7312.dtsi        | 23 ++++++
> >  .../mt8365-pumpkin-csi0-thp7312-imx258.dtso   | 73 +++++++++++++++++++
> >  .../mt8365-pumpkin-csi1-thp7312-imx258.dtso   | 73 +++++++++++++++++++
> >  4 files changed, 173 insertions(+)
> >  create mode 100644 arch/arm64/boot/dts/mediatek/mt8365-pumpkin-common-thp7312.dtsi
> >  create mode 100644 arch/arm64/boot/dts/mediatek/mt8365-pumpkin-csi0-thp7312-imx258.dtso
> >  create mode 100644 arch/arm64/boot/dts/mediatek/mt8365-pumpkin-csi1-thp7312-imx258.dtso
> > 
> > diff --git a/arch/arm64/boot/dts/mediatek/Makefile b/arch/arm64/boot/dts/mediatek/Makefile
> > index 20570bc40de8..ceaf24105001 100644
> > --- a/arch/arm64/boot/dts/mediatek/Makefile
> > +++ b/arch/arm64/boot/dts/mediatek/Makefile
> > @@ -56,4 +56,8 @@ dtb-$(CONFIG_ARCH_MEDIATEK) += mt8365-evk.dtb
> >  dtb-$(CONFIG_ARCH_MEDIATEK) += mt8365-pumpkin.dtb
> >  dtb-$(CONFIG_ARCH_MEDIATEK) += mt8516-pumpkin.dtb
> >  
> > +mtk-mt8365-pumpkin-dtbs := mt8365-pumpkin.dtb mt8365-pumpkin-csi0-thp7312-imx258.dtbo
> > +mtk-mt8365-pumpkin-dtbs := mt8365-pumpkin.dtb mt8365-pumpkin-csi1-thp7312-imx258.dtbo
> >  mtk-mt8365-pumpkin-dtbs := mt8365-pumpkin.dtb mt8365-pumpkin-ethernet-usb.dtbo
> > +
> > +dtb-$(CONFIG_ARCH_MEDIATEK) += mtk-mt8365-pumpkin.dtb
> > diff --git a/arch/arm64/boot/dts/mediatek/mt8365-pumpkin-common-thp7312.dtsi b/arch/arm64/boot/dts/mediatek/mt8365-pumpkin-common-thp7312.dtsi
> > new file mode 100644
> > index 000000000000..478697552617
> > --- /dev/null
> > +++ b/arch/arm64/boot/dts/mediatek/mt8365-pumpkin-common-thp7312.dtsi
> > @@ -0,0 +1,23 @@
> > +// SPDX-License-Identifier: GPL-2.0
> > +/*
> > + * Copyright (c) 2023 Ideas on Board
> > + * Author: Paul Elder <paul.elder@ideasonboard.com>
> > + */
> > +
> > +/dts-v1/;
> > +/plugin/;
> > +
> > +&{/} {
> > +	vsys_v4p2: regulator@0 {
> 
> Hm? Is this a bus?

There are multiple instances of "numbered" regulators in upstream DT
files, for instance arch/arm/boot/dts/nxp/imx/imx6qdl-nitrogen6_max.dtsi
has a regulator@0. There are similar instances for clocks.

I understand why it may not be a good idea, and how the root node is
indeed not a bus. In some cases, those regulators and clocks are grouped
in a regulators or clocks node that has a "simple-bus" compatible. I'm
not sure if that's a good idea, but at least it should validate.

What's the best practice for discrete board-level clocks and regulators
in overlays ? How do we ensure that their node name will not conflict
with the board to which the overlay is attached ?

> > +		compatible = "regulator-fixed";
> > +		regulator-name = "vsys-v4p2";
> > +		regulator-min-microvolt = <4200000>;
> > +		regulator-max-microvolt = <4200000>;
> > +	};
> > +
> > +	camera61_clk: cam_clk24m {
> 
> And this is not on a bus? It's the same / node!
> 
> Please work on mainline, which means take mainline code and change it to
> your needs. Do not take downstream poor code and change it...
> 
> No underscores in node names. Also generic node names, so at least with
> generic prefix or suffix.
> 
> > +		compatible = "fixed-clock";
> > +		clock-frequency = <24000000>;
> > +		#clock-cells = <0>;
> > +	};
> > +};
> > diff --git a/arch/arm64/boot/dts/mediatek/mt8365-pumpkin-csi0-thp7312-imx258.dtso b/arch/arm64/boot/dts/mediatek/mt8365-pumpkin-csi0-thp7312-imx258.dtso
> > new file mode 100644
> > index 000000000000..740d14a19d75
> > --- /dev/null
> > +++ b/arch/arm64/boot/dts/mediatek/mt8365-pumpkin-csi0-thp7312-imx258.dtso
> > @@ -0,0 +1,73 @@
> > +// SPDX-License-Identifier: GPL-2.0
> > +/*
> > + * Copyright (c) 2023 Ideas on Board
> > + * Author: Paul Elder <paul.elder@ideasonboard.com>
> > + */
> > +
> > +#include <dt-bindings/gpio/gpio.h>
> > +#include <dt-bindings/pinctrl/mt8365-pinfunc.h>
> > +#include "mt8365-pumpkin-common-thp7312.dtsi"
> > +
> > +&i2c3 {
> > +	camera@61 {
> > +		compatible = "thine,thp7312";
> > +		reg = <0x61>;
> > +		pinctrl-names = "default";
> > +		pinctrl-0 = <&cam0_pins_default>;
> > +		reset-gpios = <&pio 118 GPIO_ACTIVE_LOW>;
> > +		clocks = <&camera61_clk>;
> > +
> > +		vddcore-supply = <&vsys_v4p2>;
> > +		vhtermrx-supply = <&vsys_v4p2>;
> > +		vddtx-supply = <&vsys_v4p2>;
> > +		vddhost-supply = <&vsys_v4p2>;
> > +		vddcmos-supply = <&vsys_v4p2>;
> > +		vddgpio_0-supply = <&vsys_v4p2>;
> > +		vddgpio_1-supply = <&vsys_v4p2>;
> > +		DOVDD-supply = <&vsys_v4p2>;
> > +		AVDD-supply = <&vsys_v4p2>;
> > +		DVDD-supply = <&vsys_v4p2>;
> > +
> > +		orientation = <0>;
> > +		rotation = <0>;
> > +
> > +		thine,rx,data-lanes = <4 1 3 2>;
> 
> NAK for this property.

Please explain why. You commented very briefly in the bindings review,
and it wasn't clear to me if you were happy or not with the property,
and if not, why.

> > +
> > +		port {
> > +			isp1_out: endpoint {
> > +				remote-endpoint = <&seninf_in1>;
> > +				data-lanes = <4 2 1 3>;
> > +			};
> > +		};
> > +	};
> > +};
> > +
> > +&pio {
> > +	cam0_pins_default: cam0_pins_default {
> 
> No underscores in node names.
> 
> > +		pins_rst {
> 
> Ditto

-- 
Regards,

Laurent Pinchart

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2023-09-06  8:33 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-05 23:31 [PATCH 0/3] media: i2c: Add driver for THine THP7312 ISP Paul Elder
2023-09-05 23:31 ` [PATCH 3/3] arm64: dts: mediatek: mt8365-pumpkin: Add overlays for thp7312 cameras Paul Elder
2023-09-06  7:27   ` Krzysztof Kozlowski
2023-09-06  8:32     ` Laurent Pinchart [this message]
2023-09-06  8:48       ` Krzysztof Kozlowski
2023-09-06  9:00         ` Laurent Pinchart
2023-09-06  9:21           ` Krzysztof Kozlowski
2023-09-06  9:35             ` Laurent Pinchart
2023-09-06 11:01               ` Kieran Bingham
2023-09-06 11:14                 ` Laurent Pinchart
2023-09-07 14:55                   ` Paul Elder
2023-09-07 15:04                     ` Laurent Pinchart
2023-09-07 15:04                       ` Laurent Pinchart
2023-09-08 20:52   ` Rob Herring
2023-09-09 15:37     ` Laurent Pinchart

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=20230906083237.GL7971@pendragon.ideasonboard.com \
    --to=laurent.pinchart@ideasonboard.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=hverkuil-cisco@xs4all.nl \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=krzysztof.kozlowski@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=mchehab@kernel.org \
    --cc=paul.elder@ideasonboard.com \
    --cc=robh+dt@kernel.org \
    /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).