Lines Matching refs:tv
344 struct sun4i_tv *tv = drm_encoder_to_sun4i_tv(encoder);
349 regmap_update_bits(tv->regs, SUN4I_TVE_EN_REG,
358 struct sun4i_tv *tv = drm_encoder_to_sun4i_tv(encoder);
365 regmap_update_bits(tv->regs, SUN4I_TVE_EN_REG,
374 struct sun4i_tv *tv = drm_encoder_to_sun4i_tv(encoder);
378 regmap_update_bits(tv->regs, SUN4I_TVE_EN_REG,
386 regmap_write(tv->regs, SUN4I_TVE_CFG0_REG,
395 regmap_write(tv->regs, SUN4I_TVE_DAC0_REG,
406 regmap_write(tv->regs, SUN4I_TVE_NOTCH_REG,
410 regmap_write(tv->regs, SUN4I_TVE_CHROMA_FREQ_REG,
414 regmap_write(tv->regs, SUN4I_TVE_PORCH_REG,
419 regmap_write(tv->regs, SUN4I_TVE_LINE_REG,
423 regmap_write(tv->regs, SUN4I_TVE_LEVEL_REG,
427 regmap_write(tv->regs, SUN4I_TVE_DAC1_REG,
433 regmap_write(tv->regs, SUN4I_TVE_CB_CR_LVL_REG,
438 regmap_write(tv->regs, SUN4I_TVE_BURST_WIDTH_REG,
443 regmap_write(tv->regs, SUN4I_TVE_CB_CR_GAIN_REG,
447 regmap_write(tv->regs, SUN4I_TVE_SYNC_VBI_REG,
451 regmap_write(tv->regs, SUN4I_TVE_ACTIVE_LINE_REG,
455 regmap_write(tv->regs, SUN4I_TVE_CHROMA_REG,
458 regmap_write(tv->regs, SUN4I_TVE_12C_REG,
462 regmap_write(tv->regs, SUN4I_TVE_RESYNC_REG,
468 regmap_write(tv->regs, SUN4I_TVE_SLAVE_REG, 0);
531 .name = "tv-encoder",
540 struct sun4i_tv *tv;
545 tv = devm_kzalloc(dev, sizeof(*tv), GFP_KERNEL);
546 if (!tv)
548 tv->drv = drv;
549 dev_set_drvdata(dev, tv);
558 tv->regs = devm_regmap_init_mmio(dev, regs,
560 if (IS_ERR(tv->regs)) {
562 return PTR_ERR(tv->regs);
565 tv->reset = devm_reset_control_get(dev, NULL);
566 if (IS_ERR(tv->reset)) {
568 return PTR_ERR(tv->reset);
571 ret = reset_control_deassert(tv->reset);
577 tv->clk = devm_clk_get(dev, NULL);
578 if (IS_ERR(tv->clk)) {
580 ret = PTR_ERR(tv->clk);
583 clk_prepare_enable(tv->clk);
585 drm_encoder_helper_add(&tv->encoder,
587 ret = drm_simple_encoder_init(drm, &tv->encoder,
594 tv->encoder.possible_crtcs = drm_of_find_possible_crtcs(drm,
596 if (!tv->encoder.possible_crtcs) {
601 drm_connector_helper_add(&tv->connector,
603 ret = drm_connector_init(drm, &tv->connector,
611 tv->connector.interlace_allowed = true;
613 drm_connector_attach_encoder(&tv->connector, &tv->encoder);
618 drm_encoder_cleanup(&tv->encoder);
620 clk_disable_unprepare(tv->clk);
622 reset_control_assert(tv->reset);
629 struct sun4i_tv *tv = dev_get_drvdata(dev);
631 drm_connector_cleanup(&tv->connector);
632 drm_encoder_cleanup(&tv->encoder);
633 clk_disable_unprepare(tv->clk);
654 { .compatible = "allwinner,sun4i-a10-tv-encoder" },