Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 310293
b: refs/heads/master
c: 9c3d5eb
h: refs/heads/master
i:
  310291: 9934316
v: v3
  • Loading branch information
Mark Brown authored and Tomi Valkeinen committed Apr 23, 2012
1 parent a96518a commit 354b4ac
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 81 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: b6e695abe710ee1ae248463d325169efac487e17
refs/heads/master: 9c3d5eb71b1fdcdef434a46444d931ada6938446
80 changes: 0 additions & 80 deletions trunk/drivers/video/omap2/displays/panel-taal.c
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand All @@ -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
Expand Down Expand Up @@ -150,8 +82,6 @@ struct panel_config {
unsigned int low;
} reset_sequence;

struct panel_regulator *regulators;
int num_regulators;
};

enum {
Expand Down Expand Up @@ -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");
Expand Down Expand Up @@ -1075,8 +1000,6 @@ static int taal_probe(struct omap_dss_device *dssdev)
err_bl:
destroy_workqueue(td->workqueue);
err_wq:
free_regulators(panel_config->regulators, panel_config->num_regulators);
err_reg:
kfree(td);
err:
return r;
Expand Down Expand Up @@ -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);
}

Expand Down

0 comments on commit 354b4ac

Please sign in to comment.