Re: [PATCH RESEND 3/4] dt-bindings: drm/bridge: Add GPIO display mux binding

2019-12-23 Thread Hsin-Yi Wang
On Fri, Dec 20, 2019 at 4:48 AM Rob Herring  wrote:
>
> On Mon, Dec 16, 2019 at 03:16:23PM +0800, Hsin-Yi Wang wrote:
> > On Sat, Dec 14, 2019 at 5:29 AM Rob Herring  wrote:
> > >
> > > On Wed, Dec 11, 2019 at 12:19 AM Hsin-Yi Wang  wrote:
> > > >
> > > > From: Nicolas Boichat 
> > > >
> > > > Add bindings for Generic GPIO mux driver.
> > > >
> > > > Signed-off-by: Nicolas Boichat 
> > > > Signed-off-by: Hsin-Yi Wang 
> > > > ---
> > > > Change from RFC to v1:
> > > > - txt to yaml
> > > > ---
> > > >  .../bindings/display/bridge/gpio-mux.yaml | 89 +++
> > > >  1 file changed, 89 insertions(+)
> > > >  create mode 100644 
> > > > Documentation/devicetree/bindings/display/bridge/gpio-mux.yaml
> > > >
> > > > diff --git 
> > > > a/Documentation/devicetree/bindings/display/bridge/gpio-mux.yaml 
> > > > b/Documentation/devicetree/bindings/display/bridge/gpio-mux.yaml
> > > > new file mode 100644
> > > > index ..cef098749066
> > > > --- /dev/null
> > > > +++ b/Documentation/devicetree/bindings/display/bridge/gpio-mux.yaml
> > > > @@ -0,0 +1,89 @@
> > > > +# SPDX-License-Identifier: GPL-2.0
> > > > +%YAML 1.2
> > > > +---
> > > > +$id: http://devicetree.org/schemas/display/bridge/gpio-mux.yaml#
> > > > +$schema: http://devicetree.org/meta-schemas/core.yaml#
> > > > +
> > > > +title: Generic display mux (1 input, 2 outputs)
> > >
> > > What makes it generic? Doesn't the mux chip have power supply,
> > > possibly a reset line or not, etc.? What about a mux where the GPIO
> > > controls the mux?
> > >
> > > Generally, we avoid 'generic' bindings because h/w is rarely generic.
> > > You can have a generic driver which works on multiple devices.
> > >
> > Then how about making it mt8173-oak-gpio-mux? Since this is currently
> > only used in this board.
>
> Isn't there an underlying part# you can use? Or if you can point me to
> multiple chips implementing the same thing, then maybe a generic binding
> is fine.
There are some similar chips, for example:
https://www.paradetech.com/zh-hant/%E7%94%A2%E5%93%81%E4%BB%8B%E7%B4%B9/ps8223-3-0gbps-hdmi-12-demultiplexer/
and http://www.ti.com/lit/ds/symlink/ts3dv642.pdf
If they are used in a similar way
(https://lore.kernel.org/lkml/canmq1kddezpwhbyetn-ejncg+ofvt2mw-hoxangooyfoyj3...@mail.gmail.com/),
they would need such driver. But currently we only know that mt8173
oak board have this use case.
>
> Rob
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH RESEND 3/4] dt-bindings: drm/bridge: Add GPIO display mux binding

2019-12-19 Thread Rob Herring
On Mon, Dec 16, 2019 at 03:16:23PM +0800, Hsin-Yi Wang wrote:
> On Sat, Dec 14, 2019 at 5:29 AM Rob Herring  wrote:
> >
> > On Wed, Dec 11, 2019 at 12:19 AM Hsin-Yi Wang  wrote:
> > >
> > > From: Nicolas Boichat 
> > >
> > > Add bindings for Generic GPIO mux driver.
> > >
> > > Signed-off-by: Nicolas Boichat 
> > > Signed-off-by: Hsin-Yi Wang 
> > > ---
> > > Change from RFC to v1:
> > > - txt to yaml
> > > ---
> > >  .../bindings/display/bridge/gpio-mux.yaml | 89 +++
> > >  1 file changed, 89 insertions(+)
> > >  create mode 100644 
> > > Documentation/devicetree/bindings/display/bridge/gpio-mux.yaml
> > >
> > > diff --git 
> > > a/Documentation/devicetree/bindings/display/bridge/gpio-mux.yaml 
> > > b/Documentation/devicetree/bindings/display/bridge/gpio-mux.yaml
> > > new file mode 100644
> > > index ..cef098749066
> > > --- /dev/null
> > > +++ b/Documentation/devicetree/bindings/display/bridge/gpio-mux.yaml
> > > @@ -0,0 +1,89 @@
> > > +# SPDX-License-Identifier: GPL-2.0
> > > +%YAML 1.2
> > > +---
> > > +$id: http://devicetree.org/schemas/display/bridge/gpio-mux.yaml#
> > > +$schema: http://devicetree.org/meta-schemas/core.yaml#
> > > +
> > > +title: Generic display mux (1 input, 2 outputs)
> >
> > What makes it generic? Doesn't the mux chip have power supply,
> > possibly a reset line or not, etc.? What about a mux where the GPIO
> > controls the mux?
> >
> > Generally, we avoid 'generic' bindings because h/w is rarely generic.
> > You can have a generic driver which works on multiple devices.
> >
> Then how about making it mt8173-oak-gpio-mux? Since this is currently
> only used in this board.

Isn't there an underlying part# you can use? Or if you can point me to 
multiple chips implementing the same thing, then maybe a generic binding 
is fine.

Rob
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH RESEND 3/4] dt-bindings: drm/bridge: Add GPIO display mux binding

2019-12-16 Thread Hsin-Yi Wang
On Sat, Dec 14, 2019 at 5:29 AM Rob Herring  wrote:
>
> On Wed, Dec 11, 2019 at 12:19 AM Hsin-Yi Wang  wrote:
> >
> > From: Nicolas Boichat 
> >
> > Add bindings for Generic GPIO mux driver.
> >
> > Signed-off-by: Nicolas Boichat 
> > Signed-off-by: Hsin-Yi Wang 
> > ---
> > Change from RFC to v1:
> > - txt to yaml
> > ---
> >  .../bindings/display/bridge/gpio-mux.yaml | 89 +++
> >  1 file changed, 89 insertions(+)
> >  create mode 100644 
> > Documentation/devicetree/bindings/display/bridge/gpio-mux.yaml
> >
> > diff --git a/Documentation/devicetree/bindings/display/bridge/gpio-mux.yaml 
> > b/Documentation/devicetree/bindings/display/bridge/gpio-mux.yaml
> > new file mode 100644
> > index ..cef098749066
> > --- /dev/null
> > +++ b/Documentation/devicetree/bindings/display/bridge/gpio-mux.yaml
> > @@ -0,0 +1,89 @@
> > +# SPDX-License-Identifier: GPL-2.0
> > +%YAML 1.2
> > +---
> > +$id: http://devicetree.org/schemas/display/bridge/gpio-mux.yaml#
> > +$schema: http://devicetree.org/meta-schemas/core.yaml#
> > +
> > +title: Generic display mux (1 input, 2 outputs)
>
> What makes it generic? Doesn't the mux chip have power supply,
> possibly a reset line or not, etc.? What about a mux where the GPIO
> controls the mux?
>
> Generally, we avoid 'generic' bindings because h/w is rarely generic.
> You can have a generic driver which works on multiple devices.
>
Then how about making it mt8173-oak-gpio-mux? Since this is currently
only used in this board.

> > +
> > +maintainers:
> > +  - Nicolas Boichat 
> > +
> > +description: |
> > +  This bindings describes a simple display (e.g. HDMI) mux, that has 1
> > +  input, and 2 outputs. The mux status is controlled by hardware, and
> > +  its status is read back using a GPIO.
> > +
> > +properties:
> > +  compatible:
> > +const: gpio-display-mux
> > +
> > +  detect-gpios:
> > +maxItems: 1
> > +description: GPIO that indicates the active output
> > +
> > +  ports:
> > +type: object
> > +
> > +properties:
> > +  port@0:
> > +type: object
> > +description: |
> > +  Video port for input.
> > +
> > +  port@1:
> > +type: object
> > +description: |
> > +  2 video ports for output.
> > +  The reg value in the endpoints matches the GPIO status: when
> > +  GPIO is asserted, endpoint with reg value <1> is selected.
>
> You should describe 'endpoint@0' and 'endpoint@1' here too.
Will add in next version, thanks
>
> > +
> > +required:
> > +  - port@0
> > +  - port@1
> > +
> > +required:
> > +  - compatible
> > +  - detect-gpios
> > +  - ports
> > +
> > +examples:
> > +  - |
> > +hdmi_mux: hdmi_mux {
> > +  compatible = "gpio-display-mux";
> > +  status = "okay";
>
> Don't show status in examples.
>
> > +  detect-gpios = < 36 GPIO_ACTIVE_HIGH>;
> > +  pinctrl-names = "default";
> > +  pinctrl-0 = <_mux_pins>;
> > +  ddc-i2c-bus = <>;
>
> Not documented. Is the i2c bus muxed too? If not, then this is in the
> wrong place.
>
It's muxed, but this is required because of [1], so it should be
removed in this example.

[1]https://elixir.bootlin.com/linux/v5.5-rc2/source/Documentation/devicetree/bindings/display/mediatek/mediatek,hdmi.txt#L24
> > +
> > +  ports {
> > +#address-cells = <1>;
> > +#size-cells = <0>;
> > +
> > +port@0 { /* input */
> > +  reg = <0>;
> > +
> > +  hdmi_mux_in: endpoint {
> > +remote-endpoint = <_out>;
> > +  };
> > +};
> > +
> > +port@1 { /* output */
> > +  reg = <1>;
> > +
> > +  #address-cells = <1>;
> > +  #size-cells = <0>;
> > +
> > +  hdmi_mux_out_anx: endpoint@0 {
> > +reg = <0>;
> > +remote-endpoint = <_in>;
> > +  };
> > +
> > +  hdmi_mux_out_hdmi: endpoint@1 {
> > +reg = <1>;
> > +remote-endpoint = <_connector_in>;
> > +  };
> > +};
> > +  };
> > +};
> > --
> > 2.24.0.525.g8f36a354ae-goog
> >
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH RESEND 3/4] dt-bindings: drm/bridge: Add GPIO display mux binding

2019-12-13 Thread Rob Herring
On Wed, Dec 11, 2019 at 12:19 AM Hsin-Yi Wang  wrote:
>
> From: Nicolas Boichat 
>
> Add bindings for Generic GPIO mux driver.
>
> Signed-off-by: Nicolas Boichat 
> Signed-off-by: Hsin-Yi Wang 
> ---
> Change from RFC to v1:
> - txt to yaml
> ---
>  .../bindings/display/bridge/gpio-mux.yaml | 89 +++
>  1 file changed, 89 insertions(+)
>  create mode 100644 
> Documentation/devicetree/bindings/display/bridge/gpio-mux.yaml
>
> diff --git a/Documentation/devicetree/bindings/display/bridge/gpio-mux.yaml 
> b/Documentation/devicetree/bindings/display/bridge/gpio-mux.yaml
> new file mode 100644
> index ..cef098749066
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/display/bridge/gpio-mux.yaml
> @@ -0,0 +1,89 @@
> +# SPDX-License-Identifier: GPL-2.0
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/display/bridge/gpio-mux.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Generic display mux (1 input, 2 outputs)

What makes it generic? Doesn't the mux chip have power supply,
possibly a reset line or not, etc.? What about a mux where the GPIO
controls the mux?

Generally, we avoid 'generic' bindings because h/w is rarely generic.
You can have a generic driver which works on multiple devices.

> +
> +maintainers:
> +  - Nicolas Boichat 
> +
> +description: |
> +  This bindings describes a simple display (e.g. HDMI) mux, that has 1
> +  input, and 2 outputs. The mux status is controlled by hardware, and
> +  its status is read back using a GPIO.
> +
> +properties:
> +  compatible:
> +const: gpio-display-mux
> +
> +  detect-gpios:
> +maxItems: 1
> +description: GPIO that indicates the active output
> +
> +  ports:
> +type: object
> +
> +properties:
> +  port@0:
> +type: object
> +description: |
> +  Video port for input.
> +
> +  port@1:
> +type: object
> +description: |
> +  2 video ports for output.
> +  The reg value in the endpoints matches the GPIO status: when
> +  GPIO is asserted, endpoint with reg value <1> is selected.

You should describe 'endpoint@0' and 'endpoint@1' here too.

> +
> +required:
> +  - port@0
> +  - port@1
> +
> +required:
> +  - compatible
> +  - detect-gpios
> +  - ports
> +
> +examples:
> +  - |
> +hdmi_mux: hdmi_mux {
> +  compatible = "gpio-display-mux";
> +  status = "okay";

Don't show status in examples.

> +  detect-gpios = < 36 GPIO_ACTIVE_HIGH>;
> +  pinctrl-names = "default";
> +  pinctrl-0 = <_mux_pins>;
> +  ddc-i2c-bus = <>;

Not documented. Is the i2c bus muxed too? If not, then this is in the
wrong place.

> +
> +  ports {
> +#address-cells = <1>;
> +#size-cells = <0>;
> +
> +port@0 { /* input */
> +  reg = <0>;
> +
> +  hdmi_mux_in: endpoint {
> +remote-endpoint = <_out>;
> +  };
> +};
> +
> +port@1 { /* output */
> +  reg = <1>;
> +
> +  #address-cells = <1>;
> +  #size-cells = <0>;
> +
> +  hdmi_mux_out_anx: endpoint@0 {
> +reg = <0>;
> +remote-endpoint = <_in>;
> +  };
> +
> +  hdmi_mux_out_hdmi: endpoint@1 {
> +reg = <1>;
> +remote-endpoint = <_connector_in>;
> +  };
> +};
> +  };
> +};
> --
> 2.24.0.525.g8f36a354ae-goog
>
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH RESEND 3/4] dt-bindings: drm/bridge: Add GPIO display mux binding

2019-12-11 Thread Hsin-Yi Wang
From: Nicolas Boichat 

Add bindings for Generic GPIO mux driver.

Signed-off-by: Nicolas Boichat 
Signed-off-by: Hsin-Yi Wang 
---
Change from RFC to v1:
- txt to yaml
---
 .../bindings/display/bridge/gpio-mux.yaml | 89 +++
 1 file changed, 89 insertions(+)
 create mode 100644 
Documentation/devicetree/bindings/display/bridge/gpio-mux.yaml

diff --git a/Documentation/devicetree/bindings/display/bridge/gpio-mux.yaml 
b/Documentation/devicetree/bindings/display/bridge/gpio-mux.yaml
new file mode 100644
index ..cef098749066
--- /dev/null
+++ b/Documentation/devicetree/bindings/display/bridge/gpio-mux.yaml
@@ -0,0 +1,89 @@
+# SPDX-License-Identifier: GPL-2.0
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/display/bridge/gpio-mux.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Generic display mux (1 input, 2 outputs)
+
+maintainers:
+  - Nicolas Boichat 
+
+description: |
+  This bindings describes a simple display (e.g. HDMI) mux, that has 1
+  input, and 2 outputs. The mux status is controlled by hardware, and
+  its status is read back using a GPIO.
+
+properties:
+  compatible:
+const: gpio-display-mux
+
+  detect-gpios:
+maxItems: 1
+description: GPIO that indicates the active output
+
+  ports:
+type: object
+
+properties:
+  port@0:
+type: object
+description: |
+  Video port for input.
+
+  port@1:
+type: object
+description: |
+  2 video ports for output.
+  The reg value in the endpoints matches the GPIO status: when
+  GPIO is asserted, endpoint with reg value <1> is selected.
+
+required:
+  - port@0
+  - port@1
+
+required:
+  - compatible
+  - detect-gpios
+  - ports
+
+examples:
+  - |
+hdmi_mux: hdmi_mux {
+  compatible = "gpio-display-mux";
+  status = "okay";
+  detect-gpios = < 36 GPIO_ACTIVE_HIGH>;
+  pinctrl-names = "default";
+  pinctrl-0 = <_mux_pins>;
+  ddc-i2c-bus = <>;
+
+  ports {
+#address-cells = <1>;
+#size-cells = <0>;
+
+port@0 { /* input */
+  reg = <0>;
+
+  hdmi_mux_in: endpoint {
+remote-endpoint = <_out>;
+  };
+};
+
+port@1 { /* output */
+  reg = <1>;
+
+  #address-cells = <1>;
+  #size-cells = <0>;
+
+  hdmi_mux_out_anx: endpoint@0 {
+reg = <0>;
+remote-endpoint = <_in>;
+  };
+
+  hdmi_mux_out_hdmi: endpoint@1 {
+reg = <1>;
+remote-endpoint = <_connector_in>;
+  };
+};
+  };
+};
-- 
2.24.0.525.g8f36a354ae-goog

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel