* number. For example 7:0
*/
-#define FLD_GET(val, start, end) \
- ({ \
- int _end = (end); \
- u32 _ret_val = ((val) & GENMASK((start), _end)) >> _end; \
- _ret_val; \
- })
-
#define FLD_MOD(orig, val, start, end) \
({ \
int _start = (start), _end = (end); \
})
#define REG_GET(dispc, idx, start, end) \
- ((u32)FLD_GET(dispc_read((dispc), (idx)), (start), (end)))
+ ((u32)FIELD_GET(GENMASK((start), (end)), \
+ dispc_read((dispc), (idx))))
#define REG_FLD_MOD(dispc, idx, val, start, end) \
({ \
})
#define VID_REG_GET(dispc, hw_plane, idx, start, end) \
- ((u32)FLD_GET(dispc_vid_read((dispc), (hw_plane), (idx)), (start), (end)))
+ ((u32)FIELD_GET(GENMASK((start), (end)), \
+ dispc_vid_read((dispc), (hw_plane), (idx))))
#define VID_REG_FLD_MOD(dispc, hw_plane, idx, val, start, end) \
({ \
})
#define VP_REG_GET(dispc, vp, idx, start, end) \
- ((u32)FLD_GET(dispc_vp_read((dispc), (vp), (idx)), (start), (end)))
+ ((u32)FIELD_GET(GENMASK((start), (end)), \
+ dispc_vp_read((dispc), (vp), (idx))))
#define VP_REG_FLD_MOD(dispc, vp, idx, val, start, end) \
({ \