summaryrefslogtreecommitdiffstats
path: root/drivers/video
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2015-09-22 09:07:49 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2015-10-01 08:26:07 +0200
commit7055047a34f53bd09e8fb4b8b12dfeabc6ad74c2 (patch)
treef37449145687a1105016bdef372effb7db96dbe4 /drivers/video
parentdd80c5974bfda55aa78ec0a619e8b346d4930a6b (diff)
downloadbarebox-7055047a34f53bd09e8fb4b8b12dfeabc6ad74c2.tar.gz
barebox-7055047a34f53bd09e8fb4b8b12dfeabc6ad74c2.tar.xz
video: ipuv3: imx-ldb: Support video modes in ldb node
We used to support video modes directly in the ldb device node, that was lost in: 5bda17e video: ipuv3: Replace ipu_output with VPL. Add this support back. Also drop duplicate vpl ioctl forwarding for several calls. With this patch modes can either be retrieved from the ldb node as originally done or from the panel remote port. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'drivers/video')
-rw-r--r--drivers/video/imx-ipu-v3/imx-ldb.c55
1 files changed, 27 insertions, 28 deletions
diff --git a/drivers/video/imx-ipu-v3/imx-ldb.c b/drivers/video/imx-ipu-v3/imx-ldb.c
index 2f49ed22e9..1e9231f3f1 100644
--- a/drivers/video/imx-ipu-v3/imx-ldb.c
+++ b/drivers/video/imx-ipu-v3/imx-ldb.c
@@ -143,20 +143,7 @@ static int imx_ldb_prepare(struct imx_ldb_channel *imx_ldb_ch, struct fb_videomo
writel(ldb->ldb_ctrl, ldb->base);
- return vpl_ioctl(&imx_ldb_ch->vpl, imx_ldb_ch->output_port,
- VPL_PREPARE, NULL);
-}
-
-static int imx_ldb_enable(struct imx_ldb_channel *imx_ldb_ch, int di)
-{
- return vpl_ioctl(&imx_ldb_ch->vpl, imx_ldb_ch->output_port,
- VPL_ENABLE, NULL);
-}
-
-static int imx_ldb_disable(struct imx_ldb_channel *imx_ldb_ch, int di)
-{
- return vpl_ioctl(&imx_ldb_ch->vpl, imx_ldb_ch->output_port,
- VPL_DISABLE, NULL);
+ return 0;
}
static int imx6q_ldb_prepare(struct imx_ldb_channel *imx_ldb_ch, int di)
@@ -260,20 +247,14 @@ static int imx_ldb_ioctl(struct vpl *vpl, unsigned int port,
switch (cmd) {
case VPL_ENABLE:
- ret = vpl_ioctl(vpl, imx_ldb_ch->output_port, cmd, data);
- if (ret)
- return ret;
- return imx_ldb_enable(imx_ldb_ch, port);
+ break;
case VPL_DISABLE:
- ret = vpl_ioctl(vpl, imx_ldb_ch->output_port, cmd, data);
- if (ret)
- return ret;
- return imx_ldb_disable(imx_ldb_ch, port);
+ break;
case VPL_PREPARE:
- ret = vpl_ioctl(vpl, imx_ldb_ch->output_port, cmd, data);
+ ret = imx_ldb_prepare(imx_ldb_ch, data, port);
if (ret)
return ret;
- return imx_ldb_prepare(imx_ldb_ch, data, port);
+ break;
case IMX_IPU_VPL_DI_MODE:
mode = data;
@@ -282,9 +263,22 @@ static int imx_ldb_ioctl(struct vpl *vpl, unsigned int port,
V4L2_PIX_FMT_RGB24 : V4L2_PIX_FMT_BGR666;
return 0;
- default:
- return vpl_ioctl(vpl, imx_ldb_ch->output_port, cmd, data);
+ case VPL_GET_VIDEOMODES:
+ if (imx_ldb_ch->modes) {
+ struct display_timings *timings = data;
+ timings->num_modes = imx_ldb_ch->modes->num_modes;
+ timings->modes = imx_ldb_ch->modes->modes;
+ dev_dbg(imx_ldb_ch->ldb->dev, "Using ldb provided timings\n");
+ return 0;
+ }
+
+ break;
}
+
+ if (imx_ldb_ch->output_port > 0)
+ return vpl_ioctl(vpl, imx_ldb_ch->output_port, cmd, data);
+
+ return 0;
}
static int imx_ldb_probe(struct device_d *dev)
@@ -326,10 +320,15 @@ static int imx_ldb_probe(struct device_d *dev)
channel->chno = i;
channel->output_port = imx_ldb->soc_data->have_mux ? 4 : 1;
+ channel->modes = of_get_display_timings(child);
+
/* The output port is port@4 with mux or port@1 without mux */
port = of_graph_get_port_by_id(child, channel->output_port);
- if (!port) {
- dev_warn(dev, "No port found for %s\n", child->full_name);
+ if (!port)
+ channel->output_port = -1;
+
+ if (!channel->modes && !port) {
+ dev_err(dev, "Neither display timings in ldb node nor remote panel found\n");
continue;
}