Lines Matching refs:tv_mode
141 struct tv_mode { struct
214 static const struct tv_mode tv_modes[] = {
293 static const struct tv_mode *sun4i_tv_find_tv_by_mode(const struct drm_display_mode *mode) in sun4i_tv_find_tv_by_mode()
299 const struct tv_mode *tv_mode = &tv_modes[i]; in sun4i_tv_find_tv_by_mode() local
302 mode->name, tv_mode->name); in sun4i_tv_find_tv_by_mode()
304 if (!strcmp(mode->name, tv_mode->name)) in sun4i_tv_find_tv_by_mode()
305 return tv_mode; in sun4i_tv_find_tv_by_mode()
310 const struct tv_mode *tv_mode = &tv_modes[i]; in sun4i_tv_find_tv_by_mode() local
313 mode->name, tv_mode->name, in sun4i_tv_find_tv_by_mode()
314 mode->vdisplay, tv_mode->vdisplay); in sun4i_tv_find_tv_by_mode()
316 if (mode->vdisplay == tv_mode->vdisplay) in sun4i_tv_find_tv_by_mode()
317 return tv_mode; in sun4i_tv_find_tv_by_mode()
323 static void sun4i_tv_mode_to_drm_mode(const struct tv_mode *tv_mode, in sun4i_tv_mode_to_drm_mode() argument
332 mode->hdisplay = tv_mode->hdisplay; in sun4i_tv_mode_to_drm_mode()
333 mode->hsync_start = mode->hdisplay + tv_mode->hfront_porch; in sun4i_tv_mode_to_drm_mode()
334 mode->hsync_end = mode->hsync_start + tv_mode->hsync_len; in sun4i_tv_mode_to_drm_mode()
335 mode->htotal = mode->hsync_end + tv_mode->hback_porch; in sun4i_tv_mode_to_drm_mode()
337 mode->vdisplay = tv_mode->vdisplay; in sun4i_tv_mode_to_drm_mode()
338 mode->vsync_start = mode->vdisplay + tv_mode->vfront_porch; in sun4i_tv_mode_to_drm_mode()
339 mode->vsync_end = mode->vsync_start + tv_mode->vsync_len; in sun4i_tv_mode_to_drm_mode()
340 mode->vtotal = mode->vsync_end + tv_mode->vback_porch; in sun4i_tv_mode_to_drm_mode()
376 const struct tv_mode *tv_mode = sun4i_tv_find_tv_by_mode(mode); in sun4i_tv_mode_set() local
388 tv_mode->mode | in sun4i_tv_mode_set()
389 (tv_mode->yc_en ? SUN4I_TVE_CFG0_YC_EN : 0) | in sun4i_tv_mode_set()
398 (tv_mode->dac3_en ? SUN4I_TVE_DAC0_DAC_EN(3) : 0) | in sun4i_tv_mode_set()
403 (tv_mode->dac_bit25_en ? BIT(25) : 0) | in sun4i_tv_mode_set()
412 tv_mode->chroma_freq); in sun4i_tv_mode_set()
416 SUN4I_TVE_PORCH_BACK(tv_mode->back_porch) | in sun4i_tv_mode_set()
417 SUN4I_TVE_PORCH_FRONT(tv_mode->front_porch)); in sun4i_tv_mode_set()
422 SUN4I_TVE_LINE_NUMBER(tv_mode->line_number)); in sun4i_tv_mode_set()
425 SUN4I_TVE_LEVEL_BLANK(tv_mode->video_levels->blank) | in sun4i_tv_mode_set()
426 SUN4I_TVE_LEVEL_BLACK(tv_mode->video_levels->black)); in sun4i_tv_mode_set()
435 SUN4I_TVE_CB_CR_LVL_CB_BURST(tv_mode->burst_levels->cb) | in sun4i_tv_mode_set()
436 SUN4I_TVE_CB_CR_LVL_CR_BURST(tv_mode->burst_levels->cr)); in sun4i_tv_mode_set()
445 SUN4I_TVE_CB_CR_GAIN_CB(tv_mode->color_gains->cb) | in sun4i_tv_mode_set()
446 SUN4I_TVE_CB_CR_GAIN_CR(tv_mode->color_gains->cr)); in sun4i_tv_mode_set()
450 SUN4I_TVE_SYNC_VBI_VBLANK(tv_mode->vblank_level)); in sun4i_tv_mode_set()
464 SUN4I_TVE_RESYNC_PIXEL(tv_mode->resync_params->pixel) | in sun4i_tv_mode_set()
465 SUN4I_TVE_RESYNC_LINE(tv_mode->resync_params->line) | in sun4i_tv_mode_set()
466 (tv_mode->resync_params->field ? in sun4i_tv_mode_set()
493 const struct tv_mode *tv_mode = &tv_modes[i]; in sun4i_tv_comp_get_modes() local
501 strcpy(mode->name, tv_mode->name); in sun4i_tv_comp_get_modes()
503 sun4i_tv_mode_to_drm_mode(tv_mode, mode); in sun4i_tv_comp_get_modes()