| .. | .. |
|---|
| 11 | 11 | #include <linux/pm_runtime.h> |
|---|
| 12 | 12 | #include <linux/regmap.h> |
|---|
| 13 | 13 | |
|---|
| 14 | | -#include <drm/drmP.h> |
|---|
| 15 | 14 | #include <drm/drm_atomic_helper.h> |
|---|
| 16 | 15 | #include <drm/drm_crtc_helper.h> |
|---|
| 17 | 16 | #include <drm/drm_of.h> |
|---|
| 17 | +#include <drm/drm_probe_helper.h> |
|---|
| 18 | 18 | |
|---|
| 19 | 19 | #include <uapi/linux/videodev2.h> |
|---|
| 20 | 20 | |
|---|
| .. | .. |
|---|
| 29 | 29 | 816, 864, 0, 576, 580, 586, 625, 0, |
|---|
| 30 | 30 | DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC | |
|---|
| 31 | 31 | DRM_MODE_FLAG_INTERLACE | DRM_MODE_FLAG_DBLCLK), |
|---|
| 32 | | - .vrefresh = 50, 0, }, |
|---|
| 32 | + 0, }, |
|---|
| 33 | 33 | |
|---|
| 34 | 34 | { DRM_MODE("720x480i", DRM_MODE_TYPE_DRIVER, 13500, 720, 753, |
|---|
| 35 | 35 | 815, 858, 0, 480, 480, 486, 525, 0, |
|---|
| 36 | 36 | DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC | |
|---|
| 37 | 37 | DRM_MODE_FLAG_INTERLACE | DRM_MODE_FLAG_DBLCLK), |
|---|
| 38 | | - .vrefresh = 60, 0, }, |
|---|
| 38 | + 0, }, |
|---|
| 39 | 39 | }; |
|---|
| 40 | 40 | |
|---|
| 41 | 41 | struct env_config { |
|---|
| .. | .. |
|---|
| 421 | 421 | static void rockchip_tve_encoder_disable(struct drm_encoder *encoder) |
|---|
| 422 | 422 | { |
|---|
| 423 | 423 | struct rockchip_tve *tve = encoder_to_tve(encoder); |
|---|
| 424 | | - struct drm_crtc *crtc = encoder->crtc; |
|---|
| 425 | | - struct rockchip_crtc_state *s = to_rockchip_crtc_state(crtc->state); |
|---|
| 426 | 424 | |
|---|
| 427 | 425 | mutex_lock(&tve->suspend_lock); |
|---|
| 428 | 426 | |
|---|
| .. | .. |
|---|
| 430 | 428 | cvbs_set_disable(tve); |
|---|
| 431 | 429 | |
|---|
| 432 | 430 | mutex_unlock(&tve->suspend_lock); |
|---|
| 433 | | - |
|---|
| 434 | | - s->output_if &= ~VOP_OUTPUT_IF_TV; |
|---|
| 435 | 431 | } |
|---|
| 436 | 432 | |
|---|
| 437 | 433 | static void rockchip_tve_encoder_mode_set(struct drm_encoder *encoder, |
|---|
| .. | .. |
|---|
| 487 | 483 | */ |
|---|
| 488 | 484 | if (tve->soc_type == SOC_RK3528) |
|---|
| 489 | 485 | s->output_if |= VOP_OUTPUT_IF_BT656; |
|---|
| 490 | | - else |
|---|
| 491 | | - s->output_if |= VOP_OUTPUT_IF_TV; |
|---|
| 492 | 486 | s->color_space = V4L2_COLORSPACE_SMPTE170M; |
|---|
| 493 | 487 | s->tv_state = &conn_state->tv; |
|---|
| 494 | 488 | |
|---|
| .. | .. |
|---|
| 849 | 843 | } |
|---|
| 850 | 844 | |
|---|
| 851 | 845 | tve->dev = &pdev->dev; |
|---|
| 852 | | - tve_data = device_get_match_data(dev); |
|---|
| 846 | + tve_data = of_device_get_match_data(dev); |
|---|
| 853 | 847 | if (tve_data) { |
|---|
| 854 | 848 | tve->soc_type = tve_data->soc_type; |
|---|
| 855 | 849 | tve->input_format = tve_data->input_format; |
|---|
| .. | .. |
|---|
| 957 | 951 | check_uboot_logo(tve); |
|---|
| 958 | 952 | tve->tv_format = TVOUT_CVBS_PAL; |
|---|
| 959 | 953 | encoder = &tve->encoder; |
|---|
| 960 | | - encoder->possible_crtcs = drm_of_find_possible_crtcs(drm_dev, |
|---|
| 961 | | - dev->of_node); |
|---|
| 954 | + encoder->possible_crtcs = rockchip_drm_of_find_possible_crtcs(drm_dev, |
|---|
| 955 | + dev->of_node); |
|---|
| 962 | 956 | dev_dbg(tve->dev, "possible_crtc:%d\n", encoder->possible_crtcs); |
|---|
| 963 | 957 | |
|---|
| 964 | 958 | ret = drm_encoder_init(drm_dev, encoder, &rockchip_tve_encoder_funcs, |
|---|