All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] drm/bridge: sii902x: add optional power supplies
@ 2018-04-10  5:19 ` Philippe Cornu
  0 siblings, 0 replies; 24+ messages in thread
From: Philippe Cornu @ 2018-04-10  5:19 UTC (permalink / raw)
  To: Archit Taneja, Andrzej Hajda, Laurent Pinchart, David Airlie,
	Rob Herring, Mark Rutland, dri-devel, devicetree, linux-kernel
  Cc: Yannick Fertre, Philippe Cornu, Benjamin Gaignard, Alexandre Torgue

This patchset adds the 3 optional power supplies to the sii902x
drm bridge driver.

Philippe Cornu (2):
  dt-bindings/display/bridge: sii902x: add optional power supplies
  drm/bridge: sii902x: add optional power supplies

 .../devicetree/bindings/display/bridge/sii902x.txt |  3 ++
 drivers/gpu/drm/bridge/sii902x.c                   | 39 +++++++++++++++++++---
 2 files changed, 38 insertions(+), 4 deletions(-)

-- 
2.15.1

^ permalink raw reply	[flat|nested] 24+ messages in thread

* [PATCH 0/2] drm/bridge: sii902x: add optional power supplies
@ 2018-04-10  5:19 ` Philippe Cornu
  0 siblings, 0 replies; 24+ messages in thread
From: Philippe Cornu @ 2018-04-10  5:19 UTC (permalink / raw)
  To: Archit Taneja, Andrzej Hajda, Laurent Pinchart, David Airlie,
	Rob Herring, Mark Rutland, dri-devel, devicetree, linux-kernel
  Cc: Yannick Fertre, Philippe Cornu, Alexandre Torgue

This patchset adds the 3 optional power supplies to the sii902x
drm bridge driver.

Philippe Cornu (2):
  dt-bindings/display/bridge: sii902x: add optional power supplies
  drm/bridge: sii902x: add optional power supplies

 .../devicetree/bindings/display/bridge/sii902x.txt |  3 ++
 drivers/gpu/drm/bridge/sii902x.c                   | 39 +++++++++++++++++++---
 2 files changed, 38 insertions(+), 4 deletions(-)

-- 
2.15.1

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

^ permalink raw reply	[flat|nested] 24+ messages in thread

* [PATCH 1/2] dt-bindings/display/bridge: sii902x: add optional power supplies
  2018-04-10  5:19 ` Philippe Cornu
@ 2018-04-10  5:19   ` Philippe Cornu
  -1 siblings, 0 replies; 24+ messages in thread
From: Philippe Cornu @ 2018-04-10  5:19 UTC (permalink / raw)
  To: Archit Taneja, Andrzej Hajda, Laurent Pinchart, David Airlie,
	Rob Herring, Mark Rutland, dri-devel, devicetree, linux-kernel
  Cc: Yannick Fertre, Philippe Cornu, Benjamin Gaignard, Alexandre Torgue

Add the 3 optional power supplies using the exact description
found in the document named
"SiI9022A/SiI9024A HDMI Transmitter Data Sheet (August 2016)".

Signed-off-by: Philippe Cornu <philippe.cornu@st.com>
---
 Documentation/devicetree/bindings/display/bridge/sii902x.txt | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/Documentation/devicetree/bindings/display/bridge/sii902x.txt b/Documentation/devicetree/bindings/display/bridge/sii902x.txt
index 56a3e68ccb80..cf53678fe574 100644
--- a/Documentation/devicetree/bindings/display/bridge/sii902x.txt
+++ b/Documentation/devicetree/bindings/display/bridge/sii902x.txt
@@ -8,6 +8,9 @@ Optional properties:
 	- interrupts-extended or interrupt-parent + interrupts: describe
 	  the interrupt line used to inform the host about hotplug events.
 	- reset-gpios: OF device-tree gpio specification for RST_N pin.
+	- iovcc-supply: I/O supply voltage (1.8V or 3.3V, host-dependent).
+	- avcc12-supply: TMDS analog supply voltage (1.2V).
+	- cvcc12-supply: Digital core supply voltage (1.2V).
 
 Optional subnodes:
 	- video input: this subnode can contain a video input port node
-- 
2.15.1

^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [PATCH 1/2] dt-bindings/display/bridge: sii902x: add optional power supplies
@ 2018-04-10  5:19   ` Philippe Cornu
  0 siblings, 0 replies; 24+ messages in thread
From: Philippe Cornu @ 2018-04-10  5:19 UTC (permalink / raw)
  To: Archit Taneja, Andrzej Hajda, Laurent Pinchart, David Airlie,
	Rob Herring, Mark Rutland, dri-devel, devicetree, linux-kernel
  Cc: Yannick Fertre, Philippe Cornu, Alexandre Torgue

Add the 3 optional power supplies using the exact description
found in the document named
"SiI9022A/SiI9024A HDMI Transmitter Data Sheet (August 2016)".

Signed-off-by: Philippe Cornu <philippe.cornu@st.com>
---
 Documentation/devicetree/bindings/display/bridge/sii902x.txt | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/Documentation/devicetree/bindings/display/bridge/sii902x.txt b/Documentation/devicetree/bindings/display/bridge/sii902x.txt
index 56a3e68ccb80..cf53678fe574 100644
--- a/Documentation/devicetree/bindings/display/bridge/sii902x.txt
+++ b/Documentation/devicetree/bindings/display/bridge/sii902x.txt
@@ -8,6 +8,9 @@ Optional properties:
 	- interrupts-extended or interrupt-parent + interrupts: describe
 	  the interrupt line used to inform the host about hotplug events.
 	- reset-gpios: OF device-tree gpio specification for RST_N pin.
+	- iovcc-supply: I/O supply voltage (1.8V or 3.3V, host-dependent).
+	- avcc12-supply: TMDS analog supply voltage (1.2V).
+	- cvcc12-supply: Digital core supply voltage (1.2V).
 
 Optional subnodes:
 	- video input: this subnode can contain a video input port node
-- 
2.15.1

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

^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [PATCH 2/2] drm/bridge: sii902x: add optional power supplies
  2018-04-10  5:19 ` Philippe Cornu
@ 2018-04-10  5:19   ` Philippe Cornu
  -1 siblings, 0 replies; 24+ messages in thread
From: Philippe Cornu @ 2018-04-10  5:19 UTC (permalink / raw)
  To: Archit Taneja, Andrzej Hajda, Laurent Pinchart, David Airlie,
	Rob Herring, Mark Rutland, dri-devel, devicetree, linux-kernel
  Cc: Yannick Fertre, Philippe Cornu, Benjamin Gaignard, Alexandre Torgue

Add the 3 optional power supplies using the exact description
found in the document named
"SiI9022A/SiI9024A HDMI Transmitter Data Sheet (August 2016)".

Signed-off-by: Philippe Cornu <philippe.cornu@st.com>
---
 drivers/gpu/drm/bridge/sii902x.c | 39 +++++++++++++++++++++++++++++++++++----
 1 file changed, 35 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/bridge/sii902x.c b/drivers/gpu/drm/bridge/sii902x.c
index 60373d7eb220..e17ba6db1ec8 100644
--- a/drivers/gpu/drm/bridge/sii902x.c
+++ b/drivers/gpu/drm/bridge/sii902x.c
@@ -24,6 +24,7 @@
 #include <linux/i2c.h>
 #include <linux/module.h>
 #include <linux/regmap.h>
+#include <linux/regulator/consumer.h>
 
 #include <drm/drmP.h>
 #include <drm/drm_atomic_helper.h>
@@ -86,6 +87,7 @@ struct sii902x {
 	struct drm_bridge bridge;
 	struct drm_connector connector;
 	struct gpio_desc *reset_gpio;
+	struct regulator_bulk_data supplies[3];
 };
 
 static inline struct sii902x *bridge_to_sii902x(struct drm_bridge *bridge)
@@ -392,23 +394,43 @@ static int sii902x_probe(struct i2c_client *client,
 		return PTR_ERR(sii902x->reset_gpio);
 	}
 
+	sii902x->supplies[0].supply = "iovcc";
+	sii902x->supplies[1].supply = "avcc12";
+	sii902x->supplies[2].supply = "cvcc12";
+	ret = devm_regulator_bulk_get(dev, ARRAY_SIZE(sii902x->supplies),
+				      sii902x->supplies);
+	if (ret) {
+		dev_err(dev, "regulator_bulk_get failed\n");
+		return ret;
+	}
+
+	ret = regulator_bulk_enable(ARRAY_SIZE(sii902x->supplies),
+				    sii902x->supplies);
+	if (ret) {
+		dev_err(dev, "regulator_bulk_enable failed\n");
+		return ret;
+	}
+
+	usleep_range(10000, 20000);
+
 	sii902x_reset(sii902x);
 
 	ret = regmap_write(sii902x->regmap, SII902X_REG_TPI_RQB, 0x0);
 	if (ret)
-		return ret;
+		goto err_disable_regulator;
 
 	ret = regmap_bulk_read(sii902x->regmap, SII902X_REG_CHIPID(0),
 			       &chipid, 4);
 	if (ret) {
 		dev_err(dev, "regmap_read failed %d\n", ret);
-		return ret;
+		goto err_disable_regulator;
 	}
 
 	if (chipid[0] != 0xb0) {
 		dev_err(dev, "Invalid chipid: %02x (expecting 0xb0)\n",
 			chipid[0]);
-		return -EINVAL;
+		ret = -EINVAL;
+		goto err_disable_regulator;
 	}
 
 	/* Clear all pending interrupts */
@@ -424,7 +446,7 @@ static int sii902x_probe(struct i2c_client *client,
 						IRQF_ONESHOT, dev_name(dev),
 						sii902x);
 		if (ret)
-			return ret;
+			goto err_disable_regulator;
 	}
 
 	sii902x->bridge.funcs = &sii902x_bridge_funcs;
@@ -434,6 +456,12 @@ static int sii902x_probe(struct i2c_client *client,
 	i2c_set_clientdata(client, sii902x);
 
 	return 0;
+
+err_disable_regulator:
+	regulator_bulk_disable(ARRAY_SIZE(sii902x->supplies),
+			       sii902x->supplies);
+
+	return ret;
 }
 
 static int sii902x_remove(struct i2c_client *client)
@@ -443,6 +471,9 @@ static int sii902x_remove(struct i2c_client *client)
 
 	drm_bridge_remove(&sii902x->bridge);
 
+	regulator_bulk_disable(ARRAY_SIZE(sii902x->supplies),
+			       sii902x->supplies);
+
 	return 0;
 }
 
-- 
2.15.1

^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [PATCH 2/2] drm/bridge: sii902x: add optional power supplies
@ 2018-04-10  5:19   ` Philippe Cornu
  0 siblings, 0 replies; 24+ messages in thread
From: Philippe Cornu @ 2018-04-10  5:19 UTC (permalink / raw)
  To: Archit Taneja, Andrzej Hajda, Laurent Pinchart, David Airlie,
	Rob Herring, Mark Rutland, dri-devel, devicetree, linux-kernel
  Cc: Yannick Fertre, Philippe Cornu, Alexandre Torgue

Add the 3 optional power supplies using the exact description
found in the document named
"SiI9022A/SiI9024A HDMI Transmitter Data Sheet (August 2016)".

Signed-off-by: Philippe Cornu <philippe.cornu@st.com>
---
 drivers/gpu/drm/bridge/sii902x.c | 39 +++++++++++++++++++++++++++++++++++----
 1 file changed, 35 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/bridge/sii902x.c b/drivers/gpu/drm/bridge/sii902x.c
index 60373d7eb220..e17ba6db1ec8 100644
--- a/drivers/gpu/drm/bridge/sii902x.c
+++ b/drivers/gpu/drm/bridge/sii902x.c
@@ -24,6 +24,7 @@
 #include <linux/i2c.h>
 #include <linux/module.h>
 #include <linux/regmap.h>
+#include <linux/regulator/consumer.h>
 
 #include <drm/drmP.h>
 #include <drm/drm_atomic_helper.h>
@@ -86,6 +87,7 @@ struct sii902x {
 	struct drm_bridge bridge;
 	struct drm_connector connector;
 	struct gpio_desc *reset_gpio;
+	struct regulator_bulk_data supplies[3];
 };
 
 static inline struct sii902x *bridge_to_sii902x(struct drm_bridge *bridge)
@@ -392,23 +394,43 @@ static int sii902x_probe(struct i2c_client *client,
 		return PTR_ERR(sii902x->reset_gpio);
 	}
 
+	sii902x->supplies[0].supply = "iovcc";
+	sii902x->supplies[1].supply = "avcc12";
+	sii902x->supplies[2].supply = "cvcc12";
+	ret = devm_regulator_bulk_get(dev, ARRAY_SIZE(sii902x->supplies),
+				      sii902x->supplies);
+	if (ret) {
+		dev_err(dev, "regulator_bulk_get failed\n");
+		return ret;
+	}
+
+	ret = regulator_bulk_enable(ARRAY_SIZE(sii902x->supplies),
+				    sii902x->supplies);
+	if (ret) {
+		dev_err(dev, "regulator_bulk_enable failed\n");
+		return ret;
+	}
+
+	usleep_range(10000, 20000);
+
 	sii902x_reset(sii902x);
 
 	ret = regmap_write(sii902x->regmap, SII902X_REG_TPI_RQB, 0x0);
 	if (ret)
-		return ret;
+		goto err_disable_regulator;
 
 	ret = regmap_bulk_read(sii902x->regmap, SII902X_REG_CHIPID(0),
 			       &chipid, 4);
 	if (ret) {
 		dev_err(dev, "regmap_read failed %d\n", ret);
-		return ret;
+		goto err_disable_regulator;
 	}
 
 	if (chipid[0] != 0xb0) {
 		dev_err(dev, "Invalid chipid: %02x (expecting 0xb0)\n",
 			chipid[0]);
-		return -EINVAL;
+		ret = -EINVAL;
+		goto err_disable_regulator;
 	}
 
 	/* Clear all pending interrupts */
@@ -424,7 +446,7 @@ static int sii902x_probe(struct i2c_client *client,
 						IRQF_ONESHOT, dev_name(dev),
 						sii902x);
 		if (ret)
-			return ret;
+			goto err_disable_regulator;
 	}
 
 	sii902x->bridge.funcs = &sii902x_bridge_funcs;
@@ -434,6 +456,12 @@ static int sii902x_probe(struct i2c_client *client,
 	i2c_set_clientdata(client, sii902x);
 
 	return 0;
+
+err_disable_regulator:
+	regulator_bulk_disable(ARRAY_SIZE(sii902x->supplies),
+			       sii902x->supplies);
+
+	return ret;
 }
 
 static int sii902x_remove(struct i2c_client *client)
@@ -443,6 +471,9 @@ static int sii902x_remove(struct i2c_client *client)
 
 	drm_bridge_remove(&sii902x->bridge);
 
+	regulator_bulk_disable(ARRAY_SIZE(sii902x->supplies),
+			       sii902x->supplies);
+
 	return 0;
 }
 
-- 
2.15.1

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

^ permalink raw reply related	[flat|nested] 24+ messages in thread

* Re: [PATCH 1/2] dt-bindings/display/bridge: sii902x: add optional power supplies
  2018-04-10  5:19   ` Philippe Cornu
@ 2018-04-13 17:58     ` Rob Herring
  -1 siblings, 0 replies; 24+ messages in thread
From: Rob Herring @ 2018-04-13 17:58 UTC (permalink / raw)
  To: Philippe Cornu
  Cc: Archit Taneja, Andrzej Hajda, Laurent Pinchart, David Airlie,
	Mark Rutland, dri-devel, devicetree, linux-kernel,
	Yannick Fertre, Benjamin Gaignard, Alexandre Torgue

On Tue, Apr 10, 2018 at 07:19:26AM +0200, Philippe Cornu wrote:
> Add the 3 optional power supplies using the exact description
> found in the document named
> "SiI9022A/SiI9024A HDMI Transmitter Data Sheet (August 2016)".
> 
> Signed-off-by: Philippe Cornu <philippe.cornu@st.com>
> ---
>  Documentation/devicetree/bindings/display/bridge/sii902x.txt | 3 +++
>  1 file changed, 3 insertions(+)

Reviewed-by: Rob Herring <robh@kernel.org>

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH 1/2] dt-bindings/display/bridge: sii902x: add optional power supplies
@ 2018-04-13 17:58     ` Rob Herring
  0 siblings, 0 replies; 24+ messages in thread
From: Rob Herring @ 2018-04-13 17:58 UTC (permalink / raw)
  To: Philippe Cornu
  Cc: Mark Rutland, devicetree, Alexandre Torgue, David Airlie,
	linux-kernel, dri-devel, Yannick Fertre, Laurent Pinchart

On Tue, Apr 10, 2018 at 07:19:26AM +0200, Philippe Cornu wrote:
> Add the 3 optional power supplies using the exact description
> found in the document named
> "SiI9022A/SiI9024A HDMI Transmitter Data Sheet (August 2016)".
> 
> Signed-off-by: Philippe Cornu <philippe.cornu@st.com>
> ---
>  Documentation/devicetree/bindings/display/bridge/sii902x.txt | 3 +++
>  1 file changed, 3 insertions(+)

Reviewed-by: Rob Herring <robh@kernel.org>

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

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH 2/2] drm/bridge: sii902x: add optional power supplies
  2018-04-10  5:19   ` Philippe Cornu
  (?)
@ 2018-04-16  9:20   ` Yannick FERTRE
  -1 siblings, 0 replies; 24+ messages in thread
From: Yannick FERTRE @ 2018-04-16  9:20 UTC (permalink / raw)
  To: Philippe CORNU, Archit Taneja, Andrzej Hajda, Laurent Pinchart,
	David Airlie, Rob Herring, Mark Rutland, dri-devel, devicetree,
	linux-kernel
  Cc: Alexandre TORGUE


[-- Attachment #1.1: Type: text/plain, Size: 3879 bytes --]

Reviewed-by: yannick fertre <yannick.fertre@st.com><mailto:yannick.fertre@st.com>

On 04/10/2018 07:19 AM, Philippe Cornu wrote:

Add the 3 optional power supplies using the exact description
found in the document named
"SiI9022A/SiI9024A HDMI Transmitter Data Sheet (August 2016)".

Signed-off-by: Philippe Cornu <philippe.cornu@st.com><mailto:philippe.cornu@st.com>
---
 drivers/gpu/drm/bridge/sii902x.c | 39 +++++++++++++++++++++++++++++++++++----
 1 file changed, 35 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/bridge/sii902x.c b/drivers/gpu/drm/bridge/sii902x.c
index 60373d7eb220..e17ba6db1ec8 100644
--- a/drivers/gpu/drm/bridge/sii902x.c
+++ b/drivers/gpu/drm/bridge/sii902x.c
@@ -24,6 +24,7 @@
 #include <linux/i2c.h>
 #include <linux/module.h>
 #include <linux/regmap.h>
+#include <linux/regulator/consumer.h>

 #include <drm/drmP.h>
 #include <drm/drm_atomic_helper.h>
@@ -86,6 +87,7 @@ struct sii902x {
        struct drm_bridge bridge;
        struct drm_connector connector;
        struct gpio_desc *reset_gpio;
+       struct regulator_bulk_data supplies[3];
 };

 static inline struct sii902x *bridge_to_sii902x(struct drm_bridge *bridge)
@@ -392,23 +394,43 @@ static int sii902x_probe(struct i2c_client *client,
                return PTR_ERR(sii902x->reset_gpio);
        }

+       sii902x->supplies[0].supply = "iovcc";
+       sii902x->supplies[1].supply = "avcc12";
+       sii902x->supplies[2].supply = "cvcc12";
+       ret = devm_regulator_bulk_get(dev, ARRAY_SIZE(sii902x->supplies),
+                                     sii902x->supplies);
+       if (ret) {
+               dev_err(dev, "regulator_bulk_get failed\n");
+               return ret;
+       }
+
+       ret = regulator_bulk_enable(ARRAY_SIZE(sii902x->supplies),
+                                   sii902x->supplies);
+       if (ret) {
+               dev_err(dev, "regulator_bulk_enable failed\n");
+               return ret;
+       }
+
+       usleep_range(10000, 20000);
+
        sii902x_reset(sii902x);

        ret = regmap_write(sii902x->regmap, SII902X_REG_TPI_RQB, 0x0);
        if (ret)
-               return ret;
+               goto err_disable_regulator;

        ret = regmap_bulk_read(sii902x->regmap, SII902X_REG_CHIPID(0),
                               &chipid, 4);
        if (ret) {
                dev_err(dev, "regmap_read failed %d\n", ret);
-               return ret;
+               goto err_disable_regulator;
        }

        if (chipid[0] != 0xb0) {
                dev_err(dev, "Invalid chipid: %02x (expecting 0xb0)\n",
                        chipid[0]);
-               return -EINVAL;
+               ret = -EINVAL;
+               goto err_disable_regulator;
        }

        /* Clear all pending interrupts */
@@ -424,7 +446,7 @@ static int sii902x_probe(struct i2c_client *client,
                                                IRQF_ONESHOT, dev_name(dev),
                                                sii902x);
                if (ret)
-                       return ret;
+                       goto err_disable_regulator;
        }

        sii902x->bridge.funcs = &sii902x_bridge_funcs;
@@ -434,6 +456,12 @@ static int sii902x_probe(struct i2c_client *client,
        i2c_set_clientdata(client, sii902x);

        return 0;
+
+err_disable_regulator:
+       regulator_bulk_disable(ARRAY_SIZE(sii902x->supplies),
+                              sii902x->supplies);
+
+       return ret;
 }

 static int sii902x_remove(struct i2c_client *client)
@@ -443,6 +471,9 @@ static int sii902x_remove(struct i2c_client *client)

        drm_bridge_remove(&sii902x->bridge);

+       regulator_bulk_disable(ARRAY_SIZE(sii902x->supplies),
+                              sii902x->supplies);
+
        return 0;
 }




[-- Attachment #1.2: Type: text/html, Size: 4266 bytes --]

[-- Attachment #2: Type: text/plain, Size: 160 bytes --]

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

^ permalink raw reply related	[flat|nested] 24+ messages in thread

* Re: [PATCH 1/2] dt-bindings/display/bridge: sii902x: add optional power supplies
  2018-04-10  5:19   ` Philippe Cornu
@ 2018-04-19  8:11     ` Laurent Pinchart
  -1 siblings, 0 replies; 24+ messages in thread
From: Laurent Pinchart @ 2018-04-19  8:11 UTC (permalink / raw)
  To: Philippe Cornu
  Cc: Archit Taneja, Andrzej Hajda, David Airlie, Rob Herring,
	Mark Rutland, dri-devel, devicetree, linux-kernel,
	Yannick Fertre, Benjamin Gaignard, Alexandre Torgue

Hi Philippe,

Thank you for the patch.

On Tuesday, 10 April 2018 08:19:26 EEST Philippe Cornu wrote:
> Add the 3 optional power supplies using the exact description
> found in the document named
> "SiI9022A/SiI9024A HDMI Transmitter Data Sheet (August 2016)".
> 
> Signed-off-by: Philippe Cornu <philippe.cornu@st.com>
> ---
>  Documentation/devicetree/bindings/display/bridge/sii902x.txt | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/display/bridge/sii902x.txt
> b/Documentation/devicetree/bindings/display/bridge/sii902x.txt index
> 56a3e68ccb80..cf53678fe574 100644
> --- a/Documentation/devicetree/bindings/display/bridge/sii902x.txt
> +++ b/Documentation/devicetree/bindings/display/bridge/sii902x.txt
> @@ -8,6 +8,9 @@ Optional properties:
>  	- interrupts-extended or interrupt-parent + interrupts: describe
>  	  the interrupt line used to inform the host about hotplug events.
>  	- reset-gpios: OF device-tree gpio specification for RST_N pin.
> +	- iovcc-supply: I/O supply voltage (1.8V or 3.3V, host-dependent).
> +	- avcc12-supply: TMDS analog supply voltage (1.2V).
> +	- cvcc12-supply: Digital core supply voltage (1.2V).

It seems that the AVCC12 and CVCC12 power supplies are usually derived from 
the same source. How about starting with one DT property for both, and adding 
a second one later if needed ?

>  Optional subnodes:
>  	- video input: this subnode can contain a video input port node

-- 
Regards,

Laurent Pinchart

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH 1/2] dt-bindings/display/bridge: sii902x: add optional power supplies
@ 2018-04-19  8:11     ` Laurent Pinchart
  0 siblings, 0 replies; 24+ messages in thread
From: Laurent Pinchart @ 2018-04-19  8:11 UTC (permalink / raw)
  To: Philippe Cornu
  Cc: Mark Rutland, devicetree, Alexandre Torgue, David Airlie,
	linux-kernel, dri-devel, Yannick Fertre, Rob Herring

Hi Philippe,

Thank you for the patch.

On Tuesday, 10 April 2018 08:19:26 EEST Philippe Cornu wrote:
> Add the 3 optional power supplies using the exact description
> found in the document named
> "SiI9022A/SiI9024A HDMI Transmitter Data Sheet (August 2016)".
> 
> Signed-off-by: Philippe Cornu <philippe.cornu@st.com>
> ---
>  Documentation/devicetree/bindings/display/bridge/sii902x.txt | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/display/bridge/sii902x.txt
> b/Documentation/devicetree/bindings/display/bridge/sii902x.txt index
> 56a3e68ccb80..cf53678fe574 100644
> --- a/Documentation/devicetree/bindings/display/bridge/sii902x.txt
> +++ b/Documentation/devicetree/bindings/display/bridge/sii902x.txt
> @@ -8,6 +8,9 @@ Optional properties:
>  	- interrupts-extended or interrupt-parent + interrupts: describe
>  	  the interrupt line used to inform the host about hotplug events.
>  	- reset-gpios: OF device-tree gpio specification for RST_N pin.
> +	- iovcc-supply: I/O supply voltage (1.8V or 3.3V, host-dependent).
> +	- avcc12-supply: TMDS analog supply voltage (1.2V).
> +	- cvcc12-supply: Digital core supply voltage (1.2V).

It seems that the AVCC12 and CVCC12 power supplies are usually derived from 
the same source. How about starting with one DT property for both, and adding 
a second one later if needed ?

>  Optional subnodes:
>  	- video input: this subnode can contain a video input port node

-- 
Regards,

Laurent Pinchart



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

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH 2/2] drm/bridge: sii902x: add optional power supplies
  2018-04-10  5:19   ` Philippe Cornu
@ 2018-04-19  8:20     ` Laurent Pinchart
  -1 siblings, 0 replies; 24+ messages in thread
From: Laurent Pinchart @ 2018-04-19  8:20 UTC (permalink / raw)
  To: Philippe Cornu
  Cc: Archit Taneja, Andrzej Hajda, David Airlie, Rob Herring,
	Mark Rutland, dri-devel, devicetree, linux-kernel,
	Yannick Fertre, Benjamin Gaignard, Alexandre Torgue

Hi Philippe,

Thank you for the patch.

On Tuesday, 10 April 2018 08:19:27 EEST Philippe Cornu wrote:
> Add the 3 optional power supplies using the exact description
> found in the document named
> "SiI9022A/SiI9024A HDMI Transmitter Data Sheet (August 2016)".
> 
> Signed-off-by: Philippe Cornu <philippe.cornu@st.com>
> ---
> drivers/gpu/drm/bridge/sii902x.c | 39 +++++++++++++++++++++++++++++++++----
> 1 file changed, 35 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/gpu/drm/bridge/sii902x.c
> b/drivers/gpu/drm/bridge/sii902x.c index 60373d7eb220..e17ba6db1ec8 100644
> --- a/drivers/gpu/drm/bridge/sii902x.c
> +++ b/drivers/gpu/drm/bridge/sii902x.c
> @@ -24,6 +24,7 @@
>  #include <linux/i2c.h>
>  #include <linux/module.h>
>  #include <linux/regmap.h>
> +#include <linux/regulator/consumer.h>
> 
>  #include <drm/drmP.h>
>  #include <drm/drm_atomic_helper.h>
> @@ -86,6 +87,7 @@ struct sii902x {
>  	struct drm_bridge bridge;
>  	struct drm_connector connector;
>  	struct gpio_desc *reset_gpio;
> +	struct regulator_bulk_data supplies[3];
>  };
> 
>  static inline struct sii902x *bridge_to_sii902x(struct drm_bridge *bridge)
> @@ -392,23 +394,43 @@ static int sii902x_probe(struct i2c_client *client,
>  		return PTR_ERR(sii902x->reset_gpio);
>  	}
> 
> +	sii902x->supplies[0].supply = "iovcc";
> +	sii902x->supplies[1].supply = "avcc12";
> +	sii902x->supplies[2].supply = "cvcc12";
> +	ret = devm_regulator_bulk_get(dev, ARRAY_SIZE(sii902x->supplies),
> +				      sii902x->supplies);
> +	if (ret) {
> +		dev_err(dev, "regulator_bulk_get failed\n");

Maybe "failed to get power supplies" to be a bit more explicit ? And while at 
it, printing the value of ret too ?

> +		return ret;
> +	}
> +
> +	ret = regulator_bulk_enable(ARRAY_SIZE(sii902x->supplies),
> +				    sii902x->supplies);
> +	if (ret) {
> +		dev_err(dev, "regulator_bulk_enable failed\n");

Same here ?

> +		return ret;
> +	}
> +
> +	usleep_range(10000, 20000);
> +
>  	sii902x_reset(sii902x);
> 
>  	ret = regmap_write(sii902x->regmap, SII902X_REG_TPI_RQB, 0x0);
>  	if (ret)
> -		return ret;
> +		goto err_disable_regulator;
> 
>  	ret = regmap_bulk_read(sii902x->regmap, SII902X_REG_CHIPID(0),
>  			       &chipid, 4);
>  	if (ret) {
>  		dev_err(dev, "regmap_read failed %d\n", ret);
> -		return ret;
> +		goto err_disable_regulator;
>  	}
> 
>  	if (chipid[0] != 0xb0) {
>  		dev_err(dev, "Invalid chipid: %02x (expecting 0xb0)\n",
>  			chipid[0]);
> -		return -EINVAL;
> +		ret = -EINVAL;
> +		goto err_disable_regulator;
>  	}
> 
>  	/* Clear all pending interrupts */
> @@ -424,7 +446,7 @@ static int sii902x_probe(struct i2c_client *client,
>  						IRQF_ONESHOT, dev_name(dev),
>  						sii902x);
>  		if (ret)
> -			return ret;
> +			goto err_disable_regulator;
>  	}
> 
>  	sii902x->bridge.funcs = &sii902x_bridge_funcs;
> @@ -434,6 +456,12 @@ static int sii902x_probe(struct i2c_client *client,
>  	i2c_set_clientdata(client, sii902x);
> 
>  	return 0;
> +
> +err_disable_regulator:
> +	regulator_bulk_disable(ARRAY_SIZE(sii902x->supplies),
> +			       sii902x->supplies);
> +
> +	return ret;
>  }
> 
>  static int sii902x_remove(struct i2c_client *client)
> @@ -443,6 +471,9 @@ static int sii902x_remove(struct i2c_client *client)
> 
>  	drm_bridge_remove(&sii902x->bridge);
> 
> +	regulator_bulk_disable(ARRAY_SIZE(sii902x->supplies),
> +			       sii902x->supplies);
> +

While this seems functionally correct, would it be useful to only enable power 
supplies when needed to save power ?

>  	return 0;
>  }

-- 
Regards,

Laurent Pinchart

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH 2/2] drm/bridge: sii902x: add optional power supplies
@ 2018-04-19  8:20     ` Laurent Pinchart
  0 siblings, 0 replies; 24+ messages in thread
From: Laurent Pinchart @ 2018-04-19  8:20 UTC (permalink / raw)
  To: Philippe Cornu
  Cc: Mark Rutland, devicetree, Alexandre Torgue, David Airlie,
	linux-kernel, dri-devel, Yannick Fertre, Rob Herring

Hi Philippe,

Thank you for the patch.

On Tuesday, 10 April 2018 08:19:27 EEST Philippe Cornu wrote:
> Add the 3 optional power supplies using the exact description
> found in the document named
> "SiI9022A/SiI9024A HDMI Transmitter Data Sheet (August 2016)".
> 
> Signed-off-by: Philippe Cornu <philippe.cornu@st.com>
> ---
> drivers/gpu/drm/bridge/sii902x.c | 39 +++++++++++++++++++++++++++++++++----
> 1 file changed, 35 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/gpu/drm/bridge/sii902x.c
> b/drivers/gpu/drm/bridge/sii902x.c index 60373d7eb220..e17ba6db1ec8 100644
> --- a/drivers/gpu/drm/bridge/sii902x.c
> +++ b/drivers/gpu/drm/bridge/sii902x.c
> @@ -24,6 +24,7 @@
>  #include <linux/i2c.h>
>  #include <linux/module.h>
>  #include <linux/regmap.h>
> +#include <linux/regulator/consumer.h>
> 
>  #include <drm/drmP.h>
>  #include <drm/drm_atomic_helper.h>
> @@ -86,6 +87,7 @@ struct sii902x {
>  	struct drm_bridge bridge;
>  	struct drm_connector connector;
>  	struct gpio_desc *reset_gpio;
> +	struct regulator_bulk_data supplies[3];
>  };
> 
>  static inline struct sii902x *bridge_to_sii902x(struct drm_bridge *bridge)
> @@ -392,23 +394,43 @@ static int sii902x_probe(struct i2c_client *client,
>  		return PTR_ERR(sii902x->reset_gpio);
>  	}
> 
> +	sii902x->supplies[0].supply = "iovcc";
> +	sii902x->supplies[1].supply = "avcc12";
> +	sii902x->supplies[2].supply = "cvcc12";
> +	ret = devm_regulator_bulk_get(dev, ARRAY_SIZE(sii902x->supplies),
> +				      sii902x->supplies);
> +	if (ret) {
> +		dev_err(dev, "regulator_bulk_get failed\n");

Maybe "failed to get power supplies" to be a bit more explicit ? And while at 
it, printing the value of ret too ?

> +		return ret;
> +	}
> +
> +	ret = regulator_bulk_enable(ARRAY_SIZE(sii902x->supplies),
> +				    sii902x->supplies);
> +	if (ret) {
> +		dev_err(dev, "regulator_bulk_enable failed\n");

Same here ?

> +		return ret;
> +	}
> +
> +	usleep_range(10000, 20000);
> +
>  	sii902x_reset(sii902x);
> 
>  	ret = regmap_write(sii902x->regmap, SII902X_REG_TPI_RQB, 0x0);
>  	if (ret)
> -		return ret;
> +		goto err_disable_regulator;
> 
>  	ret = regmap_bulk_read(sii902x->regmap, SII902X_REG_CHIPID(0),
>  			       &chipid, 4);
>  	if (ret) {
>  		dev_err(dev, "regmap_read failed %d\n", ret);
> -		return ret;
> +		goto err_disable_regulator;
>  	}
> 
>  	if (chipid[0] != 0xb0) {
>  		dev_err(dev, "Invalid chipid: %02x (expecting 0xb0)\n",
>  			chipid[0]);
> -		return -EINVAL;
> +		ret = -EINVAL;
> +		goto err_disable_regulator;
>  	}
> 
>  	/* Clear all pending interrupts */
> @@ -424,7 +446,7 @@ static int sii902x_probe(struct i2c_client *client,
>  						IRQF_ONESHOT, dev_name(dev),
>  						sii902x);
>  		if (ret)
> -			return ret;
> +			goto err_disable_regulator;
>  	}
> 
>  	sii902x->bridge.funcs = &sii902x_bridge_funcs;
> @@ -434,6 +456,12 @@ static int sii902x_probe(struct i2c_client *client,
>  	i2c_set_clientdata(client, sii902x);
> 
>  	return 0;
> +
> +err_disable_regulator:
> +	regulator_bulk_disable(ARRAY_SIZE(sii902x->supplies),
> +			       sii902x->supplies);
> +
> +	return ret;
>  }
> 
>  static int sii902x_remove(struct i2c_client *client)
> @@ -443,6 +471,9 @@ static int sii902x_remove(struct i2c_client *client)
> 
>  	drm_bridge_remove(&sii902x->bridge);
> 
> +	regulator_bulk_disable(ARRAY_SIZE(sii902x->supplies),
> +			       sii902x->supplies);
> +

While this seems functionally correct, would it be useful to only enable power 
supplies when needed to save power ?

>  	return 0;
>  }

-- 
Regards,

Laurent Pinchart



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

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH 1/2] dt-bindings/display/bridge: sii902x: add optional power supplies
  2018-04-19  8:11     ` Laurent Pinchart
@ 2018-04-19  9:31       ` Philippe CORNU
  -1 siblings, 0 replies; 24+ messages in thread
From: Philippe CORNU @ 2018-04-19  9:31 UTC (permalink / raw)
  To: Laurent Pinchart
  Cc: Archit Taneja, Andrzej Hajda, David Airlie, Rob Herring,
	Mark Rutland, dri-devel, devicetree, linux-kernel,
	Yannick FERTRE, Benjamin Gaignard, Alexandre TORGUE

Hi Laurent : )

On 04/19/2018 10:11 AM, Laurent Pinchart wrote:
> Hi Philippe,
> 
> Thank you for the patch.
> 
> On Tuesday, 10 April 2018 08:19:26 EEST Philippe Cornu wrote:
>> Add the 3 optional power supplies using the exact description
>> found in the document named
>> "SiI9022A/SiI9024A HDMI Transmitter Data Sheet (August 2016)".
>>
>> Signed-off-by: Philippe Cornu <philippe.cornu@st.com>
>> ---
>>   Documentation/devicetree/bindings/display/bridge/sii902x.txt | 3 +++
>>   1 file changed, 3 insertions(+)
>>
>> diff --git a/Documentation/devicetree/bindings/display/bridge/sii902x.txt
>> b/Documentation/devicetree/bindings/display/bridge/sii902x.txt index
>> 56a3e68ccb80..cf53678fe574 100644
>> --- a/Documentation/devicetree/bindings/display/bridge/sii902x.txt
>> +++ b/Documentation/devicetree/bindings/display/bridge/sii902x.txt
>> @@ -8,6 +8,9 @@ Optional properties:
>>   	- interrupts-extended or interrupt-parent + interrupts: describe
>>   	  the interrupt line used to inform the host about hotplug events.
>>   	- reset-gpios: OF device-tree gpio specification for RST_N pin.
>> +	- iovcc-supply: I/O supply voltage (1.8V or 3.3V, host-dependent).
>> +	- avcc12-supply: TMDS analog supply voltage (1.2V).
>> +	- cvcc12-supply: Digital core supply voltage (1.2V).
> 
> It seems that the AVCC12 and CVCC12 power supplies are usually derived from
> the same source. How about starting with one DT property for both, and adding
> a second one later if needed ?
> 

Well, I do not know what is the best. Here I took the description from 
the documentation, and to allow all possible board configurations, I 
added these supplies as "optional" properties: if there is only one 1v2 
regulator on the board, the dt will contain only avcc12 or cvcc12 and 
everything will work fine (we will have a dummy regulator for the 
missing optional 1v2 reg), if both regulators are there for any reasons 
(stability, noise, whatever...) then both entries will be in the dt.

If you confirm you prefer a single 1v2 supply (named for instance 
"vcc12-supply") then I will do :-)

Many thanks,
Philippe


>>   Optional subnodes:
>>   	- video input: this subnode can contain a video input port node
> 

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH 1/2] dt-bindings/display/bridge: sii902x: add optional power supplies
@ 2018-04-19  9:31       ` Philippe CORNU
  0 siblings, 0 replies; 24+ messages in thread
From: Philippe CORNU @ 2018-04-19  9:31 UTC (permalink / raw)
  To: Laurent Pinchart
  Cc: Mark Rutland, devicetree, Alexandre TORGUE, David Airlie,
	linux-kernel, dri-devel, Yannick FERTRE, Rob Herring

Hi Laurent : )

On 04/19/2018 10:11 AM, Laurent Pinchart wrote:
> Hi Philippe,
> 
> Thank you for the patch.
> 
> On Tuesday, 10 April 2018 08:19:26 EEST Philippe Cornu wrote:
>> Add the 3 optional power supplies using the exact description
>> found in the document named
>> "SiI9022A/SiI9024A HDMI Transmitter Data Sheet (August 2016)".
>>
>> Signed-off-by: Philippe Cornu <philippe.cornu@st.com>
>> ---
>>   Documentation/devicetree/bindings/display/bridge/sii902x.txt | 3 +++
>>   1 file changed, 3 insertions(+)
>>
>> diff --git a/Documentation/devicetree/bindings/display/bridge/sii902x.txt
>> b/Documentation/devicetree/bindings/display/bridge/sii902x.txt index
>> 56a3e68ccb80..cf53678fe574 100644
>> --- a/Documentation/devicetree/bindings/display/bridge/sii902x.txt
>> +++ b/Documentation/devicetree/bindings/display/bridge/sii902x.txt
>> @@ -8,6 +8,9 @@ Optional properties:
>>   	- interrupts-extended or interrupt-parent + interrupts: describe
>>   	  the interrupt line used to inform the host about hotplug events.
>>   	- reset-gpios: OF device-tree gpio specification for RST_N pin.
>> +	- iovcc-supply: I/O supply voltage (1.8V or 3.3V, host-dependent).
>> +	- avcc12-supply: TMDS analog supply voltage (1.2V).
>> +	- cvcc12-supply: Digital core supply voltage (1.2V).
> 
> It seems that the AVCC12 and CVCC12 power supplies are usually derived from
> the same source. How about starting with one DT property for both, and adding
> a second one later if needed ?
> 

Well, I do not know what is the best. Here I took the description from 
the documentation, and to allow all possible board configurations, I 
added these supplies as "optional" properties: if there is only one 1v2 
regulator on the board, the dt will contain only avcc12 or cvcc12 and 
everything will work fine (we will have a dummy regulator for the 
missing optional 1v2 reg), if both regulators are there for any reasons 
(stability, noise, whatever...) then both entries will be in the dt.

If you confirm you prefer a single 1v2 supply (named for instance 
"vcc12-supply") then I will do :-)

Many thanks,
Philippe


>>   Optional subnodes:
>>   	- video input: this subnode can contain a video input port node
> 
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH 2/2] drm/bridge: sii902x: add optional power supplies
  2018-04-19  8:20     ` Laurent Pinchart
@ 2018-04-19  9:46       ` Philippe CORNU
  -1 siblings, 0 replies; 24+ messages in thread
From: Philippe CORNU @ 2018-04-19  9:46 UTC (permalink / raw)
  To: Laurent Pinchart
  Cc: Archit Taneja, Andrzej Hajda, David Airlie, Rob Herring,
	Mark Rutland, dri-devel, devicetree, linux-kernel,
	Yannick FERTRE, Benjamin Gaignard, Alexandre TORGUE

Hi Laurent :-)

On 04/19/2018 10:20 AM, Laurent Pinchart wrote:
> Hi Philippe,
> 
> Thank you for the patch.
> 
> On Tuesday, 10 April 2018 08:19:27 EEST Philippe Cornu wrote:
>> Add the 3 optional power supplies using the exact description
>> found in the document named
>> "SiI9022A/SiI9024A HDMI Transmitter Data Sheet (August 2016)".
>>
>> Signed-off-by: Philippe Cornu <philippe.cornu@st.com>
>> ---
>> drivers/gpu/drm/bridge/sii902x.c | 39 +++++++++++++++++++++++++++++++++----
>> 1 file changed, 35 insertions(+), 4 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/bridge/sii902x.c
>> b/drivers/gpu/drm/bridge/sii902x.c index 60373d7eb220..e17ba6db1ec8 100644
>> --- a/drivers/gpu/drm/bridge/sii902x.c
>> +++ b/drivers/gpu/drm/bridge/sii902x.c
>> @@ -24,6 +24,7 @@
>>   #include <linux/i2c.h>
>>   #include <linux/module.h>
>>   #include <linux/regmap.h>
>> +#include <linux/regulator/consumer.h>
>>
>>   #include <drm/drmP.h>
>>   #include <drm/drm_atomic_helper.h>
>> @@ -86,6 +87,7 @@ struct sii902x {
>>   	struct drm_bridge bridge;
>>   	struct drm_connector connector;
>>   	struct gpio_desc *reset_gpio;
>> +	struct regulator_bulk_data supplies[3];
>>   };
>>
>>   static inline struct sii902x *bridge_to_sii902x(struct drm_bridge *bridge)
>> @@ -392,23 +394,43 @@ static int sii902x_probe(struct i2c_client *client,
>>   		return PTR_ERR(sii902x->reset_gpio);
>>   	}
>>
>> +	sii902x->supplies[0].supply = "iovcc";
>> +	sii902x->supplies[1].supply = "avcc12";
>> +	sii902x->supplies[2].supply = "cvcc12";
>> +	ret = devm_regulator_bulk_get(dev, ARRAY_SIZE(sii902x->supplies),
>> +				      sii902x->supplies);
>> +	if (ret) {
>> +		dev_err(dev, "regulator_bulk_get failed\n");
> 
> Maybe "failed to get power supplies" to be a bit more explicit ? And while at
> it, printing the value of ret too ?
> 

good point, I will do that in v2


>> +		return ret;
>> +	}
>> +
>> +	ret = regulator_bulk_enable(ARRAY_SIZE(sii902x->supplies),
>> +				    sii902x->supplies);
>> +	if (ret) {
>> +		dev_err(dev, "regulator_bulk_enable failed\n");
> 
> Same here ?
> 

agreed

>> +		return ret;
>> +	}
>> +
>> +	usleep_range(10000, 20000);
>> +
>>   	sii902x_reset(sii902x);
>>
>>   	ret = regmap_write(sii902x->regmap, SII902X_REG_TPI_RQB, 0x0);
>>   	if (ret)
>> -		return ret;
>> +		goto err_disable_regulator;
>>
>>   	ret = regmap_bulk_read(sii902x->regmap, SII902X_REG_CHIPID(0),
>>   			       &chipid, 4);
>>   	if (ret) {
>>   		dev_err(dev, "regmap_read failed %d\n", ret);
>> -		return ret;
>> +		goto err_disable_regulator;
>>   	}
>>
>>   	if (chipid[0] != 0xb0) {
>>   		dev_err(dev, "Invalid chipid: %02x (expecting 0xb0)\n",
>>   			chipid[0]);
>> -		return -EINVAL;
>> +		ret = -EINVAL;
>> +		goto err_disable_regulator;
>>   	}
>>
>>   	/* Clear all pending interrupts */
>> @@ -424,7 +446,7 @@ static int sii902x_probe(struct i2c_client *client,
>>   						IRQF_ONESHOT, dev_name(dev),
>>   						sii902x);
>>   		if (ret)
>> -			return ret;
>> +			goto err_disable_regulator;
>>   	}
>>
>>   	sii902x->bridge.funcs = &sii902x_bridge_funcs;
>> @@ -434,6 +456,12 @@ static int sii902x_probe(struct i2c_client *client,
>>   	i2c_set_clientdata(client, sii902x);
>>
>>   	return 0;
>> +
>> +err_disable_regulator:
>> +	regulator_bulk_disable(ARRAY_SIZE(sii902x->supplies),
>> +			       sii902x->supplies);
>> +
>> +	return ret;
>>   }
>>
>>   static int sii902x_remove(struct i2c_client *client)
>> @@ -443,6 +471,9 @@ static int sii902x_remove(struct i2c_client *client)
>>
>>   	drm_bridge_remove(&sii902x->bridge);
>>
>> +	regulator_bulk_disable(ARRAY_SIZE(sii902x->supplies),
>> +			       sii902x->supplies);
>> +
> 
> While this seems functionally correct, would it be useful to only enable power
> supplies when needed to save power ?
> 

that is a good point. I do not know well (yet) this bridge. Maybe I can 
add a 3rd patch with bridge pre_enable() and post_disable() containing 
reset & supplies management. Or I can put reset&supplies in bridge 
enable() & disable() but it could be a little messy.

Any opinion/advice?
Many thanks,
Philippe :-)

>>   	return 0;
>>   }
> 

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH 2/2] drm/bridge: sii902x: add optional power supplies
@ 2018-04-19  9:46       ` Philippe CORNU
  0 siblings, 0 replies; 24+ messages in thread
From: Philippe CORNU @ 2018-04-19  9:46 UTC (permalink / raw)
  To: Laurent Pinchart
  Cc: Mark Rutland, devicetree, Alexandre TORGUE, David Airlie,
	linux-kernel, dri-devel, Yannick FERTRE, Rob Herring

Hi Laurent :-)

On 04/19/2018 10:20 AM, Laurent Pinchart wrote:
> Hi Philippe,
> 
> Thank you for the patch.
> 
> On Tuesday, 10 April 2018 08:19:27 EEST Philippe Cornu wrote:
>> Add the 3 optional power supplies using the exact description
>> found in the document named
>> "SiI9022A/SiI9024A HDMI Transmitter Data Sheet (August 2016)".
>>
>> Signed-off-by: Philippe Cornu <philippe.cornu@st.com>
>> ---
>> drivers/gpu/drm/bridge/sii902x.c | 39 +++++++++++++++++++++++++++++++++----
>> 1 file changed, 35 insertions(+), 4 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/bridge/sii902x.c
>> b/drivers/gpu/drm/bridge/sii902x.c index 60373d7eb220..e17ba6db1ec8 100644
>> --- a/drivers/gpu/drm/bridge/sii902x.c
>> +++ b/drivers/gpu/drm/bridge/sii902x.c
>> @@ -24,6 +24,7 @@
>>   #include <linux/i2c.h>
>>   #include <linux/module.h>
>>   #include <linux/regmap.h>
>> +#include <linux/regulator/consumer.h>
>>
>>   #include <drm/drmP.h>
>>   #include <drm/drm_atomic_helper.h>
>> @@ -86,6 +87,7 @@ struct sii902x {
>>   	struct drm_bridge bridge;
>>   	struct drm_connector connector;
>>   	struct gpio_desc *reset_gpio;
>> +	struct regulator_bulk_data supplies[3];
>>   };
>>
>>   static inline struct sii902x *bridge_to_sii902x(struct drm_bridge *bridge)
>> @@ -392,23 +394,43 @@ static int sii902x_probe(struct i2c_client *client,
>>   		return PTR_ERR(sii902x->reset_gpio);
>>   	}
>>
>> +	sii902x->supplies[0].supply = "iovcc";
>> +	sii902x->supplies[1].supply = "avcc12";
>> +	sii902x->supplies[2].supply = "cvcc12";
>> +	ret = devm_regulator_bulk_get(dev, ARRAY_SIZE(sii902x->supplies),
>> +				      sii902x->supplies);
>> +	if (ret) {
>> +		dev_err(dev, "regulator_bulk_get failed\n");
> 
> Maybe "failed to get power supplies" to be a bit more explicit ? And while at
> it, printing the value of ret too ?
> 

good point, I will do that in v2


>> +		return ret;
>> +	}
>> +
>> +	ret = regulator_bulk_enable(ARRAY_SIZE(sii902x->supplies),
>> +				    sii902x->supplies);
>> +	if (ret) {
>> +		dev_err(dev, "regulator_bulk_enable failed\n");
> 
> Same here ?
> 

agreed

>> +		return ret;
>> +	}
>> +
>> +	usleep_range(10000, 20000);
>> +
>>   	sii902x_reset(sii902x);
>>
>>   	ret = regmap_write(sii902x->regmap, SII902X_REG_TPI_RQB, 0x0);
>>   	if (ret)
>> -		return ret;
>> +		goto err_disable_regulator;
>>
>>   	ret = regmap_bulk_read(sii902x->regmap, SII902X_REG_CHIPID(0),
>>   			       &chipid, 4);
>>   	if (ret) {
>>   		dev_err(dev, "regmap_read failed %d\n", ret);
>> -		return ret;
>> +		goto err_disable_regulator;
>>   	}
>>
>>   	if (chipid[0] != 0xb0) {
>>   		dev_err(dev, "Invalid chipid: %02x (expecting 0xb0)\n",
>>   			chipid[0]);
>> -		return -EINVAL;
>> +		ret = -EINVAL;
>> +		goto err_disable_regulator;
>>   	}
>>
>>   	/* Clear all pending interrupts */
>> @@ -424,7 +446,7 @@ static int sii902x_probe(struct i2c_client *client,
>>   						IRQF_ONESHOT, dev_name(dev),
>>   						sii902x);
>>   		if (ret)
>> -			return ret;
>> +			goto err_disable_regulator;
>>   	}
>>
>>   	sii902x->bridge.funcs = &sii902x_bridge_funcs;
>> @@ -434,6 +456,12 @@ static int sii902x_probe(struct i2c_client *client,
>>   	i2c_set_clientdata(client, sii902x);
>>
>>   	return 0;
>> +
>> +err_disable_regulator:
>> +	regulator_bulk_disable(ARRAY_SIZE(sii902x->supplies),
>> +			       sii902x->supplies);
>> +
>> +	return ret;
>>   }
>>
>>   static int sii902x_remove(struct i2c_client *client)
>> @@ -443,6 +471,9 @@ static int sii902x_remove(struct i2c_client *client)
>>
>>   	drm_bridge_remove(&sii902x->bridge);
>>
>> +	regulator_bulk_disable(ARRAY_SIZE(sii902x->supplies),
>> +			       sii902x->supplies);
>> +
> 
> While this seems functionally correct, would it be useful to only enable power
> supplies when needed to save power ?
> 

that is a good point. I do not know well (yet) this bridge. Maybe I can 
add a 3rd patch with bridge pre_enable() and post_disable() containing 
reset & supplies management. Or I can put reset&supplies in bridge 
enable() & disable() but it could be a little messy.

Any opinion/advice?
Many thanks,
Philippe :-)

>>   	return 0;
>>   }
> 
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH 2/2] drm/bridge: sii902x: add optional power supplies
  2018-04-19  9:46       ` Philippe CORNU
@ 2018-04-19 11:00         ` Laurent Pinchart
  -1 siblings, 0 replies; 24+ messages in thread
From: Laurent Pinchart @ 2018-04-19 11:00 UTC (permalink / raw)
  To: Philippe CORNU
  Cc: Archit Taneja, Andrzej Hajda, David Airlie, Rob Herring,
	Mark Rutland, dri-devel, devicetree, linux-kernel,
	Yannick FERTRE, Benjamin Gaignard, Alexandre TORGUE

Hi Philippe,

On Thursday, 19 April 2018 12:46:31 EEST Philippe CORNU wrote:
> On 04/19/2018 10:20 AM, Laurent Pinchart wrote:
> > On Tuesday, 10 April 2018 08:19:27 EEST Philippe Cornu wrote:
> > 
> >> Add the 3 optional power supplies using the exact description
> >> found in the document named
> >> "SiI9022A/SiI9024A HDMI Transmitter Data Sheet (August 2016)".
> >>
> >> Signed-off-by: Philippe Cornu <philippe.cornu@st.com>
> >> ---
> >> drivers/gpu/drm/bridge/sii902x.c | 39 +++++++++++++++++++++++++++++++----
> >> 1 file changed, 35 insertions(+), 4 deletions(-)
> >>
> >> diff --git a/drivers/gpu/drm/bridge/sii902x.c
> >> b/drivers/gpu/drm/bridge/sii902x.c index 60373d7eb220..e17ba6db1ec8
> >> 100644
> >> --- a/drivers/gpu/drm/bridge/sii902x.c
> >> +++ b/drivers/gpu/drm/bridge/sii902x.c

[snip]

> >> @@ -443,6 +471,9 @@ static int sii902x_remove(struct i2c_client *client)
> >>
> >>   	drm_bridge_remove(&sii902x->bridge);
> >>
> >> +	regulator_bulk_disable(ARRAY_SIZE(sii902x->supplies),
> >> +			       sii902x->supplies);
> >> +
> > 
> > While this seems functionally correct, would it be useful to only enable
> > power supplies when needed to save power ?
 
> that is a good point. I do not know well (yet) this bridge. Maybe I can 
> add a 3rd patch with bridge pre_enable() and post_disable() containing 
> reset & supplies management. Or I can put reset&supplies in bridge 
> enable() & disable() but it could be a little messy.
> 
> Any opinion/advice?

I'm not familiar with this bridge yet, so we need to be careful. The first 
point you need to check is the hardware requirements regarding power supply 
sequencing. For instance could it damage the chip if the I/O supply is turned 
off while the I/O pins are externally driven ? Can the core supplies be turned 
off with the I/O supply on ? Then, based on the hardware limitations, you 
should pick the appropriate location for power handling.

> >>   	return 0;
> >>   }

-- 
Regards,

Laurent Pinchart

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH 2/2] drm/bridge: sii902x: add optional power supplies
@ 2018-04-19 11:00         ` Laurent Pinchart
  0 siblings, 0 replies; 24+ messages in thread
From: Laurent Pinchart @ 2018-04-19 11:00 UTC (permalink / raw)
  To: Philippe CORNU
  Cc: Mark Rutland, devicetree, Alexandre TORGUE, David Airlie,
	linux-kernel, dri-devel, Yannick FERTRE, Rob Herring

Hi Philippe,

On Thursday, 19 April 2018 12:46:31 EEST Philippe CORNU wrote:
> On 04/19/2018 10:20 AM, Laurent Pinchart wrote:
> > On Tuesday, 10 April 2018 08:19:27 EEST Philippe Cornu wrote:
> > 
> >> Add the 3 optional power supplies using the exact description
> >> found in the document named
> >> "SiI9022A/SiI9024A HDMI Transmitter Data Sheet (August 2016)".
> >>
> >> Signed-off-by: Philippe Cornu <philippe.cornu@st.com>
> >> ---
> >> drivers/gpu/drm/bridge/sii902x.c | 39 +++++++++++++++++++++++++++++++----
> >> 1 file changed, 35 insertions(+), 4 deletions(-)
> >>
> >> diff --git a/drivers/gpu/drm/bridge/sii902x.c
> >> b/drivers/gpu/drm/bridge/sii902x.c index 60373d7eb220..e17ba6db1ec8
> >> 100644
> >> --- a/drivers/gpu/drm/bridge/sii902x.c
> >> +++ b/drivers/gpu/drm/bridge/sii902x.c

[snip]

> >> @@ -443,6 +471,9 @@ static int sii902x_remove(struct i2c_client *client)
> >>
> >>   	drm_bridge_remove(&sii902x->bridge);
> >>
> >> +	regulator_bulk_disable(ARRAY_SIZE(sii902x->supplies),
> >> +			       sii902x->supplies);
> >> +
> > 
> > While this seems functionally correct, would it be useful to only enable
> > power supplies when needed to save power ?
 
> that is a good point. I do not know well (yet) this bridge. Maybe I can 
> add a 3rd patch with bridge pre_enable() and post_disable() containing 
> reset & supplies management. Or I can put reset&supplies in bridge 
> enable() & disable() but it could be a little messy.
> 
> Any opinion/advice?

I'm not familiar with this bridge yet, so we need to be careful. The first 
point you need to check is the hardware requirements regarding power supply 
sequencing. For instance could it damage the chip if the I/O supply is turned 
off while the I/O pins are externally driven ? Can the core supplies be turned 
off with the I/O supply on ? Then, based on the hardware limitations, you 
should pick the appropriate location for power handling.

> >>   	return 0;
> >>   }

-- 
Regards,

Laurent Pinchart



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

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH 1/2] dt-bindings/display/bridge: sii902x: add optional power supplies
  2018-04-19  9:31       ` Philippe CORNU
@ 2018-04-19 11:09         ` Laurent Pinchart
  -1 siblings, 0 replies; 24+ messages in thread
From: Laurent Pinchart @ 2018-04-19 11:09 UTC (permalink / raw)
  To: Philippe CORNU
  Cc: Archit Taneja, Andrzej Hajda, David Airlie, Rob Herring,
	Mark Rutland, dri-devel, devicetree, linux-kernel,
	Yannick FERTRE, Benjamin Gaignard, Alexandre TORGUE

Hi Philippe,

On Thursday, 19 April 2018 12:31:15 EEST Philippe CORNU wrote:
> On 04/19/2018 10:11 AM, Laurent Pinchart wrote:
> > On Tuesday, 10 April 2018 08:19:26 EEST Philippe Cornu wrote:
> > 
> >> Add the 3 optional power supplies using the exact description
> >> found in the document named
> >> "SiI9022A/SiI9024A HDMI Transmitter Data Sheet (August 2016)".
> >>
> >> Signed-off-by: Philippe Cornu <philippe.cornu@st.com>
> >> ---
> >> 
> >>   Documentation/devicetree/bindings/display/bridge/sii902x.txt | 3 +++
> >>   1 file changed, 3 insertions(+)
> >>
> >> diff --git
> >> a/Documentation/devicetree/bindings/display/bridge/sii902x.txt
> >> b/Documentation/devicetree/bindings/display/bridge/sii902x.txt index
> >> 56a3e68ccb80..cf53678fe574 100644
> >> --- a/Documentation/devicetree/bindings/display/bridge/sii902x.txt
> >> +++ b/Documentation/devicetree/bindings/display/bridge/sii902x.txt
> >> @@ -8,6 +8,9 @@ Optional properties:
> >>   	- interrupts-extended or interrupt-parent + interrupts: describe
> >>   	  the interrupt line used to inform the host about hotplug events.
> >>   	- reset-gpios: OF device-tree gpio specification for RST_N pin.
> >> +	- iovcc-supply: I/O supply voltage (1.8V or 3.3V, host-dependent).
> >> +	- avcc12-supply: TMDS analog supply voltage (1.2V).
> >> +	- cvcc12-supply: Digital core supply voltage (1.2V).
> > 
> > It seems that the AVCC12 and CVCC12 power supplies are usually derived
> > from the same source. How about starting with one DT property for both,
> > and adding a second one later if needed ?
> 
> Well, I do not know what is the best. Here I took the description from 
> the documentation, and to allow all possible board configurations, I 
> added these supplies as "optional" properties: if there is only one 1v2 
> regulator on the board, the dt will contain only avcc12 or cvcc12 and 
> everything will work fine (we will have a dummy regulator for the 
> missing optional 1v2 reg), if both regulators are there for any reasons 
> (stability, noise, whatever...) then both entries will be in the dt.
> 
> If you confirm you prefer a single 1v2 supply (named for instance 
> "vcc12-supply") then I will do :-)

Please see https://lists.freedesktop.org/archives/dri-devel/2018-April/
172400.html (and the messages that lead to it) and https://
lists.freedesktop.org/archives/dri-devel/2018-March/170763.html.

> >>   Optional subnodes:
> >>   	- video input: this subnode can contain a video input port node

-- 
Regards,

Laurent Pinchart

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH 1/2] dt-bindings/display/bridge: sii902x: add optional power supplies
@ 2018-04-19 11:09         ` Laurent Pinchart
  0 siblings, 0 replies; 24+ messages in thread
From: Laurent Pinchart @ 2018-04-19 11:09 UTC (permalink / raw)
  To: Philippe CORNU
  Cc: Mark Rutland, devicetree, Alexandre TORGUE, David Airlie,
	linux-kernel, dri-devel, Yannick FERTRE, Rob Herring

Hi Philippe,

On Thursday, 19 April 2018 12:31:15 EEST Philippe CORNU wrote:
> On 04/19/2018 10:11 AM, Laurent Pinchart wrote:
> > On Tuesday, 10 April 2018 08:19:26 EEST Philippe Cornu wrote:
> > 
> >> Add the 3 optional power supplies using the exact description
> >> found in the document named
> >> "SiI9022A/SiI9024A HDMI Transmitter Data Sheet (August 2016)".
> >>
> >> Signed-off-by: Philippe Cornu <philippe.cornu@st.com>
> >> ---
> >> 
> >>   Documentation/devicetree/bindings/display/bridge/sii902x.txt | 3 +++
> >>   1 file changed, 3 insertions(+)
> >>
> >> diff --git
> >> a/Documentation/devicetree/bindings/display/bridge/sii902x.txt
> >> b/Documentation/devicetree/bindings/display/bridge/sii902x.txt index
> >> 56a3e68ccb80..cf53678fe574 100644
> >> --- a/Documentation/devicetree/bindings/display/bridge/sii902x.txt
> >> +++ b/Documentation/devicetree/bindings/display/bridge/sii902x.txt
> >> @@ -8,6 +8,9 @@ Optional properties:
> >>   	- interrupts-extended or interrupt-parent + interrupts: describe
> >>   	  the interrupt line used to inform the host about hotplug events.
> >>   	- reset-gpios: OF device-tree gpio specification for RST_N pin.
> >> +	- iovcc-supply: I/O supply voltage (1.8V or 3.3V, host-dependent).
> >> +	- avcc12-supply: TMDS analog supply voltage (1.2V).
> >> +	- cvcc12-supply: Digital core supply voltage (1.2V).
> > 
> > It seems that the AVCC12 and CVCC12 power supplies are usually derived
> > from the same source. How about starting with one DT property for both,
> > and adding a second one later if needed ?
> 
> Well, I do not know what is the best. Here I took the description from 
> the documentation, and to allow all possible board configurations, I 
> added these supplies as "optional" properties: if there is only one 1v2 
> regulator on the board, the dt will contain only avcc12 or cvcc12 and 
> everything will work fine (we will have a dummy regulator for the 
> missing optional 1v2 reg), if both regulators are there for any reasons 
> (stability, noise, whatever...) then both entries will be in the dt.
> 
> If you confirm you prefer a single 1v2 supply (named for instance 
> "vcc12-supply") then I will do :-)

Please see https://lists.freedesktop.org/archives/dri-devel/2018-April/
172400.html (and the messages that lead to it) and https://
lists.freedesktop.org/archives/dri-devel/2018-March/170763.html.

> >>   Optional subnodes:
> >>   	- video input: this subnode can contain a video input port node

-- 
Regards,

Laurent Pinchart



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

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH 1/2] dt-bindings/display/bridge: sii902x: add optional power supplies
  2018-04-19 11:09         ` Laurent Pinchart
@ 2018-04-19 12:41           ` Philippe CORNU
  -1 siblings, 0 replies; 24+ messages in thread
From: Philippe CORNU @ 2018-04-19 12:41 UTC (permalink / raw)
  To: Laurent Pinchart
  Cc: Mark Rutland, devicetree, Alexandre TORGUE, David Airlie,
	linux-kernel, dri-devel, Yannick FERTRE, Rob Herring

Hi Laurent,


On 04/19/2018 01:09 PM, Laurent Pinchart wrote:
> Hi Philippe,
> 
> On Thursday, 19 April 2018 12:31:15 EEST Philippe CORNU wrote:
>> On 04/19/2018 10:11 AM, Laurent Pinchart wrote:
>>> On Tuesday, 10 April 2018 08:19:26 EEST Philippe Cornu wrote:
>>>
>>>> Add the 3 optional power supplies using the exact description
>>>> found in the document named
>>>> "SiI9022A/SiI9024A HDMI Transmitter Data Sheet (August 2016)".
>>>>
>>>> Signed-off-by: Philippe Cornu <philippe.cornu@st.com>
>>>> ---
>>>>
>>>>    Documentation/devicetree/bindings/display/bridge/sii902x.txt | 3 +++
>>>>    1 file changed, 3 insertions(+)
>>>>
>>>> diff --git
>>>> a/Documentation/devicetree/bindings/display/bridge/sii902x.txt
>>>> b/Documentation/devicetree/bindings/display/bridge/sii902x.txt index
>>>> 56a3e68ccb80..cf53678fe574 100644
>>>> --- a/Documentation/devicetree/bindings/display/bridge/sii902x.txt
>>>> +++ b/Documentation/devicetree/bindings/display/bridge/sii902x.txt
>>>> @@ -8,6 +8,9 @@ Optional properties:
>>>>    	- interrupts-extended or interrupt-parent + interrupts: describe
>>>>    	  the interrupt line used to inform the host about hotplug events.
>>>>    	- reset-gpios: OF device-tree gpio specification for RST_N pin.
>>>> +	- iovcc-supply: I/O supply voltage (1.8V or 3.3V, host-dependent).
>>>> +	- avcc12-supply: TMDS analog supply voltage (1.2V).
>>>> +	- cvcc12-supply: Digital core supply voltage (1.2V).
>>>
>>> It seems that the AVCC12 and CVCC12 power supplies are usually derived
>>> from the same source. How about starting with one DT property for both,
>>> and adding a second one later if needed ?
>>
>> Well, I do not know what is the best. Here I took the description from
>> the documentation, and to allow all possible board configurations, I
>> added these supplies as "optional" properties: if there is only one 1v2
>> regulator on the board, the dt will contain only avcc12 or cvcc12 and
>> everything will work fine (we will have a dummy regulator for the
>> missing optional 1v2 reg), if both regulators are there for any reasons
>> (stability, noise, whatever...) then both entries will be in the dt.
>>
>> If you confirm you prefer a single 1v2 supply (named for instance
>> "vcc12-supply") then I will do :-)
> 
> Please see https://lists.freedesktop.org/archives/dri-devel/2018-April/
> 172400.html (and the messages that lead to it) and https://
> lists.freedesktop.org/archives/dri-devel/2018-March/170763.html.
> 

Thanks for this discussion thread.

On my side, I found "CVCC12 and AVCC12 can be derived from the same 
power source" written with a small font (august 2016 datasheet p13) so 
then your advice is clearly what we have to do :-)
I will add this info in v2 too.
Thank you,
Philippe :-)

>>>>    Optional subnodes:
>>>>    	- video input: this subnode can contain a video input port node
> 

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH 1/2] dt-bindings/display/bridge: sii902x: add optional power supplies
@ 2018-04-19 12:41           ` Philippe CORNU
  0 siblings, 0 replies; 24+ messages in thread
From: Philippe CORNU @ 2018-04-19 12:41 UTC (permalink / raw)
  To: Laurent Pinchart
  Cc: Mark Rutland, devicetree, Alexandre TORGUE, David Airlie,
	linux-kernel, dri-devel, Yannick FERTRE, Rob Herring

Hi Laurent,


On 04/19/2018 01:09 PM, Laurent Pinchart wrote:
> Hi Philippe,
> 
> On Thursday, 19 April 2018 12:31:15 EEST Philippe CORNU wrote:
>> On 04/19/2018 10:11 AM, Laurent Pinchart wrote:
>>> On Tuesday, 10 April 2018 08:19:26 EEST Philippe Cornu wrote:
>>>
>>>> Add the 3 optional power supplies using the exact description
>>>> found in the document named
>>>> "SiI9022A/SiI9024A HDMI Transmitter Data Sheet (August 2016)".
>>>>
>>>> Signed-off-by: Philippe Cornu <philippe.cornu@st.com>
>>>> ---
>>>>
>>>>    Documentation/devicetree/bindings/display/bridge/sii902x.txt | 3 +++
>>>>    1 file changed, 3 insertions(+)
>>>>
>>>> diff --git
>>>> a/Documentation/devicetree/bindings/display/bridge/sii902x.txt
>>>> b/Documentation/devicetree/bindings/display/bridge/sii902x.txt index
>>>> 56a3e68ccb80..cf53678fe574 100644
>>>> --- a/Documentation/devicetree/bindings/display/bridge/sii902x.txt
>>>> +++ b/Documentation/devicetree/bindings/display/bridge/sii902x.txt
>>>> @@ -8,6 +8,9 @@ Optional properties:
>>>>    	- interrupts-extended or interrupt-parent + interrupts: describe
>>>>    	  the interrupt line used to inform the host about hotplug events.
>>>>    	- reset-gpios: OF device-tree gpio specification for RST_N pin.
>>>> +	- iovcc-supply: I/O supply voltage (1.8V or 3.3V, host-dependent).
>>>> +	- avcc12-supply: TMDS analog supply voltage (1.2V).
>>>> +	- cvcc12-supply: Digital core supply voltage (1.2V).
>>>
>>> It seems that the AVCC12 and CVCC12 power supplies are usually derived
>>> from the same source. How about starting with one DT property for both,
>>> and adding a second one later if needed ?
>>
>> Well, I do not know what is the best. Here I took the description from
>> the documentation, and to allow all possible board configurations, I
>> added these supplies as "optional" properties: if there is only one 1v2
>> regulator on the board, the dt will contain only avcc12 or cvcc12 and
>> everything will work fine (we will have a dummy regulator for the
>> missing optional 1v2 reg), if both regulators are there for any reasons
>> (stability, noise, whatever...) then both entries will be in the dt.
>>
>> If you confirm you prefer a single 1v2 supply (named for instance
>> "vcc12-supply") then I will do :-)
> 
> Please see https://lists.freedesktop.org/archives/dri-devel/2018-April/
> 172400.html (and the messages that lead to it) and https://
> lists.freedesktop.org/archives/dri-devel/2018-March/170763.html.
> 

Thanks for this discussion thread.

On my side, I found "CVCC12 and AVCC12 can be derived from the same 
power source" written with a small font (august 2016 datasheet p13) so 
then your advice is clearly what we have to do :-)
I will add this info in v2 too.
Thank you,
Philippe :-)

>>>>    Optional subnodes:
>>>>    	- video input: this subnode can contain a video input port node
> 
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH 1/2] dt-bindings/display/bridge: sii902x: add optional power supplies
  2018-04-19 12:41           ` Philippe CORNU
  (?)
@ 2018-04-19 12:50           ` Laurent Pinchart
  -1 siblings, 0 replies; 24+ messages in thread
From: Laurent Pinchart @ 2018-04-19 12:50 UTC (permalink / raw)
  To: Philippe CORNU
  Cc: Mark Rutland, devicetree, Alexandre TORGUE, David Airlie,
	linux-kernel, dri-devel, Yannick FERTRE, Rob Herring

Hi Philippe,

On Thursday, 19 April 2018 15:41:20 EEST Philippe CORNU wrote:
> On 04/19/2018 01:09 PM, Laurent Pinchart wrote:
> > On Thursday, 19 April 2018 12:31:15 EEST Philippe CORNU wrote:
> >> On 04/19/2018 10:11 AM, Laurent Pinchart wrote:
> >>> On Tuesday, 10 April 2018 08:19:26 EEST Philippe Cornu wrote:
> >>>> Add the 3 optional power supplies using the exact description
> >>>> found in the document named
> >>>> "SiI9022A/SiI9024A HDMI Transmitter Data Sheet (August 2016)".
> >>>>
> >>>> Signed-off-by: Philippe Cornu <philippe.cornu@st.com>
> >>>> ---
> >>>>
> >>>> Documentation/devicetree/bindings/display/bridge/sii902x.txt | 3 +++
> >>>> 1 file changed, 3 insertions(+)
> >>>>
> >>>> diff --git
> >>>> a/Documentation/devicetree/bindings/display/bridge/sii902x.txt
> >>>> b/Documentation/devicetree/bindings/display/bridge/sii902x.txt index
> >>>> 56a3e68ccb80..cf53678fe574 100644
> >>>> --- a/Documentation/devicetree/bindings/display/bridge/sii902x.txt
> >>>> +++ b/Documentation/devicetree/bindings/display/bridge/sii902x.txt
> >>>> @@ -8,6 +8,9 @@ Optional properties:
> >>>>    	- interrupts-extended or interrupt-parent + interrupts: describe
> >>>>    	  the interrupt line used to inform the host about hotplug events.
> >>>>    	- reset-gpios: OF device-tree gpio specification for RST_N pin.
> >>>> +	- iovcc-supply: I/O supply voltage (1.8V or 3.3V, host-dependent).
> >>>> +	- avcc12-supply: TMDS analog supply voltage (1.2V).
> >>>> +	- cvcc12-supply: Digital core supply voltage (1.2V).
> >>>
> >>> It seems that the AVCC12 and CVCC12 power supplies are usually derived
> >>> from the same source. How about starting with one DT property for both,
> >>> and adding a second one later if needed ?
> >>
> >> Well, I do not know what is the best. Here I took the description from
> >> the documentation, and to allow all possible board configurations, I
> >> added these supplies as "optional" properties: if there is only one 1v2
> >> regulator on the board, the dt will contain only avcc12 or cvcc12 and
> >> everything will work fine (we will have a dummy regulator for the
> >> missing optional 1v2 reg), if both regulators are there for any reasons
> >> (stability, noise, whatever...) then both entries will be in the dt.
> >>
> >> If you confirm you prefer a single 1v2 supply (named for instance
> >> "vcc12-supply") then I will do :-)
> > 
> > Please see https://lists.freedesktop.org/archives/dri-devel/2018-April/
> > 172400.html (and the messages that lead to it) and https://
> > lists.freedesktop.org/archives/dri-devel/2018-March/170763.html.
> 
> Thanks for this discussion thread.
> 
> On my side, I found "CVCC12 and AVCC12 can be derived from the same 
> power source" written with a small font (august 2016 datasheet p13) so 
> then your advice is clearly what we have to do :-)
> I will add this info in v2 too.

I have seen that too. While the datasheet only says that the two supplies 
*can* be derived from the same power source, I expect that to be the case in 
practice for a really vast majority of cases (I wouldn't be surprised to never 
hear of a system using two different supplies). That's why I think starting 
with one supply would be better.

> >>>>    Optional subnodes:
> >>>>    
> >>>>    	- video input: this subnode can contain a video input port node

-- 
Regards,

Laurent Pinchart

^ permalink raw reply	[flat|nested] 24+ messages in thread

end of thread, other threads:[~2018-04-19 12:50 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-10  5:19 [PATCH 0/2] drm/bridge: sii902x: add optional power supplies Philippe Cornu
2018-04-10  5:19 ` Philippe Cornu
2018-04-10  5:19 ` [PATCH 1/2] dt-bindings/display/bridge: " Philippe Cornu
2018-04-10  5:19   ` Philippe Cornu
2018-04-13 17:58   ` Rob Herring
2018-04-13 17:58     ` Rob Herring
2018-04-19  8:11   ` Laurent Pinchart
2018-04-19  8:11     ` Laurent Pinchart
2018-04-19  9:31     ` Philippe CORNU
2018-04-19  9:31       ` Philippe CORNU
2018-04-19 11:09       ` Laurent Pinchart
2018-04-19 11:09         ` Laurent Pinchart
2018-04-19 12:41         ` Philippe CORNU
2018-04-19 12:41           ` Philippe CORNU
2018-04-19 12:50           ` Laurent Pinchart
2018-04-10  5:19 ` [PATCH 2/2] drm/bridge: " Philippe Cornu
2018-04-10  5:19   ` Philippe Cornu
2018-04-16  9:20   ` Yannick FERTRE
2018-04-19  8:20   ` Laurent Pinchart
2018-04-19  8:20     ` Laurent Pinchart
2018-04-19  9:46     ` Philippe CORNU
2018-04-19  9:46       ` Philippe CORNU
2018-04-19 11:00       ` Laurent Pinchart
2018-04-19 11:00         ` Laurent Pinchart

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.