Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Frank Li <Frank.li@oss.nxp.com>
To: Ernest Van Hoecke <ernestvanhoecke@gmail.com>
Cc: Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>, Frank Li <Frank.Li@nxp.com>,
	Sascha Hauer <s.hauer@pengutronix.de>,
	Pengutronix Kernel Team <kernel@pengutronix.de>,
	Fabio Estevam <festevam@gmail.com>,
	Kieran Bingham <kieran.bingham@ideasonboard.com>,
	Francesco Dolcini <francesco.dolcini@toradex.com>,
	devicetree@vger.kernel.org, imx@lists.linux.dev,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org,
	Ernest Van Hoecke <ernest.vanhoecke@toradex.com>
Subject: Re: [PATCH 3/6] dt-bindings: connector: Add Toradex camera connector
Date: Thu, 10 Sep 2026 12:01:51 -0500	[thread overview]
Message-ID: <aqLif2zrrsbYd5sM@SMW015318> (raw)
In-Reply-To: <prwghb3ftrz5xd3hapxtlv2o2gm5xmuapnpz2h7fqulf75phqz@lk4yiaepormb>

On Thu, Sep 10, 2026 at 06:39:30PM +0200, Ernest Van Hoecke wrote:
> Hi Frank,
>
> Thanks for reviewing this so quickly.
>
> On Thu, Sep 10, 2026 at 11:26:22AM -0500, Frank Li wrote:
> > On Thu, Sep 10, 2026 at 05:37:59PM +0200, Ernest Van Hoecke wrote:
> > > From: Ernest Van Hoecke <ernest.vanhoecke@toradex.com>
> > >
> > > Toradex boards route the sideband signals of their 24-pin camera
> > > connectors to different GPIO controllers. Camera overlays which name
> > > those controllers directly must therefore be duplicated for each host
> > > board.
> > >
> > > Describe reset, power-down, detection and power-control as
> > > connector-local GPIO functions. This lets an accessory overlay remain
> > > independent of the host wiring. MIPI CSI-2, I2C, clocks and supplies
> > > remain described separately because the GPIO nexus does not abstract
> > > them.
> > >
> > > Signed-off-by: Ernest Van Hoecke <ernest.vanhoecke@toradex.com>
> > > ---
> > >  .../connector/toradex,camera-connector.yaml        | 86 ++++++++++++++++++++++
> > >  1 file changed, 86 insertions(+)
> > >
> > > diff --git a/Documentation/devicetree/bindings/connector/toradex,camera-connector.yaml b/Documentation/devicetree/bindings/connector/toradex,camera-connector.yaml
> > > new file mode 100644
> > > index 000000000000..06e6836e1aa6
> > > --- /dev/null
> > > +++ b/Documentation/devicetree/bindings/connector/toradex,camera-connector.yaml
> > > @@ -0,0 +1,86 @@
> > > +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> > > +%YAML 1.2
> > > +---
> > > +$id: http://devicetree.org/schemas/connector/toradex,camera-connector.yaml#
> > > +$schema: http://devicetree.org/meta-schemas/base.yaml#
> > > +
> > > +title: Toradex camera connector GPIO nexus
> > > +
> > > +maintainers:
> > > +  - Ernest Van Hoecke <ernest.vanhoecke@toradex.com>
> > > +  - Toradex Linux BSP Team <linux-bsp@toradex.com>
> > > +
> > > +description: |
> > > +  Toradex boards provide 24-pin camera connectors carrying MIPI CSI-2, I2C,
> > > +  clock, power, and sideband GPIO signals. This binding describes the sideband
> > > +  signals as a GPIO nexus. The other connector resources remain described by
> > > +  the surrounding board device tree.
> > > +
> > > +  The nexus exposes connector-local GPIO function numbers to camera overlays
> > > +  and maps the functions wired by a carrier board to their GPIO controllers.
> > > +  GPIO specifiers contain a function number followed by standard GPIO flags.
> > > +  A board may omit functions which it does not wire.
> > > +
> > > +  The function numbers are:
> > > +    - 0: Camera reset, connector pin 11
> > > +    - 1: Camera power-down, connector pin 22
> > > +    - 2: Camera identification, connector pin 23
> > > +    - 3: Camera power control, connector pin 24
> > > +
> > > +properties:
> > > +  compatible:
> > > +    const: toradex,camera-connector
> >
> > Name is too generally, suggest use board name, we got similar comments at
> >
> > https://lore.kernel.org/imx/20260629074734.3643227-2-chancel.liu@oss.nxp.com/
>
> I saw that and it made me reconsider this name.
>
> However, I believe that in our case it is specific enough. It is really
> the same on all our carrier boards, and Toradex specific. It's also only
> for cameras, which is more defined than just "io". Curious to see if
> others agree or if we should come up with a name for this.

If some days later, you update hardware connector to 30pin from 24pins.

>
> > > +
> > > +  "#gpio-cells":
> > > +    const: 2
> > > +
> > > +  gpio-map:
> > > +    minItems: 1
> > > +    maxItems: 4
> > > +
> > > +  gpio-map-mask:
> > > +    items:
> > > +      - const: 0xffffffff
> >
> > are you sure need full 32bit, only 4 pin, maybe 0xf should enough?
> >
>
> Indeed we could reduce the size of the mask, but I don't really see the
> value in it. Isn't it good that a user can pass through the full GPIO?

it works, I remember it control input index's width.

	 <0 0 &gpio1 0 GPIO_ACTIVE_HIGH>
          ^

You can wait for dt team's comments for this.

>
> > > +      - const: 0
> > > +
> > > +  gpio-map-pass-thru:
> > > +    items:
> > > +      - const: 0
> > > +      - const: 0xffffffff
> > > +
> >
> > missed
> > 	gpio-controller: true
> >
>
> This is one thing I didn't fully understand about the GPIO nexus
> concept, why would we need this gpio-controller flag? Isn't the gpio
> controller behind the nexus? The nexus just maps onto it. The actual
> controller would be on the SoC or an expander.

Yes, I remember "#gpio-cells" depend on "gpio-controller", does
pass dt_binding_check?

>
> > > +required:
> > > +  - compatible
> > > +  - "#gpio-cells"
> > > +  - gpio-map
> > > +  - gpio-map-mask
> > > +  - gpio-map-pass-thru
> > > +
> > > +additionalProperties: false
> > > +
> > > +examples:
> > > +  - |
> > > +    #include <dt-bindings/gpio/gpio.h>
> > > +
> > > +    camera-connector {
> > > +        compatible = "toradex,camera-connector";
> > > +        #gpio-cells = <2>;
> > > +        /*
> > > +         * 0: Camera reset, connector pin 11
> > > +         * 1: Camera power-down, connector pin 22
> > > +         * 2: Camera identification, connector pin 23
> > > +         * 3: Camera power control, connector pin 24
> > > +         */
> > > +        gpio-map = <0 0 &gpio1 0 GPIO_ACTIVE_HIGH>,
> > > +                   <1 0 &gpio1 1 GPIO_ACTIVE_HIGH>,
> > > +                   <2 0 &gpio1 2 GPIO_ACTIVE_HIGH>,
> > > +                   <3 0 &gpio1 3 GPIO_ACTIVE_HIGH>;
> > > +        gpio-map-mask = <0xffffffff 0x0>;
> > > +        gpio-map-pass-thru = <0x0 0xffffffff>;
> > > +    };
> > > +
> > > +    gpio1: gpio-controller {
> > > +        #gpio-cells = <2>;
> > > +        gpio-controller;
> > > +    };
> >
> > Need't gpio-controller.
> >
> > Frank
> >
>
> This ties in to my same confusion above, could you explain why or point
> me to a relevant example/docs?

My means needn't whole gpio-controller{} block, like &its, needn't add
node of interrupt controllers.

  Example should not contain unrelated device
  nodes, e.g. consumer nodes in a provider binding, other nodes referenced by
  phandles or node labels which are not directly referenced in the example
  itself. Phandles in the example do not have to be resolvable.

Frank

>
> Thanks and kind regards,
> Ernest


  reply	other threads:[~2026-09-10 17:02 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-10 15:37 [PATCH 0/6] arm64: dts: freescale: Add Verdin iMX8M OV5640 and Verdin iMX8MP M7 support Ernest Van Hoecke
2026-09-10 15:37 ` [PATCH 1/6] arm64: dts: freescale: imx8mp-verdin: Add Cortex-M7 remoteproc Ernest Van Hoecke
2026-09-10 15:37 ` [PATCH 2/6] arm64: dts: freescale: imx8mp-verdin: Add Cortex-M7 UART_4 overlay Ernest Van Hoecke
2026-09-10 15:37 ` [PATCH 3/6] dt-bindings: connector: Add Toradex camera connector Ernest Van Hoecke
2026-09-10 16:26   ` Frank Li
2026-09-10 16:39     ` Ernest Van Hoecke
2026-09-10 17:01       ` Frank Li [this message]
2026-09-10 17:12         ` Francesco Dolcini
2026-09-10 18:38           ` Frank Li
2026-09-10 15:38 ` [PATCH 4/6] arm64: dts: freescale: imx8m{m,p}-verdin: Add camera connector nexus Ernest Van Hoecke
2026-09-10 16:31   ` Frank Li
2026-09-10 15:38 ` [PATCH 5/6] arm64: dts: freescale: imx8m{m,p}-verdin: Add shared OV5640 overlays Ernest Van Hoecke
2026-09-10 15:38 ` [PATCH 6/6] arm64: dts: freescale: imx8mp-verdin: Add mezzanine " Ernest Van Hoecke

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=aqLif2zrrsbYd5sM@SMW015318 \
    --to=frank.li@oss.nxp.com \
    --cc=Frank.Li@nxp.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=ernest.vanhoecke@toradex.com \
    --cc=ernestvanhoecke@gmail.com \
    --cc=festevam@gmail.com \
    --cc=francesco.dolcini@toradex.com \
    --cc=imx@lists.linux.dev \
    --cc=kernel@pengutronix.de \
    --cc=kieran.bingham@ideasonboard.com \
    --cc=krzk+dt@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=robh@kernel.org \
    --cc=s.hauer@pengutronix.de \
    /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