Lines Matching full:tv

344 	struct sun4i_tv *tv = drm_encoder_to_sun4i_tv(encoder);  in sun4i_tv_disable()  local
347 DRM_DEBUG_DRIVER("Disabling the TV Output\n"); in sun4i_tv_disable()
349 regmap_update_bits(tv->regs, SUN4I_TVE_EN_REG, in sun4i_tv_disable()
358 struct sun4i_tv *tv = drm_encoder_to_sun4i_tv(encoder); in sun4i_tv_enable() local
361 DRM_DEBUG_DRIVER("Enabling the TV Output\n"); in sun4i_tv_enable()
365 regmap_update_bits(tv->regs, SUN4I_TVE_EN_REG, in sun4i_tv_enable()
374 struct sun4i_tv *tv = drm_encoder_to_sun4i_tv(encoder); in sun4i_tv_mode_set() local
378 regmap_update_bits(tv->regs, SUN4I_TVE_EN_REG, in sun4i_tv_mode_set()
386 regmap_write(tv->regs, SUN4I_TVE_CFG0_REG, in sun4i_tv_mode_set()
395 regmap_write(tv->regs, SUN4I_TVE_DAC0_REG, in sun4i_tv_mode_set()
406 regmap_write(tv->regs, SUN4I_TVE_NOTCH_REG, in sun4i_tv_mode_set()
410 regmap_write(tv->regs, SUN4I_TVE_CHROMA_FREQ_REG, in sun4i_tv_mode_set()
414 regmap_write(tv->regs, SUN4I_TVE_PORCH_REG, in sun4i_tv_mode_set()
419 regmap_write(tv->regs, SUN4I_TVE_LINE_REG, in sun4i_tv_mode_set()
423 regmap_write(tv->regs, SUN4I_TVE_LEVEL_REG, in sun4i_tv_mode_set()
427 regmap_write(tv->regs, SUN4I_TVE_DAC1_REG, in sun4i_tv_mode_set()
433 regmap_write(tv->regs, SUN4I_TVE_CB_CR_LVL_REG, in sun4i_tv_mode_set()
438 regmap_write(tv->regs, SUN4I_TVE_BURST_WIDTH_REG, in sun4i_tv_mode_set()
443 regmap_write(tv->regs, SUN4I_TVE_CB_CR_GAIN_REG, in sun4i_tv_mode_set()
447 regmap_write(tv->regs, SUN4I_TVE_SYNC_VBI_REG, in sun4i_tv_mode_set()
451 regmap_write(tv->regs, SUN4I_TVE_ACTIVE_LINE_REG, in sun4i_tv_mode_set()
455 regmap_write(tv->regs, SUN4I_TVE_CHROMA_REG, in sun4i_tv_mode_set()
458 regmap_write(tv->regs, SUN4I_TVE_12C_REG, in sun4i_tv_mode_set()
462 regmap_write(tv->regs, SUN4I_TVE_RESYNC_REG, in sun4i_tv_mode_set()
468 regmap_write(tv->regs, SUN4I_TVE_SLAVE_REG, 0); in sun4i_tv_mode_set()
531 .name = "tv-encoder",
540 struct sun4i_tv *tv; in sun4i_tv_bind() local
545 tv = devm_kzalloc(dev, sizeof(*tv), GFP_KERNEL); in sun4i_tv_bind()
546 if (!tv) in sun4i_tv_bind()
548 tv->drv = drv; in sun4i_tv_bind()
549 dev_set_drvdata(dev, tv); in sun4i_tv_bind()
554 dev_err(dev, "Couldn't map the TV encoder registers\n"); in sun4i_tv_bind()
558 tv->regs = devm_regmap_init_mmio(dev, regs, in sun4i_tv_bind()
560 if (IS_ERR(tv->regs)) { in sun4i_tv_bind()
561 dev_err(dev, "Couldn't create the TV encoder regmap\n"); in sun4i_tv_bind()
562 return PTR_ERR(tv->regs); in sun4i_tv_bind()
565 tv->reset = devm_reset_control_get(dev, NULL); in sun4i_tv_bind()
566 if (IS_ERR(tv->reset)) { in sun4i_tv_bind()
568 return PTR_ERR(tv->reset); in sun4i_tv_bind()
571 ret = reset_control_deassert(tv->reset); in sun4i_tv_bind()
577 tv->clk = devm_clk_get(dev, NULL); in sun4i_tv_bind()
578 if (IS_ERR(tv->clk)) { in sun4i_tv_bind()
579 dev_err(dev, "Couldn't get the TV encoder clock\n"); in sun4i_tv_bind()
580 ret = PTR_ERR(tv->clk); in sun4i_tv_bind()
583 clk_prepare_enable(tv->clk); in sun4i_tv_bind()
585 drm_encoder_helper_add(&tv->encoder, in sun4i_tv_bind()
587 ret = drm_simple_encoder_init(drm, &tv->encoder, in sun4i_tv_bind()
590 dev_err(dev, "Couldn't initialise the TV encoder\n"); in sun4i_tv_bind()
594 tv->encoder.possible_crtcs = drm_of_find_possible_crtcs(drm, in sun4i_tv_bind()
596 if (!tv->encoder.possible_crtcs) { in sun4i_tv_bind()
601 drm_connector_helper_add(&tv->connector, in sun4i_tv_bind()
603 ret = drm_connector_init(drm, &tv->connector, in sun4i_tv_bind()
611 tv->connector.interlace_allowed = true; in sun4i_tv_bind()
613 drm_connector_attach_encoder(&tv->connector, &tv->encoder); in sun4i_tv_bind()
618 drm_encoder_cleanup(&tv->encoder); in sun4i_tv_bind()
620 clk_disable_unprepare(tv->clk); in sun4i_tv_bind()
622 reset_control_assert(tv->reset); in sun4i_tv_bind()
629 struct sun4i_tv *tv = dev_get_drvdata(dev); in sun4i_tv_unbind() local
631 drm_connector_cleanup(&tv->connector); in sun4i_tv_unbind()
632 drm_encoder_cleanup(&tv->encoder); in sun4i_tv_unbind()
633 clk_disable_unprepare(tv->clk); in sun4i_tv_unbind()
654 { .compatible = "allwinner,sun4i-a10-tv-encoder" },
670 MODULE_DESCRIPTION("Allwinner A10 TV Encoder Driver");