aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video
diff options
context:
space:
mode:
authorTomi Valkeinen <tomi.valkeinen@ti.com>2014-05-16 05:39:29 -0400
committerTomi Valkeinen <tomi.valkeinen@ti.com>2014-05-20 07:39:47 -0400
commitb36250d8b5a390ffc395c9c2cd5c39f722a276f4 (patch)
treefd20567448ed076f1f8d9db2b479d2d4670f2ace /drivers/video
parentc594b057413d0ec6b0ef3881ae7c78b3bb1240f8 (diff)
OMAPDSS: panel NEC-NL8048HL11 DT support
We don't have any working boards using this panel right now, and the panel driver looks odd compared to the panel specs. For example, the panel spec does not mention any QVGA pin. So, while this patch adds DT support to the driver, it's not really supported and there are not bindings documentation for the panel until someone can verify how the panel actually works. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com> Cc: Erik Gilling <konkers@android.com>
Diffstat (limited to 'drivers/video')
-rw-r--r--drivers/video/fbdev/omap2/displays-new/panel-nec-nl8048hl11.c45
1 files changed, 44 insertions, 1 deletions
diff --git a/drivers/video/fbdev/omap2/displays-new/panel-nec-nl8048hl11.c b/drivers/video/fbdev/omap2/displays-new/panel-nec-nl8048hl11.c
index 996fa004b48c..3595f111aa35 100644
--- a/drivers/video/fbdev/omap2/displays-new/panel-nec-nl8048hl11.c
+++ b/drivers/video/fbdev/omap2/displays-new/panel-nec-nl8048hl11.c
@@ -16,6 +16,7 @@
16#include <linux/spi/spi.h> 16#include <linux/spi/spi.h>
17#include <linux/fb.h> 17#include <linux/fb.h>
18#include <linux/gpio.h> 18#include <linux/gpio.h>
19#include <linux/of_gpio.h>
19 20
20#include <video/omapdss.h> 21#include <video/omapdss.h>
21#include <video/omap-panel-data.h> 22#include <video/omap-panel-data.h>
@@ -156,7 +157,8 @@ static int nec_8048_enable(struct omap_dss_device *dssdev)
156 if (omapdss_device_is_enabled(dssdev)) 157 if (omapdss_device_is_enabled(dssdev))
157 return 0; 158 return 0;
158 159
159 in->ops.dpi->set_data_lines(in, ddata->data_lines); 160 if (ddata->data_lines)
161 in->ops.dpi->set_data_lines(in, ddata->data_lines);
160 in->ops.dpi->set_timings(in, &ddata->videomode); 162 in->ops.dpi->set_timings(in, &ddata->videomode);
161 163
162 r = in->ops.dpi->enable(in); 164 r = in->ops.dpi->enable(in);
@@ -258,6 +260,34 @@ static int nec_8048_probe_pdata(struct spi_device *spi)
258 return 0; 260 return 0;
259} 261}
260 262
263static int nec_8048_probe_of(struct spi_device *spi)
264{
265 struct device_node *node = spi->dev.of_node;
266 struct panel_drv_data *ddata = dev_get_drvdata(&spi->dev);
267 struct omap_dss_device *in;
268 int gpio;
269
270 gpio = of_get_named_gpio(node, "reset-gpios", 0);
271 if (!gpio_is_valid(gpio)) {
272 dev_err(&spi->dev, "failed to parse enable gpio\n");
273 return gpio;
274 }
275 ddata->res_gpio = gpio;
276
277 /* XXX the panel spec doesn't mention any QVGA pin?? */
278 ddata->qvga_gpio = -ENOENT;
279
280 in = omapdss_of_find_source_for_first_ep(node);
281 if (IS_ERR(in)) {
282 dev_err(&spi->dev, "failed to find video source\n");
283 return PTR_ERR(in);
284 }
285
286 ddata->in = in;
287
288 return 0;
289}
290
261static int nec_8048_probe(struct spi_device *spi) 291static int nec_8048_probe(struct spi_device *spi)
262{ 292{
263 struct panel_drv_data *ddata; 293 struct panel_drv_data *ddata;
@@ -289,6 +319,10 @@ static int nec_8048_probe(struct spi_device *spi)
289 r = nec_8048_probe_pdata(spi); 319 r = nec_8048_probe_pdata(spi);
290 if (r) 320 if (r)
291 return r; 321 return r;
322 } else if (spi->dev.of_node) {
323 r = nec_8048_probe_of(spi);
324 if (r)
325 return r;
292 } else { 326 } else {
293 return -ENODEV; 327 return -ENODEV;
294 } 328 }
@@ -377,11 +411,19 @@ static SIMPLE_DEV_PM_OPS(nec_8048_pm_ops, nec_8048_suspend,
377#define NEC_8048_PM_OPS NULL 411#define NEC_8048_PM_OPS NULL
378#endif 412#endif
379 413
414static const struct of_device_id nec_8048_of_match[] = {
415 { .compatible = "omapdss,nec,nl8048hl11", },
416 {},
417};
418
419MODULE_DEVICE_TABLE(of, nec_8048_of_match);
420
380static struct spi_driver nec_8048_driver = { 421static struct spi_driver nec_8048_driver = {
381 .driver = { 422 .driver = {
382 .name = "panel-nec-nl8048hl11", 423 .name = "panel-nec-nl8048hl11",
383 .owner = THIS_MODULE, 424 .owner = THIS_MODULE,
384 .pm = NEC_8048_PM_OPS, 425 .pm = NEC_8048_PM_OPS,
426 .of_match_table = nec_8048_of_match,
385 }, 427 },
386 .probe = nec_8048_probe, 428 .probe = nec_8048_probe,
387 .remove = nec_8048_remove, 429 .remove = nec_8048_remove,
@@ -389,6 +431,7 @@ static struct spi_driver nec_8048_driver = {
389 431
390module_spi_driver(nec_8048_driver); 432module_spi_driver(nec_8048_driver);
391 433
434MODULE_ALIAS("spi:nec,nl8048hl11");
392MODULE_AUTHOR("Erik Gilling <konkers@android.com>"); 435MODULE_AUTHOR("Erik Gilling <konkers@android.com>");
393MODULE_DESCRIPTION("NEC-NL8048HL11 Driver"); 436MODULE_DESCRIPTION("NEC-NL8048HL11 Driver");
394MODULE_LICENSE("GPL"); 437MODULE_LICENSE("GPL");