From: Tomi Valkeinen <tomi.valkeinen@ti.com> To: linux-omap@vger.kernel.org, linux-fbdev@vger.kernel.org, devicetree@vger.kernel.org Cc: Tomi Valkeinen <tomi.valkeinen@ti.com> Subject: [PATCHv2 22/27] OMAPDSS: encoder-tfp410: Add DT support Date: Mon, 16 Dec 2013 16:56:29 +0200 [thread overview] Message-ID: <1387205794-32246-23-git-send-email-tomi.valkeinen@ti.com> (raw) In-Reply-To: <1387205794-32246-1-git-send-email-tomi.valkeinen@ti.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com> --- drivers/video/omap2/displays-new/encoder-tfp410.c | 43 ++++++++++++++++++++++- 1 file changed, 42 insertions(+), 1 deletion(-) diff --git a/drivers/video/omap2/displays-new/encoder-tfp410.c b/drivers/video/omap2/displays-new/encoder-tfp410.c index 4a291e756be9..2c664d476788 100644 --- a/drivers/video/omap2/displays-new/encoder-tfp410.c +++ b/drivers/video/omap2/displays-new/encoder-tfp410.c @@ -13,6 +13,7 @@ #include <linux/module.h> #include <linux/platform_device.h> #include <linux/slab.h> +#include <linux/of_gpio.h> #include <video/omapdss.h> #include <video/omap-panel-data.h> @@ -82,7 +83,8 @@ static int tfp410_enable(struct omap_dss_device *dssdev) return 0; in->ops.dpi->set_timings(in, &ddata->timings); - in->ops.dpi->set_data_lines(in, ddata->data_lines); + if (ddata->data_lines) + in->ops.dpi->set_data_lines(in, ddata->data_lines); r = in->ops.dpi->enable(in); if (r) @@ -179,6 +181,33 @@ static int tfp410_probe_pdata(struct platform_device *pdev) return 0; } +static int tfp410_probe_of(struct platform_device *pdev) +{ + struct panel_drv_data *ddata = platform_get_drvdata(pdev); + struct device_node *node = pdev->dev.of_node; + struct omap_dss_device *in; + int gpio; + + gpio = of_get_gpio(node, 0); + + if (gpio_is_valid(gpio) || gpio == -ENOENT) { + ddata->pd_gpio = gpio; + } else { + dev_err(&pdev->dev, "failed to parse PD gpio\n"); + return gpio; + } + + in = omapdss_of_find_source_for_first_ep(node); + if (IS_ERR(in)) { + dev_err(&pdev->dev, "failed to find video source\n"); + return PTR_ERR(in); + } + + ddata->in = in; + + return 0; +} + static int tfp410_probe(struct platform_device *pdev) { struct panel_drv_data *ddata; @@ -195,6 +224,10 @@ static int tfp410_probe(struct platform_device *pdev) r = tfp410_probe_pdata(pdev); if (r) return r; + } else if (pdev->dev.of_node) { + r = tfp410_probe_of(pdev); + if (r) + return r; } else { return -ENODEV; } @@ -251,12 +284,20 @@ static int __exit tfp410_remove(struct platform_device *pdev) return 0; } +static const struct of_device_id tfp410_of_match[] = { + { .compatible = "ti,tfp410", }, + {}, +}; + +MODULE_DEVICE_TABLE(of, tfp410_of_match); + static struct platform_driver tfp410_driver = { .probe = tfp410_probe, .remove = __exit_p(tfp410_remove), .driver = { .name = "tfp410", .owner = THIS_MODULE, + .of_match_table = tfp410_of_match, }, }; -- 1.8.3.2
WARNING: multiple messages have this Message-ID (diff)
From: Tomi Valkeinen <tomi.valkeinen@ti.com> To: linux-omap@vger.kernel.org, linux-fbdev@vger.kernel.org, devicetree@vger.kernel.org Cc: Tomi Valkeinen <tomi.valkeinen@ti.com> Subject: [PATCHv2 22/27] OMAPDSS: encoder-tfp410: Add DT support Date: Mon, 16 Dec 2013 14:56:29 +0000 [thread overview] Message-ID: <1387205794-32246-23-git-send-email-tomi.valkeinen@ti.com> (raw) In-Reply-To: <1387205794-32246-1-git-send-email-tomi.valkeinen@ti.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com> --- drivers/video/omap2/displays-new/encoder-tfp410.c | 43 ++++++++++++++++++++++- 1 file changed, 42 insertions(+), 1 deletion(-) diff --git a/drivers/video/omap2/displays-new/encoder-tfp410.c b/drivers/video/omap2/displays-new/encoder-tfp410.c index 4a291e756be9..2c664d476788 100644 --- a/drivers/video/omap2/displays-new/encoder-tfp410.c +++ b/drivers/video/omap2/displays-new/encoder-tfp410.c @@ -13,6 +13,7 @@ #include <linux/module.h> #include <linux/platform_device.h> #include <linux/slab.h> +#include <linux/of_gpio.h> #include <video/omapdss.h> #include <video/omap-panel-data.h> @@ -82,7 +83,8 @@ static int tfp410_enable(struct omap_dss_device *dssdev) return 0; in->ops.dpi->set_timings(in, &ddata->timings); - in->ops.dpi->set_data_lines(in, ddata->data_lines); + if (ddata->data_lines) + in->ops.dpi->set_data_lines(in, ddata->data_lines); r = in->ops.dpi->enable(in); if (r) @@ -179,6 +181,33 @@ static int tfp410_probe_pdata(struct platform_device *pdev) return 0; } +static int tfp410_probe_of(struct platform_device *pdev) +{ + struct panel_drv_data *ddata = platform_get_drvdata(pdev); + struct device_node *node = pdev->dev.of_node; + struct omap_dss_device *in; + int gpio; + + gpio = of_get_gpio(node, 0); + + if (gpio_is_valid(gpio) || gpio = -ENOENT) { + ddata->pd_gpio = gpio; + } else { + dev_err(&pdev->dev, "failed to parse PD gpio\n"); + return gpio; + } + + in = omapdss_of_find_source_for_first_ep(node); + if (IS_ERR(in)) { + dev_err(&pdev->dev, "failed to find video source\n"); + return PTR_ERR(in); + } + + ddata->in = in; + + return 0; +} + static int tfp410_probe(struct platform_device *pdev) { struct panel_drv_data *ddata; @@ -195,6 +224,10 @@ static int tfp410_probe(struct platform_device *pdev) r = tfp410_probe_pdata(pdev); if (r) return r; + } else if (pdev->dev.of_node) { + r = tfp410_probe_of(pdev); + if (r) + return r; } else { return -ENODEV; } @@ -251,12 +284,20 @@ static int __exit tfp410_remove(struct platform_device *pdev) return 0; } +static const struct of_device_id tfp410_of_match[] = { + { .compatible = "ti,tfp410", }, + {}, +}; + +MODULE_DEVICE_TABLE(of, tfp410_of_match); + static struct platform_driver tfp410_driver = { .probe = tfp410_probe, .remove = __exit_p(tfp410_remove), .driver = { .name = "tfp410", .owner = THIS_MODULE, + .of_match_table = tfp410_of_match, }, }; -- 1.8.3.2
next prev parent reply other threads:[~2013-12-16 14:56 UTC|newest] Thread overview: 98+ messages / expand[flat|nested] mbox.gz Atom feed top 2013-12-16 14:56 [PATCHv2 00/27] OMAPDSS: DT support v2 Tomi Valkeinen 2013-12-16 14:56 ` Tomi Valkeinen 2013-12-16 14:56 ` [PATCHv2 01/27] ARM: OMAP: remove DSS DT hack Tomi Valkeinen 2013-12-16 14:56 ` Tomi Valkeinen 2013-12-16 18:41 ` Tony Lindgren 2013-12-16 18:41 ` Tony Lindgren 2013-12-17 6:45 ` Tomi Valkeinen 2013-12-17 6:45 ` Tomi Valkeinen 2013-12-17 15:30 ` Tony Lindgren 2013-12-17 15:30 ` Tony Lindgren 2013-12-18 7:12 ` Tomi Valkeinen 2013-12-18 7:12 ` Tomi Valkeinen 2013-12-18 10:21 ` Tomi Valkeinen 2013-12-18 10:21 ` Tomi Valkeinen 2013-12-18 17:33 ` Tony Lindgren 2013-12-18 17:33 ` Tony Lindgren 2013-12-18 17:32 ` Tony Lindgren 2013-12-18 17:32 ` Tony Lindgren 2013-12-16 14:56 ` [PATCHv2 02/27] OMAPDSS: remove DT hacks for regulators Tomi Valkeinen 2013-12-16 14:56 ` Tomi Valkeinen 2013-12-16 18:42 ` Tony Lindgren 2013-12-16 18:42 ` Tony Lindgren 2013-12-17 6:42 ` Tomi Valkeinen 2013-12-17 6:42 ` Tomi Valkeinen 2013-12-16 14:56 ` [PATCHv2 03/27] ARM: OMAP2+: add omapdss_init_of() Tomi Valkeinen 2013-12-16 14:56 ` Tomi Valkeinen 2013-12-16 18:46 ` Tony Lindgren 2013-12-16 18:46 ` Tony Lindgren 2013-12-17 6:20 ` Tomi Valkeinen 2013-12-17 6:20 ` Tomi Valkeinen 2013-12-16 14:56 ` [PATCHv2 04/27] OMAPDSS: add 'label' support for DT Tomi Valkeinen 2013-12-16 14:56 ` Tomi Valkeinen 2013-12-16 14:56 ` [PATCHv2 05/27] OMAPDSS: get dssdev->alias from DT alias Tomi Valkeinen 2013-12-16 14:56 ` Tomi Valkeinen 2013-12-16 14:56 ` [PATCHv2 06/27] OMAPFB: clean up default display search Tomi Valkeinen 2013-12-16 14:56 ` Tomi Valkeinen 2013-12-16 14:56 ` [PATCHv2 08/27] OMAPDSS: add of helpers Tomi Valkeinen 2013-12-16 14:56 ` Tomi Valkeinen 2013-12-17 7:00 ` Archit Taneja 2013-12-17 7:12 ` Archit Taneja 2013-12-17 7:01 ` Tomi Valkeinen 2013-12-17 7:01 ` Tomi Valkeinen 2013-12-16 14:56 ` [PATCHv2 09/27] OMAPDSS: Add DT support to DSS, DISPC, DPI and SDI Tomi Valkeinen 2013-12-16 14:56 ` Tomi Valkeinen 2013-12-16 14:56 ` [PATCHv2 10/27] OMAPDSS: Add DT support to HDMI Tomi Valkeinen 2013-12-16 14:56 ` Tomi Valkeinen 2013-12-16 14:56 ` [PATCHv2 11/27] OMAPDSS: Add DT support to VENC Tomi Valkeinen 2013-12-16 14:56 ` Tomi Valkeinen 2013-12-16 14:56 ` [PATCHv2 12/27] OMAPDSS: Add DT support to DSI Tomi Valkeinen 2013-12-16 14:56 ` Tomi Valkeinen 2013-12-16 14:56 ` [PATCHv2 13/27] ARM: omap3.dtsi: add omapdss information Tomi Valkeinen 2013-12-16 14:56 ` Tomi Valkeinen 2013-12-16 14:56 ` [PATCHv2 14/27] ARM: omap4.dtsi: " Tomi Valkeinen 2013-12-16 14:56 ` Tomi Valkeinen 2013-12-16 14:56 ` [PATCHv2 15/27] ARM: omap4-panda.dts: add display information Tomi Valkeinen 2013-12-16 14:56 ` Tomi Valkeinen 2013-12-16 14:56 ` [PATCHv2 16/27] ARM: omap4-sdp.dts: " Tomi Valkeinen 2013-12-16 14:56 ` Tomi Valkeinen [not found] ` <1387205794-32246-1-git-send-email-tomi.valkeinen-l0cyMroinI0@public.gmane.org> 2013-12-16 14:56 ` [PATCHv2 07/27] OMAPFB: search for default display with DT alias Tomi Valkeinen 2013-12-16 14:56 ` Tomi Valkeinen 2013-12-16 14:56 ` [PATCHv2 17/27] ARM: omap3-tobi.dts: add lcd (TEST) Tomi Valkeinen 2013-12-16 14:56 ` Tomi Valkeinen 2013-12-17 17:17 ` Florian Vaussard 2013-12-17 17:17 ` Florian Vaussard 2013-12-16 14:56 ` [PATCHv2 18/27] ARM: omap3-beagle.dts: add display information Tomi Valkeinen 2013-12-16 14:56 ` Tomi Valkeinen 2013-12-16 14:56 ` [PATCHv2 19/27] ARM: omap3-beagle-xm.dts: " Tomi Valkeinen 2013-12-16 14:56 ` Tomi Valkeinen 2013-12-16 14:56 ` [PATCHv2 20/27] ARM: omap3-igep0020.dts: " Tomi Valkeinen 2013-12-16 14:56 ` Tomi Valkeinen 2013-12-16 14:56 ` [PATCHv2 21/27] OMAPDSS: panel-dsi-cm: Add DT support Tomi Valkeinen 2013-12-16 14:56 ` Tomi Valkeinen 2013-12-16 14:56 ` Tomi Valkeinen [this message] 2013-12-16 14:56 ` [PATCHv2 22/27] OMAPDSS: encoder-tfp410: " Tomi Valkeinen 2013-12-16 14:56 ` [PATCHv2 23/27] OMAPDSS: connector-dvi: " Tomi Valkeinen 2013-12-16 14:56 ` Tomi Valkeinen 2013-12-17 7:05 ` Sascha Hauer 2013-12-17 7:05 ` Sascha Hauer 2013-12-17 7:15 ` Tomi Valkeinen 2013-12-17 7:15 ` Tomi Valkeinen 2013-12-17 15:15 ` Laurent Pinchart 2013-12-17 15:15 ` Laurent Pinchart 2013-12-18 10:41 ` Tomi Valkeinen 2013-12-18 10:41 ` Tomi Valkeinen [not found] ` <52B17BBF.8090003-l0cyMroinI0@public.gmane.org> 2013-12-18 14:02 ` Tomi Valkeinen 2013-12-18 14:02 ` Tomi Valkeinen 2013-12-16 14:56 ` [PATCHv2 24/27] OMAPDSS: encoder-tpd12s015: " Tomi Valkeinen 2013-12-16 14:56 ` Tomi Valkeinen 2013-12-16 14:56 ` [PATCHv2 25/27] OMAPDSS: hdmi-connector: " Tomi Valkeinen 2013-12-16 14:56 ` Tomi Valkeinen 2013-12-16 14:56 ` [PATCHv2 26/27] OMAPDSS: panel-dpi: " Tomi Valkeinen 2013-12-16 14:56 ` Tomi Valkeinen 2013-12-16 14:56 ` [PATCHv2 27/27] OMAPDSS: connector-analog-tv: " Tomi Valkeinen 2013-12-16 14:56 ` Tomi Valkeinen [not found] ` <1387205794-32246-28-git-send-email-tomi.valkeinen-l0cyMroinI0@public.gmane.org> 2014-08-26 16:58 ` Laurent Pinchart 2014-08-26 16:58 ` Laurent Pinchart 2014-08-27 9:37 ` Tomi Valkeinen 2014-08-27 9:37 ` Tomi Valkeinen
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=1387205794-32246-23-git-send-email-tomi.valkeinen@ti.com \ --to=tomi.valkeinen@ti.com \ --cc=devicetree@vger.kernel.org \ --cc=linux-fbdev@vger.kernel.org \ --cc=linux-omap@vger.kernel.org \ /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: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.