Lines Matching full:tv

339 	struct sun4i_tv *tv = drm_encoder_to_sun4i_tv(encoder);  in sun4i_tv_disable()  local
342 DRM_DEBUG_DRIVER("Disabling the TV Output\n"); in sun4i_tv_disable()
344 regmap_update_bits(tv->regs, SUN4I_TVE_EN_REG, in sun4i_tv_disable()
354 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()
364 regmap_update_bits(tv->regs, SUN4I_TVE_EN_REG, in sun4i_tv_enable()
372 regmap_write(tv->regs, SUN4I_TVE_CFG0_REG, in sun4i_tv_enable()
381 regmap_write(tv->regs, SUN4I_TVE_DAC0_REG, in sun4i_tv_enable()
392 regmap_write(tv->regs, SUN4I_TVE_NOTCH_REG, in sun4i_tv_enable()
396 regmap_write(tv->regs, SUN4I_TVE_CHROMA_FREQ_REG, in sun4i_tv_enable()
400 regmap_write(tv->regs, SUN4I_TVE_PORCH_REG, in sun4i_tv_enable()
405 regmap_write(tv->regs, SUN4I_TVE_LINE_REG, in sun4i_tv_enable()
409 regmap_write(tv->regs, SUN4I_TVE_LEVEL_REG, in sun4i_tv_enable()
413 regmap_write(tv->regs, SUN4I_TVE_DAC1_REG, in sun4i_tv_enable()
419 regmap_write(tv->regs, SUN4I_TVE_CB_CR_LVL_REG, in sun4i_tv_enable()
424 regmap_write(tv->regs, SUN4I_TVE_BURST_WIDTH_REG, in sun4i_tv_enable()
429 regmap_write(tv->regs, SUN4I_TVE_CB_CR_GAIN_REG, in sun4i_tv_enable()
433 regmap_write(tv->regs, SUN4I_TVE_SYNC_VBI_REG, in sun4i_tv_enable()
437 regmap_write(tv->regs, SUN4I_TVE_ACTIVE_LINE_REG, in sun4i_tv_enable()
441 regmap_write(tv->regs, SUN4I_TVE_CHROMA_REG, in sun4i_tv_enable()
444 regmap_write(tv->regs, SUN4I_TVE_12C_REG, in sun4i_tv_enable()
448 regmap_write(tv->regs, SUN4I_TVE_RESYNC_REG, in sun4i_tv_enable()
454 regmap_write(tv->regs, SUN4I_TVE_SLAVE_REG, 0); in sun4i_tv_enable()
458 regmap_update_bits(tv->regs, SUN4I_TVE_EN_REG, in sun4i_tv_enable()
508 .name = "tv-encoder",
517 struct sun4i_tv *tv; in sun4i_tv_bind() local
521 tv = devm_kzalloc(dev, sizeof(*tv), GFP_KERNEL); in sun4i_tv_bind()
522 if (!tv) in sun4i_tv_bind()
524 tv->drv = drv; in sun4i_tv_bind()
525 dev_set_drvdata(dev, tv); in sun4i_tv_bind()
529 dev_err(dev, "Couldn't map the TV encoder registers\n"); in sun4i_tv_bind()
533 tv->regs = devm_regmap_init_mmio(dev, regs, in sun4i_tv_bind()
535 if (IS_ERR(tv->regs)) { in sun4i_tv_bind()
536 dev_err(dev, "Couldn't create the TV encoder regmap\n"); in sun4i_tv_bind()
537 return PTR_ERR(tv->regs); in sun4i_tv_bind()
540 tv->reset = devm_reset_control_get(dev, NULL); in sun4i_tv_bind()
541 if (IS_ERR(tv->reset)) { in sun4i_tv_bind()
543 return PTR_ERR(tv->reset); in sun4i_tv_bind()
546 ret = reset_control_deassert(tv->reset); in sun4i_tv_bind()
552 tv->clk = devm_clk_get(dev, NULL); in sun4i_tv_bind()
553 if (IS_ERR(tv->clk)) { in sun4i_tv_bind()
554 dev_err(dev, "Couldn't get the TV encoder clock\n"); in sun4i_tv_bind()
555 ret = PTR_ERR(tv->clk); in sun4i_tv_bind()
558 clk_prepare_enable(tv->clk); in sun4i_tv_bind()
560 drm_encoder_helper_add(&tv->encoder, in sun4i_tv_bind()
562 ret = drm_simple_encoder_init(drm, &tv->encoder, in sun4i_tv_bind()
565 dev_err(dev, "Couldn't initialise the TV encoder\n"); in sun4i_tv_bind()
569 tv->encoder.possible_crtcs = drm_of_find_possible_crtcs(drm, in sun4i_tv_bind()
571 if (!tv->encoder.possible_crtcs) { in sun4i_tv_bind()
576 drm_connector_helper_add(&tv->connector, in sun4i_tv_bind()
578 ret = drm_connector_init(drm, &tv->connector, in sun4i_tv_bind()
586 tv->connector.interlace_allowed = true; in sun4i_tv_bind()
588 drm_connector_attach_encoder(&tv->connector, &tv->encoder); in sun4i_tv_bind()
593 drm_encoder_cleanup(&tv->encoder); in sun4i_tv_bind()
595 clk_disable_unprepare(tv->clk); in sun4i_tv_bind()
597 reset_control_assert(tv->reset); in sun4i_tv_bind()
604 struct sun4i_tv *tv = dev_get_drvdata(dev); in sun4i_tv_unbind() local
606 drm_connector_cleanup(&tv->connector); in sun4i_tv_unbind()
607 drm_encoder_cleanup(&tv->encoder); in sun4i_tv_unbind()
608 clk_disable_unprepare(tv->clk); in sun4i_tv_unbind()
609 reset_control_assert(tv->reset); in sun4i_tv_unbind()
630 { .compatible = "allwinner,sun4i-a10-tv-encoder" },
646 MODULE_DESCRIPTION("Allwinner A10 TV Encoder Driver");