20
20
#include "rockchip_drm_vop.h"
21
21
#include "rockchip_vop_reg.h"
22
22
23
- #define VOP_REG (off , _mask , s ) \
24
- {.offset = off, \
23
+ #define _VOP_REG (off , _mask , _shift , _write_mask , _relaxed ) \
24
+ { \
25
+ .offset = off, \
25
26
.mask = _mask, \
26
- .shift = s, \
27
- .write_mask = false,}
27
+ .shift = _shift, \
28
+ .write_mask = _write_mask, \
29
+ .relaxed = _relaxed, \
30
+ }
28
31
29
- #define VOP_REG_MASK (off , _mask , s ) \
30
- {.offset = off, \
31
- .mask = _mask, \
32
- .shift = s, \
33
- .write_mask = true,}
32
+ #define VOP_REG (off , _mask , _shift ) \
33
+ _VOP_REG(off, _mask, _shift, false, true)
34
+
35
+ #define VOP_REG_SYNC (off , _mask , _shift ) \
36
+ _VOP_REG(off, _mask, _shift, false, false)
37
+
38
+ #define VOP_REG_MASK_SYNC (off , _mask , _shift ) \
39
+ _VOP_REG(off, _mask, _shift, true, false)
34
40
35
41
static const uint32_t formats_win_full [] = {
36
42
DRM_FORMAT_XRGB8888 ,
@@ -116,7 +122,7 @@ static const struct vop_intr rk3036_intr = {
116
122
};
117
123
118
124
static const struct vop_ctrl rk3036_ctrl_data = {
119
- .standby = VOP_REG (RK3036_SYS_CTRL , 0x1 , 30 ),
125
+ .standby = VOP_REG_SYNC (RK3036_SYS_CTRL , 0x1 , 30 ),
120
126
.out_mode = VOP_REG (RK3036_DSP_CTRL0 , 0xf , 0 ),
121
127
.pin_pol = VOP_REG (RK3036_DSP_CTRL0 , 0xf , 4 ),
122
128
.dsp_blank = VOP_REG (RK3036_DSP_CTRL1 , 0x1 , 24 ),
@@ -125,7 +131,7 @@ static const struct vop_ctrl rk3036_ctrl_data = {
125
131
.vtotal_pw = VOP_REG (RK3036_DSP_VTOTAL_VS_END , 0x1fff1fff , 0 ),
126
132
.vact_st_end = VOP_REG (RK3036_DSP_VACT_ST_END , 0x1fff1fff , 0 ),
127
133
.line_flag_num [0 ] = VOP_REG (RK3036_INT_STATUS , 0xfff , 12 ),
128
- .cfg_done = VOP_REG (RK3036_REG_CFG_DONE , 0x1 , 0 ),
134
+ .cfg_done = VOP_REG_SYNC (RK3036_REG_CFG_DONE , 0x1 , 0 ),
129
135
};
130
136
131
137
static const struct vop_data rk3036_vop = {
@@ -201,7 +207,7 @@ static const struct vop_win_phy rk3288_win23_data = {
201
207
};
202
208
203
209
static const struct vop_ctrl rk3288_ctrl_data = {
204
- .standby = VOP_REG (RK3288_SYS_CTRL , 0x1 , 22 ),
210
+ .standby = VOP_REG_SYNC (RK3288_SYS_CTRL , 0x1 , 22 ),
205
211
.gate_en = VOP_REG (RK3288_SYS_CTRL , 0x1 , 23 ),
206
212
.mmu_en = VOP_REG (RK3288_SYS_CTRL , 0x1 , 20 ),
207
213
.rgb_en = VOP_REG (RK3288_SYS_CTRL , 0x1 , 12 ),
@@ -222,7 +228,7 @@ static const struct vop_ctrl rk3288_ctrl_data = {
222
228
.vpost_st_end = VOP_REG (RK3288_POST_DSP_VACT_INFO , 0x1fff1fff , 0 ),
223
229
.line_flag_num [0 ] = VOP_REG (RK3288_INTR_CTRL0 , 0x1fff , 12 ),
224
230
.global_regdone_en = VOP_REG (RK3288_SYS_CTRL , 0x1 , 11 ),
225
- .cfg_done = VOP_REG (RK3288_REG_CFG_DONE , 0x1 , 0 ),
231
+ .cfg_done = VOP_REG_SYNC (RK3288_REG_CFG_DONE , 0x1 , 0 ),
226
232
};
227
233
228
234
/*
@@ -266,7 +272,7 @@ static const struct vop_data rk3288_vop = {
266
272
};
267
273
268
274
static const struct vop_ctrl rk3399_ctrl_data = {
269
- .standby = VOP_REG (RK3399_SYS_CTRL , 0x1 , 22 ),
275
+ .standby = VOP_REG_SYNC (RK3399_SYS_CTRL , 0x1 , 22 ),
270
276
.gate_en = VOP_REG (RK3399_SYS_CTRL , 0x1 , 23 ),
271
277
.dp_en = VOP_REG (RK3399_SYS_CTRL , 0x1 , 11 ),
272
278
.rgb_en = VOP_REG (RK3399_SYS_CTRL , 0x1 , 12 ),
@@ -290,7 +296,7 @@ static const struct vop_ctrl rk3399_ctrl_data = {
290
296
.vpost_st_end = VOP_REG (RK3399_POST_DSP_VACT_INFO , 0x1fff1fff , 0 ),
291
297
.line_flag_num [0 ] = VOP_REG (RK3399_LINE_FLAG , 0xffff , 0 ),
292
298
.line_flag_num [1 ] = VOP_REG (RK3399_LINE_FLAG , 0xffff , 16 ),
293
- .cfg_done = VOP_REG_MASK (RK3399_REG_CFG_DONE , 0x1 , 0 ),
299
+ .cfg_done = VOP_REG_MASK_SYNC (RK3399_REG_CFG_DONE , 0x1 , 0 ),
294
300
};
295
301
296
302
static const int rk3399_vop_intrs [] = {
@@ -306,9 +312,9 @@ static const int rk3399_vop_intrs[] = {
306
312
static const struct vop_intr rk3399_vop_intr = {
307
313
.intrs = rk3399_vop_intrs ,
308
314
.nintrs = ARRAY_SIZE (rk3399_vop_intrs ),
309
- .status = VOP_REG_MASK (RK3399_INTR_STATUS0 , 0xffff , 0 ),
310
- .enable = VOP_REG_MASK (RK3399_INTR_EN0 , 0xffff , 0 ),
311
- .clear = VOP_REG_MASK (RK3399_INTR_CLEAR0 , 0xffff , 0 ),
315
+ .status = VOP_REG_MASK_SYNC (RK3399_INTR_STATUS0 , 0xffff , 0 ),
316
+ .enable = VOP_REG_MASK_SYNC (RK3399_INTR_EN0 , 0xffff , 0 ),
317
+ .clear = VOP_REG_MASK_SYNC (RK3399_INTR_CLEAR0 , 0xffff , 0 ),
312
318
};
313
319
314
320
static const struct vop_data rk3399_vop_big = {
0 commit comments