|
64 | 64 | #define ICU_TINT_LEVEL_HIGH 2
|
65 | 65 | #define ICU_TINT_LEVEL_LOW 3
|
66 | 66 |
|
67 |
| -#define ICU_TSSR_TSSEL_PREP(tssel, n) ((tssel) << ((n) * 8)) |
68 |
| -#define ICU_TSSR_TSSEL_MASK(n) ICU_TSSR_TSSEL_PREP(0x7F, n) |
| 67 | +#define ICU_TSSR_TSSEL_PREP(tssel, n, field_width) ((tssel) << ((n) * (field_width))) |
| 68 | +#define ICU_TSSR_TSSEL_MASK(n, field_width) \ |
| 69 | +({\ |
| 70 | + typeof(field_width) (_field_width) = (field_width); \ |
| 71 | + ICU_TSSR_TSSEL_PREP((GENMASK(((_field_width) - 2), 0)), (n), _field_width); \ |
| 72 | +}) |
| 73 | + |
69 | 74 | #define ICU_TSSR_TIEN(n, field_width) \
|
70 | 75 | ({\
|
71 | 76 | typeof(field_width) (_field_width) = (field_width); \
|
@@ -326,8 +331,8 @@ static int rzv2h_tint_set_type(struct irq_data *d, unsigned int type)
|
326 | 331 | guard(raw_spinlock)(&priv->lock);
|
327 | 332 |
|
328 | 333 | tssr = readl_relaxed(priv->base + priv->info->t_offs + ICU_TSSR(tssr_k));
|
329 |
| - tssr &= ~(ICU_TSSR_TSSEL_MASK(tssel_n) | tien); |
330 |
| - tssr |= ICU_TSSR_TSSEL_PREP(tint, tssel_n); |
| 334 | + tssr &= ~(ICU_TSSR_TSSEL_MASK(tssel_n, priv->info->field_width) | tien); |
| 335 | + tssr |= ICU_TSSR_TSSEL_PREP(tint, tssel_n, priv->info->field_width); |
331 | 336 |
|
332 | 337 | writel_relaxed(tssr, priv->base + priv->info->t_offs + ICU_TSSR(tssr_k));
|
333 | 338 |
|
|
0 commit comments