From: Florian Vaussard <florian.vaussard@epfl.ch>
To: Tomi Valkeinen <tomi.valkeinen@ti.com>,
linux-fbdev@vger.kernel.org, linux-omap@vger.kernel.org
Cc: Archit Taneja <archit@ti.com>
Subject: Re: [PATCH 2/3] OMAPDSS: panel-lgphilips-lb035q02: Add DT support
Date: Tue, 20 May 2014 10:58:11 +0000 [thread overview]
Message-ID: <537B3543.2040906@epfl.ch> (raw)
In-Reply-To: <1400148637-17726-3-git-send-email-tomi.valkeinen@ti.com>
Hi Tomi,
On 05/15/2014 12:10 PM, Tomi Valkeinen wrote:
> Add DT support for panel-lgphilips-lb035q02.
>
> We disable the use of the backlight_gpio as it should be handled via
> backlight framework with DT boots.
>
> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
> ---
> .../omap2/displays-new/panel-lgphilips-lb035q02.c | 44 +++++++++++++++++++++-
> 1 file changed, 43 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/video/fbdev/omap2/displays-new/panel-lgphilips-lb035q02.c b/drivers/video/fbdev/omap2/displays-new/panel-lgphilips-lb035q02.c
> index 6e6acd696a70..76c4fdc51c31 100644
> --- a/drivers/video/fbdev/omap2/displays-new/panel-lgphilips-lb035q02.c
> +++ b/drivers/video/fbdev/omap2/displays-new/panel-lgphilips-lb035q02.c
> @@ -159,7 +159,8 @@ static int lb035q02_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);
> @@ -277,6 +278,35 @@ err_gpio:
> return r;
> }
>
> +static int lb035q02_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;
> + struct gpio_desc *gpio;
> +
> + gpio = devm_gpiod_get(&spi->dev, "enable");
> + if (IS_ERR(gpio)) {
> + dev_err(&spi->dev, "failed to parse enable gpio\n");
> + return PTR_ERR(gpio);
> + } else {
> + gpiod_direction_output(gpio, 0);
> + ddata->enable_gpio = gpio;
> + }
> +
> + ddata->backlight_gpio = -ENOENT;
> +
> + 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 lb035q02_panel_spi_probe(struct spi_device *spi)
> {
> struct panel_drv_data *ddata;
> @@ -295,6 +325,10 @@ static int lb035q02_panel_spi_probe(struct spi_device *spi)
> r = lb035q02_probe_pdata(spi);
> if (r)
> return r;
> + } else if (spi->dev.of_node) {
> + r = lb035q02_probe_of(spi);
> + if (r)
> + return r;
> } else {
> return -ENODEV;
> }
> @@ -346,6 +380,13 @@ static int lb035q02_panel_spi_remove(struct spi_device *spi)
> return 0;
> }
>
> +static const struct of_device_id lb035q02_of_match[] = {
> + { .compatible = "omapdss,lgphilips,lb035q02", },
> + {},
> +};
> +
> +MODULE_DEVICE_TABLE(of, lb035q02_of_match);
> +
> static struct spi_driver lb035q02_spi_driver = {
> .probe = lb035q02_panel_spi_probe,
> .remove = lb035q02_panel_spi_remove,
> @@ -357,6 +398,7 @@ static struct spi_driver lb035q02_spi_driver = {
>
.of_match_table = lb035q02_of_match,
is missing.
> module_spi_driver(lb035q02_spi_driver);
>
> +MODULE_ALIAS("spi:lgphilips,lb035q02");
> MODULE_AUTHOR("Tomi Valkeinen <tomi.valkeinen@ti.com>");
> MODULE_DESCRIPTION("LG.Philips LB035Q02 LCD Panel driver");
> MODULE_LICENSE("GPL");
>
Regards,
Florian
next prev parent reply other threads:[~2014-05-20 10:58 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-05-15 10:10 [PATCH 0/3] OMAPDSS: DT support for panel-lgphilips-lb035q02 Tomi Valkeinen
2014-05-15 10:10 ` [PATCH 1/3] OMAPDSS: panel-lgphilips-lb035q02: use gpiod for enable gpio Tomi Valkeinen
2014-05-15 10:10 ` [PATCH 2/3] OMAPDSS: panel-lgphilips-lb035q02: Add DT support Tomi Valkeinen
2014-05-20 10:58 ` Florian Vaussard [this message]
2014-05-20 11:36 ` Tomi Valkeinen
2014-05-15 10:10 ` [PATCH 3/3] Doc/DT: Add binding doc for lgphilips,lb035q02.txt Tomi Valkeinen
2014-05-20 11:01 ` Florian Vaussard
2014-05-20 11:04 ` [PATCH 0/3] OMAPDSS: DT support for panel-lgphilips-lb035q02 Florian Vaussard
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=537B3543.2040906@epfl.ch \
--to=florian.vaussard@epfl.ch \
--cc=archit@ti.com \
--cc=linux-fbdev@vger.kernel.org \
--cc=linux-omap@vger.kernel.org \
--cc=tomi.valkeinen@ti.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).