2018-04-10 05:24:47

by Philippe Cornu

[permalink] [raw]
Subject: [PATCH 0/2] drm/bridge: sii902x: add optional power supplies

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



2018-04-10 05:23:45

by Philippe Cornu

[permalink] [raw]
Subject: [PATCH 2/2] drm/bridge: sii902x: add optional power supplies

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 <[email protected]>
---
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


2018-04-10 05:23:45

by Philippe Cornu

[permalink] [raw]
Subject: [PATCH 1/2] dt-bindings/display/bridge: sii902x: add optional power supplies

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 <[email protected]>
---
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


2018-04-13 17:59:45

by Rob Herring (Arm)

[permalink] [raw]
Subject: Re: [PATCH 1/2] dt-bindings/display/bridge: sii902x: add optional power supplies

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 <[email protected]>
> ---
> Documentation/devicetree/bindings/display/bridge/sii902x.txt | 3 +++
> 1 file changed, 3 insertions(+)

Reviewed-by: Rob Herring <[email protected]>


2018-04-19 08:22:30

by Laurent Pinchart

[permalink] [raw]
Subject: Re: [PATCH 1/2] dt-bindings/display/bridge: sii902x: add optional power supplies

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 <[email protected]>
> ---
> 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




2018-04-19 08:22:59

by Laurent Pinchart

[permalink] [raw]
Subject: Re: [PATCH 2/2] drm/bridge: sii902x: add optional power supplies

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 <[email protected]>
> ---
> 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




2018-04-19 09:33:15

by Philippe Cornu

[permalink] [raw]
Subject: Re: [PATCH 1/2] dt-bindings/display/bridge: sii902x: add optional power supplies

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 <[email protected]>
>> ---
>> 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
>

2018-04-19 09:48:20

by Philippe Cornu

[permalink] [raw]
Subject: Re: [PATCH 2/2] drm/bridge: sii902x: add optional power supplies

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 <[email protected]>
>> ---
>> 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;
>> }
>

2018-04-19 11:03:51

by Laurent Pinchart

[permalink] [raw]
Subject: Re: [PATCH 2/2] drm/bridge: sii902x: add optional power supplies

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 <[email protected]>
> >> ---
> >> 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




2018-04-19 11:11:09

by Laurent Pinchart

[permalink] [raw]
Subject: Re: [PATCH 1/2] dt-bindings/display/bridge: sii902x: add optional power supplies

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 <[email protected]>
> >> ---
> >>
> >> 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




2018-04-19 12:42:57

by Philippe Cornu

[permalink] [raw]
Subject: Re: [PATCH 1/2] dt-bindings/display/bridge: sii902x: add optional power supplies

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 <[email protected]>
>>>> ---
>>>>
>>>> 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
>

2018-04-19 12:51:36

by Laurent Pinchart

[permalink] [raw]
Subject: Re: [PATCH 1/2] dt-bindings/display/bridge: sii902x: add optional power supplies

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 <[email protected]>
> >>>> ---
> >>>>
> >>>> 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