1 /* 2 * (C) Copyright 2008-2017 Fuzhou Rockchip Electronics Co., Ltd 3 * 4 * SPDX-License-Identifier: GPL-2.0+ 5 */ 6 7 #include <config.h> 8 #include <common.h> 9 #include <errno.h> 10 #include <malloc.h> 11 #include <asm/unaligned.h> 12 #include <asm/io.h> 13 #include <linux/list.h> 14 15 #include "rockchip_vop.h" 16 #include "rockchip_vop_reg.h" 17 18 #define VOP_REG_VER_MASK(off, _mask, s, _write_mask, _major, \ 19 _begin_minor, _end_minor) \ 20 {.offset = off, \ 21 .mask = _mask, \ 22 .shift = s, \ 23 .write_mask = _write_mask, \ 24 .major = _major, \ 25 .begin_minor = _begin_minor, \ 26 .end_minor = _end_minor,} 27 28 #define VOP_REG(off, _mask, s) \ 29 VOP_REG_VER_MASK(off, _mask, s, false, 0, 0, -1) 30 31 #define VOP_REG_MASK(off, _mask, s) \ 32 VOP_REG_VER_MASK(off, _mask, s, true, 0, 0, -1) 33 34 #define VOP_REG_VER(off, _mask, s, _major, _begin_minor, _end_minor) \ 35 VOP_REG_VER_MASK(off, _mask, s, false, \ 36 _major, _begin_minor, _end_minor) 37 38 static const struct vop_scl_extension rk3288_win_full_scl_ext = { 39 .cbcr_vsd_mode = VOP_REG(RK3288_WIN0_CTRL1, 0x1, 31), 40 .cbcr_vsu_mode = VOP_REG(RK3288_WIN0_CTRL1, 0x1, 30), 41 .cbcr_hsd_mode = VOP_REG(RK3288_WIN0_CTRL1, 0x3, 28), 42 .cbcr_ver_scl_mode = VOP_REG(RK3288_WIN0_CTRL1, 0x3, 26), 43 .cbcr_hor_scl_mode = VOP_REG(RK3288_WIN0_CTRL1, 0x3, 24), 44 .yrgb_vsd_mode = VOP_REG(RK3288_WIN0_CTRL1, 0x1, 23), 45 .yrgb_vsu_mode = VOP_REG(RK3288_WIN0_CTRL1, 0x1, 22), 46 .yrgb_hsd_mode = VOP_REG(RK3288_WIN0_CTRL1, 0x3, 20), 47 .yrgb_ver_scl_mode = VOP_REG(RK3288_WIN0_CTRL1, 0x3, 18), 48 .yrgb_hor_scl_mode = VOP_REG(RK3288_WIN0_CTRL1, 0x3, 16), 49 .line_load_mode = VOP_REG(RK3288_WIN0_CTRL1, 0x1, 15), 50 .cbcr_axi_gather_num = VOP_REG(RK3288_WIN0_CTRL1, 0x7, 12), 51 .yrgb_axi_gather_num = VOP_REG(RK3288_WIN0_CTRL1, 0xf, 8), 52 .vsd_cbcr_gt2 = VOP_REG(RK3288_WIN0_CTRL1, 0x1, 7), 53 .vsd_cbcr_gt4 = VOP_REG(RK3288_WIN0_CTRL1, 0x1, 6), 54 .vsd_yrgb_gt2 = VOP_REG(RK3288_WIN0_CTRL1, 0x1, 5), 55 .vsd_yrgb_gt4 = VOP_REG(RK3288_WIN0_CTRL1, 0x1, 4), 56 .bic_coe_sel = VOP_REG(RK3288_WIN0_CTRL1, 0x3, 2), 57 .cbcr_axi_gather_en = VOP_REG(RK3288_WIN0_CTRL1, 0x1, 1), 58 .yrgb_axi_gather_en = VOP_REG(RK3288_WIN0_CTRL1, 0x1, 0), 59 .lb_mode = VOP_REG(RK3288_WIN0_CTRL0, 0x7, 5), 60 }; 61 62 static const struct vop_scl_regs rk3288_win_full_scl = { 63 .ext = &rk3288_win_full_scl_ext, 64 .scale_yrgb_x = VOP_REG(RK3288_WIN0_SCL_FACTOR_YRGB, 0xffff, 0x0), 65 .scale_yrgb_y = VOP_REG(RK3288_WIN0_SCL_FACTOR_YRGB, 0xffff, 16), 66 .scale_cbcr_x = VOP_REG(RK3288_WIN0_SCL_FACTOR_CBR, 0xffff, 0x0), 67 .scale_cbcr_y = VOP_REG(RK3288_WIN0_SCL_FACTOR_CBR, 0xffff, 16), 68 }; 69 70 static const struct vop_win rk3288_win01_data = { 71 .scl = &rk3288_win_full_scl, 72 .enable = VOP_REG(RK3288_WIN0_CTRL0, 0x1, 0), 73 .format = VOP_REG(RK3288_WIN0_CTRL0, 0x7, 1), 74 .rb_swap = VOP_REG(RK3288_WIN0_CTRL0, 0x1, 12), 75 .ymirror = VOP_REG_VER(RK3368_WIN0_CTRL0, 0x1, 22, 3, 2, -1), 76 .act_info = VOP_REG(RK3288_WIN0_ACT_INFO, 0x1fff1fff, 0), 77 .dsp_info = VOP_REG(RK3288_WIN0_DSP_INFO, 0x0fff0fff, 0), 78 .dsp_st = VOP_REG(RK3288_WIN0_DSP_ST, 0x1fff1fff, 0), 79 .yrgb_mst = VOP_REG(RK3288_WIN0_YRGB_MST, 0xffffffff, 0), 80 .uv_mst = VOP_REG(RK3288_WIN0_CBR_MST, 0xffffffff, 0), 81 .yrgb_vir = VOP_REG(RK3288_WIN0_VIR, 0x3fff, 0), 82 .uv_vir = VOP_REG(RK3288_WIN0_VIR, 0x3fff, 16), 83 .src_alpha_ctl = VOP_REG(RK3288_WIN0_SRC_ALPHA_CTRL, 0xffffffff, 0), 84 .dst_alpha_ctl = VOP_REG(RK3288_WIN0_DST_ALPHA_CTRL, 0xffffffff, 0), 85 }; 86 87 static const struct vop_ctrl rk3288_ctrl_data = { 88 .standby = VOP_REG(RK3288_SYS_CTRL, 0x1, 22), 89 .axi_outstanding_max_num = VOP_REG(RK3288_SYS_CTRL1, 0x1f, 13), 90 .axi_max_outstanding_en = VOP_REG(RK3288_SYS_CTRL1, 0x1, 12), 91 .reg_done_frm = VOP_REG_VER(RK3288_SYS_CTRL1, 0x1, 24, 3, 7, -1), 92 .htotal_pw = VOP_REG(RK3288_DSP_HTOTAL_HS_END, 0x1fff1fff, 0), 93 .hact_st_end = VOP_REG(RK3288_DSP_HACT_ST_END, 0x1fff1fff, 0), 94 .vtotal_pw = VOP_REG(RK3288_DSP_VTOTAL_VS_END, 0x1fff1fff, 0), 95 .vact_st_end = VOP_REG(RK3288_DSP_VACT_ST_END, 0x1fff1fff, 0), 96 .vact_st_end_f1 = VOP_REG(RK3288_DSP_VACT_ST_END_F1, 0x1fff1fff, 0), 97 .vs_st_end_f1 = VOP_REG(RK3288_DSP_VS_ST_END_F1, 0x1fff1fff, 0), 98 .hpost_st_end = VOP_REG(RK3288_POST_DSP_HACT_INFO, 0x1fff1fff, 0), 99 .vpost_st_end = VOP_REG(RK3288_POST_DSP_VACT_INFO, 0x1fff1fff, 0), 100 .vpost_st_end_f1 = VOP_REG(RK3288_POST_DSP_VACT_INFO_F1, 0x1fff1fff, 0), 101 .post_scl_factor = VOP_REG(RK3288_POST_SCL_FACTOR_YRGB, 0xffffffff, 0), 102 .post_scl_ctrl = VOP_REG(RK3288_POST_SCL_CTRL, 0x3, 0), 103 104 .dsp_interlace = VOP_REG(RK3288_DSP_CTRL0, 0x1, 10), 105 .auto_gate_en = VOP_REG(RK3288_SYS_CTRL, 0x1, 23), 106 .dsp_layer_sel = VOP_REG(RK3288_DSP_CTRL1, 0xff, 8), 107 .post_lb_mode = VOP_REG_VER(RK3288_SYS_CTRL, 0x1, 18, 3, 2, -1), 108 .global_regdone_en = VOP_REG_VER(RK3288_SYS_CTRL, 0x1, 11, 3, 2, -1), 109 .overlay_mode = VOP_REG_VER(RK3288_SYS_CTRL, 0x1, 16, 3, 2, -1), 110 .core_dclk_div = VOP_REG_VER(RK3399_DSP_CTRL0, 0x1, 4, 3, 4, -1), 111 .p2i_en = VOP_REG_VER(RK3399_DSP_CTRL0, 0x1, 5, 3, 4, -1), 112 .dclk_ddr = VOP_REG_VER(RK3399_DSP_CTRL0, 0x1, 8, 3, 4, -1), 113 .dp_en = VOP_REG(RK3399_SYS_CTRL, 0x1, 11), 114 .rgb_en = VOP_REG(RK3288_SYS_CTRL, 0x1, 12), 115 .hdmi_en = VOP_REG(RK3288_SYS_CTRL, 0x1, 13), 116 .edp_en = VOP_REG(RK3288_SYS_CTRL, 0x1, 14), 117 .mipi_en = VOP_REG(RK3288_SYS_CTRL, 0x1, 15), 118 .mipi_dual_channel_en = VOP_REG(RK3288_SYS_CTRL, 0x1, 3), 119 .data01_swap = VOP_REG_VER(RK3288_SYS_CTRL, 0x1, 17, 3, 5, -1), 120 .dclk_pol = VOP_REG_VER(RK3288_DSP_CTRL0, 0x1, 7, 3, 0, 1), 121 .pin_pol = VOP_REG_VER(RK3288_DSP_CTRL0, 0xf, 4, 3, 0, 1), 122 .dp_dclk_pol = VOP_REG_VER(RK3399_DSP_CTRL1, 0x1, 19, 3, 5, -1), 123 .dp_pin_pol = VOP_REG_VER(RK3399_DSP_CTRL1, 0x7, 16, 3, 5, -1), 124 .rgb_dclk_pol = VOP_REG_VER(RK3368_DSP_CTRL1, 0x1, 19, 3, 2, -1), 125 .rgb_pin_pol = VOP_REG_VER(RK3368_DSP_CTRL1, 0x7, 16, 3, 2, -1), 126 .tve_dclk_en = VOP_REG(RK3288_SYS_CTRL, 0x1, 24), 127 .tve_dclk_pol = VOP_REG(RK3288_SYS_CTRL, 0x1, 25), 128 .tve_sw_mode = VOP_REG(RK3288_SYS_CTRL, 0x1, 26), 129 .sw_uv_offset_en = VOP_REG(RK3288_SYS_CTRL, 0x1, 27), 130 .sw_genlock = VOP_REG(RK3288_SYS_CTRL, 0x1, 28), 131 .hdmi_dclk_pol = VOP_REG_VER(RK3368_DSP_CTRL1, 0x1, 23, 3, 2, -1), 132 .hdmi_pin_pol = VOP_REG_VER(RK3368_DSP_CTRL1, 0x7, 20, 3, 2, -1), 133 .edp_dclk_pol = VOP_REG_VER(RK3368_DSP_CTRL1, 0x1, 27, 3, 2, -1), 134 .edp_pin_pol = VOP_REG_VER(RK3368_DSP_CTRL1, 0x7, 24, 3, 2, -1), 135 .mipi_dclk_pol = VOP_REG_VER(RK3368_DSP_CTRL1, 0x1, 31, 3, 2, -1), 136 .mipi_pin_pol = VOP_REG_VER(RK3368_DSP_CTRL1, 0x7, 28, 3, 2, -1), 137 138 .dither_down = VOP_REG(RK3288_DSP_CTRL1, 0xf, 1), 139 .dither_up = VOP_REG(RK3288_DSP_CTRL1, 0x1, 6), 140 141 .dsp_out_yuv = VOP_REG_VER(RK3399_POST_SCL_CTRL, 0x1, 2, 3, 5, -1), 142 .dsp_data_swap = VOP_REG(RK3288_DSP_CTRL0, 0x1f, 12), 143 .dsp_bg_swap = VOP_REG(RK3288_DSP_CTRL0, 0x1, 12), 144 .dsp_rb_swap = VOP_REG(RK3288_DSP_CTRL0, 0x1, 13), 145 .dsp_rg_swap = VOP_REG(RK3288_DSP_CTRL0, 0x1, 14), 146 .dsp_delta_swap = VOP_REG(RK3288_DSP_CTRL0, 0x1, 15), 147 .dsp_dummy_swap = VOP_REG(RK3288_DSP_CTRL0, 0x1, 16), 148 .dsp_ccir656_avg = VOP_REG(RK3288_DSP_CTRL0, 0x1, 20), 149 .dsp_blank = VOP_REG(RK3288_DSP_CTRL0, 0x3, 18), 150 .dsp_lut_en = VOP_REG(RK3288_DSP_CTRL1, 0x1, 0), 151 .update_gamma_lut = VOP_REG_VER(RK3288_DSP_CTRL1, 0x1, 7, 3, 5, -1), 152 .out_mode = VOP_REG(RK3288_DSP_CTRL0, 0xf, 0), 153 154 .bcsh_brightness = VOP_REG(RK3288_BCSH_BCS, 0xff, 0), 155 .bcsh_contrast = VOP_REG(RK3288_BCSH_BCS, 0x1ff, 8), 156 .bcsh_sat_con = VOP_REG(RK3288_BCSH_BCS, 0x3ff, 20), 157 .bcsh_out_mode = VOP_REG(RK3288_BCSH_BCS, 0x3, 0), 158 .bcsh_sin_hue = VOP_REG(RK3288_BCSH_H, 0x1ff, 0), 159 .bcsh_cos_hue = VOP_REG(RK3288_BCSH_H, 0x1ff, 16), 160 .bcsh_r2y_csc_mode = VOP_REG_VER(RK3368_BCSH_CTRL, 0x1, 6, 3, 1, -1), 161 .bcsh_r2y_en = VOP_REG_VER(RK3368_BCSH_CTRL, 0x1, 4, 3, 1, -1), 162 .bcsh_y2r_csc_mode = VOP_REG_VER(RK3368_BCSH_CTRL, 0x3, 2, 3, 1, -1), 163 .bcsh_y2r_en = VOP_REG_VER(RK3368_BCSH_CTRL, 0x1, 0, 3, 1, -1), 164 .bcsh_color_bar = VOP_REG(RK3288_BCSH_COLOR_BAR, 0xffffff, 8), 165 .bcsh_en = VOP_REG(RK3288_BCSH_COLOR_BAR, 0x1, 0), 166 167 .xmirror = VOP_REG(RK3288_DSP_CTRL0, 0x1, 22), 168 .ymirror = VOP_REG(RK3288_DSP_CTRL0, 0x1, 23), 169 170 .dsp_background = VOP_REG(RK3288_DSP_BG, 0xffffffff, 0), 171 172 .cfg_done = VOP_REG(RK3288_REG_CFG_DONE, 0x1, 0), 173 .win_gate[0] = VOP_REG(RK3288_WIN2_CTRL0, 0x1, 0), 174 .win_gate[1] = VOP_REG(RK3288_WIN3_CTRL0, 0x1, 0), 175 176 .mcu_pix_total = VOP_REG(RK3288_MCU_CTRL, 0x3f, 0), 177 .mcu_cs_pst = VOP_REG(RK3288_MCU_CTRL, 0xf, 6), 178 .mcu_cs_pend = VOP_REG(RK3288_MCU_CTRL, 0x3f, 10), 179 .mcu_rw_pst = VOP_REG(RK3288_MCU_CTRL, 0xf, 16), 180 .mcu_rw_pend = VOP_REG(RK3288_MCU_CTRL, 0x3f, 20), 181 .mcu_clk_sel = VOP_REG(RK3288_MCU_CTRL, 0x1, 26), 182 .mcu_hold_mode = VOP_REG(RK3288_MCU_CTRL, 0x1, 27), 183 .mcu_frame_st = VOP_REG(RK3288_MCU_CTRL, 0x1, 28), 184 .mcu_rs = VOP_REG(RK3288_MCU_CTRL, 0x1, 29), 185 .mcu_bypass = VOP_REG(RK3288_MCU_CTRL, 0x1, 30), 186 .mcu_type = VOP_REG(RK3288_MCU_CTRL, 0x1, 31), 187 .mcu_rw_bypass_port = VOP_REG(RK3288_MCU_BYPASS_WPORT, 0xffffffff, 0), 188 }; 189 190 static const struct vop_line_flag rk3288_vop_line_flag = { 191 .line_flag_num[0] = VOP_REG(RK3288_INTR_CTRL0, 0x1fff, 12), 192 }; 193 194 static const struct vop_grf_ctrl rk3288_vop_big_grf_ctrl = { 195 .grf_dclk_inv = VOP_REG(RK3288_GRF_SOC_CON15, 0x1, 13), 196 }; 197 198 static const struct vop_grf_ctrl rk3288_vop_lit_grf_ctrl = { 199 .grf_dclk_inv = VOP_REG(RK3288_GRF_SOC_CON15, 0x1, 15), 200 }; 201 202 const struct vop_data rk3288_vop_big = { 203 .version = VOP_VERSION(3, 1), 204 .max_output = {3840, 2160}, 205 .feature = VOP_FEATURE_OUTPUT_10BIT, 206 .ctrl = &rk3288_ctrl_data, 207 .grf_ctrl = &rk3288_vop_big_grf_ctrl, 208 .win = &rk3288_win01_data, 209 .line_flag = &rk3288_vop_line_flag, 210 .reg_len = RK3288_DSP_VACT_ST_END_F1 * 4, 211 }; 212 213 const struct vop_data rk3288_vop_lit = { 214 .version = VOP_VERSION(3, 1), 215 .max_output = {2560, 1600}, 216 .feature = VOP_FEATURE_OUTPUT_10BIT, 217 .ctrl = &rk3288_ctrl_data, 218 .grf_ctrl = &rk3288_vop_lit_grf_ctrl, 219 .win = &rk3288_win01_data, 220 .line_flag = &rk3288_vop_line_flag, 221 .reg_len = RK3288_DSP_VACT_ST_END_F1 * 4, 222 }; 223 224 static const struct vop_win rk3368_win23_data = { 225 .enable = VOP_REG(RK3368_WIN2_CTRL0, 0x1, 4), 226 .format = VOP_REG(RK3368_WIN2_CTRL0, 0x3, 5), 227 .ymirror = VOP_REG(RK3368_WIN2_CTRL1, 0x1, 15), 228 .rb_swap = VOP_REG(RK3368_WIN2_CTRL0, 0x1, 20), 229 .dsp_info = VOP_REG(RK3368_WIN2_DSP_INFO0, 0x0fff0fff, 0), 230 .dsp_st = VOP_REG(RK3368_WIN2_DSP_ST0, 0x1fff1fff, 0), 231 .yrgb_mst = VOP_REG(RK3368_WIN2_MST0, 0xffffffff, 0), 232 .yrgb_vir = VOP_REG(RK3368_WIN2_VIR0_1, 0x1fff, 0), 233 .src_alpha_ctl = VOP_REG(RK3368_WIN2_SRC_ALPHA_CTRL, 0xffff, 0), 234 .dst_alpha_ctl = VOP_REG(RK3368_WIN2_DST_ALPHA_CTRL, 0xffffffff, 0), 235 }; 236 237 static const struct vop_line_flag rk3368_vop_line_flag = { 238 .line_flag_num[0] = VOP_REG(RK3368_LINE_FLAG, 0xffff, 0), 239 .line_flag_num[1] = VOP_REG(RK3368_LINE_FLAG, 0xffff, 16), 240 }; 241 242 static const struct vop_grf_ctrl rk3368_vop_grf_ctrl = { 243 .grf_dclk_inv = VOP_REG(RK3368_GRF_SOC_CON6, 0x1, 5), 244 }; 245 246 const struct vop_data rk3368_vop = { 247 .version = VOP_VERSION(3, 2), 248 .max_output = {4096, 2160}, 249 .ctrl = &rk3288_ctrl_data, 250 .grf_ctrl = &rk3368_vop_grf_ctrl, 251 .win = &rk3288_win01_data, 252 .line_flag = &rk3368_vop_line_flag, 253 .reg_len = RK3368_DSP_VACT_ST_END_F1 * 4, 254 }; 255 256 static const struct vop_line_flag rk3366_vop_line_flag = { 257 .line_flag_num[0] = VOP_REG(RK3366_LINE_FLAG, 0xffff, 0), 258 .line_flag_num[1] = VOP_REG(RK3366_LINE_FLAG, 0xffff, 16), 259 }; 260 261 const struct vop_data rk3366_vop = { 262 .version = VOP_VERSION(3, 4), 263 .max_output = {4096, 2160}, 264 .ctrl = &rk3288_ctrl_data, 265 .win = &rk3288_win01_data, 266 .line_flag = &rk3366_vop_line_flag, 267 .reg_len = RK3366_DSP_VACT_ST_END_F1 * 4, 268 }; 269 270 static const uint32_t vop_csc_r2y_bt601[] = { 271 0x02590132, 0xff530075, 0x0200fead, 0xfe530200, 272 0x0000ffad, 0x00000200, 0x00080200, 0x00080200, 273 }; 274 275 static const uint32_t vop_csc_r2y_bt601_12_235[] = { 276 0x02040107, 0xff680064, 0x01c2fed6, 0xfe8701c2, 277 0x0000ffb7, 0x00010200, 0x00080200, 0x00080200, 278 }; 279 280 static const uint32_t vop_csc_r2y_bt709[] = { 281 0x027500bb, 0xff99003f, 0x01c2fea5, 0xfe6801c2, 282 0x0000ffd7, 0x00010200, 0x00080200, 0x00080200, 283 }; 284 285 static const uint32_t vop_csc_r2y_bt2020[] = { 286 0x025300e6, 0xff830034, 0x01c1febd, 0xfe6401c1, 287 0x0000ffdc, 0x00010200, 0x00080200, 0x00080200, 288 }; 289 290 static const struct vop_csc_table rk3399_csc_table = { 291 .r2y_bt601 = vop_csc_r2y_bt601, 292 .r2y_bt601_12_235 = vop_csc_r2y_bt601_12_235, 293 .r2y_bt709 = vop_csc_r2y_bt709, 294 .r2y_bt2020 = vop_csc_r2y_bt2020, 295 }; 296 297 static const struct vop_csc rk3399_win0_csc = { 298 .r2r_en = VOP_REG(RK3399_YUV2YUV_WIN, 0x1, 0), 299 .y2r_en = VOP_REG(RK3399_YUV2YUV_WIN, 0x1, 1), 300 .r2y_en = VOP_REG(RK3399_YUV2YUV_WIN, 0x1, 2), 301 .y2r_offset = RK3399_WIN0_YUV2YUV_Y2R, 302 .r2r_offset = RK3399_WIN0_YUV2YUV_3X3, 303 .r2y_offset = RK3399_WIN0_YUV2YUV_R2Y, 304 }; 305 306 static const struct vop_csc rk3399_win2_csc = { 307 .r2r_en = VOP_REG(RK3399_YUV2YUV_WIN, 0x1, 16), 308 .r2y_en = VOP_REG(RK3399_YUV2YUV_WIN, 0x1, 18), 309 .r2r_offset = RK3399_WIN2_YUV2YUV_3X3, 310 311 }; 312 313 const struct vop_data rk3399_vop_big = { 314 .version = VOP_VERSION(3, 5), 315 .max_output = {4096, 2160}, 316 .feature = VOP_FEATURE_OUTPUT_10BIT, 317 .ctrl = &rk3288_ctrl_data, 318 .win = &rk3288_win01_data, 319 .line_flag = &rk3366_vop_line_flag, 320 .csc_table = &rk3399_csc_table, 321 .win_csc = &rk3399_win0_csc, 322 .reg_len = RK3399_DSP_VACT_ST_END_F1 * 4, 323 }; 324 325 const struct vop_data rk3399_vop_lit = { 326 .version = VOP_VERSION(3, 6), 327 .max_output = {2560, 1600}, 328 .ctrl = &rk3288_ctrl_data, 329 .win = &rk3368_win23_data, 330 .line_flag = &rk3366_vop_line_flag, 331 .csc_table = &rk3399_csc_table, 332 .win_csc = &rk3399_win2_csc, 333 .reg_len = RK3399_DSP_VACT_ST_END_F1 * 4, 334 }; 335 336 const struct vop_data rk322x_vop = { 337 .version = VOP_VERSION(3, 7), 338 .max_output = {4096, 2160}, 339 .feature = VOP_FEATURE_OUTPUT_10BIT, 340 .ctrl = &rk3288_ctrl_data, 341 .win = &rk3288_win01_data, 342 .line_flag = &rk3366_vop_line_flag, 343 .reg_len = RK3399_DSP_VACT_ST_END_F1 * 4, 344 }; 345 346 static const struct vop_ctrl rk3328_ctrl_data = { 347 .standby = VOP_REG(RK3328_SYS_CTRL, 0x1, 22), 348 .axi_outstanding_max_num = VOP_REG(RK3328_SYS_CTRL1, 0x1f, 13), 349 .axi_max_outstanding_en = VOP_REG(RK3328_SYS_CTRL1, 0x1, 12), 350 .reg_done_frm = VOP_REG(RK3328_SYS_CTRL1, 0x1, 24), 351 .auto_gate_en = VOP_REG(RK3328_SYS_CTRL, 0x1, 23), 352 .htotal_pw = VOP_REG(RK3328_DSP_HTOTAL_HS_END, 0x1fff1fff, 0), 353 .hact_st_end = VOP_REG(RK3328_DSP_HACT_ST_END, 0x1fff1fff, 0), 354 .vtotal_pw = VOP_REG(RK3328_DSP_VTOTAL_VS_END, 0x1fff1fff, 0), 355 .vact_st_end = VOP_REG(RK3328_DSP_VACT_ST_END, 0x1fff1fff, 0), 356 .vact_st_end_f1 = VOP_REG(RK3328_DSP_VACT_ST_END_F1, 0x1fff1fff, 0), 357 .vs_st_end_f1 = VOP_REG(RK3328_DSP_VS_ST_END_F1, 0x1fff1fff, 0), 358 .hpost_st_end = VOP_REG(RK3328_POST_DSP_HACT_INFO, 0x1fff1fff, 0), 359 .vpost_st_end = VOP_REG(RK3328_POST_DSP_VACT_INFO, 0x1fff1fff, 0), 360 .vpost_st_end_f1 = VOP_REG(RK3328_POST_DSP_VACT_INFO_F1, 0x1fff1fff, 0), 361 .post_scl_factor = VOP_REG(RK3328_POST_SCL_FACTOR_YRGB, 0xffffffff, 0), 362 .post_scl_ctrl = VOP_REG(RK3328_POST_SCL_CTRL, 0x3, 0), 363 .dsp_out_yuv = VOP_REG(RK3328_POST_SCL_CTRL, 0x1, 2), 364 .dsp_interlace = VOP_REG(RK3328_DSP_CTRL0, 0x1, 10), 365 .dsp_layer_sel = VOP_REG(RK3328_DSP_CTRL1, 0xff, 8), 366 .post_lb_mode = VOP_REG(RK3328_SYS_CTRL, 0x1, 18), 367 .global_regdone_en = VOP_REG(RK3328_SYS_CTRL, 0x1, 11), 368 .overlay_mode = VOP_REG(RK3328_SYS_CTRL, 0x1, 16), 369 .core_dclk_div = VOP_REG(RK3328_DSP_CTRL0, 0x1, 4), 370 .dclk_ddr = VOP_REG(RK3328_DSP_CTRL0, 0x1, 8), 371 .p2i_en = VOP_REG(RK3328_DSP_CTRL0, 0x1, 5), 372 .rgb_en = VOP_REG(RK3328_SYS_CTRL, 0x1, 12), 373 .hdmi_en = VOP_REG(RK3328_SYS_CTRL, 0x1, 13), 374 .edp_en = VOP_REG(RK3328_SYS_CTRL, 0x1, 14), 375 .mipi_en = VOP_REG(RK3328_SYS_CTRL, 0x1, 15), 376 .tve_dclk_en = VOP_REG(RK3328_SYS_CTRL, 0x1, 24), 377 .tve_dclk_pol = VOP_REG(RK3328_SYS_CTRL, 0x1, 25), 378 .tve_sw_mode = VOP_REG(RK3328_SYS_CTRL, 0x1, 26), 379 .sw_uv_offset_en = VOP_REG(RK3328_SYS_CTRL, 0x1, 27), 380 .sw_genlock = VOP_REG(RK3328_SYS_CTRL, 0x1, 28), 381 .sw_dac_sel = VOP_REG(RK3328_SYS_CTRL, 0x1, 29), 382 .rgb_pin_pol = VOP_REG(RK3328_DSP_CTRL1, 0xf, 16), 383 .hdmi_pin_pol = VOP_REG(RK3328_DSP_CTRL1, 0xf, 20), 384 .edp_pin_pol = VOP_REG(RK3328_DSP_CTRL1, 0xf, 24), 385 .mipi_pin_pol = VOP_REG(RK3328_DSP_CTRL1, 0xf, 28), 386 387 .dither_down = VOP_REG(RK3328_DSP_CTRL1, 0xf, 1), 388 .dither_up = VOP_REG(RK3328_DSP_CTRL1, 0x1, 6), 389 390 .dsp_data_swap = VOP_REG(RK3328_DSP_CTRL0, 0x1f, 12), 391 .dsp_bg_swap = VOP_REG(RK3328_DSP_CTRL0, 0x1, 12), 392 .dsp_rb_swap = VOP_REG(RK3328_DSP_CTRL0, 0x1, 13), 393 .dsp_rg_swap = VOP_REG(RK3328_DSP_CTRL0, 0x1, 14), 394 .dsp_delta_swap = VOP_REG(RK3328_DSP_CTRL0, 0x1, 15), 395 .dsp_dummy_swap = VOP_REG(RK3328_DSP_CTRL0, 0x1, 16), 396 .dsp_ccir656_avg = VOP_REG(RK3328_DSP_CTRL0, 0x1, 20), 397 .dsp_blank = VOP_REG(RK3328_DSP_CTRL0, 0x3, 18), 398 .dsp_lut_en = VOP_REG(RK3328_DSP_CTRL1, 0x1, 0), 399 .out_mode = VOP_REG(RK3328_DSP_CTRL0, 0xf, 0), 400 401 .xmirror = VOP_REG(RK3328_DSP_CTRL0, 0x1, 22), 402 .ymirror = VOP_REG(RK3328_DSP_CTRL0, 0x1, 23), 403 404 .dsp_background = VOP_REG(RK3328_DSP_BG, 0xffffffff, 0), 405 406 .bcsh_brightness = VOP_REG(RK3328_BCSH_BCS, 0xff, 0), 407 .bcsh_contrast = VOP_REG(RK3328_BCSH_BCS, 0x1ff, 8), 408 .bcsh_sat_con = VOP_REG(RK3328_BCSH_BCS, 0x3ff, 20), 409 .bcsh_out_mode = VOP_REG(RK3328_BCSH_BCS, 0x3, 30), 410 .bcsh_sin_hue = VOP_REG(RK3328_BCSH_H, 0x1ff, 0), 411 .bcsh_cos_hue = VOP_REG(RK3328_BCSH_H, 0x1ff, 16), 412 .bcsh_r2y_csc_mode = VOP_REG(RK3328_BCSH_CTRL, 0x3, 6), 413 .bcsh_r2y_en = VOP_REG(RK3328_BCSH_CTRL, 0x1, 4), 414 .bcsh_y2r_csc_mode = VOP_REG(RK3328_BCSH_CTRL, 0x3, 2), 415 .bcsh_y2r_en = VOP_REG(RK3328_BCSH_CTRL, 0x1, 0), 416 .bcsh_color_bar = VOP_REG(RK3328_BCSH_COLOR_BAR, 0xffffff, 8), 417 .bcsh_en = VOP_REG(RK3328_BCSH_COLOR_BAR, 0x1, 0), 418 .win_channel[0] = VOP_REG_VER(RK3328_WIN0_CTRL2, 0xff, 0, 3, 8, 8), 419 .win_channel[1] = VOP_REG_VER(RK3328_WIN1_CTRL2, 0xff, 0, 3, 8, 8), 420 .win_channel[2] = VOP_REG_VER(RK3328_WIN2_CTRL2, 0xff, 0, 3, 8, 8), 421 422 .cfg_done = VOP_REG(RK3328_REG_CFG_DONE, 0x1, 0), 423 }; 424 425 426 static const struct vop_line_flag rk3328_vop_line_flag = { 427 .line_flag_num[0] = VOP_REG(RK3328_LINE_FLAG, 0xffff, 0), 428 .line_flag_num[1] = VOP_REG(RK3328_LINE_FLAG, 0xffff, 16), 429 }; 430 431 const struct vop_data rk3328_vop = { 432 .version = VOP_VERSION(3, 8), 433 .max_output = {4096, 2160}, 434 .feature = VOP_FEATURE_OUTPUT_10BIT, 435 .ctrl = &rk3328_ctrl_data, 436 .win = &rk3288_win01_data, 437 .win_offset = 0xd0, 438 .line_flag = &rk3328_vop_line_flag, 439 .reg_len = RK3328_DSP_VACT_ST_END_F1 * 4, 440 }; 441 442 static const struct vop_win rk3126_win1_data = { 443 .enable = VOP_REG(RK3036_SYS_CTRL, 0x1, 1), 444 .format = VOP_REG(RK3036_SYS_CTRL, 0x7, 6), 445 .rb_swap = VOP_REG(RK3036_SYS_CTRL, 0x1, 19), 446 .dsp_info = VOP_REG(RK3126_WIN1_DSP_INFO, 0x0fff0fff, 0), 447 .dsp_st = VOP_REG(RK3126_WIN1_DSP_ST, 0x1fff1fff, 0), 448 .yrgb_mst = VOP_REG(RK3126_WIN1_MST, 0xffffffff, 0), 449 .yrgb_vir = VOP_REG(RK3036_WIN1_VIR, 0xffff, 0), 450 }; 451 452 static const struct vop_ctrl rk3036_ctrl_data = { 453 .standby = VOP_REG(RK3036_SYS_CTRL, 0x1, 30), 454 .out_mode = VOP_REG(RK3036_DSP_CTRL0, 0xf, 0), 455 .dsp_blank = VOP_REG(RK3036_DSP_CTRL1, 0x1, 24), 456 .dclk_pol = VOP_REG(RK3036_DSP_CTRL0, 0x1, 7), 457 .pin_pol = VOP_REG(RK3036_DSP_CTRL0, 0xf, 4), 458 .dither_down = VOP_REG(RK3036_DSP_CTRL0, 0x3, 10), 459 .dsp_layer_sel = VOP_REG(RK3036_DSP_CTRL0, 0x1, 8), 460 .htotal_pw = VOP_REG(RK3036_DSP_HTOTAL_HS_END, 0x1fff1fff, 0), 461 .hact_st_end = VOP_REG(RK3036_DSP_HACT_ST_END, 0x1fff1fff, 0), 462 .hdmi_en = VOP_REG(RK3036_AXI_BUS_CTRL, 0x1, 22), 463 .hdmi_dclk_pol = VOP_REG(RK3036_AXI_BUS_CTRL, 0x1, 23), 464 .hdmi_pin_pol = VOP_REG(RK3036_INT_SCALER, 0x7, 4), 465 .rgb_en = VOP_REG(RK3036_AXI_BUS_CTRL, 0x1, 24), 466 .rgb_dclk_pol = VOP_REG(RK3036_AXI_BUS_CTRL, 0x1, 25), 467 .lvds_en = VOP_REG(RK3036_AXI_BUS_CTRL, 0x1, 26), 468 .lvds_dclk_pol = VOP_REG(RK3036_AXI_BUS_CTRL, 0x1, 27), 469 .mipi_en = VOP_REG(RK3036_AXI_BUS_CTRL, 0x1, 28), 470 .mipi_dclk_pol = VOP_REG(RK3036_AXI_BUS_CTRL, 0x1, 29), 471 .vtotal_pw = VOP_REG(RK3036_DSP_VTOTAL_VS_END, 0x1fff1fff, 0), 472 .vact_st_end = VOP_REG(RK3036_DSP_VACT_ST_END, 0x1fff1fff, 0), 473 .cfg_done = VOP_REG(RK3036_REG_CFG_DONE, 0x1, 0), 474 }; 475 476 static const struct vop_line_flag rk3036_vop_line_flag = { 477 .line_flag_num[0] = VOP_REG(RK3036_INT_STATUS, 0xfff, 12), 478 }; 479 480 const struct vop_data rk3036_vop = { 481 .version = VOP_VERSION(2, 2), 482 .max_output = {1920, 1080}, 483 .ctrl = &rk3036_ctrl_data, 484 .win = &rk3126_win1_data, 485 .line_flag = &rk3036_vop_line_flag, 486 .reg_len = RK3036_DSP_VACT_ST_END_F1 * 4, 487 }; 488 489 static const struct vop_scl_regs rk3366_lit_win_scl = { 490 .scale_yrgb_x = VOP_REG(RK3366_LIT_WIN0_SCL_FACTOR_YRGB, 0xffff, 0x0), 491 .scale_yrgb_y = VOP_REG(RK3366_LIT_WIN0_SCL_FACTOR_YRGB, 0xffff, 16), 492 .scale_cbcr_x = VOP_REG(RK3366_LIT_WIN0_SCL_FACTOR_CBR, 0xffff, 0x0), 493 .scale_cbcr_y = VOP_REG(RK3366_LIT_WIN0_SCL_FACTOR_CBR, 0xffff, 16), 494 }; 495 496 static const struct vop_win rk3366_win0_data = { 497 .scl = &rk3366_lit_win_scl, 498 499 .enable = VOP_REG(RK3366_LIT_WIN0_CTRL0, 0x1, 0), 500 .format = VOP_REG(RK3366_LIT_WIN0_CTRL0, 0x7, 1), 501 .rb_swap = VOP_REG(RK3366_LIT_WIN0_CTRL0, 0x1, 12), 502 .act_info = VOP_REG(RK3366_LIT_WIN0_ACT_INFO, 0xffffffff, 0), 503 .dsp_info = VOP_REG(RK3366_LIT_WIN0_DSP_INFO, 0xffffffff, 0), 504 .dsp_st = VOP_REG(RK3366_LIT_WIN0_DSP_ST, 0xffffffff, 0), 505 .yrgb_mst = VOP_REG(RK3366_LIT_WIN0_YRGB_MST0, 0xffffffff, 0), 506 .uv_mst = VOP_REG(RK3366_LIT_WIN0_CBR_MST0, 0xffffffff, 0), 507 .yrgb_vir = VOP_REG(RK3366_LIT_WIN0_VIR, 0x1fff, 0), 508 .uv_vir = VOP_REG(RK3366_LIT_WIN0_VIR, 0x1fff, 16), 509 510 .alpha_mode = VOP_REG(RK3366_LIT_WIN0_ALPHA_CTRL, 0x1, 1), 511 .alpha_en = VOP_REG(RK3366_LIT_WIN0_ALPHA_CTRL, 0x1, 0), 512 }; 513 514 static const struct vop_win rk3366_win1_data = { 515 .enable = VOP_REG(RK3366_LIT_WIN1_CTRL0, 0x1, 0), 516 .format = VOP_REG(RK3366_LIT_WIN1_CTRL0, 0x7, 4), 517 .rb_swap = VOP_REG(RK3366_LIT_WIN1_CTRL0, 0x1, 12), 518 .dsp_info = VOP_REG(RK3366_LIT_WIN1_DSP_INFO, 0xffffffff, 0), 519 .dsp_st = VOP_REG(RK3366_LIT_WIN1_DSP_ST, 0xffffffff, 0), 520 .yrgb_mst = VOP_REG(RK3366_LIT_WIN1_MST, 0xffffffff, 0), 521 .yrgb_vir = VOP_REG(RK3366_LIT_WIN1_VIR, 0x1fff, 0), 522 523 .alpha_mode = VOP_REG(RK3366_LIT_WIN1_ALPHA_CTRL, 0x1, 1), 524 .alpha_en = VOP_REG(RK3366_LIT_WIN1_ALPHA_CTRL, 0x1, 0), 525 }; 526 527 static const struct vop_ctrl px30_ctrl_data = { 528 .standby = VOP_REG(RK3366_LIT_SYS_CTRL2, 0x1, 1), 529 .htotal_pw = VOP_REG(RK3366_LIT_DSP_HTOTAL_HS_END, 0x0fff0fff, 0), 530 .hact_st_end = VOP_REG(RK3366_LIT_DSP_HACT_ST_END, 0x0fff0fff, 0), 531 .vtotal_pw = VOP_REG(RK3366_LIT_DSP_VTOTAL_VS_END, 0x0fff0fff, 0), 532 .vact_st_end = VOP_REG(RK3366_LIT_DSP_VACT_ST_END, 0x0fff0fff, 0), 533 .vact_st_end_f1 = VOP_REG(RK3366_LIT_DSP_VACT_ST_END_F1, 0x0fff0fff, 0), 534 .vs_st_end_f1 = VOP_REG(RK3366_LIT_DSP_VS_ST_END_F1, 0x0fff0fff, 0), 535 .dsp_interlace = VOP_REG(RK3366_LIT_DSP_CTRL2, 0x1, 0), 536 .global_regdone_en = VOP_REG(RK3366_LIT_SYS_CTRL2, 0x1, 13), 537 .auto_gate_en = VOP_REG(RK3366_LIT_SYS_CTRL2, 0x1, 0), 538 .dsp_layer_sel = VOP_REG(RK3366_LIT_DSP_CTRL2, 0xf, 22), 539 .overlay_mode = VOP_REG(RK3366_LIT_DSP_CTRL2, 0x1, 4), 540 .core_dclk_div = VOP_REG(RK3366_LIT_DSP_CTRL0, 0x1, 13), 541 .dclk_ddr = VOP_REG(RK3366_LIT_DSP_CTRL0, 0x1, 14), 542 .rgb_en = VOP_REG(RK3366_LIT_DSP_CTRL0, 0x1, 0), 543 .rgb_pin_pol = VOP_REG(RK3366_LIT_DSP_CTRL0, 0x7, 2), 544 .hdmi_en = VOP_REG(RK3366_LIT_DSP_CTRL0, 0x1, 8), 545 .hdmi_pin_pol = VOP_REG(RK3366_LIT_DSP_CTRL0, 0x7, 10), 546 .lvds_en = VOP_REG(RK3366_LIT_DSP_CTRL0, 0x1, 16), 547 .lvds_pin_pol = VOP_REG(RK3366_LIT_DSP_CTRL0, 0x7, 18), 548 .mipi_en = VOP_REG(RK3366_LIT_DSP_CTRL0, 0x1, 24), 549 .mipi_pin_pol = VOP_REG(RK3366_LIT_DSP_CTRL0, 0x7, 26), 550 .mipi_dclk_pol = VOP_REG(RK3366_LIT_DSP_CTRL0, 0x1, 25), 551 .lvds_dclk_pol = VOP_REG(RK3366_LIT_DSP_CTRL0, 0x1, 17), 552 .hdmi_dclk_pol = VOP_REG(RK3366_LIT_DSP_CTRL0, 0x1, 9), 553 .rgb_dclk_pol = VOP_REG(RK3366_LIT_DSP_CTRL0, 0x1, 1), 554 .dither_up = VOP_REG(RK3366_LIT_DSP_CTRL2, 0x1, 2), 555 .dither_down = VOP_REG(RK3366_LIT_DSP_CTRL2, 0x7, 6), 556 .dsp_data_swap = VOP_REG(RK3366_LIT_DSP_CTRL2, 0x1f, 9), 557 .dsp_bg_swap = VOP_REG(RK3366_LIT_DSP_CTRL2, 0x1, 9), 558 .dsp_rb_swap = VOP_REG(RK3366_LIT_DSP_CTRL2, 0x1, 11), 559 .dsp_rg_swap = VOP_REG(RK3366_LIT_DSP_CTRL2, 0x1, 12), 560 .dsp_ccir656_avg = VOP_REG(RK3366_LIT_SYS_CTRL2, 0x1, 5), 561 .dsp_black = VOP_REG(RK3366_LIT_DSP_CTRL2, 0x1, 15), 562 .dsp_blank = VOP_REG(RK3366_LIT_DSP_CTRL2, 0x1, 14), 563 .dsp_outzero = VOP_REG(RK3366_LIT_SYS_CTRL2, 0x1, 3), 564 .dsp_lut_en = VOP_REG(RK3366_LIT_DSP_CTRL2, 0x1, 5), 565 .out_mode = VOP_REG(RK3366_LIT_DSP_CTRL2, 0xf, 16), 566 .dsp_background = VOP_REG(RK3366_LIT_DSP_BG, 0x00ffffff, 0), 567 .cfg_done = VOP_REG(RK3366_LIT_REG_CFG_DONE, 0x1, 0), 568 569 .bcsh_en = VOP_REG(RK3366_LIT_BCSH_CTRL, 0x1, 0), 570 .bcsh_r2y_csc_mode = VOP_REG(RK3366_LIT_BCSH_CTRL, 0x1, 1), 571 .bcsh_out_mode = VOP_REG(RK3366_LIT_BCSH_CTRL, 0x3, 2), 572 .bcsh_y2r_csc_mode = VOP_REG(RK3366_LIT_BCSH_CTRL, 0x3, 4), 573 .bcsh_y2r_en = VOP_REG(RK3366_LIT_BCSH_CTRL, 0x1, 6), 574 .bcsh_r2y_en = VOP_REG(RK3366_LIT_BCSH_CTRL, 0x1, 7), 575 .bcsh_color_bar = VOP_REG(RK3366_LIT_BCSH_COL_BAR, 0xffffff, 0), 576 .bcsh_brightness = VOP_REG(RK3366_LIT_BCSH_BCS, 0xff, 0), 577 .bcsh_contrast = VOP_REG(RK3366_LIT_BCSH_BCS, 0x1ff, 8), 578 .bcsh_sat_con = VOP_REG(RK3366_LIT_BCSH_BCS, 0x3ff, 20), 579 .bcsh_sin_hue = VOP_REG(RK3366_LIT_BCSH_H, 0x1ff, 0), 580 .bcsh_cos_hue = VOP_REG(RK3366_LIT_BCSH_H, 0x1ff, 16), 581 582 .cabc_config_mode = VOP_REG(PX30_CABC_CTRL0, 0x3, 2), 583 .cabc_calc_pixel_num = VOP_REG(PX30_CABC_CTRL0, 0x7fffff, 4), 584 .cabc_handle_en = VOP_REG(PX30_CABC_CTRL0, 0x1, 1), 585 .cabc_en = VOP_REG(PX30_CABC_CTRL0, 0x1, 0), 586 .cabc_total_num = VOP_REG(PX30_CABC_CTRL1, 0x7fffff, 4), 587 .cabc_lut_en = VOP_REG(PX30_CABC_CTRL1, 0x1, 0), 588 .cabc_stage_up_mode = VOP_REG(PX30_CABC_CTRL2, 0x1, 19), 589 .cabc_stage_up = VOP_REG(PX30_CABC_CTRL2, 0x1ff, 8), 590 .cabc_stage_down = VOP_REG(PX30_CABC_CTRL2, 0xff, 0), 591 .cabc_global_dn = VOP_REG(PX30_CABC_CTRL3, 0xff, 0), 592 .cabc_global_dn_limit_en = VOP_REG(PX30_CABC_CTRL3, 0x1, 8), 593 594 .mcu_pix_total = VOP_REG(RK3366_LIT_MCU_CTRL, 0x3f, 0), 595 .mcu_cs_pst = VOP_REG(RK3366_LIT_MCU_CTRL, 0xf, 6), 596 .mcu_cs_pend = VOP_REG(RK3366_LIT_MCU_CTRL, 0x3f, 10), 597 .mcu_rw_pst = VOP_REG(RK3366_LIT_MCU_CTRL, 0xf, 16), 598 .mcu_rw_pend = VOP_REG(RK3366_LIT_MCU_CTRL, 0x3f, 20), 599 .mcu_clk_sel = VOP_REG(RK3366_LIT_MCU_CTRL, 0x1, 26), 600 .mcu_hold_mode = VOP_REG(RK3366_LIT_MCU_CTRL, 0x1, 27), 601 .mcu_frame_st = VOP_REG(RK3366_LIT_MCU_CTRL, 0x1, 28), 602 .mcu_rs = VOP_REG(RK3366_LIT_MCU_CTRL, 0x1, 29), 603 .mcu_bypass = VOP_REG(RK3366_LIT_MCU_CTRL, 0x1, 30), 604 .mcu_type = VOP_REG(RK3366_LIT_MCU_CTRL, 0x1, 31), 605 .mcu_rw_bypass_port = VOP_REG(RK3366_LIT_MCU_RW_BYPASS_PORT, 606 0xffffffff, 0), 607 }; 608 609 static const struct vop_line_flag rk3366_vop_lite_line_flag = { 610 .line_flag_num[0] = VOP_REG(RK3366_LIT_LINE_FLAG, 0xfff, 0), 611 }; 612 613 static const struct vop_grf_ctrl px30_grf_ctrl = { 614 .grf_dclk_inv = VOP_REG(PX30_GRF_PD_VO_CON1, 0x1, 4), 615 }; 616 617 const struct vop_data px30_vop_lit = { 618 .version = VOP_VERSION(2, 5), 619 .max_output = {1920, 1080}, 620 .ctrl = &px30_ctrl_data, 621 .grf_ctrl = &px30_grf_ctrl, 622 .win = &rk3366_win1_data, 623 .line_flag = &rk3366_vop_lite_line_flag, 624 .reg_len = RK3366_LIT_FRC_LOWER01_0 * 4, 625 }; 626 627 const struct vop_data px30_vop_big = { 628 .version = VOP_VERSION(2, 6), 629 .max_output = {1920, 1080}, 630 .ctrl = &px30_ctrl_data, 631 .grf_ctrl = &px30_grf_ctrl, 632 .win = &rk3366_win1_data, 633 .line_flag = &rk3366_vop_lite_line_flag, 634 .reg_len = RK3366_LIT_FRC_LOWER01_0 * 4, 635 }; 636 637 static const struct vop_ctrl rk3308_ctrl_data = { 638 .standby = VOP_REG(RK3366_LIT_SYS_CTRL2, 0x1, 1), 639 .axi_outstanding_max_num = VOP_REG(RK3366_LIT_SYS_CTRL1, 0x1f, 16), 640 .axi_max_outstanding_en = VOP_REG(RK3366_LIT_SYS_CTRL1, 0x1, 12), 641 .htotal_pw = VOP_REG(RK3366_LIT_DSP_HTOTAL_HS_END, 0x0fff0fff, 0), 642 .hact_st_end = VOP_REG(RK3366_LIT_DSP_HACT_ST_END, 0x0fff0fff, 0), 643 .vtotal_pw = VOP_REG(RK3366_LIT_DSP_VTOTAL_VS_END, 0x0fff0fff, 0), 644 .vact_st_end = VOP_REG(RK3366_LIT_DSP_VACT_ST_END, 0x0fff0fff, 0), 645 .vact_st_end_f1 = VOP_REG(RK3366_LIT_DSP_VACT_ST_END_F1, 0x0fff0fff, 0), 646 .vs_st_end_f1 = VOP_REG(RK3366_LIT_DSP_VS_ST_END_F1, 0x0fff0fff, 0), 647 .global_regdone_en = VOP_REG(RK3366_LIT_SYS_CTRL2, 0x1, 13), 648 .auto_gate_en = VOP_REG(RK3366_LIT_SYS_CTRL2, 0x1, 0), 649 .dsp_layer_sel = VOP_REG(RK3366_LIT_DSP_CTRL2, 0x1, 3), 650 .overlay_mode = VOP_REG(RK3366_LIT_DSP_CTRL2, 0x1, 4), 651 .dclk_ddr = VOP_REG(RK3366_LIT_DSP_CTRL0, 0x1, 14), 652 .rgb_en = VOP_REG(RK3366_LIT_DSP_CTRL0, 0x1, 0), 653 .rgb_pin_pol = VOP_REG(RK3366_LIT_DSP_CTRL0, 0x7, 2), 654 .rgb_dclk_pol = VOP_REG(RK3366_LIT_DSP_CTRL0, 0x1, 1), 655 .dither_up = VOP_REG(RK3366_LIT_DSP_CTRL2, 0x1, 2), 656 .dither_down = VOP_REG(RK3366_LIT_DSP_CTRL2, 0x7, 6), 657 .dsp_data_swap = VOP_REG(RK3366_LIT_DSP_CTRL2, 0x1f, 9), 658 .dsp_bg_swap = VOP_REG(RK3366_LIT_DSP_CTRL2, 0x1, 9), 659 .dsp_rb_swap = VOP_REG(RK3366_LIT_DSP_CTRL2, 0x1, 11), 660 .dsp_rg_swap = VOP_REG(RK3366_LIT_DSP_CTRL2, 0x1, 12), 661 .dsp_ccir656_avg = VOP_REG(RK3366_LIT_SYS_CTRL2, 0x1, 5), 662 .dsp_black = VOP_REG(RK3366_LIT_DSP_CTRL2, 0x1, 15), 663 .dsp_blank = VOP_REG(RK3366_LIT_DSP_CTRL2, 0x1, 14), 664 .dsp_outzero = VOP_REG(RK3366_LIT_SYS_CTRL2, 0x1, 3), 665 .dsp_lut_en = VOP_REG(RK3366_LIT_DSP_CTRL2, 0x1, 5), 666 .out_mode = VOP_REG(RK3366_LIT_DSP_CTRL2, 0xf, 16), 667 .dsp_background = VOP_REG(RK3366_LIT_DSP_BG, 0x00ffffff, 0), 668 .cfg_done = VOP_REG(RK3366_LIT_REG_CFG_DONE, 0x1, 0), 669 670 .bcsh_en = VOP_REG(RK3366_LIT_BCSH_CTRL, 0x1, 0), 671 .bcsh_r2y_csc_mode = VOP_REG(RK3366_LIT_BCSH_CTRL, 0x1, 1), 672 .bcsh_out_mode = VOP_REG(RK3366_LIT_BCSH_CTRL, 0x3, 2), 673 .bcsh_y2r_csc_mode = VOP_REG(RK3366_LIT_BCSH_CTRL, 0x3, 4), 674 .bcsh_y2r_en = VOP_REG(RK3366_LIT_BCSH_CTRL, 0x1, 6), 675 .bcsh_r2y_en = VOP_REG(RK3366_LIT_BCSH_CTRL, 0x1, 7), 676 .bcsh_color_bar = VOP_REG(RK3366_LIT_BCSH_COL_BAR, 0xffffff, 0), 677 .bcsh_brightness = VOP_REG(RK3366_LIT_BCSH_BCS, 0xff, 0), 678 .bcsh_contrast = VOP_REG(RK3366_LIT_BCSH_BCS, 0x1ff, 8), 679 .bcsh_sat_con = VOP_REG(RK3366_LIT_BCSH_BCS, 0x3ff, 20), 680 .bcsh_sin_hue = VOP_REG(RK3366_LIT_BCSH_H, 0x1ff, 0), 681 .bcsh_cos_hue = VOP_REG(RK3366_LIT_BCSH_H, 0x1ff, 16), 682 683 .mcu_pix_total = VOP_REG(RK3366_LIT_MCU_CTRL, 0x3f, 0), 684 .mcu_cs_pst = VOP_REG(RK3366_LIT_MCU_CTRL, 0xf, 6), 685 .mcu_cs_pend = VOP_REG(RK3366_LIT_MCU_CTRL, 0x3f, 10), 686 .mcu_rw_pst = VOP_REG(RK3366_LIT_MCU_CTRL, 0xf, 16), 687 .mcu_rw_pend = VOP_REG(RK3366_LIT_MCU_CTRL, 0x3f, 20), 688 .mcu_clk_sel = VOP_REG(RK3366_LIT_MCU_CTRL, 0x1, 26), 689 .mcu_hold_mode = VOP_REG(RK3366_LIT_MCU_CTRL, 0x1, 27), 690 .mcu_frame_st = VOP_REG(RK3366_LIT_MCU_CTRL, 0x1, 28), 691 .mcu_rs = VOP_REG(RK3366_LIT_MCU_CTRL, 0x1, 29), 692 .mcu_bypass = VOP_REG(RK3366_LIT_MCU_CTRL, 0x1, 30), 693 .mcu_type = VOP_REG(RK3366_LIT_MCU_CTRL, 0x1, 31), 694 .mcu_rw_bypass_port = VOP_REG(RK3366_LIT_MCU_RW_BYPASS_PORT, 695 0xffffffff, 0), 696 }; 697 698 const struct vop_data rk3308_vop = { 699 .version = VOP_VERSION(2, 7), 700 .max_output = {1920, 1080}, 701 .ctrl = &rk3308_ctrl_data, 702 .win = &rk3366_win0_data, 703 .line_flag = &rk3366_vop_lite_line_flag, 704 .reg_len = RK3366_LIT_FRC_LOWER01_0 * 4, 705 }; 706 707 static const struct vop_grf_ctrl rk1808_grf_ctrl = { 708 .grf_dclk_inv = VOP_REG(RK1808_GRF_PD_VO_CON1, 0x1, 4), 709 }; 710 711 const struct vop_data rk1808_vop = { 712 .version = VOP_VERSION(2, 8), 713 .max_output = {1920, 1080}, 714 .ctrl = &px30_ctrl_data, 715 .grf_ctrl = &rk1808_grf_ctrl, 716 .win = &rk3366_win1_data, 717 .line_flag = &rk3366_vop_lite_line_flag, 718 .reg_len = RK3366_LIT_FRC_LOWER01_0 * 4, 719 }; 720 721 static const struct vop_ctrl rk3506_ctrl_data = { 722 .cfg_done = VOP_REG(RK3366_LIT_REG_CFG_DONE, 0x1, 0), 723 724 .dsp_background = VOP_REG(RK3366_LIT_DSP_BG, 0x00ffffff, 0), 725 726 .axi_outstanding_max_num = VOP_REG(RK3366_LIT_SYS_CTRL1, 0x1f, 16), 727 .axi_max_outstanding_en = VOP_REG(RK3366_LIT_SYS_CTRL1, 0x1, 12), 728 729 .auto_gate_en = VOP_REG(RK3366_LIT_SYS_CTRL2, 0x1, 0), 730 .standby = VOP_REG(RK3366_LIT_SYS_CTRL2, 0x1, 1), 731 .dsp_outzero = VOP_REG(RK3366_LIT_SYS_CTRL2, 0x1, 3), 732 .yuv_clip = VOP_REG(RK3366_LIT_SYS_CTRL2, 0x1, 4), 733 734 .rgb_en = VOP_REG(RK3366_LIT_DSP_CTRL0, 0x1, 0), 735 .rgb_pin_pol = VOP_REG(RK3366_LIT_DSP_CTRL0, 0x7, 2), 736 .bt1120_uv_swap = VOP_REG(RK3366_LIT_DSP_CTRL0, 0x1, 5), 737 .bt656_en = VOP_REG(RK3366_LIT_DSP_CTRL0, 0x1, 6), 738 .core_dclk_div = VOP_REG(RK3366_LIT_DSP_CTRL0, 0x1, 13), 739 .mipi_en = VOP_REG(RK3366_LIT_DSP_CTRL0, 0x1, 24), 740 .mipi_dclk_pol = VOP_REG(RK3366_LIT_DSP_CTRL0, 0x1, 25), 741 .mipi_pin_pol = VOP_REG(RK3366_LIT_DSP_CTRL0, 0x7, 26), 742 .bt1120_yc_swap = VOP_REG(RK3366_LIT_DSP_CTRL0, 0x1, 30), 743 .bt1120_en = VOP_REG(RK3366_LIT_DSP_CTRL0, 0x1, 31), 744 745 .dsp_interlace = VOP_REG(RK3366_LIT_DSP_CTRL2, 0x1, 0), 746 .dsp_interlace_pol = VOP_REG(RK3366_LIT_DSP_CTRL2, 0x1, 1), 747 .dither_up = VOP_REG(RK3366_LIT_DSP_CTRL2, 0x1, 2), 748 .dsp_lut_en = VOP_REG(RK3366_LIT_DSP_CTRL2, 0x1, 5), 749 .dither_down = VOP_REG(RK3366_LIT_DSP_CTRL2, 0x1, 8), 750 .dsp_data_swap = VOP_REG(RK3366_LIT_DSP_CTRL2, 0x1f, 9), 751 .dsp_bg_swap = VOP_REG(RK3366_LIT_DSP_CTRL2, 0x1, 9), 752 .dsp_rb_swap = VOP_REG(RK3366_LIT_DSP_CTRL2, 0x1, 11), 753 .dsp_rg_swap = VOP_REG(RK3366_LIT_DSP_CTRL2, 0x1, 12), 754 .dsp_blank = VOP_REG(RK3366_LIT_DSP_CTRL2, 0x1, 14), 755 .dsp_black = VOP_REG(RK3366_LIT_DSP_CTRL2, 0x1, 15), 756 .out_mode = VOP_REG(RK3366_LIT_DSP_CTRL2, 0xf, 16), 757 758 .htotal_pw = VOP_REG(RK3366_LIT_DSP_HTOTAL_HS_END, 0x0fff0fff, 0), 759 .hact_st_end = VOP_REG(RK3366_LIT_DSP_HACT_ST_END, 0x0fff0fff, 0), 760 .vtotal_pw = VOP_REG(RK3366_LIT_DSP_VTOTAL_VS_END, 0x0fff0fff, 0), 761 .vact_st_end = VOP_REG(RK3366_LIT_DSP_VACT_ST_END, 0x0fff0fff, 0), 762 .vact_st_end_f1 = VOP_REG(RK3366_LIT_DSP_VACT_ST_END_F1, 0x0fff0fff, 0), 763 .vs_st_end_f1 = VOP_REG(RK3366_LIT_DSP_VS_ST_END_F1, 0x0fff0fff, 0), 764 765 .bcsh_en = VOP_REG(RK3366_LIT_BCSH_CTRL, 0x1, 0), 766 .bcsh_r2y_csc_mode = VOP_REG(RK3366_LIT_BCSH_CTRL, 0x1, 1), 767 .bcsh_out_mode = VOP_REG(RK3366_LIT_BCSH_CTRL, 0x3, 2), 768 .bcsh_y2r_csc_mode = VOP_REG(RK3366_LIT_BCSH_CTRL, 0x3, 4), 769 .bcsh_y2r_en = VOP_REG(RK3366_LIT_BCSH_CTRL, 0x1, 6), 770 .bcsh_r2y_en = VOP_REG(RK3366_LIT_BCSH_CTRL, 0x1, 7), 771 772 .bcsh_color_bar = VOP_REG(RK3366_LIT_BCSH_COL_BAR, 0xffffff, 0), 773 .bcsh_brightness = VOP_REG(RK3366_LIT_BCSH_BCS, 0xff, 0), 774 .bcsh_contrast = VOP_REG(RK3366_LIT_BCSH_BCS, 0x1ff, 8), 775 .bcsh_sat_con = VOP_REG(RK3366_LIT_BCSH_BCS, 0x3ff, 20), 776 .bcsh_sin_hue = VOP_REG(RK3366_LIT_BCSH_H, 0x1ff, 0), 777 .bcsh_cos_hue = VOP_REG(RK3366_LIT_BCSH_H, 0x1ff, 16), 778 779 .mcu_pix_total = VOP_REG(RK3366_LIT_MCU_CTRL, 0x3f, 0), 780 .mcu_cs_pst = VOP_REG(RK3366_LIT_MCU_CTRL, 0xf, 6), 781 .mcu_cs_pend = VOP_REG(RK3366_LIT_MCU_CTRL, 0x3f, 10), 782 .mcu_rw_pst = VOP_REG(RK3366_LIT_MCU_CTRL, 0xf, 16), 783 .mcu_rw_pend = VOP_REG(RK3366_LIT_MCU_CTRL, 0x3f, 20), 784 .mcu_clk_sel = VOP_REG(RK3366_LIT_MCU_CTRL, 0x1, 26), 785 .mcu_hold_mode = VOP_REG(RK3366_LIT_MCU_CTRL, 0x1, 27), 786 .mcu_frame_st = VOP_REG(RK3366_LIT_MCU_CTRL, 0x1, 28), 787 .mcu_rs = VOP_REG(RK3366_LIT_MCU_CTRL, 0x1, 29), 788 .mcu_bypass = VOP_REG(RK3366_LIT_MCU_CTRL, 0x1, 30), 789 .mcu_type = VOP_REG(RK3366_LIT_MCU_CTRL, 0x1, 31), 790 .mcu_rw_bypass_port = VOP_REG(RK3366_LIT_MCU_RW_BYPASS_PORT, 791 0xffffffff, 0), 792 }; 793 794 static const struct vop_win rk3506_win1_data = { 795 .enable = VOP_REG(RK3366_LIT_WIN1_CTRL0, 0x1, 0), 796 .format = VOP_REG(RK3366_LIT_WIN1_CTRL0, 0x7, 4), 797 .interlace_read = VOP_REG(RK3366_LIT_WIN1_CTRL0, 0x1, 8), 798 .rb_swap = VOP_REG(RK3366_LIT_WIN1_CTRL0, 0x1, 12), 799 800 .yrgb_vir = VOP_REG(RK3366_LIT_WIN1_VIR, 0x1fff, 0), 801 .yrgb_mst = VOP_REG(RK3366_LIT_WIN1_MST, 0xffffffff, 0), 802 .dsp_info = VOP_REG(RK3366_LIT_WIN1_DSP_INFO, 0xffffffff, 0), 803 .dsp_st = VOP_REG(RK3366_LIT_WIN1_DSP_ST, 0xffffffff, 0), 804 805 .alpha_en = VOP_REG(RK3366_LIT_WIN1_ALPHA_CTRL, 0x1, 0), 806 .alpha_mode = VOP_REG(RK3366_LIT_WIN1_ALPHA_CTRL, 0x1, 1), 807 }; 808 809 const struct vop_data rk3506_vop = { 810 .version = VOP_VERSION(2, 0xe), 811 .max_output = {1280, 1280}, 812 .ctrl = &rk3506_ctrl_data, 813 .win = &rk3506_win1_data, 814 .line_flag = &rk3366_vop_lite_line_flag, 815 .reg_len = RK3366_LIT_FRC_LOWER01_0 * 4, 816 }; 817 818 static const struct vop_ctrl rk3576_lit_ctrl_data = { 819 .cfg_done = VOP_REG(EBC_CONFIG_DONE, 0x1, 0), 820 821 .enable = VOP_REG(EBC_VOP_SYS_CTRL, 0x1, 0), 822 .bcsh_r2y_en = VOP_REG(EBC_VOP_SYS_CTRL, 0x1, 1), 823 .bcsh_r2y_csc_mode = VOP_REG(EBC_VOP_SYS_CTRL, 0x1, 2), 824 .bt1120_yc_swap = VOP_REG(EBC_VOP_SYS_CTRL, 0x1, 6), 825 .bt1120_uv_swap = VOP_REG(EBC_VOP_SYS_CTRL, 0x1, 7), 826 .inf_out_en = VOP_REG(EBC_VOP_SYS_CTRL, 0x1, 8), 827 828 .rgb_en = VOP_REG(EBC_VOP_DSP_CTRL0, 0x1, 0), 829 .bt1120_en = VOP_REG(EBC_VOP_DSP_CTRL0, 0x1, 1), 830 .bt656_en = VOP_REG(EBC_VOP_DSP_CTRL0, 0x1, 2), 831 .core_dclk_div = VOP_REG(EBC_VOP_DSP_CTRL0, 0x1, 3), 832 .dclk_pol = VOP_REG(EBC_VOP_DSP_CTRL0, 0x1, 4), 833 .rgb_pin_pol = VOP_REG(EBC_VOP_DSP_CTRL0, 0x7, 5), 834 .standby = VOP_REG(EBC_VOP_DSP_CTRL0, 0x1, 15), 835 .out_dresetn = VOP_REG(EBC_VOP_DSP_CTRL0, 0x1, 31), 836 837 .dsp_interlace = VOP_REG(EBC_VOP_DSP_CTRL1, 0x1, 0), 838 .dsp_interlace_pol = VOP_REG(EBC_VOP_DSP_CTRL1, 0x1, 1), 839 .dither_up = VOP_REG(EBC_VOP_DSP_CTRL1, 0x1, 4), 840 .dither_down = VOP_REG(EBC_VOP_DSP_CTRL1, 0x7, 5), 841 .dsp_data_swap = VOP_REG(EBC_VOP_DSP_CTRL1, 0x1f, 8), 842 .dsp_bg_swap = VOP_REG(EBC_VOP_DSP_CTRL1, 0x1, 8), 843 .dsp_rb_swap = VOP_REG(EBC_VOP_DSP_CTRL1, 0x1, 9), 844 .dsp_rg_swap = VOP_REG(EBC_VOP_DSP_CTRL1, 0x1, 10), 845 .dsp_delta_swap = VOP_REG(EBC_VOP_DSP_CTRL1, 0x1, 11), 846 .dsp_dummy_swap = VOP_REG(EBC_VOP_DSP_CTRL1, 0x1, 12), 847 .dsp_black = VOP_REG(EBC_VOP_DSP_CTRL1, 0x1, 14), 848 .dsp_blank = VOP_REG(EBC_VOP_DSP_CTRL1, 0x1, 15), 849 .out_mode = VOP_REG(EBC_VOP_DSP_CTRL1, 0xf, 16), 850 851 .mcu_pix_total = VOP_REG(EBC_VOP_MCU_CTRL, 0x3f, 0), 852 .mcu_cs_pst = VOP_REG(EBC_VOP_MCU_CTRL, 0xf, 6), 853 .mcu_cs_pend = VOP_REG(EBC_VOP_MCU_CTRL, 0x3f, 10), 854 .mcu_rw_pst = VOP_REG(EBC_VOP_MCU_CTRL, 0xf, 16), 855 .mcu_rw_pend = VOP_REG(EBC_VOP_MCU_CTRL, 0x3f, 20), 856 .mcu_hold_mode = VOP_REG(EBC_VOP_MCU_CTRL, 0x1, 27), 857 .mcu_frame_st = VOP_REG(EBC_VOP_MCU_CTRL, 0x1, 28), 858 .mcu_rs = VOP_REG(EBC_VOP_MCU_CTRL, 0x1, 29), 859 .mcu_bypass = VOP_REG(EBC_VOP_MCU_CTRL, 0x1, 30), 860 .mcu_type = VOP_REG(EBC_VOP_MCU_CTRL, 0x1, 31), 861 .mcu_rw_bypass_port = VOP_REG(EBC_MCU_RW_BYPASS_PORT, 0xffffffff, 0), 862 863 .htotal_pw = VOP_REG(EBC_DSP_HTOTAL_HS_END, 0x0fff0fff, 0), 864 .hact_st_end = VOP_REG(EBC_DSP_HACT_ST_END, 0x0fff0fff, 0), 865 .vtotal_pw = VOP_REG(EBC_DSP_VTOTAL_VS_END, 0x0fff0fff, 0), 866 .vact_st_end = VOP_REG(EBC_DSP_VACT_ST_END, 0x0fff0fff, 0), 867 .vs_st_end_f1 = VOP_REG(EBC_DSP_VS_ST_END_F1, 0x0fff0fff, 0), 868 .vact_st_end_f1 = VOP_REG(EBC_DSP_VACT_ST_END_F1, 0x0fff0fff, 0), 869 870 .dsp_background = VOP_REG(EBC_DSP_BG, 0xffffffff, 0), 871 }; 872 873 static const struct vop_grf_ctrl rk3576_lit_vo0_grf_ctrl = { 874 .grf_edp_ch_sel = VOP_REG(RK3576_VO0_GRF_SOC_CON9, 0x1, 10), 875 .grf_hdmi_ch_sel = VOP_REG(RK3576_VO0_GRF_SOC_CON9, 0x1, 9), 876 .grf_mipi_ch_sel = VOP_REG(RK3576_VO0_GRF_SOC_CON9, 0x1, 8), 877 .grf_hdmi_pin_pol = VOP_REG(RK3576_VO0_GRF_SOC_CON13, 0x3, 5), 878 .grf_hdmi_1to4_en = VOP_REG(RK3576_VO0_GRF_SOC_CON13, 0x1, 4), 879 .grf_mipi_mode = VOP_REG(RK3576_VO0_GRF_SOC_CON13, 0x1, 3), 880 .grf_mipi_pin_pol = VOP_REG(RK3576_VO0_GRF_SOC_CON13, 0x3, 1), 881 .grf_mipi_1to4_en = VOP_REG(RK3576_VO0_GRF_SOC_CON13, 0x1, 0), 882 }; 883 884 static const struct vop_grf_ctrl rk3576_lit_grf_ctrl = { 885 .grf_dclk_inv = VOP_REG(RK3576_IOC_GRF_MISC_CON8, 0x1, 9), 886 .grf_vopl_sel = VOP_REG(RK3576_IOC_GRF_MISC_CON8, 0x1, 11), 887 }; 888 889 static const struct vop_win rk3576_lit_win2_data = { 890 .dsp_info = VOP_REG(EBC_VOP_WIN_DSP_INFO, 0xffffffff, 0), 891 .dsp_st = VOP_REG(EBC_VOP_WIN_DSP_ST, 0xffffffff, 0), 892 893 .yrgb_mst = VOP_REG(EBC_WIN_MST2, 0xffffffff, 0), 894 895 .enable = VOP_REG(EBC_WIN2_CTRL, 0x1, 0), 896 897 .interlace_read = VOP_REG(EBC_VOP_SYS_CTRL, 0x1, 3), 898 .format = VOP_REG(EBC_VOP_SYS_CTRL, 0x3, 4), 899 900 .yrgb_vir = VOP_REG(EBC_VOP_WIN_VIR, 0x1fff, 0), 901 }; 902 903 static const struct vop_line_flag rk3576_vop_lit_line_flag = { 904 .line_flag_num[0] = VOP_REG(EBC_LINE_FLAG, 0xfff, 0), 905 .line_flag_num[1] = VOP_REG(EBC_LINE_FLAG, 0xfff, 16), 906 }; 907 908 const struct vop_data rk3576_vop_lit = { 909 .version = VOP_VERSION(2, 0xd), 910 .max_output = {1920, 1920}, 911 .ctrl = &rk3576_lit_ctrl_data, 912 .vo0_grf_ctrl = &rk3576_lit_vo0_grf_ctrl, 913 .grf_ctrl = &rk3576_lit_grf_ctrl, 914 .win = &rk3576_lit_win2_data, 915 .line_flag = &rk3576_vop_lit_line_flag, 916 .reg_len = EBC_VOP_INT_STATUS * 4, 917 }; 918 919 const struct vop_data rv1108_vop = { 920 .version = VOP_VERSION(2, 4), 921 .max_output = {1920, 1080}, 922 .ctrl = &rk3308_ctrl_data, 923 .win = &rk3366_win0_data, 924 .line_flag = &rk3366_vop_lite_line_flag, 925 .reg_len = RK3366_LIT_FRC_LOWER01_0 * 4, 926 }; 927 928 static const struct vop_win rv1126_win2_data = { 929 .gate = VOP_REG(RV1126_WIN2_CTRL0, 0x1, 0), 930 .interlace_read = VOP_REG_VER(RV1126_WIN2_CTRL0, 0x1, 1, 2, 0xf, -1), 931 .enable = VOP_REG(RV1126_WIN2_CTRL0, 0x1, 4), 932 .format = VOP_REG(RV1126_WIN2_CTRL0, 0x3, 5), 933 .rb_swap = VOP_REG(RV1126_WIN2_CTRL0, 0x1, 20), 934 .dsp_info = VOP_REG(RV1126_WIN2_DSP_INFO0, 0x0fff0fff, 0), 935 .dsp_st = VOP_REG(RV1126_WIN2_DSP_ST0, 0x1fff1fff, 0), 936 .yrgb_mst = VOP_REG(RV1126_WIN2_MST0, 0xffffffff, 0), 937 .yrgb_vir = VOP_REG(RV1126_WIN2_VIR0_1, 0x1fff, 0), 938 }; 939 940 static const struct vop_ctrl rv1126_ctrl_data = { 941 .standby = VOP_REG(RK3366_LIT_SYS_CTRL2, 0x1, 1), 942 .axi_outstanding_max_num = VOP_REG(RK3366_LIT_SYS_CTRL1, 0x1f, 16), 943 .axi_max_outstanding_en = VOP_REG(RK3366_LIT_SYS_CTRL1, 0x1, 12), 944 .htotal_pw = VOP_REG(RK3366_LIT_DSP_HTOTAL_HS_END, 0x0fff0fff, 0), 945 .hact_st_end = VOP_REG(RK3366_LIT_DSP_HACT_ST_END, 0x0fff0fff, 0), 946 .vtotal_pw = VOP_REG(RK3366_LIT_DSP_VTOTAL_VS_END, 0x0fff0fff, 0), 947 .vact_st_end = VOP_REG(RK3366_LIT_DSP_VACT_ST_END, 0x0fff0fff, 0), 948 .vact_st_end_f1 = VOP_REG(RK3366_LIT_DSP_VACT_ST_END_F1, 0x0fff0fff, 0), 949 .vs_st_end_f1 = VOP_REG(RK3366_LIT_DSP_VS_ST_END_F1, 0x0fff0fff, 0), 950 .dsp_interlace = VOP_REG(RK3366_LIT_DSP_CTRL2, 0x1, 0), 951 .global_regdone_en = VOP_REG(RK3366_LIT_SYS_CTRL2, 0x1, 13), 952 .auto_gate_en = VOP_REG(RK3366_LIT_SYS_CTRL2, 0x1, 0), 953 .dsp_layer_sel = VOP_REG(RK3366_LIT_DSP_CTRL2, 0xff, 22), 954 .overlay_mode = VOP_REG(RK3366_LIT_DSP_CTRL2, 0x1, 4), 955 .core_dclk_div = VOP_REG(RK3366_LIT_DSP_CTRL0, 0x1, 13), 956 .dclk_ddr = VOP_REG(RK3366_LIT_DSP_CTRL0, 0x1, 14), 957 .rgb_en = VOP_REG(RK3366_LIT_DSP_CTRL0, 0x1, 0), 958 .rgb_pin_pol = VOP_REG(RK3366_LIT_DSP_CTRL0, 0x7, 2), 959 .hdmi_en = VOP_REG(RK3366_LIT_DSP_CTRL0, 0x1, 8), 960 .hdmi_pin_pol = VOP_REG(RK3366_LIT_DSP_CTRL0, 0x7, 10), 961 .lvds_en = VOP_REG(RK3366_LIT_DSP_CTRL0, 0x1, 16), 962 .lvds_pin_pol = VOP_REG(RK3366_LIT_DSP_CTRL0, 0x7, 18), 963 .mipi_en = VOP_REG(RK3366_LIT_DSP_CTRL0, 0x1, 24), 964 .mipi_pin_pol = VOP_REG(RK3366_LIT_DSP_CTRL0, 0x7, 26), 965 .mipi_dclk_pol = VOP_REG(RK3366_LIT_DSP_CTRL0, 0x1, 25), 966 .lvds_dclk_pol = VOP_REG(RK3366_LIT_DSP_CTRL0, 0x1, 17), 967 .hdmi_dclk_pol = VOP_REG(RK3366_LIT_DSP_CTRL0, 0x1, 9), 968 .rgb_dclk_pol = VOP_REG(RK3366_LIT_DSP_CTRL0, 0x1, 1), 969 .dither_down = VOP_REG(RK3366_LIT_DSP_CTRL2, 0x1, 8), 970 .dither_up = VOP_REG(RK3366_LIT_DSP_CTRL2, 0x1, 2), 971 .dsp_data_swap = VOP_REG(RK3366_LIT_DSP_CTRL2, 0x1f, 9), 972 .dsp_bg_swap = VOP_REG(RK3366_LIT_DSP_CTRL2, 0x1, 9), 973 .dsp_rb_swap = VOP_REG(RK3366_LIT_DSP_CTRL2, 0x1, 11), 974 .dsp_rg_swap = VOP_REG(RK3366_LIT_DSP_CTRL2, 0x1, 12), 975 .yuv_clip = VOP_REG(RK3366_LIT_SYS_CTRL2, 0x1, 4), 976 .dsp_ccir656_avg = VOP_REG(RK3366_LIT_SYS_CTRL2, 0x1, 5), 977 .dsp_black = VOP_REG(RK3366_LIT_DSP_CTRL2, 0x1, 15), 978 .dsp_blank = VOP_REG(RK3366_LIT_DSP_CTRL2, 0x1, 14), 979 .dsp_outzero = VOP_REG(RK3366_LIT_SYS_CTRL2, 0x1, 3), 980 .dsp_lut_en = VOP_REG(RK3366_LIT_DSP_CTRL2, 0x1, 5), 981 .out_mode = VOP_REG(RK3366_LIT_DSP_CTRL2, 0xf, 16), 982 .dsp_background = VOP_REG(RK3366_LIT_DSP_BG, 0x00ffffff, 0), 983 .cfg_done = VOP_REG(RK3366_LIT_REG_CFG_DONE, 0x1, 0), 984 985 .bcsh_en = VOP_REG(RK3366_LIT_BCSH_CTRL, 0x1, 0), 986 .bcsh_r2y_csc_mode = VOP_REG(RK3366_LIT_BCSH_CTRL, 0x1, 1), 987 .bcsh_out_mode = VOP_REG(RK3366_LIT_BCSH_CTRL, 0x3, 2), 988 .bcsh_y2r_csc_mode = VOP_REG(RK3366_LIT_BCSH_CTRL, 0x3, 4), 989 .bcsh_y2r_en = VOP_REG(RK3366_LIT_BCSH_CTRL, 0x1, 6), 990 .bcsh_r2y_en = VOP_REG(RK3366_LIT_BCSH_CTRL, 0x1, 7), 991 .bcsh_color_bar = VOP_REG(RK3366_LIT_BCSH_COL_BAR, 0xffffff, 0), 992 .bcsh_brightness = VOP_REG(RK3366_LIT_BCSH_BCS, 0xff, 0), 993 .bcsh_contrast = VOP_REG(RK3366_LIT_BCSH_BCS, 0x1ff, 8), 994 .bcsh_sat_con = VOP_REG(RK3366_LIT_BCSH_BCS, 0x3ff, 20), 995 .bcsh_sin_hue = VOP_REG(RK3366_LIT_BCSH_H, 0x1ff, 0), 996 .bcsh_cos_hue = VOP_REG(RK3366_LIT_BCSH_H, 0x1ff, 16), 997 998 .mcu_pix_total = VOP_REG(RK3366_LIT_MCU_CTRL, 0x3f, 0), 999 .mcu_cs_pst = VOP_REG(RK3366_LIT_MCU_CTRL, 0xf, 6), 1000 .mcu_cs_pend = VOP_REG(RK3366_LIT_MCU_CTRL, 0x3f, 10), 1001 .mcu_rw_pst = VOP_REG(RK3366_LIT_MCU_CTRL, 0xf, 16), 1002 .mcu_rw_pend = VOP_REG(RK3366_LIT_MCU_CTRL, 0x3f, 20), 1003 .mcu_clk_sel = VOP_REG(RK3366_LIT_MCU_CTRL, 0x1, 26), 1004 .mcu_hold_mode = VOP_REG(RK3366_LIT_MCU_CTRL, 0x1, 27), 1005 .mcu_frame_st = VOP_REG(RK3366_LIT_MCU_CTRL, 0x1, 28), 1006 .mcu_rs = VOP_REG(RK3366_LIT_MCU_CTRL, 0x1, 29), 1007 .mcu_bypass = VOP_REG(RK3366_LIT_MCU_CTRL, 0x1, 30), 1008 .mcu_type = VOP_REG(RK3366_LIT_MCU_CTRL, 0x1, 31), 1009 .mcu_rw_bypass_port = VOP_REG(RK3366_LIT_MCU_RW_BYPASS_PORT, 1010 0xffffffff, 0), 1011 }; 1012 1013 static const struct vop_grf_ctrl rv1126_grf_ctrl = { 1014 .grf_dclk_inv = VOP_REG(0x1026c, 0x1, 2), 1015 }; 1016 1017 const struct vop_data rv1126_vop = { 1018 .version = VOP_VERSION(2, 7), 1019 .max_output = {1920, 1080}, 1020 .ctrl = &rv1126_ctrl_data, 1021 .grf_ctrl = &rv1126_grf_ctrl, 1022 .win = &rv1126_win2_data, 1023 .line_flag = &rk3366_vop_lite_line_flag, 1024 .reg_len = RK3366_LIT_FLAG_REG * 4, 1025 }; 1026 1027 static const struct vop_ctrl rv1126b_ctrl_data = { 1028 .cfg_done = VOP_REG(RK3366_LIT_REG_CFG_DONE, 0x1, 0), 1029 .dsp_background = VOP_REG(RK3366_LIT_DSP_BG, 0x00ffffff, 0), 1030 1031 .mcu_pix_total = VOP_REG(RK3366_LIT_MCU_CTRL, 0x3f, 0), 1032 .mcu_cs_pst = VOP_REG(RK3366_LIT_MCU_CTRL, 0xf, 6), 1033 .mcu_cs_pend = VOP_REG(RK3366_LIT_MCU_CTRL, 0x3f, 10), 1034 .mcu_rw_pst = VOP_REG(RK3366_LIT_MCU_CTRL, 0xf, 16), 1035 .mcu_rw_pend = VOP_REG(RK3366_LIT_MCU_CTRL, 0x3f, 20), 1036 .mcu_clk_sel = VOP_REG(RK3366_LIT_MCU_CTRL, 0x1, 26), 1037 .mcu_hold_mode = VOP_REG(RK3366_LIT_MCU_CTRL, 0x1, 27), 1038 .mcu_frame_st = VOP_REG(RK3366_LIT_MCU_CTRL, 0x1, 28), 1039 .mcu_rs = VOP_REG(RK3366_LIT_MCU_CTRL, 0x1, 29), 1040 .mcu_bypass = VOP_REG(RK3366_LIT_MCU_CTRL, 0x1, 30), 1041 .mcu_type = VOP_REG(RK3366_LIT_MCU_CTRL, 0x1, 31), 1042 .mcu_rw_bypass_port = VOP_REG(RK3366_LIT_MCU_RW_BYPASS_PORT, 1043 0xffffffff, 0), 1044 1045 .axi_max_outstanding_en = VOP_REG(RK3366_LIT_SYS_CTRL1, 0x1, 12), 1046 .axi_outstanding_max_num = VOP_REG(RK3366_LIT_SYS_CTRL1, 0x1f, 16), 1047 1048 .auto_gate_en = VOP_REG(RK3366_LIT_SYS_CTRL2, 0x1, 0), 1049 .standby = VOP_REG(RK3366_LIT_SYS_CTRL2, 0x1, 1), 1050 .dsp_outzero = VOP_REG(RK3366_LIT_SYS_CTRL2, 0x1, 3), 1051 .yuv_clip = VOP_REG(RK3366_LIT_SYS_CTRL2, 0x1, 4), 1052 .global_regdone_en = VOP_REG(RK3366_LIT_SYS_CTRL2, 0x1, 13), 1053 1054 .rgb_en = VOP_REG(RK3366_LIT_DSP_CTRL0, 0x1, 0), 1055 .rgb_dclk_pol = VOP_REG(RK3366_LIT_DSP_CTRL0, 0x1, 1), 1056 .rgb_pin_pol = VOP_REG(RK3366_LIT_DSP_CTRL0, 0x7, 2), 1057 .core_dclk_div = VOP_REG(RK3366_LIT_DSP_CTRL0, 0x1, 13), 1058 .mipi_en = VOP_REG(RK3366_LIT_DSP_CTRL0, 0x1, 24), 1059 .mipi_dclk_pol = VOP_REG(RK3366_LIT_DSP_CTRL0, 0x1, 25), 1060 .mipi_pin_pol = VOP_REG(RK3366_LIT_DSP_CTRL0, 0x7, 26), 1061 .bt1120_yc_swap = VOP_REG(RK3366_LIT_DSP_CTRL0, 0x1, 30), 1062 .bt1120_en = VOP_REG(RK3366_LIT_DSP_CTRL0, 0x1, 31), 1063 .bt656_en = VOP_REG(RK3366_LIT_DSP_CTRL0, 0x1, 6), 1064 1065 .mcu_force_rdn = VOP_REG(RV1126B_DSP_CTRL1, 0x1, 21), 1066 1067 .dsp_interlace = VOP_REG(RK3366_LIT_DSP_CTRL2, 0x1, 0), 1068 .dither_up = VOP_REG(RK3366_LIT_DSP_CTRL2, 0x1, 2), 1069 .overlay_mode = VOP_REG(RK3366_LIT_DSP_CTRL2, 0x1, 4), 1070 .dsp_lut_en = VOP_REG(RK3366_LIT_DSP_CTRL2, 0x1, 5), 1071 .dither_down = VOP_REG(RK3366_LIT_DSP_CTRL2, 0x1, 8), 1072 .dsp_bg_swap = VOP_REG(RK3366_LIT_DSP_CTRL2, 0x1, 9), 1073 .dsp_data_swap = VOP_REG(RK3366_LIT_DSP_CTRL2, 0x1f, 9), 1074 .dsp_rb_swap = VOP_REG(RK3366_LIT_DSP_CTRL2, 0x1, 11), 1075 .dsp_rg_swap = VOP_REG(RK3366_LIT_DSP_CTRL2, 0x1, 12), 1076 .dsp_blank = VOP_REG(RK3366_LIT_DSP_CTRL2, 0x1, 14), 1077 .dsp_black = VOP_REG(RK3366_LIT_DSP_CTRL2, 0x1, 15), 1078 .out_mode = VOP_REG(RK3366_LIT_DSP_CTRL2, 0xf, 16), 1079 .dsp_layer_sel = VOP_REG(RK3366_LIT_DSP_CTRL2, 0xf, 22), 1080 1081 .htotal_pw = VOP_REG(RK3366_LIT_DSP_HTOTAL_HS_END, 0x0fff0fff, 0), 1082 .hact_st_end = VOP_REG(RK3366_LIT_DSP_HACT_ST_END, 0x0fff0fff, 0), 1083 .vtotal_pw = VOP_REG(RK3366_LIT_DSP_VTOTAL_VS_END, 0x0fff0fff, 0), 1084 .vact_st_end = VOP_REG(RK3366_LIT_DSP_VACT_ST_END, 0x0fff0fff, 0), 1085 .vact_st_end_f1 = VOP_REG(RK3366_LIT_DSP_VACT_ST_END_F1, 0x0fff0fff, 0), 1086 .vs_st_end_f1 = VOP_REG(RK3366_LIT_DSP_VS_ST_END_F1, 0x0fff0fff, 0), 1087 1088 .bcsh_en = VOP_REG(RK3366_LIT_BCSH_CTRL, 0x1, 0), 1089 .bcsh_r2y_csc_mode = VOP_REG(RK3366_LIT_BCSH_CTRL, 0x1, 1), 1090 .bcsh_out_mode = VOP_REG(RK3366_LIT_BCSH_CTRL, 0x3, 2), 1091 .bcsh_y2r_csc_mode = VOP_REG(RK3366_LIT_BCSH_CTRL, 0x3, 4), 1092 .bcsh_y2r_en = VOP_REG(RK3366_LIT_BCSH_CTRL, 0x1, 6), 1093 .bcsh_r2y_en = VOP_REG(RK3366_LIT_BCSH_CTRL, 0x1, 7), 1094 1095 .bcsh_color_bar = VOP_REG(RK3366_LIT_BCSH_COL_BAR, 0xffffff, 0), 1096 .bcsh_brightness = VOP_REG(RK3366_LIT_BCSH_BCS, 0xff, 0), 1097 .bcsh_contrast = VOP_REG(RK3366_LIT_BCSH_BCS, 0x1ff, 8), 1098 .bcsh_sat_con = VOP_REG(RK3366_LIT_BCSH_BCS, 0x3ff, 20), 1099 .bcsh_sin_hue = VOP_REG(RK3366_LIT_BCSH_H, 0x1ff, 0), 1100 .bcsh_cos_hue = VOP_REG(RK3366_LIT_BCSH_H, 0x1ff, 16), 1101 }; 1102 1103 static const struct vop_grf_ctrl rv1126b_grf_ctrl = { 1104 .grf_dclk_inv = VOP_REG(0x30b9c, 0x1, 0), 1105 }; 1106 1107 const struct vop_data rv1126b_vop = { 1108 .version = VOP_VERSION(2, 0xf), 1109 .max_output = {1920, 1080}, 1110 .ctrl = &rv1126b_ctrl_data, 1111 .grf_ctrl = &rv1126b_grf_ctrl, 1112 .win = &rv1126_win2_data, 1113 .line_flag = &rk3366_vop_lite_line_flag, 1114 .reg_len = RK3366_LIT_FLAG_REG * 4, 1115 }; 1116 1117 static const struct vop_ctrl rv1106_ctrl_data = { 1118 .standby = VOP_REG(RK3366_LIT_SYS_CTRL2, 0x1, 1), 1119 .axi_outstanding_max_num = VOP_REG(RK3366_LIT_SYS_CTRL1, 0x1f, 16), 1120 .axi_max_outstanding_en = VOP_REG(RK3366_LIT_SYS_CTRL1, 0x1, 12), 1121 .htotal_pw = VOP_REG(RK3366_LIT_DSP_HTOTAL_HS_END, 0x0fff0fff, 0), 1122 .hact_st_end = VOP_REG(RK3366_LIT_DSP_HACT_ST_END, 0x0fff0fff, 0), 1123 .vtotal_pw = VOP_REG(RK3366_LIT_DSP_VTOTAL_VS_END, 0x0fff0fff, 0), 1124 .vact_st_end = VOP_REG(RK3366_LIT_DSP_VACT_ST_END, 0x0fff0fff, 0), 1125 .vact_st_end_f1 = VOP_REG(RK3366_LIT_DSP_VACT_ST_END_F1, 0x0fff0fff, 0), 1126 .vs_st_end_f1 = VOP_REG(RK3366_LIT_DSP_VS_ST_END_F1, 0x0fff0fff, 0), 1127 .dsp_interlace = VOP_REG(RK3366_LIT_DSP_CTRL2, 0x1, 0), 1128 .auto_gate_en = VOP_REG(RK3366_LIT_SYS_CTRL2, 0x1, 0), 1129 .core_dclk_div = VOP_REG(RK3366_LIT_DSP_CTRL0, 0x1, 13), 1130 .rgb_en = VOP_REG(RK3366_LIT_DSP_CTRL0, 0x1, 0), 1131 .rgb_pin_pol = VOP_REG(RK3366_LIT_DSP_CTRL0, 0x7, 2), 1132 .dither_down = VOP_REG(RK3366_LIT_DSP_CTRL2, 0x1, 8), 1133 .dither_up = VOP_REG(RK3366_LIT_DSP_CTRL2, 0x1, 2), 1134 .dsp_data_swap = VOP_REG(RK3366_LIT_DSP_CTRL2, 0x1f, 9), 1135 .dsp_bg_swap = VOP_REG(RK3366_LIT_DSP_CTRL2, 0x1, 9), 1136 .dsp_rb_swap = VOP_REG(RK3366_LIT_DSP_CTRL2, 0x1, 11), 1137 .dsp_rg_swap = VOP_REG(RK3366_LIT_DSP_CTRL2, 0x1, 12), 1138 .yuv_clip = VOP_REG(RK3366_LIT_SYS_CTRL2, 0x1, 4), 1139 .dsp_black = VOP_REG(RK3366_LIT_DSP_CTRL2, 0x1, 15), 1140 .dsp_blank = VOP_REG(RK3366_LIT_DSP_CTRL2, 0x1, 14), 1141 .dsp_outzero = VOP_REG(RK3366_LIT_SYS_CTRL2, 0x1, 3), 1142 .out_mode = VOP_REG(RK3366_LIT_DSP_CTRL2, 0xf, 16), 1143 .dsp_background = VOP_REG(RK3366_LIT_DSP_BG, 0x00ffffff, 0), 1144 .cfg_done = VOP_REG(RK3366_LIT_REG_CFG_DONE, 0x1, 0), 1145 1146 .bcsh_en = VOP_REG(RK3366_LIT_BCSH_CTRL, 0x1, 0), 1147 .bcsh_r2y_csc_mode = VOP_REG(RK3366_LIT_BCSH_CTRL, 0x1, 1), 1148 .bcsh_out_mode = VOP_REG(RK3366_LIT_BCSH_CTRL, 0x3, 2), 1149 .bcsh_y2r_csc_mode = VOP_REG(RK3366_LIT_BCSH_CTRL, 0x3, 4), 1150 .bcsh_y2r_en = VOP_REG(RK3366_LIT_BCSH_CTRL, 0x1, 6), 1151 .bcsh_r2y_en = VOP_REG(RK3366_LIT_BCSH_CTRL, 0x1, 7), 1152 .bcsh_color_bar = VOP_REG(RK3366_LIT_BCSH_COL_BAR, 0xffffff, 0), 1153 .bcsh_brightness = VOP_REG(RK3366_LIT_BCSH_BCS, 0xff, 0), 1154 .bcsh_contrast = VOP_REG(RK3366_LIT_BCSH_BCS, 0x1ff, 8), 1155 .bcsh_sat_con = VOP_REG(RK3366_LIT_BCSH_BCS, 0x3ff, 20), 1156 .bcsh_sin_hue = VOP_REG(RK3366_LIT_BCSH_H, 0x1ff, 0), 1157 .bcsh_cos_hue = VOP_REG(RK3366_LIT_BCSH_H, 0x1ff, 16), 1158 1159 .mcu_pix_total = VOP_REG(RK3366_LIT_MCU_CTRL, 0x3f, 0), 1160 .mcu_cs_pst = VOP_REG(RK3366_LIT_MCU_CTRL, 0xf, 6), 1161 .mcu_cs_pend = VOP_REG(RK3366_LIT_MCU_CTRL, 0x3f, 10), 1162 .mcu_rw_pst = VOP_REG(RK3366_LIT_MCU_CTRL, 0xf, 16), 1163 .mcu_rw_pend = VOP_REG(RK3366_LIT_MCU_CTRL, 0x3f, 20), 1164 .mcu_clk_sel = VOP_REG(RK3366_LIT_MCU_CTRL, 0x1, 26), 1165 .mcu_hold_mode = VOP_REG(RK3366_LIT_MCU_CTRL, 0x1, 27), 1166 .mcu_frame_st = VOP_REG(RK3366_LIT_MCU_CTRL, 0x1, 28), 1167 .mcu_rs = VOP_REG(RK3366_LIT_MCU_CTRL, 0x1, 29), 1168 .mcu_bypass = VOP_REG(RK3366_LIT_MCU_CTRL, 0x1, 30), 1169 .mcu_type = VOP_REG(RK3366_LIT_MCU_CTRL, 0x1, 31), 1170 .mcu_rw_bypass_port = VOP_REG(RK3366_LIT_MCU_RW_BYPASS_PORT, 1171 0xffffffff, 0), 1172 .bt1120_yc_swap = VOP_REG(RK3366_LIT_DSP_CTRL0, 0x1, 30), 1173 .bt1120_en = VOP_REG(RK3366_LIT_DSP_CTRL0, 0x1, 31), 1174 .bt656_en = VOP_REG(RK3366_LIT_DSP_CTRL0, 0x1, 6), 1175 }; 1176 1177 static const struct vop_grf_ctrl rv1106_grf_ctrl = { 1178 .grf_dclk_inv = VOP_REG(0x1000c, 0x1, 2), 1179 }; 1180 1181 static const struct vop_win rv1106_win1_data = { 1182 .enable = VOP_REG(RK3366_LIT_WIN1_CTRL0, 0x1, 0), 1183 .format = VOP_REG(RK3366_LIT_WIN1_CTRL0, 0x7, 4), 1184 .interlace_read = VOP_REG(RK3366_LIT_WIN1_CTRL0, 0x1, 8), 1185 .rb_swap = VOP_REG(RK3366_LIT_WIN1_CTRL0, 0x1, 12), 1186 .dsp_info = VOP_REG(RK3366_LIT_WIN1_DSP_INFO, 0x0fff0fff, 0), 1187 .dsp_st = VOP_REG(RK3366_LIT_WIN1_DSP_ST, 0xffffffff, 0), 1188 .yrgb_mst = VOP_REG(RK3366_LIT_WIN1_MST, 0xffffffff, 0), 1189 .yrgb_vir = VOP_REG(RK3366_LIT_WIN1_VIR, 0x1fff, 0), 1190 1191 .alpha_mode = VOP_REG(RK3366_LIT_WIN1_ALPHA_CTRL, 0x1, 1), 1192 .alpha_en = VOP_REG(RK3366_LIT_WIN1_ALPHA_CTRL, 0x1, 0), 1193 }; 1194 1195 static const struct vop_line_flag rv1106_vop_lite_line_flag = { 1196 .line_flag_num[0] = VOP_REG(RK3366_LIT_LINE_FLAG, 0xfff, 0), 1197 .line_flag_num[1] = VOP_REG(RK3366_LIT_LINE_FLAG, 0xfff, 16), 1198 }; 1199 1200 const struct vop_data rv1106_vop = { 1201 .version = VOP_VERSION(2, 12), 1202 .max_output = {1280, 1280}, 1203 .ctrl = &rv1106_ctrl_data, 1204 .grf_ctrl = &rv1106_grf_ctrl, 1205 .win = &rv1106_win1_data, 1206 .line_flag = &rv1106_vop_lite_line_flag, 1207 .reg_len = RK3366_LIT_FLAG_REG * 4, 1208 }; 1209