diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2014-06-08 11:31:16 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-06-08 11:31:16 -0700 |
commit | 3f17ea6dea8ba5668873afa54628a91aaa3fb1c0 (patch) | |
tree | afbeb2accd4c2199ddd705ae943995b143a0af02 /drivers/video/fbdev/omap2/displays-new/panel-tpo-td043mtea1.c | |
parent | 1860e379875dfe7271c649058aeddffe5afd9d0d (diff) | |
parent | 1a5700bc2d10cd379a795fd2bb377a190af5acd4 (diff) | |
download | op-kernel-dev-3f17ea6dea8ba5668873afa54628a91aaa3fb1c0.zip op-kernel-dev-3f17ea6dea8ba5668873afa54628a91aaa3fb1c0.tar.gz |
Merge branch 'next' (accumulated 3.16 merge window patches) into master
Now that 3.15 is released, this merges the 'next' branch into 'master',
bringing us to the normal situation where my 'master' branch is the
merge window.
* accumulated work in next: (6809 commits)
ufs: sb mutex merge + mutex_destroy
powerpc: update comments for generic idle conversion
cris: update comments for generic idle conversion
idle: remove cpu_idle() forward declarations
nbd: zero from and len fields in NBD_CMD_DISCONNECT.
mm: convert some level-less printks to pr_*
MAINTAINERS: adi-buildroot-devel is moderated
MAINTAINERS: add linux-api for review of API/ABI changes
mm/kmemleak-test.c: use pr_fmt for logging
fs/dlm/debug_fs.c: replace seq_printf by seq_puts
fs/dlm/lockspace.c: convert simple_str to kstr
fs/dlm/config.c: convert simple_str to kstr
mm: mark remap_file_pages() syscall as deprecated
mm: memcontrol: remove unnecessary memcg argument from soft limit functions
mm: memcontrol: clean up memcg zoneinfo lookup
mm/memblock.c: call kmemleak directly from memblock_(alloc|free)
mm/mempool.c: update the kmemleak stack trace for mempool allocations
lib/radix-tree.c: update the kmemleak stack trace for radix tree allocations
mm: introduce kmemleak_update_trace()
mm/kmemleak.c: use %u to print ->checksum
...
Diffstat (limited to 'drivers/video/fbdev/omap2/displays-new/panel-tpo-td043mtea1.c')
-rw-r--r-- | drivers/video/fbdev/omap2/displays-new/panel-tpo-td043mtea1.c | 42 |
1 files changed, 41 insertions, 1 deletions
diff --git a/drivers/video/fbdev/omap2/displays-new/panel-tpo-td043mtea1.c b/drivers/video/fbdev/omap2/displays-new/panel-tpo-td043mtea1.c index 875b402..de78ab0 100644 --- a/drivers/video/fbdev/omap2/displays-new/panel-tpo-td043mtea1.c +++ b/drivers/video/fbdev/omap2/displays-new/panel-tpo-td043mtea1.c @@ -17,6 +17,7 @@ #include <linux/gpio.h> #include <linux/err.h> #include <linux/slab.h> +#include <linux/of_gpio.h> #include <video/omapdss.h> #include <video/omap-panel-data.h> @@ -376,7 +377,8 @@ static int tpo_td043_enable(struct omap_dss_device *dssdev) if (omapdss_device_is_enabled(dssdev)) return 0; - in->ops.dpi->set_data_lines(in, ddata->data_lines); + if (ddata->data_lines) + in->ops.dpi->set_data_lines(in, ddata->data_lines); in->ops.dpi->set_timings(in, &ddata->videomode); r = in->ops.dpi->enable(in); @@ -489,6 +491,31 @@ static int tpo_td043_probe_pdata(struct spi_device *spi) return 0; } +static int tpo_td043_probe_of(struct spi_device *spi) +{ + struct device_node *node = spi->dev.of_node; + struct panel_drv_data *ddata = dev_get_drvdata(&spi->dev); + struct omap_dss_device *in; + int gpio; + + gpio = of_get_named_gpio(node, "reset-gpios", 0); + if (!gpio_is_valid(gpio)) { + dev_err(&spi->dev, "failed to parse enable gpio\n"); + return gpio; + } + ddata->nreset_gpio = gpio; + + in = omapdss_of_find_source_for_first_ep(node); + if (IS_ERR(in)) { + dev_err(&spi->dev, "failed to find video source\n"); + return PTR_ERR(in); + } + + ddata->in = in; + + return 0; +} + static int tpo_td043_probe(struct spi_device *spi) { struct panel_drv_data *ddata; @@ -518,6 +545,10 @@ static int tpo_td043_probe(struct spi_device *spi) r = tpo_td043_probe_pdata(spi); if (r) return r; + } else if (spi->dev.of_node) { + r = tpo_td043_probe_of(spi); + if (r) + return r; } else { return -ENODEV; } @@ -629,11 +660,19 @@ static int tpo_td043_spi_resume(struct device *dev) static SIMPLE_DEV_PM_OPS(tpo_td043_spi_pm, tpo_td043_spi_suspend, tpo_td043_spi_resume); +static const struct of_device_id tpo_td043_of_match[] = { + { .compatible = "omapdss,tpo,td043mtea1", }, + {}, +}; + +MODULE_DEVICE_TABLE(of, tpo_td043_of_match); + static struct spi_driver tpo_td043_spi_driver = { .driver = { .name = "panel-tpo-td043mtea1", .owner = THIS_MODULE, .pm = &tpo_td043_spi_pm, + .of_match_table = tpo_td043_of_match, }, .probe = tpo_td043_probe, .remove = tpo_td043_remove, @@ -641,6 +680,7 @@ static struct spi_driver tpo_td043_spi_driver = { module_spi_driver(tpo_td043_spi_driver); +MODULE_ALIAS("spi:tpo,td043mtea1"); MODULE_AUTHOR("GraÅžvydas Ignotas <notasas@gmail.com>"); MODULE_DESCRIPTION("TPO TD043MTEA1 LCD Driver"); MODULE_LICENSE("GPL"); |