Lines Matching +full:clk +full:- +full:mgr

1 // SPDX-License-Identifier: GPL-2.0-only
15 #include <linux/clk.h>
249 struct clk *tv_dac_clk;
273 venc_write_reg(VENC_LLEN, config->llen); in venc_write_config()
274 venc_write_reg(VENC_FLENS, config->flens); in venc_write_config()
275 venc_write_reg(VENC_CC_CARR_WSS_CARR, config->cc_carr_wss_carr); in venc_write_config()
276 venc_write_reg(VENC_C_PHASE, config->c_phase); in venc_write_config()
277 venc_write_reg(VENC_GAIN_U, config->gain_u); in venc_write_config()
278 venc_write_reg(VENC_GAIN_V, config->gain_v); in venc_write_config()
279 venc_write_reg(VENC_GAIN_Y, config->gain_y); in venc_write_config()
280 venc_write_reg(VENC_BLACK_LEVEL, config->black_level); in venc_write_config()
281 venc_write_reg(VENC_BLANK_LEVEL, config->blank_level); in venc_write_config()
282 venc_write_reg(VENC_M_CONTROL, config->m_control); in venc_write_config()
283 venc_write_reg(VENC_BSTAMP_WSS_DATA, config->bstamp_wss_data | in venc_write_config()
285 venc_write_reg(VENC_S_CARR, config->s_carr); in venc_write_config()
286 venc_write_reg(VENC_L21__WC_CTL, config->l21__wc_ctl); in venc_write_config()
287 venc_write_reg(VENC_SAVID__EAVID, config->savid__eavid); in venc_write_config()
288 venc_write_reg(VENC_FLEN__FAL, config->flen__fal); in venc_write_config()
289 venc_write_reg(VENC_LAL__PHASE_RESET, config->lal__phase_reset); in venc_write_config()
290 venc_write_reg(VENC_HS_INT_START_STOP_X, config->hs_int_start_stop_x); in venc_write_config()
291 venc_write_reg(VENC_HS_EXT_START_STOP_X, config->hs_ext_start_stop_x); in venc_write_config()
292 venc_write_reg(VENC_VS_INT_START_X, config->vs_int_start_x); in venc_write_config()
294 config->vs_int_stop_x__vs_int_start_y); in venc_write_config()
296 config->vs_int_stop_y__vs_ext_start_x); in venc_write_config()
298 config->vs_ext_stop_x__vs_ext_start_y); in venc_write_config()
299 venc_write_reg(VENC_VS_EXT_STOP_Y, config->vs_ext_stop_y); in venc_write_config()
300 venc_write_reg(VENC_AVID_START_STOP_X, config->avid_start_stop_x); in venc_write_config()
301 venc_write_reg(VENC_AVID_START_STOP_Y, config->avid_start_stop_y); in venc_write_config()
303 config->fid_int_start_x__fid_int_start_y); in venc_write_config()
305 config->fid_int_offset_y__fid_ext_start_x); in venc_write_config()
307 config->fid_ext_start_y__fid_ext_offset_y); in venc_write_config()
310 venc_write_reg(VENC_VIDOUT_CTRL, config->vidout_ctrl); in venc_write_config()
311 venc_write_reg(VENC_HFLTR_CTRL, config->hfltr_ctrl); in venc_write_config()
312 venc_write_reg(VENC_X_COLOR, config->x_color); in venc_write_config()
313 venc_write_reg(VENC_LINE21, config->line21); in venc_write_config()
314 venc_write_reg(VENC_LN_SEL, config->ln_sel); in venc_write_config()
315 venc_write_reg(VENC_HTRIGGER_VTRIGGER, config->htrigger_vtrigger); in venc_write_config()
317 config->tvdetgp_int_start_stop_x); in venc_write_config()
319 config->tvdetgp_int_start_stop_y); in venc_write_config()
320 venc_write_reg(VENC_GEN_CTRL, config->gen_ctrl); in venc_write_config()
321 venc_write_reg(VENC_F_CONTROL, config->f_control); in venc_write_config()
322 venc_write_reg(VENC_SYNC_CTRL, config->sync_ctrl); in venc_write_config()
331 if (--t == 0) { in venc_reset()
350 r = pm_runtime_get_sync(&venc.pdev->dev); in venc_runtime_get()
352 pm_runtime_put_sync(&venc.pdev->dev); in venc_runtime_get()
364 r = pm_runtime_put_sync(&venc.pdev->dev); in venc_runtime_put()
365 WARN_ON(r < 0 && r != -ENOSYS); in venc_runtime_put()
383 struct omap_overlay_manager *mgr = venc.output.manager; in venc_power_on() local
401 else /* S-Video */ in venc_power_on()
409 dss_mgr_set_timings(mgr, &venc.timings); in venc_power_on()
415 r = dss_mgr_enable(mgr); in venc_power_on()
434 struct omap_overlay_manager *mgr = venc.output.manager; in venc_power_off() local
439 dss_mgr_disable(mgr); in venc_power_off()
455 if (out->manager == NULL) { in venc_display_enable()
457 r = -ENODEV; in venc_display_enable()
515 return -EINVAL; in venc_check_timings()
552 venc_write_reg(VENC_BSTAMP_WSS_DATA, config->bstamp_wss_data | in venc_set_wss()
590 if (venc.pdev->dev.of_node) in venc_init_regulator()
591 vdda_dac = devm_regulator_get(&venc.pdev->dev, "vdda"); in venc_init_regulator()
593 vdda_dac = devm_regulator_get(&venc.pdev->dev, "vdda_dac"); in venc_init_regulator()
596 if (PTR_ERR(vdda_dac) != -EPROBE_DEFER) in venc_init_regulator()
608 #define DUMPREG(r) seq_printf(s, "%-35s %08x\n", #r, venc_read_reg(r)) in venc_dump_regs()
662 struct clk *clk; in venc_get_clocks() local
665 clk = devm_clk_get(&pdev->dev, "tv_dac_clk"); in venc_get_clocks()
666 if (IS_ERR(clk)) { in venc_get_clocks()
668 return PTR_ERR(clk); in venc_get_clocks()
671 clk = NULL; in venc_get_clocks()
674 venc.tv_dac_clk = clk; in venc_get_clocks()
682 struct omap_overlay_manager *mgr; in venc_connect() local
689 mgr = omap_dss_get_overlay_manager(dssdev->dispc_channel); in venc_connect()
690 if (!mgr) in venc_connect()
691 return -ENODEV; in venc_connect()
693 r = dss_mgr_connect(mgr, dssdev); in venc_connect()
700 dst->name); in venc_connect()
701 dss_mgr_disconnect(mgr, dssdev); in venc_connect()
711 WARN_ON(dst != dssdev->dst); in venc_disconnect()
713 if (dst != dssdev->dst) in venc_disconnect()
718 if (dssdev->manager) in venc_disconnect()
719 dss_mgr_disconnect(dssdev->manager, dssdev); in venc_disconnect()
744 out->dev = &pdev->dev; in venc_init_output()
745 out->id = OMAP_DSS_OUTPUT_VENC; in venc_init_output()
746 out->output_type = OMAP_DISPLAY_TYPE_VENC; in venc_init_output()
747 out->name = "venc.0"; in venc_init_output()
748 out->dispc_channel = OMAP_DSS_CHANNEL_DIGIT; in venc_init_output()
749 out->ops.atv = &venc_ops; in venc_init_output()
750 out->owner = THIS_MODULE; in venc_init_output()
764 struct device_node *node = pdev->dev.of_node; in venc_probe_of()
773 venc.invert_polarity = of_property_read_bool(ep, "ti,invert-polarity"); in venc_probe_of()
777 dev_err(&pdev->dev, in venc_probe_of()
790 dev_err(&pdev->dev, "bad channel property '%d'\n", channels); in venc_probe_of()
791 r = -EINVAL; in venc_probe_of()
821 return -EINVAL; in venc_bind()
824 venc.base = devm_ioremap(&pdev->dev, venc_mem->start, in venc_bind()
828 return -ENOMEM; in venc_bind()
835 pm_runtime_enable(&pdev->dev); in venc_bind()
842 dev_dbg(&pdev->dev, "OMAP VENC rev %d\n", rev_id); in venc_bind()
846 if (pdev->dev.of_node) { in venc_bind()
862 pm_runtime_disable(&pdev->dev); in venc_bind()
872 pm_runtime_disable(&pdev->dev); in venc_unbind()
882 return component_add(&pdev->dev, &venc_component_ops); in venc_probe()
887 component_del(&pdev->dev, &venc_component_ops); in venc_remove()
921 { .compatible = "ti,omap2-venc", },
922 { .compatible = "ti,omap3-venc", },
923 { .compatible = "ti,omap4-venc", },