* [PATCH 1/4] OMAP: DSS2: Remove suspicous and unused TAAL regulator API usage
@ 2012-05-03 10:57 Mark Brown
2012-05-03 10:57 ` [PATCH 2/4] OMAPDSS: VENC: Check for errors from regulator_enable() Mark Brown
` (3 more replies)
0 siblings, 4 replies; 8+ messages in thread
From: Mark Brown @ 2012-05-03 10:57 UTC (permalink / raw)
To: Tomi Valkeinen, Florian Tobias Schandinat
Cc: linux-fbdev, linux-omap, Mark Brown
The TAAL driver contains some regulator support which is currently unused
(the code is there but the one panel supported by the driver doesn't have
any regulators provided). This code mostly looks like an open coded
version of the regulator core bulk API.
The only additional feature is that a voltage range can be set once when
the device is opened, though this is never varied at runtime. The general
expectation is that if the device is not actively managing the voltage of
the device (eg, doing DVFS) then any configuration will be done using the
constraints rather than by drivers, saving them code and ensuring that
they work well with systems where the voltage is not configurable.
If systems are added needing regulator support this can be added back in,
though it should be based on core features rather than open coding things.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
---
drivers/video/omap2/displays/panel-taal.c | 80 -----------------------------
1 file changed, 80 deletions(-)
diff --git a/drivers/video/omap2/displays/panel-taal.c b/drivers/video/omap2/displays/panel-taal.c
index 0f21fa5..72d6307 100644
--- a/drivers/video/omap2/displays/panel-taal.c
+++ b/drivers/video/omap2/displays/panel-taal.c
@@ -30,7 +30,6 @@
#include <linux/gpio.h>
#include <linux/workqueue.h>
#include <linux/slab.h>
-#include <linux/regulator/consumer.h>
#include <linux/mutex.h>
#include <video/omapdss.h>
@@ -55,73 +54,6 @@ static int _taal_enable_te(struct omap_dss_device *dssdev, bool enable);
static int taal_panel_reset(struct omap_dss_device *dssdev);
-struct panel_regulator {
- struct regulator *regulator;
- const char *name;
- int min_uV;
- int max_uV;
-};
-
-static void free_regulators(struct panel_regulator *regulators, int n)
-{
- int i;
-
- for (i = 0; i < n; i++) {
- /* disable/put in reverse order */
- regulator_disable(regulators[n - i - 1].regulator);
- regulator_put(regulators[n - i - 1].regulator);
- }
-}
-
-static int init_regulators(struct omap_dss_device *dssdev,
- struct panel_regulator *regulators, int n)
-{
- int r, i, v;
-
- for (i = 0; i < n; i++) {
- struct regulator *reg;
-
- reg = regulator_get(&dssdev->dev, regulators[i].name);
- if (IS_ERR(reg)) {
- dev_err(&dssdev->dev, "failed to get regulator %s\n",
- regulators[i].name);
- r = PTR_ERR(reg);
- goto err;
- }
-
- /* FIXME: better handling of fixed vs. variable regulators */
- v = regulator_get_voltage(reg);
- if (v < regulators[i].min_uV || v > regulators[i].max_uV) {
- r = regulator_set_voltage(reg, regulators[i].min_uV,
- regulators[i].max_uV);
- if (r) {
- dev_err(&dssdev->dev,
- "failed to set regulator %s voltage\n",
- regulators[i].name);
- regulator_put(reg);
- goto err;
- }
- }
-
- r = regulator_enable(reg);
- if (r) {
- dev_err(&dssdev->dev, "failed to enable regulator %s\n",
- regulators[i].name);
- regulator_put(reg);
- goto err;
- }
-
- regulators[i].regulator = reg;
- }
-
- return 0;
-
-err:
- free_regulators(regulators, i);
-
- return r;
-}
-
/**
* struct panel_config - panel configuration
* @name: panel name
@@ -150,8 +82,6 @@ struct panel_config {
unsigned int low;
} reset_sequence;
- struct panel_regulator *regulators;
- int num_regulators;
};
enum {
@@ -977,11 +907,6 @@ static int taal_probe(struct omap_dss_device *dssdev)
atomic_set(&td->do_update, 0);
- r = init_regulators(dssdev, panel_config->regulators,
- panel_config->num_regulators);
- if (r)
- goto err_reg;
-
td->workqueue = create_singlethread_workqueue("taal_esd");
if (td->workqueue = NULL) {
dev_err(&dssdev->dev, "can't create ESD workqueue\n");
@@ -1075,8 +1000,6 @@ err_gpio:
err_bl:
destroy_workqueue(td->workqueue);
err_wq:
- free_regulators(panel_config->regulators, panel_config->num_regulators);
-err_reg:
kfree(td);
err:
return r;
@@ -1113,9 +1036,6 @@ static void __exit taal_remove(struct omap_dss_device *dssdev)
/* reset, to be sure that the panel is in a valid state */
taal_hw_reset(dssdev);
- free_regulators(td->panel_config->regulators,
- td->panel_config->num_regulators);
-
kfree(td);
}
--
1.7.10
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH 2/4] OMAPDSS: VENC: Check for errors from regulator_enable()
2012-05-03 10:57 [PATCH 1/4] OMAP: DSS2: Remove suspicous and unused TAAL regulator API usage Mark Brown
@ 2012-05-03 10:57 ` Mark Brown
2012-05-03 10:57 ` [PATCH 3/4] OMAPDSS: TPO-TD03MTEA1: " Mark Brown
` (2 subsequent siblings)
3 siblings, 0 replies; 8+ messages in thread
From: Mark Brown @ 2012-05-03 10:57 UTC (permalink / raw)
To: Tomi Valkeinen, Florian Tobias Schandinat
Cc: linux-fbdev, linux-omap, 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.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
---
drivers/video/omap2/dss/venc.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/video/omap2/dss/venc.c b/drivers/video/omap2/dss/venc.c
index 9c3daf7..abfbd4a 100644
--- a/drivers/video/omap2/dss/venc.c
+++ b/drivers/video/omap2/dss/venc.c
@@ -443,7 +443,9 @@ static int venc_power_on(struct omap_dss_device *dssdev)
dispc_set_digit_size(dssdev->panel.timings.x_res,
dssdev->panel.timings.y_res/2);
- regulator_enable(venc.vdda_dac_reg);
+ r = regulator_enable(venc.vdda_dac_reg);
+ if (r)
+ goto err;
if (dssdev->platform_enable)
dssdev->platform_enable(dssdev);
--
1.7.10
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH 3/4] OMAPDSS: TPO-TD03MTEA1: Check for errors from regulator_enable()
2012-05-03 10:57 [PATCH 1/4] OMAP: DSS2: Remove suspicous and unused TAAL regulator API usage Mark Brown
2012-05-03 10:57 ` [PATCH 2/4] OMAPDSS: VENC: Check for errors from regulator_enable() Mark Brown
@ 2012-05-03 10:57 ` Mark Brown
2012-05-03 10:57 ` [PATCH 4/4] OMAPDSS: TPO-TD03MTEA1: Correct comment for power on delay Mark Brown
2012-05-03 13:11 ` [PATCH 1/4] OMAP: DSS2: Remove suspicous and unused TAAL regulator API usage Tomi Valkeinen
3 siblings, 0 replies; 8+ messages in thread
From: Mark Brown @ 2012-05-03 10:57 UTC (permalink / raw)
To: Tomi Valkeinen, Florian Tobias Schandinat
Cc: linux-fbdev, linux-omap, 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.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Grazvydas Ignotas <notasas@gmail.com>
---
drivers/video/omap2/displays/panel-tpo-td043mtea1.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/video/omap2/displays/panel-tpo-td043mtea1.c b/drivers/video/omap2/displays/panel-tpo-td043mtea1.c
index 32f3fcd..74c6b87 100644
--- a/drivers/video/omap2/displays/panel-tpo-td043mtea1.c
+++ b/drivers/video/omap2/displays/panel-tpo-td043mtea1.c
@@ -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);
--
1.7.10
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH 4/4] OMAPDSS: TPO-TD03MTEA1: Correct comment for power on delay
2012-05-03 10:57 [PATCH 1/4] OMAP: DSS2: Remove suspicous and unused TAAL regulator API usage Mark Brown
2012-05-03 10:57 ` [PATCH 2/4] OMAPDSS: VENC: Check for errors from regulator_enable() Mark Brown
2012-05-03 10:57 ` [PATCH 3/4] OMAPDSS: TPO-TD03MTEA1: " Mark Brown
@ 2012-05-03 10:57 ` Mark Brown
2012-05-03 13:11 ` [PATCH 1/4] OMAP: DSS2: Remove suspicous and unused TAAL regulator API usage Tomi Valkeinen
3 siblings, 0 replies; 8+ messages in thread
From: Mark Brown @ 2012-05-03 10:57 UTC (permalink / raw)
To: Tomi Valkeinen, Florian Tobias Schandinat
Cc: linux-fbdev, linux-omap, 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). Correct the comment to avoid misleading people
taking this code as a reference.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Grazvydas Ignotas <notasas@gmail.com>
---
drivers/video/omap2/displays/panel-tpo-td043mtea1.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/video/omap2/displays/panel-tpo-td043mtea1.c b/drivers/video/omap2/displays/panel-tpo-td043mtea1.c
index 74c6b87..987cb84 100644
--- a/drivers/video/omap2/displays/panel-tpo-td043mtea1.c
+++ b/drivers/video/omap2/displays/panel-tpo-td043mtea1.c
@@ -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))
--
1.7.10
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH 1/4] OMAP: DSS2: Remove suspicous and unused TAAL regulator API usage
2012-05-03 10:57 [PATCH 1/4] OMAP: DSS2: Remove suspicous and unused TAAL regulator API usage Mark Brown
` (2 preceding siblings ...)
2012-05-03 10:57 ` [PATCH 4/4] OMAPDSS: TPO-TD03MTEA1: Correct comment for power on delay Mark Brown
@ 2012-05-03 13:11 ` Tomi Valkeinen
2012-05-03 13:21 ` Mark Brown
3 siblings, 1 reply; 8+ messages in thread
From: Tomi Valkeinen @ 2012-05-03 13:11 UTC (permalink / raw)
To: Mark Brown; +Cc: Florian Tobias Schandinat, linux-fbdev, linux-omap
[-- Attachment #1: Type: text/plain, Size: 1084 bytes --]
Hi,
On Thu, 2012-05-03 at 11:57 +0100, Mark Brown wrote:
> The TAAL driver contains some regulator support which is currently unused
> (the code is there but the one panel supported by the driver doesn't have
> any regulators provided). This code mostly looks like an open coded
> version of the regulator core bulk API.
>
> The only additional feature is that a voltage range can be set once when
> the device is opened, though this is never varied at runtime. The general
> expectation is that if the device is not actively managing the voltage of
> the device (eg, doing DVFS) then any configuration will be done using the
> constraints rather than by drivers, saving them code and ensuring that
> they work well with systems where the voltage is not configurable.
>
> If systems are added needing regulator support this can be added back in,
> though it should be based on core features rather than open coding things.
I've already applied this and the three other patches that you sent in
March to my omapdss tree. Have there been any changes?
Tomi
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH 1/4] OMAP: DSS2: Remove suspicous and unused TAAL regulator API usage
2012-05-03 13:11 ` [PATCH 1/4] OMAP: DSS2: Remove suspicous and unused TAAL regulator API usage Tomi Valkeinen
@ 2012-05-03 13:21 ` Mark Brown
2012-05-03 13:23 ` Tomi Valkeinen
0 siblings, 1 reply; 8+ messages in thread
From: Mark Brown @ 2012-05-03 13:21 UTC (permalink / raw)
To: Tomi Valkeinen; +Cc: Florian Tobias Schandinat, linux-fbdev, linux-omap
[-- Attachment #1: Type: text/plain, Size: 281 bytes --]
On Thu, May 03, 2012 at 04:11:00PM +0300, Tomi Valkeinen wrote:
> I've already applied this and the three other patches that you sent in
> March to my omapdss tree. Have there been any changes?
No, it's a resend - if you've applied these changes they're not showing
up in -next.
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH 1/4] OMAP: DSS2: Remove suspicous and unused TAAL regulator API usage
2012-05-03 13:21 ` Mark Brown
@ 2012-05-03 13:23 ` Tomi Valkeinen
2012-05-03 13:39 ` Mark Brown
0 siblings, 1 reply; 8+ messages in thread
From: Tomi Valkeinen @ 2012-05-03 13:23 UTC (permalink / raw)
To: Mark Brown; +Cc: Florian Tobias Schandinat, linux-fbdev, linux-omap
[-- Attachment #1: Type: text/plain, Size: 454 bytes --]
On Thu, 2012-05-03 at 14:21 +0100, Mark Brown wrote:
> On Thu, May 03, 2012 at 04:11:00PM +0300, Tomi Valkeinen wrote:
>
> > I've already applied this and the three other patches that you sent in
> > March to my omapdss tree. Have there been any changes?
>
> No, it's a resend - if you've applied these changes they're not showing
> up in -next.
Yes, I seem to have forgotten to update my for-next branch. I'll do it
right away.
Tomi
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH 1/4] OMAP: DSS2: Remove suspicous and unused TAAL regulator API usage
2012-05-03 13:23 ` Tomi Valkeinen
@ 2012-05-03 13:39 ` Mark Brown
0 siblings, 0 replies; 8+ messages in thread
From: Mark Brown @ 2012-05-03 13:39 UTC (permalink / raw)
To: Tomi Valkeinen; +Cc: Florian Tobias Schandinat, linux-fbdev, linux-omap
[-- Attachment #1: Type: text/plain, Size: 524 bytes --]
On Thu, May 03, 2012 at 04:23:27PM +0300, Tomi Valkeinen wrote:
> On Thu, 2012-05-03 at 14:21 +0100, Mark Brown wrote:
> > On Thu, May 03, 2012 at 04:11:00PM +0300, Tomi Valkeinen wrote:
> > > I've already applied this and the three other patches that you sent in
> > > March to my omapdss tree. Have there been any changes?
> > No, it's a resend - if you've applied these changes they're not showing
> > up in -next.
> Yes, I seem to have forgotten to update my for-next branch. I'll do it
> right away.
Great, thanks!
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2012-05-03 13:39 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-05-03 10:57 [PATCH 1/4] OMAP: DSS2: Remove suspicous and unused TAAL regulator API usage Mark Brown
2012-05-03 10:57 ` [PATCH 2/4] OMAPDSS: VENC: Check for errors from regulator_enable() Mark Brown
2012-05-03 10:57 ` [PATCH 3/4] OMAPDSS: TPO-TD03MTEA1: " Mark Brown
2012-05-03 10:57 ` [PATCH 4/4] OMAPDSS: TPO-TD03MTEA1: Correct comment for power on delay Mark Brown
2012-05-03 13:11 ` [PATCH 1/4] OMAP: DSS2: Remove suspicous and unused TAAL regulator API usage Tomi Valkeinen
2012-05-03 13:21 ` Mark Brown
2012-05-03 13:23 ` Tomi Valkeinen
2012-05-03 13:39 ` Mark Brown
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).