Skip to contentSkip to conversation

OMAPDSS: TPO-TD03MTEA1: Check for errors from regulator_enable()

PATCH In review Mark Brown 3 participants 5 messages Mar 19, 2012 – Mar 21, 2012 Framebuffer layer

lore
Share & tools
lore

Mark Brown

author
#0 lore raw

PATCH 1/2 OMAPDSS: TPO-TD03MTEA1: Check for errors from regulator_enable()

It is possible for regulator_enable() to fail and if it does fail that's generally a bad sign for anything we try to do with the hardware afterwards so check for and immediately return an error if regulator_enable() fails.

---
 .../video/omap2/displays/panel-tpo-td043mtea1.c    |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
drivers/video/omap2/displays/panel-tpo-td043mtea1.c +4 -1
index 32f3fcd..74c6b87 100644
@@ -272,11 +272,14 @@ static const struct omap_video_timings tpo_td043_timings = {
 static int tpo_td043_power_on(struct tpo_td043_device *tpo_td043)
 {
 	int nreset_gpio = tpo_td043->nreset_gpio;
+	int r;
 
 	if (tpo_td043->powered_on)
 		return 0;
 
-	regulator_enable(tpo_td043->vcc_reg);
+	r = regulator_enable(tpo_td043->vcc_reg);
+	if (r != 0)
+		return r;
 
 	/* wait for regulator to stabilize */
 	msleep(160);
Signature · 1 line
1.7.9.1
author
#1 lore raw

PATCH 2/2 OMAPDSS: TPO-TD03MTEA1: Correct comment for power on delay

Since any power on stabilisation delay for the supply itself should be taken care of transparently by the regulator API when the regulator is enabled the additional delay that the TPO-TD03MTEA1 driver adds after that returned should be due to the requirements of the device itself rather than the supply (the delay is also suspicously long for one for a regulator to ramp). Correct the comment to avoid misleading people taking this code as a reference.

---
 .../video/omap2/displays/panel-tpo-td043mtea1.c    |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/video/omap2/displays/panel-tpo-td043mtea1.c +1 -1
index 74c6b87..987cb84 100644
@@ -281,7 +281,7 @@ static int tpo_td043_power_on(struct tpo_td043_device *tpo_td043)
 	if (r != 0)
 		return r;
 
-	/* wait for regulator to stabilize */
+	/* wait for panel to stabilize */
 	msleep(160);
 
 	if (gpio_is_valid(nreset_gpio))
Signature · 1 line
1.7.9.1
Acked-by on v1 1/2
#3 lore raw
In reply to Mark Brown
Quoted 9 lines · Mark Brown

It is possible for regulator_enable() to fail and if it does fail that's generally a bad sign for anything we try to do with the hardware afterwards so check for and immediately return an error if regulator_enable() fails.

---
 .../video/omap2/displays/panel-tpo-td043mtea1.c    |    5 ++++-

 1 files changed, 4 insertions(+), 1 deletions(-)

FWIW:

Signature · 1 line
Gražvydas
Acked-by on v1 2/2
#2 lore raw

Re: [PATCH 2/2] OMAPDSS: TPO-TD03MTEA1: Correct comment for power on delay

In reply to Mark Brown
Quoted 6 lines · Mark Brown

Since any power on stabilisation delay for the supply itself should be taken care of transparently by the regulator API when the regulator is enabled the additional delay that the TPO-TD03MTEA1 driver adds after that returned should be due to the requirements of the device itself rather than the supply (the delay is also suspicously long for one for a regulator to ramp).

True, it came from panel's datasheet which asks to wait for ">10ms + 7 vsyncs" after tuning on the supply and before switching the control signal.

Quoted 7 lines

Correct the comment to avoid misleading people
taking this code as a reference.

---
 .../video/omap2/displays/panel-tpo-td043mtea1.c    |    2 +-

 1 files changed, 1 insertions(+), 1 deletions(-)

FWIW:

Signature · 1 line
Gražvydas
#4 lore raw
In reply to Mark Brown
Quoted 19 lines · Mark Brown

It is possible for regulator_enable() to fail and if it does fail that's generally a bad sign for anything we try to do with the hardware afterwards so check for and immediately return an error if regulator_enable() fails.

---
 .../video/omap2/displays/panel-tpo-td043mtea1.c    |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
drivers/video/omap2/displays/panel-tpo-td043mtea1.c +1 -0
index 32f3fcd..74c6b87 100644
@@ -272,11 +272,14 @@ static const struct omap_video_timings tpo_td043_timings = {
 static int tpo_td043_power_on(struct tpo_td043_device *tpo_td043)
 {
 	int nreset_gpio = tpo_td043->nreset_gpio;
+	int r;
 

drivers/video/omap2/displays/panel-tpo-td043mtea1.c static const struct omap_video_timings tpo_td043_timings = { · line 285

Quoted 10 lines
drivers/video/omap2/displays/panel-tpo-td043mtea1.c +3 -1
 	if (tpo_td043->powered_on)
 		return 0;
 
-	regulator_enable(tpo_td043->vcc_reg);
+	r = regulator_enable(tpo_td043->vcc_reg);
+	if (r != 0)
+		return r;
 
 	/* wait for regulator to stabilize */
 	msleep(160);

Thanks, I'll apply this series to omapdss tree.

Tomi