diff mbox

[11/11] OMAPDSS: DPI: use VPLL2 regulator if VDDS_DSI is not found

Message ID 1384608224-9452-12-git-send-email-javier.martinez@collabora.co.uk (mailing list archive)
State New, archived
Headers show

Commit Message

Javier Martinez Canillas Nov. 16, 2013, 1:23 p.m. UTC
On Device Tree boot the VDDS_DSI regulator is not linked to
the DPI device so omapfb driver probing fails with:

[    3.186035] OMAPFB: omapfb_probe
[    3.190704] omapdss DPI error: can't get VDDS_DSI regulator
[    3.196594] omapfb omapfb: failed to connect default display
[    3.202667] omapfb omapfb: failed to init overlay connections
[    3.208892] OMAPFB: free_resources
[    3.212493] OMAPFB: free all fbmem
[    3.216735] omapfb omapfb: failed to setup omapfb

As a workaround try to use the VPLL2 regulator from twl4030 in
dpi_init_regulator() if getting the VDDS_DSI regulator fails.

Signed-off-by: Javier Martinez Canillas <javier.martinez@collabora.co.uk>
---
 drivers/video/omap2/dss/dpi.c | 5 +++++
 1 file changed, 5 insertions(+)

Comments

Tony Lindgren Nov. 16, 2013, 2:18 p.m. UTC | #1
* Javier Martinez Canillas <javier.martinez@collabora.co.uk> [131116 05:25]:
> On Device Tree boot the VDDS_DSI regulator is not linked to
> the DPI device so omapfb driver probing fails with:
> 
> [    3.186035] OMAPFB: omapfb_probe
> [    3.190704] omapdss DPI error: can't get VDDS_DSI regulator
> [    3.196594] omapfb omapfb: failed to connect default display
> [    3.202667] omapfb omapfb: failed to init overlay connections
> [    3.208892] OMAPFB: free_resources
> [    3.212493] OMAPFB: free all fbmem
> [    3.216735] omapfb omapfb: failed to setup omapfb
> 
> As a workaround try to use the VPLL2 regulator from twl4030 in
> dpi_init_regulator() if getting the VDDS_DSI regulator fails.

Probably makes sens to fix this in the dpi.c, but this can also be set
in the .dts file. I just set up the following in the omap3-ldp.dts file:

&vaux1 {
	/* Needed for ads7846 */
	regulator-name = "vcc";
};

&vpll2 {
	/* Needed for DSS */
	regulator-name = "vdds_dsi";
};

Regards,

Tony

 
> Signed-off-by: Javier Martinez Canillas <javier.martinez@collabora.co.uk>
> ---
>  drivers/video/omap2/dss/dpi.c | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/drivers/video/omap2/dss/dpi.c b/drivers/video/omap2/dss/dpi.c
> index bd48cde..e328f0b 100644
> --- a/drivers/video/omap2/dss/dpi.c
> +++ b/drivers/video/omap2/dss/dpi.c
> @@ -550,6 +550,11 @@ static int dpi_init_regulator(void)
>  		return 0;
>  
>  	vdds_dsi = devm_regulator_get(&dpi.pdev->dev, "vdds_dsi");
> +
> +        /* DT HACK: try VPLL2 to make omapdss work for OMAP3 IGEPv2 */
> +        if (IS_ERR(vdds_dsi))
> +                vdds_dsi = devm_regulator_get(&dpi.pdev->dev, "VPLL2");
> +
>  	if (IS_ERR(vdds_dsi)) {
>  		DSSERR("can't get VDDS_DSI regulator\n");
>  		return PTR_ERR(vdds_dsi);
> -- 
> 1.8.4.2
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Javier Martinez Canillas Nov. 16, 2013, 3:34 p.m. UTC | #2
Hi Tony,

On 11/16/2013 03:18 PM, Tony Lindgren wrote:
> * Javier Martinez Canillas <javier.martinez@collabora.co.uk> [131116 05:25]:
>> On Device Tree boot the VDDS_DSI regulator is not linked to
>> the DPI device so omapfb driver probing fails with:
>> 
>> [    3.186035] OMAPFB: omapfb_probe
>> [    3.190704] omapdss DPI error: can't get VDDS_DSI regulator
>> [    3.196594] omapfb omapfb: failed to connect default display
>> [    3.202667] omapfb omapfb: failed to init overlay connections
>> [    3.208892] OMAPFB: free_resources
>> [    3.212493] OMAPFB: free all fbmem
>> [    3.216735] omapfb omapfb: failed to setup omapfb
>> 
>> As a workaround try to use the VPLL2 regulator from twl4030 in
>> dpi_init_regulator() if getting the VDDS_DSI regulator fails.
> 
> Probably makes sens to fix this in the dpi.c, but this can also be set
> in the .dts file. I just set up the following in the omap3-ldp.dts file:
> 

Sorry is not clear to me if you agree that makes sense to do this fix on dpi.c
or if you think this is a bad idea and prefer to do it in the DTS instead?

I'm asking to know if I have to send a follow up patch or not :)

> &vaux1 {
> 	/* Needed for ads7846 */
> 	regulator-name = "vcc";
> };
> 
> &vpll2 {
> 	/* Needed for DSS */
> 	regulator-name = "vdds_dsi";
> };
> 
> Regards,
> 
> Tony
> 
>  
>> Signed-off-by: Javier Martinez Canillas <javier.martinez@collabora.co.uk>
>> ---
>>  drivers/video/omap2/dss/dpi.c | 5 +++++
>>  1 file changed, 5 insertions(+)
>> 
>> diff --git a/drivers/video/omap2/dss/dpi.c b/drivers/video/omap2/dss/dpi.c
>> index bd48cde..e328f0b 100644
>> --- a/drivers/video/omap2/dss/dpi.c
>> +++ b/drivers/video/omap2/dss/dpi.c
>> @@ -550,6 +550,11 @@ static int dpi_init_regulator(void)
>>  		return 0;
>>  
>>  	vdds_dsi = devm_regulator_get(&dpi.pdev->dev, "vdds_dsi");
>> +
>> +        /* DT HACK: try VPLL2 to make omapdss work for OMAP3 IGEPv2 */
>> +        if (IS_ERR(vdds_dsi))
>> +                vdds_dsi = devm_regulator_get(&dpi.pdev->dev, "VPLL2");
>> +
>>  	if (IS_ERR(vdds_dsi)) {
>>  		DSSERR("can't get VDDS_DSI regulator\n");
>>  		return PTR_ERR(vdds_dsi);
>> -- 
>> 1.8.4.2
>> 
> 

Best regards,
Javier
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Tony Lindgren Nov. 16, 2013, 3:45 p.m. UTC | #3
* Javier Martinez Canillas <javier.martinez@collabora.co.uk> [131116 07:36]:
> Hi Tony,
> 
> On 11/16/2013 03:18 PM, Tony Lindgren wrote:
> > * Javier Martinez Canillas <javier.martinez@collabora.co.uk> [131116 05:25]:
> >> On Device Tree boot the VDDS_DSI regulator is not linked to
> >> the DPI device so omapfb driver probing fails with:
> >> 
> >> [    3.186035] OMAPFB: omapfb_probe
> >> [    3.190704] omapdss DPI error: can't get VDDS_DSI regulator
> >> [    3.196594] omapfb omapfb: failed to connect default display
> >> [    3.202667] omapfb omapfb: failed to init overlay connections
> >> [    3.208892] OMAPFB: free_resources
> >> [    3.212493] OMAPFB: free all fbmem
> >> [    3.216735] omapfb omapfb: failed to setup omapfb
> >> 
> >> As a workaround try to use the VPLL2 regulator from twl4030 in
> >> dpi_init_regulator() if getting the VDDS_DSI regulator fails.
> > 
> > Probably makes sens to fix this in the dpi.c, but this can also be set
> > in the .dts file. I just set up the following in the omap3-ldp.dts file:
> > 
> 
> Sorry is not clear to me if you agree that makes sense to do this fix on dpi.c
> or if you think this is a bad idea and prefer to do it in the DTS instead?
> 
> I'm asking to know if I have to send a follow up patch or not :)

Well let's see what Tomi prefers.

> > &vaux1 {
> > 	/* Needed for ads7846 */
> > 	regulator-name = "vcc";
> > };
> > 
> > &vpll2 {
> > 	/* Needed for DSS */
> > 	regulator-name = "vdds_dsi";
> > };

In the long we'll use regulator phandles anyways in the DSS related
nodes, so from that point of view fixing dpi.c makes sense.

Regards,

Tony
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Sebastian Reichel Nov. 16, 2013, 4:02 p.m. UTC | #4
On Sat, Nov 16, 2013 at 07:45:07AM -0800, Tony Lindgren wrote:
> Well let's see what Tomi prefers.
> 
> > > &vaux1 {
> > > 	/* Needed for ads7846 */
> > > 	regulator-name = "vcc";
> > > };
> > > 
> > > &vpll2 {
> > > 	/* Needed for DSS */
> > > 	regulator-name = "vdds_dsi";
> > > };
> 
> In the long we'll use regulator phandles anyways in the DSS related
> nodes, so from that point of view fixing dpi.c makes sense.

The hack, as being sent by Javier, will result in the wrong
regulator being used on the Nokia N900, which is using vaux1.
It must depend on the machine.

At the same time the N900 device tree file uses V28 as
regulator-name for vaux1 (which is the same one as legacy boot
used). Nothing depends on this, but I don't think it's a
good idea to use this property. Apparently it does not work
if multiple drivers need the same regulator under different
names.

-- Sebastian
diff mbox

Patch

diff --git a/drivers/video/omap2/dss/dpi.c b/drivers/video/omap2/dss/dpi.c
index bd48cde..e328f0b 100644
--- a/drivers/video/omap2/dss/dpi.c
+++ b/drivers/video/omap2/dss/dpi.c
@@ -550,6 +550,11 @@  static int dpi_init_regulator(void)
 		return 0;
 
 	vdds_dsi = devm_regulator_get(&dpi.pdev->dev, "vdds_dsi");
+
+        /* DT HACK: try VPLL2 to make omapdss work for OMAP3 IGEPv2 */
+        if (IS_ERR(vdds_dsi))
+                vdds_dsi = devm_regulator_get(&dpi.pdev->dev, "VPLL2");
+
 	if (IS_ERR(vdds_dsi)) {
 		DSSERR("can't get VDDS_DSI regulator\n");
 		return PTR_ERR(vdds_dsi);