Skip to content

Commit 1d930d4

Browse files
Fabrizio Castrogeertu
authored andcommitted
pinctrl: renesas: rzg2l: Remove RZG2L_TINT_IRQ_START_INDEX
The RZ/V2H(P) SoC has 16 IRQ interrupts, while every other SoC has 8, and this affects the start index of TINT interrupts (1 + 16 = 17, rather than 1 + 8 = 9). Macro RZG2L_TINT_IRQ_START_INDEX cannot work anymore, replace it with a new member within struct rzg2l_hwcfg. Signed-off-by: Fabrizio Castro <[email protected]> Reviewed-by: Geert Uytterhoeven <[email protected]> Tested-by: Claudiu Beznea <[email protected]> Link: https://lore.kernel.org/[email protected] Signed-off-by: Geert Uytterhoeven <[email protected]>
1 parent a813032 commit 1d930d4

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

drivers/pinctrl/renesas/pinctrl-rzg2l.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,6 @@
168168
#define RZG2L_PIN_ID_TO_PIN(id) ((id) % RZG2L_PINS_PER_PORT)
169169

170170
#define RZG2L_TINT_MAX_INTERRUPT 32
171-
#define RZG2L_TINT_IRQ_START_INDEX 9
172171
#define RZG2L_PACK_HWIRQ(t, i) (((t) << 16) | (i))
173172

174173
/* Custom pinconf parameters */
@@ -247,6 +246,7 @@ enum rzg2l_iolh_index {
247246
* @iolh_groupb_ua: IOLH group B uA specific values
248247
* @iolh_groupc_ua: IOLH group C uA specific values
249248
* @iolh_groupb_oi: IOLH group B output impedance specific values
249+
* @tint_start_index: the start index for the TINT interrupts
250250
* @drive_strength_ua: drive strength in uA is supported (otherwise mA is supported)
251251
* @func_base: base number for port function (see register PFC)
252252
* @oen_max_pin: the maximum pin number supporting output enable
@@ -258,6 +258,7 @@ struct rzg2l_hwcfg {
258258
u16 iolh_groupb_ua[RZG2L_IOLH_IDX_MAX];
259259
u16 iolh_groupc_ua[RZG2L_IOLH_IDX_MAX];
260260
u16 iolh_groupb_oi[4];
261+
u16 tint_start_index;
261262
bool drive_strength_ua;
262263
u8 func_base;
263264
u8 oen_max_pin;
@@ -2379,7 +2380,7 @@ static int rzg2l_gpio_child_to_parent_hwirq(struct gpio_chip *gc,
23792380

23802381
rzg2l_gpio_irq_endisable(pctrl, child, true);
23812382
pctrl->hwirq[irq] = child;
2382-
irq += RZG2L_TINT_IRQ_START_INDEX;
2383+
irq += pctrl->data->hwcfg->tint_start_index;
23832384

23842385
/* All these interrupts are level high in the CPU */
23852386
*parent_type = IRQ_TYPE_LEVEL_HIGH;
@@ -3034,6 +3035,7 @@ static const struct rzg2l_hwcfg rzg2l_hwcfg = {
30343035
[RZG2L_IOLH_IDX_3V3] = 2000, 4000, 8000, 12000,
30353036
},
30363037
.iolh_groupb_oi = { 100, 66, 50, 33, },
3038+
.tint_start_index = 9,
30373039
.oen_max_pin = 0,
30383040
};
30393041

@@ -3063,6 +3065,7 @@ static const struct rzg2l_hwcfg rzg3s_hwcfg = {
30633065
/* 3v3 power source */
30643066
[RZG2L_IOLH_IDX_3V3] = 4500, 5200, 5700, 6050,
30653067
},
3068+
.tint_start_index = 9,
30663069
.drive_strength_ua = true,
30673070
.func_base = 1,
30683071
.oen_max_pin = 1, /* Pin 1 of P0 and P7 is the maximum OEN pin. */
@@ -3073,6 +3076,7 @@ static const struct rzg2l_hwcfg rzv2h_hwcfg = {
30733076
.regs = {
30743077
.pwpr = 0x3c04,
30753078
},
3079+
.tint_start_index = 17,
30763080
};
30773081

30783082
static struct rzg2l_pinctrl_data r9a07g043_data = {

0 commit comments

Comments
 (0)