Lines Matching refs:tv

266 	struct sun4i_tv *tv = drm_encoder_to_sun4i_tv(encoder);  in sun4i_tv_disable()  local
271 regmap_update_bits(tv->regs, SUN4I_TVE_EN_REG, in sun4i_tv_disable()
281 struct sun4i_tv *tv = drm_encoder_to_sun4i_tv(encoder); in sun4i_tv_enable() local
286 struct drm_connector *connector = &tv->connector; in sun4i_tv_enable()
290 sun4i_tv_find_tv_by_mode(conn_state->tv.mode); in sun4i_tv_enable()
295 regmap_update_bits(tv->regs, SUN4I_TVE_EN_REG, in sun4i_tv_enable()
303 regmap_write(tv->regs, SUN4I_TVE_CFG0_REG, in sun4i_tv_enable()
312 regmap_write(tv->regs, SUN4I_TVE_DAC0_REG, in sun4i_tv_enable()
323 regmap_write(tv->regs, SUN4I_TVE_NOTCH_REG, in sun4i_tv_enable()
327 regmap_write(tv->regs, SUN4I_TVE_CHROMA_FREQ_REG, in sun4i_tv_enable()
331 regmap_write(tv->regs, SUN4I_TVE_PORCH_REG, in sun4i_tv_enable()
336 regmap_write(tv->regs, SUN4I_TVE_LINE_REG, in sun4i_tv_enable()
340 regmap_write(tv->regs, SUN4I_TVE_LEVEL_REG, in sun4i_tv_enable()
344 regmap_write(tv->regs, SUN4I_TVE_DAC1_REG, in sun4i_tv_enable()
350 regmap_write(tv->regs, SUN4I_TVE_CB_CR_LVL_REG, in sun4i_tv_enable()
355 regmap_write(tv->regs, SUN4I_TVE_BURST_WIDTH_REG, in sun4i_tv_enable()
360 regmap_write(tv->regs, SUN4I_TVE_CB_CR_GAIN_REG, in sun4i_tv_enable()
364 regmap_write(tv->regs, SUN4I_TVE_SYNC_VBI_REG, in sun4i_tv_enable()
368 regmap_write(tv->regs, SUN4I_TVE_ACTIVE_LINE_REG, in sun4i_tv_enable()
372 regmap_write(tv->regs, SUN4I_TVE_CHROMA_REG, in sun4i_tv_enable()
375 regmap_write(tv->regs, SUN4I_TVE_12C_REG, in sun4i_tv_enable()
379 regmap_write(tv->regs, SUN4I_TVE_RESYNC_REG, in sun4i_tv_enable()
385 regmap_write(tv->regs, SUN4I_TVE_SLAVE_REG, 0); in sun4i_tv_enable()
389 regmap_update_bits(tv->regs, SUN4I_TVE_EN_REG, in sun4i_tv_enable()
432 struct sun4i_tv *tv; in sun4i_tv_bind() local
436 tv = devm_kzalloc(dev, sizeof(*tv), GFP_KERNEL); in sun4i_tv_bind()
437 if (!tv) in sun4i_tv_bind()
439 tv->drv = drv; in sun4i_tv_bind()
440 dev_set_drvdata(dev, tv); in sun4i_tv_bind()
448 tv->regs = devm_regmap_init_mmio(dev, regs, in sun4i_tv_bind()
450 if (IS_ERR(tv->regs)) { in sun4i_tv_bind()
452 return PTR_ERR(tv->regs); in sun4i_tv_bind()
455 tv->reset = devm_reset_control_get(dev, NULL); in sun4i_tv_bind()
456 if (IS_ERR(tv->reset)) { in sun4i_tv_bind()
458 return PTR_ERR(tv->reset); in sun4i_tv_bind()
461 ret = reset_control_deassert(tv->reset); in sun4i_tv_bind()
467 tv->clk = devm_clk_get(dev, NULL); in sun4i_tv_bind()
468 if (IS_ERR(tv->clk)) { in sun4i_tv_bind()
470 ret = PTR_ERR(tv->clk); in sun4i_tv_bind()
473 clk_prepare_enable(tv->clk); in sun4i_tv_bind()
475 drm_encoder_helper_add(&tv->encoder, in sun4i_tv_bind()
477 ret = drm_simple_encoder_init(drm, &tv->encoder, in sun4i_tv_bind()
484 tv->encoder.possible_crtcs = drm_of_find_possible_crtcs(drm, in sun4i_tv_bind()
486 if (!tv->encoder.possible_crtcs) { in sun4i_tv_bind()
491 drm_connector_helper_add(&tv->connector, in sun4i_tv_bind()
493 ret = drm_connector_init(drm, &tv->connector, in sun4i_tv_bind()
501 tv->connector.interlace_allowed = true; in sun4i_tv_bind()
503 drm_connector_attach_encoder(&tv->connector, &tv->encoder); in sun4i_tv_bind()
511 drm_object_attach_property(&tv->connector.base, in sun4i_tv_bind()
518 drm_connector_cleanup(&tv->connector); in sun4i_tv_bind()
520 drm_encoder_cleanup(&tv->encoder); in sun4i_tv_bind()
522 clk_disable_unprepare(tv->clk); in sun4i_tv_bind()
524 reset_control_assert(tv->reset); in sun4i_tv_bind()
531 struct sun4i_tv *tv = dev_get_drvdata(dev); in sun4i_tv_unbind() local
533 drm_connector_cleanup(&tv->connector); in sun4i_tv_unbind()
534 drm_encoder_cleanup(&tv->encoder); in sun4i_tv_unbind()
535 clk_disable_unprepare(tv->clk); in sun4i_tv_unbind()
536 reset_control_assert(tv->reset); in sun4i_tv_unbind()