Lines Matching full:venc
3 * linux/drivers/video/omap2/dss/venc.c
8 * VENC settings from TI's DSS driver
11 #define DSS_SUBSYS_NAME "VENC"
35 /* Venc registers */
257 } venc; variable
261 __raw_writel(val, venc.base + idx); in venc_write_reg()
266 u32 l = __raw_readl(venc.base + idx); in venc_read_reg()
272 DSSDBG("write venc conf\n"); in venc_write_config()
285 venc.wss_data); in venc_write_config()
333 DSSERR("Failed to reset venc\n"); in venc_reset()
351 r = pm_runtime_resume_and_get(&venc.pdev->dev); in venc_runtime_get()
363 r = pm_runtime_put_sync(&venc.pdev->dev); in venc_runtime_put()
382 struct omap_overlay_manager *mgr = venc.output.manager; in venc_power_on()
391 venc_write_config(venc_timings_to_config(&venc.timings)); in venc_power_on()
393 dss_set_venc_output(venc.type); in venc_power_on()
398 if (venc.type == OMAP_DSS_VENC_TYPE_COMPOSITE) in venc_power_on()
403 if (venc.invert_polarity == false) in venc_power_on()
408 dss_mgr_set_timings(mgr, &venc.timings); in venc_power_on()
410 r = regulator_enable(venc.vdda_dac_reg); in venc_power_on()
421 regulator_disable(venc.vdda_dac_reg); in venc_power_on()
433 struct omap_overlay_manager *mgr = venc.output.manager; in venc_power_off()
440 regulator_disable(venc.vdda_dac_reg); in venc_power_off()
447 struct omap_dss_device *out = &venc.output; in venc_display_enable()
452 mutex_lock(&venc.venc_lock); in venc_display_enable()
464 venc.wss_data = 0; in venc_display_enable()
466 mutex_unlock(&venc.venc_lock); in venc_display_enable()
470 mutex_unlock(&venc.venc_lock); in venc_display_enable()
478 mutex_lock(&venc.venc_lock); in venc_display_disable()
482 mutex_unlock(&venc.venc_lock); in venc_display_disable()
490 mutex_lock(&venc.venc_lock); in venc_set_timings()
493 if (memcmp(&venc.timings, timings, sizeof(*timings))) in venc_set_timings()
494 venc.wss_data = 0; in venc_set_timings()
496 venc.timings = *timings; in venc_set_timings()
500 mutex_unlock(&venc.venc_lock); in venc_set_timings()
520 mutex_lock(&venc.venc_lock); in venc_get_timings()
522 *timings = venc.timings; in venc_get_timings()
524 mutex_unlock(&venc.venc_lock); in venc_get_timings()
530 return (venc.wss_data >> 8) ^ 0xfffff; in venc_get_wss()
540 mutex_lock(&venc.venc_lock); in venc_set_wss()
542 config = venc_timings_to_config(&venc.timings); in venc_set_wss()
545 venc.wss_data = (wss ^ 0xfffff) << 8; in venc_set_wss()
552 venc.wss_data); in venc_set_wss()
557 mutex_unlock(&venc.venc_lock); in venc_set_wss()
565 mutex_lock(&venc.venc_lock); in venc_set_type()
567 venc.type = type; in venc_set_type()
569 mutex_unlock(&venc.venc_lock); in venc_set_type()
575 mutex_lock(&venc.venc_lock); in venc_invert_vid_out_polarity()
577 venc.invert_polarity = invert_polarity; in venc_invert_vid_out_polarity()
579 mutex_unlock(&venc.venc_lock); in venc_invert_vid_out_polarity()
586 if (venc.vdda_dac_reg != NULL) in venc_init_regulator()
589 if (venc.pdev->dev.of_node) in venc_init_regulator()
590 vdda_dac = devm_regulator_get(&venc.pdev->dev, "vdda"); in venc_init_regulator()
592 vdda_dac = devm_regulator_get(&venc.pdev->dev, "vdda_dac"); in venc_init_regulator()
600 venc.vdda_dac_reg = vdda_dac; in venc_init_regulator()
673 venc.tv_dac_clk = clk; in venc_get_clocks()
741 struct omap_dss_device *out = &venc.output; in venc_init_output()
746 out->name = "venc.0"; in venc_init_output()
756 struct omap_dss_device *out = &venc.output; in venc_uninit_output()
772 venc.invert_polarity = of_property_read_bool(ep, "ti,invert-polarity"); in venc_probe_of()
783 venc.type = OMAP_DSS_VENC_TYPE_COMPOSITE; in venc_probe_of()
786 venc.type = OMAP_DSS_VENC_TYPE_SVIDEO; in venc_probe_of()
803 /* VENC HW IP initialisation */
811 venc.pdev = pdev; in venc_bind()
813 mutex_init(&venc.venc_lock); in venc_bind()
815 venc.wss_data = 0; in venc_bind()
817 venc_mem = platform_get_resource(venc.pdev, IORESOURCE_MEM, 0); in venc_bind()
819 DSSERR("can't get IORESOURCE_MEM VENC\n"); in venc_bind()
823 venc.base = devm_ioremap(&pdev->dev, venc_mem->start, in venc_bind()
825 if (!venc.base) { in venc_bind()
826 DSSERR("can't ioremap VENC\n"); in venc_bind()
841 dev_dbg(&pdev->dev, "OMAP VENC rev %d\n", rev_id); in venc_bind()
853 dss_debugfs_create_file("venc", venc_dump_regs); in venc_bind()
891 clk_disable_unprepare(venc.tv_dac_clk); in venc_runtime_suspend()
906 return clk_prepare_enable(venc.tv_dac_clk); in venc_runtime_resume()
915 { .compatible = "ti,omap2-venc", },
916 { .compatible = "ti,omap3-venc", },
917 { .compatible = "ti,omap4-venc", },