Lines Matching refs:tv
344 struct sun4i_tv *tv = drm_encoder_to_sun4i_tv(encoder); in sun4i_tv_disable() local
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
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()
540 struct sun4i_tv *tv; in sun4i_tv_bind() local
544 tv = devm_kzalloc(dev, sizeof(*tv), GFP_KERNEL); in sun4i_tv_bind()
545 if (!tv) in sun4i_tv_bind()
547 tv->drv = drv; in sun4i_tv_bind()
548 dev_set_drvdata(dev, tv); in sun4i_tv_bind()
556 tv->regs = devm_regmap_init_mmio(dev, regs, in sun4i_tv_bind()
558 if (IS_ERR(tv->regs)) { in sun4i_tv_bind()
560 return PTR_ERR(tv->regs); in sun4i_tv_bind()
563 tv->reset = devm_reset_control_get(dev, NULL); in sun4i_tv_bind()
564 if (IS_ERR(tv->reset)) { in sun4i_tv_bind()
566 return PTR_ERR(tv->reset); in sun4i_tv_bind()
569 ret = reset_control_deassert(tv->reset); in sun4i_tv_bind()
575 tv->clk = devm_clk_get(dev, NULL); in sun4i_tv_bind()
576 if (IS_ERR(tv->clk)) { in sun4i_tv_bind()
578 ret = PTR_ERR(tv->clk); in sun4i_tv_bind()
581 clk_prepare_enable(tv->clk); in sun4i_tv_bind()
583 drm_encoder_helper_add(&tv->encoder, in sun4i_tv_bind()
585 ret = drm_simple_encoder_init(drm, &tv->encoder, in sun4i_tv_bind()
592 tv->encoder.possible_crtcs = drm_of_find_possible_crtcs(drm, in sun4i_tv_bind()
594 if (!tv->encoder.possible_crtcs) { in sun4i_tv_bind()
599 drm_connector_helper_add(&tv->connector, in sun4i_tv_bind()
601 ret = drm_connector_init(drm, &tv->connector, in sun4i_tv_bind()
609 tv->connector.interlace_allowed = true; in sun4i_tv_bind()
611 drm_connector_attach_encoder(&tv->connector, &tv->encoder); in sun4i_tv_bind()
616 drm_encoder_cleanup(&tv->encoder); in sun4i_tv_bind()
618 clk_disable_unprepare(tv->clk); in sun4i_tv_bind()
620 reset_control_assert(tv->reset); in sun4i_tv_bind()
627 struct sun4i_tv *tv = dev_get_drvdata(dev); in sun4i_tv_unbind() local
629 drm_connector_cleanup(&tv->connector); in sun4i_tv_unbind()
630 drm_encoder_cleanup(&tv->encoder); in sun4i_tv_unbind()
631 clk_disable_unprepare(tv->clk); in sun4i_tv_unbind()