summaryrefslogtreecommitdiffstats
path: root/drivers/video/omap2/displays
diff options
context:
space:
mode:
authorArchit Taneja <archit@ti.com>2012-12-04 15:36:34 +0530
committerTomi Valkeinen <tomi.valkeinen@ti.com>2013-04-03 15:21:09 +0300
commitd52e2e7557eace36e7eb731bbd40ed3588eb0f1b (patch)
tree6817da53b67bcf82458605f64fcfbba07802928f /drivers/video/omap2/displays
parent3552fb78f1d8d0403ca7f8224da3e85bf2776321 (diff)
downloadlinux-stable-d52e2e7557eace36e7eb731bbd40ed3588eb0f1b.tar.gz
linux-stable-d52e2e7557eace36e7eb731bbd40ed3588eb0f1b.tar.bz2
linux-stable-d52e2e7557eace36e7eb731bbd40ed3588eb0f1b.zip
OMAPDSS: picodlp panel: handle gpio data in panel driver
The picodlp panel driver leaves gpio requests to the platform's board file. These should happen in the panel driver itself. A platform data struct called picodlp_panel_data already exists to hold gpio numbers and other platform data. Request all the gpios in the panel driver so that the board files which use the the panel don't need to do it. This will help in removing the need for the panel drivers to have platform related callbacks. Signed-off-by: Archit Taneja <archit@ti.com>
Diffstat (limited to 'drivers/video/omap2/displays')
-rw-r--r--drivers/video/omap2/displays/panel-picodlp.c21
1 files changed, 20 insertions, 1 deletions
diff --git a/drivers/video/omap2/displays/panel-picodlp.c b/drivers/video/omap2/displays/panel-picodlp.c
index 56d536cabf50..bc8ac77f8827 100644
--- a/drivers/video/omap2/displays/panel-picodlp.c
+++ b/drivers/video/omap2/displays/panel-picodlp.c
@@ -423,10 +423,13 @@ static int picodlp_panel_probe(struct omap_dss_device *dssdev)
struct picodlp_panel_data *picodlp_pdata = get_panel_data(dssdev);
struct i2c_adapter *adapter;
struct i2c_client *picodlp_i2c_client;
- int picodlp_adapter_id;
+ int r, picodlp_adapter_id;
dssdev->panel.timings = pico_ls_timings;
+ if (!picodlp_pdata)
+ return -EINVAL;
+
picod = devm_kzalloc(&dssdev->dev, sizeof(*picod), GFP_KERNEL);
if (!picod)
return -ENOMEM;
@@ -452,6 +455,22 @@ static int picodlp_panel_probe(struct omap_dss_device *dssdev)
dev_set_drvdata(&dssdev->dev, picod);
+ if (gpio_is_valid(picodlp_pdata->emu_done_gpio)) {
+ r = devm_gpio_request_one(&dssdev->dev,
+ picodlp_pdata->emu_done_gpio,
+ GPIOF_IN, "DLP EMU DONE");
+ if (r)
+ return r;
+ }
+
+ if (gpio_is_valid(picodlp_pdata->pwrgood_gpio)) {
+ r = devm_gpio_request_one(&dssdev->dev,
+ picodlp_pdata->pwrgood_gpio,
+ GPIOF_OUT_INIT_LOW, "DLP PWRGOOD");
+ if (r)
+ return r;
+ }
+
return 0;
}