From 5d47dbc85228de3ce82dea11af3c169e66cbf520 Mon Sep 17 00:00:00 2001 From: Tomi Valkeinen Date: Wed, 24 Apr 2013 13:32:51 +0300 Subject: OMAPDSS: public omapdss_register_output() In order to allow multiple display block in a video pipeline, we need to give the drivers way to register themselves. For now we have the omapdss_register_display() which is used to register panels, and dss_register_output() which is used to register DSS encoders. This patch makes dss_register_output() public (with the name of omapdss_register_output), which can be used to register also external encoders. The distinction between register_output and register_display is that a "display" is an entity at the end of the videopipeline, and "output" is something inside the pipeline. The registration and naming will be made saner in the future, but the current names and functions are kept to minimize changes during the dss device model transition. Signed-off-by: Tomi Valkeinen diff --git a/drivers/video/omap2/dss/dpi.c b/drivers/video/omap2/dss/dpi.c index 892a2b2..5351d02 100644 --- a/drivers/video/omap2/dss/dpi.c +++ b/drivers/video/omap2/dss/dpi.c @@ -689,14 +689,14 @@ static void dpi_init_output(struct platform_device *pdev) out->dispc_channel = dpi_get_channel(); out->owner = THIS_MODULE; - dss_register_output(out); + omapdss_register_output(out); } static void __exit dpi_uninit_output(struct platform_device *pdev) { struct omap_dss_device *out = &dpi.output; - dss_unregister_output(out); + omapdss_unregister_output(out); } static int omap_dpi_probe(struct platform_device *pdev) diff --git a/drivers/video/omap2/dss/dsi.c b/drivers/video/omap2/dss/dsi.c index d6b019f..58fbff9 100644 --- a/drivers/video/omap2/dss/dsi.c +++ b/drivers/video/omap2/dss/dsi.c @@ -5426,7 +5426,7 @@ static void dsi_init_output(struct platform_device *dsidev) out->dispc_channel = dsi_get_channel(dsi->module_id); out->owner = THIS_MODULE; - dss_register_output(out); + omapdss_register_output(out); } static void dsi_uninit_output(struct platform_device *dsidev) @@ -5434,7 +5434,7 @@ static void dsi_uninit_output(struct platform_device *dsidev) struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev); struct omap_dss_device *out = &dsi->output; - dss_unregister_output(out); + omapdss_unregister_output(out); } /* DSI1 HW IP initialisation */ diff --git a/drivers/video/omap2/dss/dss.h b/drivers/video/omap2/dss/dss.h index ed70fa0..50a2362 100644 --- a/drivers/video/omap2/dss/dss.h +++ b/drivers/video/omap2/dss/dss.h @@ -179,10 +179,6 @@ void dss_put_device(struct omap_dss_device *dssdev); void dss_copy_device_pdata(struct omap_dss_device *dst, const struct omap_dss_device *src); -/* output */ -void dss_register_output(struct omap_dss_device *out); -void dss_unregister_output(struct omap_dss_device *out); - /* display */ int dss_suspend_all_devices(void); int dss_resume_all_devices(void); diff --git a/drivers/video/omap2/dss/hdmi.c b/drivers/video/omap2/dss/hdmi.c index e1c0992..2b0a2aa 100644 --- a/drivers/video/omap2/dss/hdmi.c +++ b/drivers/video/omap2/dss/hdmi.c @@ -1036,14 +1036,14 @@ static void hdmi_init_output(struct platform_device *pdev) out->dispc_channel = OMAP_DSS_CHANNEL_DIGIT; out->owner = THIS_MODULE; - dss_register_output(out); + omapdss_register_output(out); } static void __exit hdmi_uninit_output(struct platform_device *pdev) { struct omap_dss_device *out = &hdmi.output; - dss_unregister_output(out); + omapdss_unregister_output(out); } /* HDMI HW IP initialisation */ diff --git a/drivers/video/omap2/dss/output.c b/drivers/video/omap2/dss/output.c index 9ad7d21..0ba168e 100644 --- a/drivers/video/omap2/dss/output.c +++ b/drivers/video/omap2/dss/output.c @@ -92,15 +92,18 @@ err: } EXPORT_SYMBOL(omapdss_output_unset_device); -void dss_register_output(struct omap_dss_device *out) +int omapdss_register_output(struct omap_dss_device *out) { list_add_tail(&out->list, &output_list); + return 0; } +EXPORT_SYMBOL(omapdss_register_output); -void dss_unregister_output(struct omap_dss_device *out) +void omapdss_unregister_output(struct omap_dss_device *out) { list_del(&out->list); } +EXPORT_SYMBOL(omapdss_unregister_output); struct omap_dss_device *omap_dss_get_output(enum omap_dss_output_id id) { diff --git a/drivers/video/omap2/dss/rfbi.c b/drivers/video/omap2/dss/rfbi.c index f18c946..fdfe6e6 100644 --- a/drivers/video/omap2/dss/rfbi.c +++ b/drivers/video/omap2/dss/rfbi.c @@ -1022,14 +1022,14 @@ static void rfbi_init_output(struct platform_device *pdev) out->dispc_channel = OMAP_DSS_CHANNEL_LCD; out->owner = THIS_MODULE; - dss_register_output(out); + omapdss_register_output(out); } static void __exit rfbi_uninit_output(struct platform_device *pdev) { struct omap_dss_device *out = &rfbi.output; - dss_unregister_output(out); + omapdss_unregister_output(out); } /* RFBI HW IP initialisation */ diff --git a/drivers/video/omap2/dss/sdi.c b/drivers/video/omap2/dss/sdi.c index bcb75f5..69d907f 100644 --- a/drivers/video/omap2/dss/sdi.c +++ b/drivers/video/omap2/dss/sdi.c @@ -344,14 +344,14 @@ static void sdi_init_output(struct platform_device *pdev) out->dispc_channel = OMAP_DSS_CHANNEL_LCD; out->owner = THIS_MODULE; - dss_register_output(out); + omapdss_register_output(out); } static void __exit sdi_uninit_output(struct platform_device *pdev) { struct omap_dss_device *out = &sdi.output; - dss_unregister_output(out); + omapdss_unregister_output(out); } static int omap_sdi_probe(struct platform_device *pdev) diff --git a/drivers/video/omap2/dss/venc.c b/drivers/video/omap2/dss/venc.c index 8720f13..e47b64e 100644 --- a/drivers/video/omap2/dss/venc.c +++ b/drivers/video/omap2/dss/venc.c @@ -790,14 +790,14 @@ static void venc_init_output(struct platform_device *pdev) out->dispc_channel = OMAP_DSS_CHANNEL_DIGIT; out->owner = THIS_MODULE; - dss_register_output(out); + omapdss_register_output(out); } static void __exit venc_uninit_output(struct platform_device *pdev) { struct omap_dss_device *out = &venc.output; - dss_unregister_output(out); + omapdss_unregister_output(out); } /* VENC HW IP initialisation */ diff --git a/include/video/omapdss.h b/include/video/omapdss.h index ef9db24..cca912a 100644 --- a/include/video/omapdss.h +++ b/include/video/omapdss.h @@ -780,6 +780,8 @@ struct omap_overlay_manager *omap_dss_get_overlay_manager(int num); int omap_dss_get_num_overlays(void); struct omap_overlay *omap_dss_get_overlay(int num); +int omapdss_register_output(struct omap_dss_device *output); +void omapdss_unregister_output(struct omap_dss_device *output); struct omap_dss_device *omap_dss_get_output(enum omap_dss_output_id id); struct omap_dss_device *omap_dss_find_output(const char *name); struct omap_dss_device *omap_dss_find_output_by_node(struct device_node *node); -- cgit v0.10.2 From efedce1425976fc73154a826552aad4f54086a25 Mon Sep 17 00:00:00 2001 From: Tomi Valkeinen Date: Tue, 23 Apr 2013 14:35:40 +0300 Subject: OMAPDSS: modify get/find functions to go through the device chain In the future will have arbitrarily long video pipeline chains, instead of the current two-entities-per-pipeline model. This patch changes the affected get/find style functions so that they properly go through the video pipeline chain, for example when getting the overlay manager connected to a given display. Signed-off-by: Tomi Valkeinen diff --git a/drivers/video/omap2/dss/apply.c b/drivers/video/omap2/dss/apply.c index 752b985..d6212d63 100644 --- a/drivers/video/omap2/dss/apply.c +++ b/drivers/video/omap2/dss/apply.c @@ -422,7 +422,19 @@ static void wait_pending_extra_info_updates(void) static struct omap_dss_device *dss_mgr_get_device(struct omap_overlay_manager *mgr) { - return mgr->output ? mgr->output->device : NULL; + struct omap_dss_device *dssdev; + + dssdev = mgr->output; + if (dssdev == NULL) + return NULL; + + while (dssdev->device) + dssdev = dssdev->device; + + if (dssdev->driver) + return dssdev; + else + return NULL; } static struct omap_dss_device *dss_ovl_get_device(struct omap_overlay *ovl) diff --git a/drivers/video/omap2/dss/output.c b/drivers/video/omap2/dss/output.c index 0ba168e..3f5c0a7 100644 --- a/drivers/video/omap2/dss/output.c +++ b/drivers/video/omap2/dss/output.c @@ -146,7 +146,13 @@ EXPORT_SYMBOL(omap_dss_find_output_by_node); struct omap_dss_device *omapdss_find_output_from_display(struct omap_dss_device *dssdev) { - return omap_dss_get_device(dssdev->output); + while (dssdev->output) + dssdev = dssdev->output; + + if (dssdev->id != 0) + return omap_dss_get_device(dssdev); + + return NULL; } EXPORT_SYMBOL(omapdss_find_output_from_display); -- cgit v0.10.2 From bc24b8b6d75be869e2ae0c1e4d93cbb0463f5935 Mon Sep 17 00:00:00 2001 From: Tomi Valkeinen Date: Mon, 13 May 2013 13:40:33 +0300 Subject: OMAPDSS: add OMAP_DISPLAY_TYPE_DVI Add new display bus type for DVI. This is not used by omapdss driver itself, but is used by external encoder chips that output DVI. Signed-off-by: Tomi Valkeinen diff --git a/drivers/video/omap2/dss/display.c b/drivers/video/omap2/dss/display.c index 0daf3e3..fafe7c9 100644 --- a/drivers/video/omap2/dss/display.c +++ b/drivers/video/omap2/dss/display.c @@ -61,6 +61,7 @@ int omapdss_default_get_recommended_bpp(struct omap_dss_device *dssdev) case OMAP_DISPLAY_TYPE_VENC: case OMAP_DISPLAY_TYPE_SDI: case OMAP_DISPLAY_TYPE_HDMI: + case OMAP_DISPLAY_TYPE_DVI: return 24; default: BUG(); diff --git a/include/video/omapdss.h b/include/video/omapdss.h index cca912a..cff514e 100644 --- a/include/video/omapdss.h +++ b/include/video/omapdss.h @@ -70,6 +70,7 @@ enum omap_display_type { OMAP_DISPLAY_TYPE_DSI = 1 << 3, OMAP_DISPLAY_TYPE_VENC = 1 << 4, OMAP_DISPLAY_TYPE_HDMI = 1 << 5, + OMAP_DISPLAY_TYPE_DVI = 1 << 6, }; enum omap_plane { -- cgit v0.10.2 From 4635c17d32359e10bcaba3d1835e4aaaea685298 Mon Sep 17 00:00:00 2001 From: Tomi Valkeinen Date: Tue, 14 May 2013 14:14:15 +0300 Subject: drm/omap: DVI connector fix The omapdrm driver currently uses a string comparison to find out if the display is a DVI display. This is not reliable, and as we now have a specific display type for DVI, let's use that. Signed-off-by: Tomi Valkeinen diff --git a/drivers/gpu/drm/omapdrm/omap_drv.c b/drivers/gpu/drm/omapdrm/omap_drv.c index 2c2316a..a3004f1 100644 --- a/drivers/gpu/drm/omapdrm/omap_drv.c +++ b/drivers/gpu/drm/omapdrm/omap_drv.c @@ -65,10 +65,8 @@ static int get_connector_type(struct omap_dss_device *dssdev) switch (dssdev->type) { case OMAP_DISPLAY_TYPE_HDMI: return DRM_MODE_CONNECTOR_HDMIA; - case OMAP_DISPLAY_TYPE_DPI: - if (!strcmp(dssdev->name, "dvi")) - return DRM_MODE_CONNECTOR_DVID; - /* fallthrough */ + case OMAP_DISPLAY_TYPE_DVI: + return DRM_MODE_CONNECTOR_DVID; default: return DRM_MODE_CONNECTOR_Unknown; } -- cgit v0.10.2 From 0b24edb1c7d5aeadde0e38337b9b86fe16064505 Mon Sep 17 00:00:00 2001 From: Tomi Valkeinen Date: Fri, 24 May 2013 13:18:52 +0300 Subject: OMAPDSS: DPI: Add ops Add "ops" style method for using DPI functionality. Ops style calls will allow us to have arbitrarily long display pipelines, where each entity can call ops in the previous display entity. Signed-off-by: Tomi Valkeinen diff --git a/drivers/video/omap2/dss/dpi.c b/drivers/video/omap2/dss/dpi.c index 5351d02..6433eab 100644 --- a/drivers/video/omap2/dss/dpi.c +++ b/drivers/video/omap2/dss/dpi.c @@ -461,6 +461,16 @@ void omapdss_dpi_set_timings(struct omap_dss_device *dssdev, } EXPORT_SYMBOL(omapdss_dpi_set_timings); +static void dpi_get_timings(struct omap_dss_device *dssdev, + struct omap_video_timings *timings) +{ + mutex_lock(&dpi.lock); + + *timings = dpi.timings; + + mutex_unlock(&dpi.lock); +} + int dpi_check_timings(struct omap_dss_device *dssdev, struct omap_video_timings *timings) { @@ -678,6 +688,65 @@ static int dpi_probe_pdata(struct platform_device *dpidev) return 0; } +static int dpi_connect(struct omap_dss_device *dssdev, + struct omap_dss_device *dst) +{ + struct omap_overlay_manager *mgr; + int r; + + r = dpi_init_regulator(); + if (r) + return r; + + dpi_init_pll(); + + mgr = omap_dss_get_overlay_manager(dssdev->dispc_channel); + if (!mgr) + return -ENODEV; + + r = dss_mgr_connect(mgr, dssdev); + if (r) + return r; + + r = omapdss_output_set_device(dssdev, dst); + if (r) { + DSSERR("failed to connect output to new device: %s\n", + dst->name); + dss_mgr_disconnect(mgr, dssdev); + return r; + } + + return 0; +} + +static void dpi_disconnect(struct omap_dss_device *dssdev, + struct omap_dss_device *dst) +{ + WARN_ON(dst != dssdev->device); + + if (dst != dssdev->device) + return; + + omapdss_output_unset_device(dssdev); + + if (dssdev->manager) + dss_mgr_disconnect(dssdev->manager, dssdev); +} + +static const struct omapdss_dpi_ops dpi_ops = { + .connect = dpi_connect, + .disconnect = dpi_disconnect, + + .enable = omapdss_dpi_display_enable, + .disable = omapdss_dpi_display_disable, + + .check_timings = dpi_check_timings, + .set_timings = omapdss_dpi_set_timings, + .get_timings = dpi_get_timings, + + .set_data_lines = omapdss_dpi_set_data_lines, +}; + static void dpi_init_output(struct platform_device *pdev) { struct omap_dss_device *out = &dpi.output; @@ -687,6 +756,7 @@ static void dpi_init_output(struct platform_device *pdev) out->output_type = OMAP_DISPLAY_TYPE_DPI; out->name = "dpi.0"; out->dispc_channel = dpi_get_channel(); + out->ops.dpi = &dpi_ops; out->owner = THIS_MODULE; omapdss_register_output(out); diff --git a/include/video/omapdss.h b/include/video/omapdss.h index cff514e..71fe156 100644 --- a/include/video/omapdss.h +++ b/include/video/omapdss.h @@ -573,6 +573,25 @@ struct omap_dss_writeback_info { u8 pre_mult_alpha; }; +struct omapdss_dpi_ops { + int (*connect)(struct omap_dss_device *dssdev, + struct omap_dss_device *dst); + void (*disconnect)(struct omap_dss_device *dssdev, + struct omap_dss_device *dst); + + int (*enable)(struct omap_dss_device *dssdev); + void (*disable)(struct omap_dss_device *dssdev); + + int (*check_timings)(struct omap_dss_device *dssdev, + struct omap_video_timings *timings); + void (*set_timings)(struct omap_dss_device *dssdev, + struct omap_video_timings *timings); + void (*get_timings)(struct omap_dss_device *dssdev, + struct omap_video_timings *timings); + + void (*set_data_lines)(struct omap_dss_device *dssdev, int data_lines); +}; + struct omap_dss_device { /* old device, to be removed */ struct device old_dev; @@ -638,6 +657,10 @@ struct omap_dss_device { struct omap_dss_driver *driver; + union { + const struct omapdss_dpi_ops *dpi; + } ops; + /* helper variable for driver suspend/resume */ bool activate_after_resume; -- cgit v0.10.2 From b1082dfd610772aff79f55f11a1b73e34f07d31f Mon Sep 17 00:00:00 2001 From: Tomi Valkeinen Date: Fri, 24 May 2013 13:19:14 +0300 Subject: OMAPDSS: SDI: Add ops Add "ops" style method for using SDI functionality. Ops style calls will allow us to have arbitrarily long display pipelines, where each entity can call ops in the previous display entity. Signed-off-by: Tomi Valkeinen diff --git a/drivers/video/omap2/dss/sdi.c b/drivers/video/omap2/dss/sdi.c index 69d907f..856af2e 100644 --- a/drivers/video/omap2/dss/sdi.c +++ b/drivers/video/omap2/dss/sdi.c @@ -234,6 +234,26 @@ void omapdss_sdi_set_timings(struct omap_dss_device *dssdev, } EXPORT_SYMBOL(omapdss_sdi_set_timings); +static void sdi_get_timings(struct omap_dss_device *dssdev, + struct omap_video_timings *timings) +{ + *timings = sdi.timings; +} + +static int sdi_check_timings(struct omap_dss_device *dssdev, + struct omap_video_timings *timings) +{ + struct omap_overlay_manager *mgr = sdi.output.manager; + + if (mgr && !dispc_mgr_timings_ok(mgr->id, timings)) + return -EINVAL; + + if (timings->pixel_clock == 0) + return -EINVAL; + + return 0; +} + void omapdss_sdi_set_datapairs(struct omap_dss_device *dssdev, int datapairs) { sdi.datapairs = datapairs; @@ -333,6 +353,63 @@ static int sdi_probe_pdata(struct platform_device *sdidev) return 0; } +static int sdi_connect(struct omap_dss_device *dssdev, + struct omap_dss_device *dst) +{ + struct omap_overlay_manager *mgr; + int r; + + r = sdi_init_regulator(); + if (r) + return r; + + mgr = omap_dss_get_overlay_manager(dssdev->dispc_channel); + if (!mgr) + return -ENODEV; + + r = dss_mgr_connect(mgr, dssdev); + if (r) + return r; + + r = omapdss_output_set_device(dssdev, dst); + if (r) { + DSSERR("failed to connect output to new device: %s\n", + dst->name); + dss_mgr_disconnect(mgr, dssdev); + return r; + } + + return 0; +} + +static void sdi_disconnect(struct omap_dss_device *dssdev, + struct omap_dss_device *dst) +{ + WARN_ON(dst != dssdev->device); + + if (dst != dssdev->device) + return; + + omapdss_output_unset_device(dssdev); + + if (dssdev->manager) + dss_mgr_disconnect(dssdev->manager, dssdev); +} + +static const struct omapdss_sdi_ops sdi_ops = { + .connect = sdi_connect, + .disconnect = sdi_disconnect, + + .enable = omapdss_sdi_display_enable, + .disable = omapdss_sdi_display_disable, + + .check_timings = sdi_check_timings, + .set_timings = omapdss_sdi_set_timings, + .get_timings = sdi_get_timings, + + .set_datapairs = omapdss_sdi_set_datapairs, +}; + static void sdi_init_output(struct platform_device *pdev) { struct omap_dss_device *out = &sdi.output; @@ -342,6 +419,7 @@ static void sdi_init_output(struct platform_device *pdev) out->output_type = OMAP_DISPLAY_TYPE_SDI; out->name = "sdi.0"; out->dispc_channel = OMAP_DSS_CHANNEL_LCD; + out->ops.sdi = &sdi_ops; out->owner = THIS_MODULE; omapdss_register_output(out); diff --git a/include/video/omapdss.h b/include/video/omapdss.h index 71fe156..c5935a8 100644 --- a/include/video/omapdss.h +++ b/include/video/omapdss.h @@ -592,6 +592,25 @@ struct omapdss_dpi_ops { void (*set_data_lines)(struct omap_dss_device *dssdev, int data_lines); }; +struct omapdss_sdi_ops { + int (*connect)(struct omap_dss_device *dssdev, + struct omap_dss_device *dst); + void (*disconnect)(struct omap_dss_device *dssdev, + struct omap_dss_device *dst); + + int (*enable)(struct omap_dss_device *dssdev); + void (*disable)(struct omap_dss_device *dssdev); + + int (*check_timings)(struct omap_dss_device *dssdev, + struct omap_video_timings *timings); + void (*set_timings)(struct omap_dss_device *dssdev, + struct omap_video_timings *timings); + void (*get_timings)(struct omap_dss_device *dssdev, + struct omap_video_timings *timings); + + void (*set_datapairs)(struct omap_dss_device *dssdev, int datapairs); +}; + struct omap_dss_device { /* old device, to be removed */ struct device old_dev; @@ -659,6 +678,7 @@ struct omap_dss_device { union { const struct omapdss_dpi_ops *dpi; + const struct omapdss_sdi_ops *sdi; } ops; /* helper variable for driver suspend/resume */ -- cgit v0.10.2 From 7700c2d4f79c423f29a5c2c10ca5a9b9c8c5c60f Mon Sep 17 00:00:00 2001 From: Tomi Valkeinen Date: Fri, 24 May 2013 13:19:30 +0300 Subject: OMAPDSS: DVI: Add ops Add "ops" style method for using DVI functionality. Ops style calls will allow us to have arbitrarily long display pipelines, where each entity can call ops in the previous display entity. Signed-off-by: Tomi Valkeinen diff --git a/include/video/omapdss.h b/include/video/omapdss.h index c5935a8..3b3903f 100644 --- a/include/video/omapdss.h +++ b/include/video/omapdss.h @@ -611,6 +611,23 @@ struct omapdss_sdi_ops { void (*set_datapairs)(struct omap_dss_device *dssdev, int datapairs); }; +struct omapdss_dvi_ops { + int (*connect)(struct omap_dss_device *dssdev, + struct omap_dss_device *dst); + void (*disconnect)(struct omap_dss_device *dssdev, + struct omap_dss_device *dst); + + int (*enable)(struct omap_dss_device *dssdev); + void (*disable)(struct omap_dss_device *dssdev); + + int (*check_timings)(struct omap_dss_device *dssdev, + struct omap_video_timings *timings); + void (*set_timings)(struct omap_dss_device *dssdev, + struct omap_video_timings *timings); + void (*get_timings)(struct omap_dss_device *dssdev, + struct omap_video_timings *timings); +}; + struct omap_dss_device { /* old device, to be removed */ struct device old_dev; @@ -679,6 +696,7 @@ struct omap_dss_device { union { const struct omapdss_dpi_ops *dpi; const struct omapdss_sdi_ops *sdi; + const struct omapdss_dvi_ops *dvi; } ops; /* helper variable for driver suspend/resume */ -- cgit v0.10.2 From fb8efa49660ea450ad632c9d8b70f12e4a43a495 Mon Sep 17 00:00:00 2001 From: Tomi Valkeinen Date: Fri, 24 May 2013 13:19:50 +0300 Subject: OMAPDSS: AnalogTV: Add ops Add "ops" style method for using analog TV functionality. Ops style calls will allow us to have arbitrarily long display pipelines, where each entity can call ops in the previous display entity. Signed-off-by: Tomi Valkeinen diff --git a/drivers/video/omap2/dss/venc.c b/drivers/video/omap2/dss/venc.c index e47b64e..496a106 100644 --- a/drivers/video/omap2/dss/venc.c +++ b/drivers/video/omap2/dss/venc.c @@ -564,6 +564,16 @@ int omapdss_venc_check_timings(struct omap_dss_device *dssdev, return -EINVAL; } +static void venc_get_timings(struct omap_dss_device *dssdev, + struct omap_video_timings *timings) +{ + mutex_lock(&venc.venc_lock); + + *timings = venc.timings; + + mutex_unlock(&venc.venc_lock); +} + u32 omapdss_venc_get_wss(struct omap_dss_device *dssdev) { /* Invert due to VENC_L21_WC_CTL:INV=1 */ @@ -779,6 +789,67 @@ static int venc_probe_pdata(struct platform_device *vencdev) return 0; } +static int venc_connect(struct omap_dss_device *dssdev, + struct omap_dss_device *dst) +{ + struct omap_overlay_manager *mgr; + int r; + + r = venc_init_regulator(); + if (r) + return r; + + mgr = omap_dss_get_overlay_manager(dssdev->dispc_channel); + if (!mgr) + return -ENODEV; + + r = dss_mgr_connect(mgr, dssdev); + if (r) + return r; + + r = omapdss_output_set_device(dssdev, dst); + if (r) { + DSSERR("failed to connect output to new device: %s\n", + dst->name); + dss_mgr_disconnect(mgr, dssdev); + return r; + } + + return 0; +} + +static void venc_disconnect(struct omap_dss_device *dssdev, + struct omap_dss_device *dst) +{ + WARN_ON(dst != dssdev->device); + + if (dst != dssdev->device) + return; + + omapdss_output_unset_device(dssdev); + + if (dssdev->manager) + dss_mgr_disconnect(dssdev->manager, dssdev); +} + +static const struct omapdss_atv_ops venc_ops = { + .connect = venc_connect, + .disconnect = venc_disconnect, + + .enable = omapdss_venc_display_enable, + .disable = omapdss_venc_display_disable, + + .check_timings = omapdss_venc_check_timings, + .set_timings = omapdss_venc_set_timings, + .get_timings = venc_get_timings, + + .set_type = omapdss_venc_set_type, + .invert_vid_out_polarity = omapdss_venc_invert_vid_out_polarity, + + .set_wss = omapdss_venc_set_wss, + .get_wss = omapdss_venc_get_wss, +}; + static void venc_init_output(struct platform_device *pdev) { struct omap_dss_device *out = &venc.output; @@ -788,6 +859,7 @@ static void venc_init_output(struct platform_device *pdev) out->output_type = OMAP_DISPLAY_TYPE_VENC; out->name = "venc.0"; out->dispc_channel = OMAP_DSS_CHANNEL_DIGIT; + out->ops.atv = &venc_ops; out->owner = THIS_MODULE; omapdss_register_output(out); diff --git a/include/video/omapdss.h b/include/video/omapdss.h index 3b3903f..adb1036 100644 --- a/include/video/omapdss.h +++ b/include/video/omapdss.h @@ -628,6 +628,31 @@ struct omapdss_dvi_ops { struct omap_video_timings *timings); }; +struct omapdss_atv_ops { + int (*connect)(struct omap_dss_device *dssdev, + struct omap_dss_device *dst); + void (*disconnect)(struct omap_dss_device *dssdev, + struct omap_dss_device *dst); + + int (*enable)(struct omap_dss_device *dssdev); + void (*disable)(struct omap_dss_device *dssdev); + + int (*check_timings)(struct omap_dss_device *dssdev, + struct omap_video_timings *timings); + void (*set_timings)(struct omap_dss_device *dssdev, + struct omap_video_timings *timings); + void (*get_timings)(struct omap_dss_device *dssdev, + struct omap_video_timings *timings); + + void (*set_type)(struct omap_dss_device *dssdev, + enum omap_dss_venc_type type); + void (*invert_vid_out_polarity)(struct omap_dss_device *dssdev, + bool invert_polarity); + + int (*set_wss)(struct omap_dss_device *dssdev, u32 wss); + u32 (*get_wss)(struct omap_dss_device *dssdev); +}; + struct omap_dss_device { /* old device, to be removed */ struct device old_dev; @@ -697,6 +722,7 @@ struct omap_dss_device { const struct omapdss_dpi_ops *dpi; const struct omapdss_sdi_ops *sdi; const struct omapdss_dvi_ops *dvi; + const struct omapdss_atv_ops *atv; } ops; /* helper variable for driver suspend/resume */ -- cgit v0.10.2 From 0b450c31317914feb39616cb553b67c170aaf3d0 Mon Sep 17 00:00:00 2001 From: Tomi Valkeinen Date: Fri, 24 May 2013 13:20:17 +0300 Subject: OMAPDSS: HDMI: Add ops Add "ops" style method for using HDMI functionality. Ops style calls will allow us to have arbitrarily long display pipelines, where each entity can call ops in the previous display entity. Signed-off-by: Tomi Valkeinen diff --git a/drivers/video/omap2/dss/hdmi.c b/drivers/video/omap2/dss/hdmi.c index 2b0a2aa..44a885b 100644 --- a/drivers/video/omap2/dss/hdmi.c +++ b/drivers/video/omap2/dss/hdmi.c @@ -70,6 +70,8 @@ static struct { int ls_oe_gpio; int hpd_gpio; + bool core_enabled; + struct omap_dss_device output; } hdmi; @@ -515,8 +517,10 @@ static int hdmi_power_on_core(struct omap_dss_device *dssdev) { int r; - gpio_set_value(hdmi.ct_cp_hpd_gpio, 1); - gpio_set_value(hdmi.ls_oe_gpio, 1); + if (gpio_is_valid(hdmi.ct_cp_hpd_gpio)) + gpio_set_value(hdmi.ct_cp_hpd_gpio, 1); + if (gpio_is_valid(hdmi.ls_oe_gpio)) + gpio_set_value(hdmi.ls_oe_gpio, 1); /* wait 300us after CT_CP_HPD for the 5V power output to reach 90% */ udelay(300); @@ -532,22 +536,30 @@ static int hdmi_power_on_core(struct omap_dss_device *dssdev) /* Make selection of HDMI in DSS */ dss_select_hdmi_venc_clk_source(DSS_HDMI_M_PCLK); + hdmi.core_enabled = true; + return 0; err_runtime_get: regulator_disable(hdmi.vdda_hdmi_dac_reg); err_vdac_enable: - gpio_set_value(hdmi.ct_cp_hpd_gpio, 0); - gpio_set_value(hdmi.ls_oe_gpio, 0); + if (gpio_is_valid(hdmi.ct_cp_hpd_gpio)) + gpio_set_value(hdmi.ct_cp_hpd_gpio, 0); + if (gpio_is_valid(hdmi.ls_oe_gpio)) + gpio_set_value(hdmi.ls_oe_gpio, 0); return r; } static void hdmi_power_off_core(struct omap_dss_device *dssdev) { + hdmi.core_enabled = false; + hdmi_runtime_put(); regulator_disable(hdmi.vdda_hdmi_dac_reg); - gpio_set_value(hdmi.ct_cp_hpd_gpio, 0); - gpio_set_value(hdmi.ls_oe_gpio, 0); + if (gpio_is_valid(hdmi.ct_cp_hpd_gpio)) + gpio_set_value(hdmi.ct_cp_hpd_gpio, 0); + if (gpio_is_valid(hdmi.ls_oe_gpio)) + gpio_set_value(hdmi.ls_oe_gpio, 0); } static int hdmi_power_on_full(struct omap_dss_device *dssdev) @@ -662,6 +674,18 @@ void omapdss_hdmi_display_set_timing(struct omap_dss_device *dssdev, mutex_unlock(&hdmi.lock); } +static void omapdss_hdmi_display_get_timings(struct omap_dss_device *dssdev, + struct omap_video_timings *timings) +{ + const struct hdmi_config *cfg; + + cfg = hdmi_get_timings(); + if (cfg == NULL) + cfg = &vesa_timings[0]; + + memcpy(timings, &cfg->timings, sizeof(cfg->timings)); +} + static void hdmi_dump_regs(struct seq_file *s) { mutex_lock(&hdmi.lock); @@ -1025,6 +1049,199 @@ static int hdmi_probe_pdata(struct platform_device *pdev) return 0; } +static int hdmi_connect(struct omap_dss_device *dssdev, + struct omap_dss_device *dst) +{ + struct omap_overlay_manager *mgr; + int r; + + dss_init_hdmi_ip_ops(&hdmi.ip_data, omapdss_get_version()); + + r = hdmi_init_regulator(); + if (r) + return r; + + mgr = omap_dss_get_overlay_manager(dssdev->dispc_channel); + if (!mgr) + return -ENODEV; + + r = dss_mgr_connect(mgr, dssdev); + if (r) + return r; + + r = omapdss_output_set_device(dssdev, dst); + if (r) { + DSSERR("failed to connect output to new device: %s\n", + dst->name); + dss_mgr_disconnect(mgr, dssdev); + return r; + } + + return 0; +} + +static void hdmi_disconnect(struct omap_dss_device *dssdev, + struct omap_dss_device *dst) +{ + WARN_ON(dst != dssdev->device); + + if (dst != dssdev->device) + return; + + omapdss_output_unset_device(dssdev); + + if (dssdev->manager) + dss_mgr_disconnect(dssdev->manager, dssdev); +} + +static int hdmi_read_edid(struct omap_dss_device *dssdev, + u8 *edid, int len) +{ + bool need_enable; + int r; + + need_enable = hdmi.core_enabled == false; + + if (need_enable) { + r = omapdss_hdmi_core_enable(dssdev); + if (r) + return r; + } + + r = omapdss_hdmi_read_edid(edid, len); + + if (need_enable) + omapdss_hdmi_core_disable(dssdev); + + return r; +} + +#if defined(CONFIG_OMAP4_DSS_HDMI_AUDIO) +static int omapdss_hdmi_audio_enable(struct omap_dss_device *dssdev) +{ + int r; + + mutex_lock(&hdmi.lock); + + if (!hdmi_mode_has_audio()) { + r = -EPERM; + goto err; + } + + r = hdmi_audio_enable(); + if (r) + goto err; + + mutex_unlock(&hdmi.lock); + return 0; + +err: + mutex_unlock(&hdmi.lock); + return r; +} + +static void omapdss_hdmi_audio_disable(struct omap_dss_device *dssdev) +{ + hdmi_audio_disable(); +} + +static int omapdss_hdmi_audio_start(struct omap_dss_device *dssdev) +{ + return hdmi_audio_start(); +} + +static void omapdss_hdmi_audio_stop(struct omap_dss_device *dssdev) +{ + hdmi_audio_stop(); +} + +static bool omapdss_hdmi_audio_supported(struct omap_dss_device *dssdev) +{ + bool r; + + mutex_lock(&hdmi.lock); + + r = hdmi_mode_has_audio(); + + mutex_unlock(&hdmi.lock); + return r; +} + +static int omapdss_hdmi_audio_config(struct omap_dss_device *dssdev, + struct omap_dss_audio *audio) +{ + int r; + + mutex_lock(&hdmi.lock); + + if (!hdmi_mode_has_audio()) { + r = -EPERM; + goto err; + } + + r = hdmi_audio_config(audio); + if (r) + goto err; + + mutex_unlock(&hdmi.lock); + return 0; + +err: + mutex_unlock(&hdmi.lock); + return r; +} +#else +static int omapdss_hdmi_audio_enable(struct omap_dss_device *dssdev) +{ + return -EPERM; +} + +static void omapdss_hdmi_audio_disable(struct omap_dss_device *dssdev) +{ +} + +static int omapdss_hdmi_audio_start(struct omap_dss_device *dssdev) +{ + return -EPERM; +} + +static void omapdss_hdmi_audio_stop(struct omap_dss_device *dssdev) +{ +} + +static bool omapdss_hdmi_audio_supported(struct omap_dss_device *dssdev) +{ + return false; +} + +static int omapdss_hdmi_audio_config(struct omap_dss_device *dssdev, + struct omap_dss_audio *audio) +{ + return -EPERM; +} +#endif + +static const struct omapdss_hdmi_ops hdmi_ops = { + .connect = hdmi_connect, + .disconnect = hdmi_disconnect, + + .enable = omapdss_hdmi_display_enable, + .disable = omapdss_hdmi_display_disable, + + .check_timings = omapdss_hdmi_display_check_timing, + .set_timings = omapdss_hdmi_display_set_timing, + .get_timings = omapdss_hdmi_display_get_timings, + + .read_edid = hdmi_read_edid, + + .audio_enable = omapdss_hdmi_audio_enable, + .audio_disable = omapdss_hdmi_audio_disable, + .audio_start = omapdss_hdmi_audio_start, + .audio_stop = omapdss_hdmi_audio_stop, + .audio_supported = omapdss_hdmi_audio_supported, + .audio_config = omapdss_hdmi_audio_config, +}; + static void hdmi_init_output(struct platform_device *pdev) { struct omap_dss_device *out = &hdmi.output; @@ -1034,6 +1251,7 @@ static void hdmi_init_output(struct platform_device *pdev) out->output_type = OMAP_DISPLAY_TYPE_HDMI; out->name = "hdmi.0"; out->dispc_channel = OMAP_DSS_CHANNEL_DIGIT; + out->ops.hdmi = &hdmi_ops; out->owner = THIS_MODULE; omapdss_register_output(out); @@ -1083,6 +1301,10 @@ static int omapdss_hdmihw_probe(struct platform_device *pdev) hdmi.ip_data.pll_offset = HDMI_PLLCTRL; hdmi.ip_data.phy_offset = HDMI_PHY; + hdmi.ct_cp_hpd_gpio = -1; + hdmi.ls_oe_gpio = -1; + hdmi.hpd_gpio = -1; + hdmi_init_output(pdev); r = hdmi_panel_init(); diff --git a/include/video/omapdss.h b/include/video/omapdss.h index adb1036..709e801 100644 --- a/include/video/omapdss.h +++ b/include/video/omapdss.h @@ -172,6 +172,11 @@ enum omap_dss_audio_state { OMAP_DSS_AUDIO_PLAYING, }; +struct omap_dss_audio { + struct snd_aes_iec958 *iec; + struct snd_cea_861_aud_if *cea; +}; + enum omap_dss_rotation_type { OMAP_DSS_ROT_DMA = 1 << 0, OMAP_DSS_ROT_VRFB = 1 << 1, @@ -653,6 +658,39 @@ struct omapdss_atv_ops { u32 (*get_wss)(struct omap_dss_device *dssdev); }; +struct omapdss_hdmi_ops { + int (*connect)(struct omap_dss_device *dssdev, + struct omap_dss_device *dst); + void (*disconnect)(struct omap_dss_device *dssdev, + struct omap_dss_device *dst); + + int (*enable)(struct omap_dss_device *dssdev); + void (*disable)(struct omap_dss_device *dssdev); + + int (*check_timings)(struct omap_dss_device *dssdev, + struct omap_video_timings *timings); + void (*set_timings)(struct omap_dss_device *dssdev, + struct omap_video_timings *timings); + void (*get_timings)(struct omap_dss_device *dssdev, + struct omap_video_timings *timings); + + int (*read_edid)(struct omap_dss_device *dssdev, u8 *buf, int len); + bool (*detect)(struct omap_dss_device *dssdev); + + /* + * Note: These functions might sleep. Do not call while + * holding a spinlock/readlock. + */ + int (*audio_enable)(struct omap_dss_device *dssdev); + void (*audio_disable)(struct omap_dss_device *dssdev); + bool (*audio_supported)(struct omap_dss_device *dssdev); + int (*audio_config)(struct omap_dss_device *dssdev, + struct omap_dss_audio *audio); + /* Note: These functions may not sleep */ + int (*audio_start)(struct omap_dss_device *dssdev); + void (*audio_stop)(struct omap_dss_device *dssdev); +}; + struct omap_dss_device { /* old device, to be removed */ struct device old_dev; @@ -722,6 +760,7 @@ struct omap_dss_device { const struct omapdss_dpi_ops *dpi; const struct omapdss_sdi_ops *sdi; const struct omapdss_dvi_ops *dvi; + const struct omapdss_hdmi_ops *hdmi; const struct omapdss_atv_ops *atv; } ops; @@ -759,11 +798,6 @@ struct omap_dss_hdmi_data int hpd_gpio; }; -struct omap_dss_audio { - struct snd_aes_iec958 *iec; - struct snd_cea_861_aud_if *cea; -}; - struct omap_dss_driver { struct device_driver driver; -- cgit v0.10.2 From deb16df884966570ebe6197feecab100436414e5 Mon Sep 17 00:00:00 2001 From: Tomi Valkeinen Date: Fri, 24 May 2013 13:20:27 +0300 Subject: OMAPDSS: DSI: Add ops Add "ops" style method for using DSI functionality. Ops style calls will allow us to have arbitrarily long display pipelines, where each entity can call ops in the previous display entity. Signed-off-by: Tomi Valkeinen diff --git a/drivers/video/omap2/dss/dsi.c b/drivers/video/omap2/dss/dsi.c index 58fbff9..99a043b 100644 --- a/drivers/video/omap2/dss/dsi.c +++ b/drivers/video/omap2/dss/dsi.c @@ -383,6 +383,15 @@ static inline struct dsi_data *dsi_get_dsidrv_data(struct platform_device *dside static inline struct platform_device *dsi_get_dsidev_from_dssdev(struct omap_dss_device *dssdev) { + /* HACK: dssdev can be either the panel device, when using old API, or + * the dsi device itself, when using the new API. So we solve this for + * now by checking the dssdev->id. This will be removed when the old API + * is removed. + */ + if (dssdev->id == OMAP_DSS_OUTPUT_DSI1 || + dssdev->id == OMAP_DSS_OUTPUT_DSI2) + return to_platform_device(dssdev->dev); + return to_platform_device(dssdev->output->dev); } @@ -5412,6 +5421,89 @@ static int dsi_probe_pdata(struct platform_device *dsidev) return 0; } +static int dsi_connect(struct omap_dss_device *dssdev, + struct omap_dss_device *dst) +{ + struct platform_device *dsidev = dsi_get_dsidev_from_dssdev(dssdev); + struct omap_overlay_manager *mgr; + int r; + + r = dsi_regulator_init(dsidev); + if (r) + return r; + + mgr = omap_dss_get_overlay_manager(dssdev->dispc_channel); + if (!mgr) + return -ENODEV; + + r = dss_mgr_connect(mgr, dssdev); + if (r) + return r; + + r = omapdss_output_set_device(dssdev, dst); + if (r) { + DSSERR("failed to connect output to new device: %s\n", + dssdev->name); + dss_mgr_disconnect(mgr, dssdev); + return r; + } + + return 0; +} + +static void dsi_disconnect(struct omap_dss_device *dssdev, + struct omap_dss_device *dst) +{ + WARN_ON(dst != dssdev->device); + + if (dst != dssdev->device) + return; + + omapdss_output_unset_device(dssdev); + + if (dssdev->manager) + dss_mgr_disconnect(dssdev->manager, dssdev); +} + +static const struct omapdss_dsi_ops dsi_ops = { + .connect = dsi_connect, + .disconnect = dsi_disconnect, + + .bus_lock = dsi_bus_lock, + .bus_unlock = dsi_bus_unlock, + + .enable = omapdss_dsi_display_enable, + .disable = omapdss_dsi_display_disable, + + .enable_hs = omapdss_dsi_vc_enable_hs, + + .configure_pins = omapdss_dsi_configure_pins, + .set_config = omapdss_dsi_set_config, + + .enable_video_output = dsi_enable_video_output, + .disable_video_output = dsi_disable_video_output, + + .update = omap_dsi_update, + + .enable_te = omapdss_dsi_enable_te, + + .request_vc = omap_dsi_request_vc, + .set_vc_id = omap_dsi_set_vc_id, + .release_vc = omap_dsi_release_vc, + + .dcs_write = dsi_vc_dcs_write, + .dcs_write_nosync = dsi_vc_dcs_write_nosync, + .dcs_read = dsi_vc_dcs_read, + + .gen_write = dsi_vc_generic_write, + .gen_write_nosync = dsi_vc_generic_write_nosync, + .gen_read = dsi_vc_generic_read, + + .bta_sync = dsi_vc_send_bta_sync, + + .set_max_rx_packet_size = dsi_vc_set_max_rx_packet_size, +}; + static void dsi_init_output(struct platform_device *dsidev) { struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev); @@ -5424,6 +5516,7 @@ static void dsi_init_output(struct platform_device *dsidev) out->output_type = OMAP_DISPLAY_TYPE_DSI; out->name = dsi->module_id == 0 ? "dsi.0" : "dsi.1"; out->dispc_channel = dsi_get_channel(dsi->module_id); + out->ops.dsi = &dsi_ops; out->owner = THIS_MODULE; omapdss_register_output(out); diff --git a/include/video/omapdss.h b/include/video/omapdss.h index 709e801..b394635 100644 --- a/include/video/omapdss.h +++ b/include/video/omapdss.h @@ -691,6 +691,63 @@ struct omapdss_hdmi_ops { void (*audio_stop)(struct omap_dss_device *dssdev); }; +struct omapdss_dsi_ops { + int (*connect)(struct omap_dss_device *dssdev, + struct omap_dss_device *dst); + void (*disconnect)(struct omap_dss_device *dssdev, + struct omap_dss_device *dst); + + int (*enable)(struct omap_dss_device *dssdev); + void (*disable)(struct omap_dss_device *dssdev, bool disconnect_lanes, + bool enter_ulps); + + /* bus configuration */ + int (*set_config)(struct omap_dss_device *dssdev, + const struct omap_dss_dsi_config *cfg); + int (*configure_pins)(struct omap_dss_device *dssdev, + const struct omap_dsi_pin_config *pin_cfg); + + void (*enable_hs)(struct omap_dss_device *dssdev, int channel, + bool enable); + int (*enable_te)(struct omap_dss_device *dssdev, bool enable); + + int (*update)(struct omap_dss_device *dssdev, int channel, + void (*callback)(int, void *), void *data); + + void (*bus_lock)(struct omap_dss_device *dssdev); + void (*bus_unlock)(struct omap_dss_device *dssdev); + + int (*enable_video_output)(struct omap_dss_device *dssdev, int channel); + void (*disable_video_output)(struct omap_dss_device *dssdev, + int channel); + + int (*request_vc)(struct omap_dss_device *dssdev, int *channel); + int (*set_vc_id)(struct omap_dss_device *dssdev, int channel, + int vc_id); + void (*release_vc)(struct omap_dss_device *dssdev, int channel); + + /* data transfer */ + int (*dcs_write)(struct omap_dss_device *dssdev, int channel, + u8 *data, int len); + int (*dcs_write_nosync)(struct omap_dss_device *dssdev, int channel, + u8 *data, int len); + int (*dcs_read)(struct omap_dss_device *dssdev, int channel, u8 dcs_cmd, + u8 *data, int len); + + int (*gen_write)(struct omap_dss_device *dssdev, int channel, + u8 *data, int len); + int (*gen_write_nosync)(struct omap_dss_device *dssdev, int channel, + u8 *data, int len); + int (*gen_read)(struct omap_dss_device *dssdev, int channel, + u8 *reqdata, int reqlen, + u8 *data, int len); + + int (*bta_sync)(struct omap_dss_device *dssdev, int channel); + + int (*set_max_rx_packet_size)(struct omap_dss_device *dssdev, + int channel, u16 plen); +}; + struct omap_dss_device { /* old device, to be removed */ struct device old_dev; @@ -762,6 +819,7 @@ struct omap_dss_device { const struct omapdss_dvi_ops *dvi; const struct omapdss_hdmi_ops *hdmi; const struct omapdss_atv_ops *atv; + const struct omapdss_dsi_ops *dsi; } ops; /* helper variable for driver suspend/resume */ -- cgit v0.10.2 From 2773fefbd764646a3dba3349d4848d90d85a127d Mon Sep 17 00:00:00 2001 From: Tomi Valkeinen Date: Fri, 24 May 2013 14:18:30 +0300 Subject: OMAPDSS: Add new TFP410 Encoder driver Add TFP410 DPI-to-DVI Encoder driver which uses the new DSS device model and DSS ops. Signed-off-by: Tomi Valkeinen diff --git a/drivers/video/omap2/Kconfig b/drivers/video/omap2/Kconfig index b07b2b0..56cad0f 100644 --- a/drivers/video/omap2/Kconfig +++ b/drivers/video/omap2/Kconfig @@ -6,5 +6,6 @@ if ARCH_OMAP2PLUS source "drivers/video/omap2/dss/Kconfig" source "drivers/video/omap2/omapfb/Kconfig" source "drivers/video/omap2/displays/Kconfig" +source "drivers/video/omap2/displays-new/Kconfig" endif diff --git a/drivers/video/omap2/Makefile b/drivers/video/omap2/Makefile index 296e5c5..86873c2 100644 --- a/drivers/video/omap2/Makefile +++ b/drivers/video/omap2/Makefile @@ -2,4 +2,5 @@ obj-$(CONFIG_OMAP2_VRFB) += vrfb.o obj-$(CONFIG_OMAP2_DSS) += dss/ obj-y += displays/ +obj-y += displays-new/ obj-$(CONFIG_FB_OMAP2) += omapfb/ diff --git a/drivers/video/omap2/displays-new/Kconfig b/drivers/video/omap2/displays-new/Kconfig new file mode 100644 index 0000000..92c2324 --- /dev/null +++ b/drivers/video/omap2/displays-new/Kconfig @@ -0,0 +1,9 @@ +menu "OMAP Display Device Drivers" + depends on OMAP2_DSS + +config DISPLAY_ENCODER_TFP410 + tristate "TFP410 DPI to DVI Encoder" + help + Driver for TFP410 DPI to DVI encoder. + +endmenu diff --git a/drivers/video/omap2/displays-new/Makefile b/drivers/video/omap2/displays-new/Makefile new file mode 100644 index 0000000..b0d3457 --- /dev/null +++ b/drivers/video/omap2/displays-new/Makefile @@ -0,0 +1 @@ +obj-$(CONFIG_DISPLAY_ENCODER_TFP410) += encoder-tfp410.o diff --git a/drivers/video/omap2/displays-new/encoder-tfp410.c b/drivers/video/omap2/displays-new/encoder-tfp410.c new file mode 100644 index 0000000..a04f658 --- /dev/null +++ b/drivers/video/omap2/displays-new/encoder-tfp410.c @@ -0,0 +1,267 @@ +/* + * TFP410 DPI-to-DVI encoder driver + * + * Copyright (C) 2013 Texas Instruments + * Author: Tomi Valkeinen + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 as published by + * the Free Software Foundation. + */ + +#include +#include +#include +#include + +#include