@@ -582,8 +582,8 @@ static struct rzv2h_mstop
if (!mstop)
return NULL;
- mstop->idx = (mstop_data >> 16) & 0xffff;
- mstop->mask = mstop_data & 0xffff;
+ mstop->idx = FIELD_GET(BUS_MSTOP_IDX_MASK, (mstop_data));
+ mstop->mask = FIELD_GET(BUS_MSTOP_BITS_MASK, (mstop_data));
if (rzv2h_mod_clock_is_enabled(&clock->hw))
refcount_set(&mstop->ref_cnt, 1);
else
@@ -46,7 +46,10 @@ struct ddiv {
#define CDDIV4_DIVCTL1 DDIV_PACK(CPG_CDDIV4, 4, 1, 17)
#define CDDIV4_DIVCTL2 DDIV_PACK(CPG_CDDIV4, 8, 1, 18)
-#define BUS_MSTOP(idx, mask) (((idx) & 0xffff) << 16 | (mask))
+#define BUS_MSTOP_IDX_MASK GENMASK(31, 16)
+#define BUS_MSTOP_BITS_MASK GENMASK(15, 0)
+#define BUS_MSTOP(idx, mask) (FIELD_PREP_CONST(BUS_MSTOP_IDX_MASK, (idx)) | \
+ FIELD_PREP_CONST(BUS_MSTOP_BITS_MASK, (mask)))
#define BUS_MSTOP_NONE GENMASK(31, 0)
/**