Re: [PATCH v6 1/4] dt-bindings: media: ti,ds90ub953: Add support for remote GPIO data source

Linus Walleij
2026-04-26T08:36:24Z

Hi Guoniu,

thanks for your patch!

n Fri, Apr 24, 2026 at 3:40 AM Guoniu Zhou <guoniu.zhou@oss.nxp.com> wrote:

> The DS90UB953 supports four pins, GPIO0 through GPIO3. When enabled as an
> output, it can be programed to output local data or remote data coming
> from the remote compatible deserializer.
>
> Add GPIO flag in second cell to select remote GPIO data source.
>
> Signed-off-by: Guoniu Zhou <guoniu.zhou@nxp.com>
(...)
> ---
> Changes in v6:
> - Added GPIO_DATA_SOURCE_REMOTE flag to dt-bindings/gpio/gpio.h

(...)
> +/*
> + * Bit 24 indicates the GPIO data source is from a remote device.
> + * This is used in serializer/deserializer setups where the GPIO pin
> + * on the local device (e.g., TI DS90UB953 serializer) reflects the
> + * state of a GPIO on the remote device (e.g., TI DS90UB960 deserializer).
> + */
> +#define GPIO_DATA_SOURCE_REMOTE 0x01000000

So this is added to all GPIO controllers ever in existance as something
fundamental about GPIO that may need its own flag.

I doubt this.

I understand that the driver needs to deal with this in a per-gpio-line
basis though, have you considered:

1. Just hard-coding this into the driver based on the .compatible
string, if the remote GPIOs are always the same for this TI thing?

2. If it is just for one particular system, you *could* actually have
a table/mask inside the driver for this:
if (of_machine_is_compatible("my-funky-system")) which will
kick in only on that very machine,

3. If you really want to store the information in the media i2c
device node, add some custom property like this:
ti,remote-sources = <0x0000001f>;
where a bit is set to 1 for each GPIO which is remote.

Putting flags on the GPIO lines themselves seems too complex
and system-specific.

Yours,
Linus Walleij