aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorTomi Valkeinen <tomi.valkeinen@ti.com>2013-05-24 06:19:50 -0400
committerTomi Valkeinen <tomi.valkeinen@ti.com>2013-06-17 07:01:00 -0400
commitfb8efa49660ea450ad632c9d8b70f12e4a43a495 (patch)
tree04d9704190f3e7700966a786b7f377368744affc /drivers
parent7700c2d4f79c423f29a5c2c10ca5a9b9c8c5c60f (diff)
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 <tomi.valkeinen@ti.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/video/omap2/dss/venc.c72
1 files changed, 72 insertions, 0 deletions
diff --git a/drivers/video/omap2/dss/venc.c b/drivers/video/omap2/dss/venc.c
index e47b64eee62c..496a106fe823 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,
564 return -EINVAL; 564 return -EINVAL;
565} 565}
566 566
567static void venc_get_timings(struct omap_dss_device *dssdev,
568 struct omap_video_timings *timings)
569{
570 mutex_lock(&venc.venc_lock);
571
572 *timings = venc.timings;
573
574 mutex_unlock(&venc.venc_lock);
575}
576
567u32 omapdss_venc_get_wss(struct omap_dss_device *dssdev) 577u32 omapdss_venc_get_wss(struct omap_dss_device *dssdev)
568{ 578{
569 /* Invert due to VENC_L21_WC_CTL:INV=1 */ 579 /* Invert due to VENC_L21_WC_CTL:INV=1 */
@@ -779,6 +789,67 @@ static int venc_probe_pdata(struct platform_device *vencdev)
779 return 0; 789 return 0;
780} 790}
781 791
792static int venc_connect(struct omap_dss_device *dssdev,
793 struct omap_dss_device *dst)
794{
795 struct omap_overlay_manager *mgr;
796 int r;
797
798 r = venc_init_regulator();
799 if (r)
800 return r;
801
802 mgr = omap_dss_get_overlay_manager(dssdev->dispc_channel);
803 if (!mgr)
804 return -ENODEV;
805
806 r = dss_mgr_connect(mgr, dssdev);
807 if (r)
808 return r;
809
810 r = omapdss_output_set_device(dssdev, dst);
811 if (r) {
812 DSSERR("failed to connect output to new device: %s\n",
813 dst->name);
814 dss_mgr_disconnect(mgr, dssdev);
815 return r;
816 }
817
818 return 0;
819}
820
821static void venc_disconnect(struct omap_dss_device *dssdev,
822 struct omap_dss_device *dst)
823{
824 WARN_ON(dst != dssdev->device);
825
826 if (dst != dssdev->device)
827 return;
828
829 omapdss_output_unset_device(dssdev);
830
831 if (dssdev->manager)
832 dss_mgr_disconnect(dssdev->manager, dssdev);
833}
834
835static const struct omapdss_atv_ops venc_ops = {
836 .connect = venc_connect,
837 .disconnect = venc_disconnect,
838
839 .enable = omapdss_venc_display_enable,
840 .disable = omapdss_venc_display_disable,
841
842 .check_timings = omapdss_venc_check_timings,
843 .set_timings = omapdss_venc_set_timings,
844 .get_timings = venc_get_timings,
845
846 .set_type = omapdss_venc_set_type,
847 .invert_vid_out_polarity = omapdss_venc_invert_vid_out_polarity,
848
849 .set_wss = omapdss_venc_set_wss,
850 .get_wss = omapdss_venc_get_wss,
851};
852
782static void venc_init_output(struct platform_device *pdev) 853static void venc_init_output(struct platform_device *pdev)
783{ 854{
784 struct omap_dss_device *out = &venc.output; 855 struct omap_dss_device *out = &venc.output;
@@ -788,6 +859,7 @@ static void venc_init_output(struct platform_device *pdev)
788 out->output_type = OMAP_DISPLAY_TYPE_VENC; 859 out->output_type = OMAP_DISPLAY_TYPE_VENC;
789 out->name = "venc.0"; 860 out->name = "venc.0";
790 out->dispc_channel = OMAP_DSS_CHANNEL_DIGIT; 861 out->dispc_channel = OMAP_DSS_CHANNEL_DIGIT;
862 out->ops.atv = &venc_ops;
791 out->owner = THIS_MODULE; 863 out->owner = THIS_MODULE;
792 864
793 omapdss_register_output(out); 865 omapdss_register_output(out);