drm/bridge: sii902x: add optional power supplies
Subsystems (4)
cover 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(-)
Signature · 6 lines
2.15.1 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
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)".
--- Documentation/devicetree/bindings/display/bridge/sii902x.txt | 3 +++ 1 file changed, 3 insertions(+)
Documentation/devicetree/bindings/display/bridge/sii902x.txt +3 -0
@@ -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
Signature · 6 lines
2.15.1 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH 2/2 drm/bridge: sii902x: add optional power supplies
In reply to Philippe CornuAdd the 3 optional power supplies using the exact description found in the document named
"SiI9022A/SiI9024A HDMI Transmitter Data Sheet (August 2016)".
--- drivers/gpu/drm/bridge/sii902x.c | 39 +++++++++++++++++++++++++++++++++++---- 1 file changed, 35 insertions(+), 4 deletions(-)
drivers/gpu/drm/bridge/sii902x.c +35 -4
@@ -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 ; }
Signature · 6 lines
2.15.1 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 1/2] dt-bindings/display/bridge: sii902x: add optional power supplies
In reply to Philippe CornuQuoted 8 lines · Philippe Cornu
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(+)
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
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)".
--- drivers/gpu/drm/bridge/sii902x.c | 39 +++++++++++++++++++++++++++++++++++---- 1 file changed, 35 insertions(+), 4 deletions(-)
drivers/gpu/drm/bridge/sii902x.c +35 -4
@@ -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 ; }
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Laurent Pinchart
reviewerRe: [PATCH 1/2] dt-bindings/display/bridge: sii902x: add optional power supplies
In reply to Philippe CornuHi Philippe,
Thank you for the patch.
Quoted 15 lines · 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(+)(quoted diff) +0
-0
b/Documentation/devicetree/bindings/display/bridge/sii902x.txtindex56a3e68ccb80..cf53678fe574100644
Documentation/devicetree/bindings/display/bridge/sii902x.txt Optional properties: · line 13
Quoted 6 lines
Documentation/devicetree/bindings/display/bridge/sii902x.txt +3
-0@@ -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 ?
Quoted 2 lines
Documentation/devicetree/bindings/display/bridge/sii902x.txt +0
-0Optional subnodes: - video input: this subnode can contain a video input port node
Signature · 10 lines
Regards, Laurent Pinchart _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Laurent Pinchart
reviewerHi Philippe,
Thank you for the patch.
Quoted 30 lines · 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(-)(quoted diff) +0
-0
b/drivers/gpu/drm/bridge/sii902x.cindex60373d7eb220..e17ba6db1ec8100644drivers/gpu/drm/bridge/sii902x.c +2
-0@@ -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)
drivers/gpu/drm/bridge/sii902x.c static int sii902x_probe(struct i2c_client *client, · line 403
Quoted 10 lines
drivers/gpu/drm/bridge/sii902x.c +7
-0@@ -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 ?
drivers/gpu/drm/bridge/sii902x.c static int sii902x_probe(struct i2c_client *client, · line 410
Quoted 7 lines
drivers/gpu/drm/bridge/sii902x.c +7
-0+return ret; + } + + ret =regulator_bulk_enable (ARRAY_SIZE (sii902x->supplies), + sii902x->supplies); +if (ret) { +dev_err (dev,"regulator_bulk_enable failed\n" );
Same here ?
Quoted 52 lines
drivers/gpu/drm/bridge/sii902x.c +16
-4+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)
drivers/gpu/drm/bridge/sii902x.c static int sii902x_remove(struct i2c_client *client) · line 476
Quoted 6 lines
drivers/gpu/drm/bridge/sii902x.c +3
-0@@ -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 ?
Quoted 2 lines
drivers/gpu/drm/bridge/sii902x.c +0
-0return 0 ; }
Signature · 10 lines
Regards, Laurent Pinchart _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 1/2] dt-bindings/display/bridge: sii902x: add optional power supplies
In reply to Laurent PinchartHi Laurent : )
Quoted 14 lines · Laurent Pinchart
Hi Philippe,
Thank you for the patch.
Quoted 9 lines · 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(+)
Quoted 17 lines
Documentation/devicetree/bindings/display/bridge/sii902x.txt Optional properties: · line 13
Quoted 12 lines
(quoted diff) +0
-0
b/Documentation/devicetree/bindings/display/bridge/sii902x.txtindex56a3e68ccb80..cf53678fe574100644Documentation/devicetree/bindings/display/bridge/sii902x.txt +3
-0@@ -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
Quoted 3 lines
Documentation/devicetree/bindings/display/bridge/sii902x.txt Optional properties: · line 16
Quoted 2 lines
Documentation/devicetree/bindings/display/bridge/sii902x.txt +0
-0Optional subnodes: - video input: this subnode can contain a video input port node
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Hi Laurent :-)
Quoted 38 lines · Laurent Pinchart
Hi Philippe,
Thank you for the patch.
Quoted 33 lines · 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(-)(quoted diff) +0
-0
b/drivers/gpu/drm/bridge/sii902x.cindex60373d7eb220..e17ba6db1ec8100644drivers/gpu/drm/bridge/sii902x.c +2
-0@@ -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); }
Quoted 11 lines
drivers/gpu/drm/bridge/sii902x.c static int sii902x_probe(struct i2c_client *client, · line 403
Quoted 7 lines
drivers/gpu/drm/bridge/sii902x.c +7
-0+ 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
Quoted 10 lines
drivers/gpu/drm/bridge/sii902x.c static int sii902x_probe(struct i2c_client *client, · line 410
Quoted 7 lines
drivers/gpu/drm/bridge/sii902x.c +7
-0+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
Quoted 53 lines
Quoted 53 lines
drivers/gpu/drm/bridge/sii902x.c +16
-4+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)
Quoted 9 lines
drivers/gpu/drm/bridge/sii902x.c static int sii902x_remove(struct i2c_client *client) · line 476
Quoted 5 lines
drivers/gpu/drm/bridge/sii902x.c +3
-0drm_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 :-)
Quoted 3 lines
drivers/gpu/drm/bridge/sii902x.c static int sii902x_remove(struct i2c_client *client) · line 478
Quoted 2 lines
drivers/gpu/drm/bridge/sii902x.c +0
-0return 0 ; }
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Laurent Pinchart
reviewerHi Philippe,
Quoted 17 lines · On Thursday, 19 April 2018 12:46:31 EEST Philippe CORNU wrote:
Quoted 16 lines · Laurent Pinchart
Quoted 14 lines · 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(-)(quoted diff) +0
-0
b/drivers/gpu/drm/bridge/sii902x.cindex60373d7eb220..e17ba6db1ec8100644drivers/gpu/drm/bridge/sii902x.c +0
-0
[snip]
Quoted 11 lines
Quoted 10 lines
drivers/gpu/drm/bridge/sii902x.c static int sii902x_remove(struct i2c_client *client) · line 476
Quoted 7 lines
drivers/gpu/drm/bridge/sii902x.c +3
-0@@ -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 ?
Quoted 6 lines
that is a good point. I do not know well (yet) this bridge. Maybe I can add a 3rd patch with bridge
pre_enable()andpost_disable()containing reset & supplies management. Or I can put reset&supplies in bridgeenable()&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.
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
drivers/gpu/drm/bridge/sii902x.c +0
-0return 0 ; }
Signature · 10 lines
Regards, Laurent Pinchart _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Laurent Pinchart
reviewerRe: [PATCH 1/2] dt-bindings/display/bridge: sii902x: add optional power supplies
In reply to Philippe CORNUHi Philippe,
Quoted 39 lines · On Thursday, 19 April 2018 12:31:15 EEST Philippe CORNU wrote:
Quoted 21 lines · Laurent Pinchart
Quoted 19 lines · 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.txtb/Documentation/devicetree/bindings/display/bridge/sii902x.txtindex56a3e68ccb80..cf53678fe574100644Documentation/devicetree/bindings/display/bridge/sii902x.txt +0
-0@@ -8,6 +8,9 @@ Optional properties: - interrupts-extended or interrupt-parent + interrupts: describe the interrupt line used to inform the host about hotplug events.Quoted 8 lines
Documentation/devicetree/bindings/display/bridge/sii902x.txt Optional properties: · line 13
Quoted 4 lines
Documentation/devicetree/bindings/display/bridge/sii902x.txt +3
-0- 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.
Quoted 2 lines
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.
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Documentation/devicetree/bindings/display/bridge/sii902x.txt +0
-0Optional subnodes: - video input: this subnode can contain a video input port node
Signature · 10 lines
Regards, Laurent Pinchart _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 1/2] dt-bindings/display/bridge: sii902x: add optional power supplies
Hi Laurent,
Quoted 42 lines · Laurent Pinchart
Hi Philippe,
Quoted 39 lines · On Thursday, 19 April 2018 12:31:15 EEST Philippe CORNU wrote:
Quoted 21 lines · Laurent Pinchart
Quoted 19 lines · 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.txtb/Documentation/devicetree/bindings/display/bridge/sii902x.txtindex56a3e68ccb80..cf53678fe574100644Documentation/devicetree/bindings/display/bridge/sii902x.txt +0
-0@@ -8,6 +8,9 @@ Optional properties: - interrupts-extended or interrupt-parent + interrupts: describe the interrupt line used to inform the host about hotplug events.Quoted 8 lines
Documentation/devicetree/bindings/display/bridge/sii902x.txt Optional properties: · line 13
Quoted 4 lines
Documentation/devicetree/bindings/display/bridge/sii902x.txt +3
-0- 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.
Quoted 7 lines
Quoted 2 lines
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 :-)
Quoted 3 lines
Quoted 2 lines
Quoted 2 lines
Documentation/devicetree/bindings/display/bridge/sii902x.txt Optional properties: · line 16
Quoted 2 lines
Documentation/devicetree/bindings/display/bridge/sii902x.txt +0
-0Optional subnodes: - video input: this subnode can contain a video input port node
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Laurent Pinchart
reviewerRe: [PATCH 1/2] dt-bindings/display/bridge: sii902x: add optional power supplies
Hi Philippe,
Quoted 47 lines · On Thursday, 19 April 2018 15:41:20 EEST Philippe CORNU wrote:
Quoted 39 lines · Laurent Pinchart
Quoted 38 lines · On Thursday, 19 April 2018 12:31:15 EEST Philippe CORNU wrote:
Quoted 20 lines · Laurent Pinchart
Quoted 19 lines · 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.txtb/Documentation/devicetree/bindings/display/bridge/sii902x.txtindex56a3e68ccb80..cf53678fe574100644Documentation/devicetree/bindings/display/bridge/sii902x.txt +0
-0@@ -8,6 +8,9 @@ Optional properties: - interrupts-extended or interrupt-parent + interrupts: describe the interrupt line used to inform the host about hotplug events.Quoted 8 lines
Documentation/devicetree/bindings/display/bridge/sii902x.txt Optional properties: · line 13
Quoted 4 lines
Documentation/devicetree/bindings/display/bridge/sii902x.txt +3
-0- 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.
Quoted 6 lines
Quoted 2 lines
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.
Quoted 6 lines
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.
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Documentation/devicetree/bindings/display/bridge/sii902x.txt +0
-0Optional subnodes: - video input: this subnode can contain a video input port node
Signature · 3 lines
Regards, Laurent Pinchart