Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

pinctrl: amd: Add fields for interrupt status and wake status

If the firmware has misconfigured a GPIO it may cause interrupt
status or wake status bits to be set and not asserted. Add these
to debug output to catch this case.

Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
Link: https://lore.kernel.org/r/20230328174231.8924-3-mario.limonciello@amd.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>

authored by

Mario Limonciello and committed by
Linus Walleij
010f493d 75358cf3

+17 -3
+17 -3
drivers/pinctrl/pinctrl-amd.c
··· 211 211 char *wake_cntrl1; 212 212 char *wake_cntrl2; 213 213 char *pin_sts; 214 + char *interrupt_sts; 215 + char *wake_sts; 214 216 char *pull_up_sel; 215 217 char *orientation; 216 218 char debounce_value[40]; ··· 245 243 continue; 246 244 } 247 245 seq_printf(s, "GPIO bank%d\n", bank); 248 - seq_puts(s, "gpio\tint|active|trigger|S0i3| S3|S4/S5| Z|wake|pull| orient| debounce|reg\n"); 246 + seq_puts(s, "gpio\t int|active|trigger|S0i3| S3|S4/S5| Z|wake|pull| orient| debounce|reg\n"); 249 247 for (; i < pin_num; i++) { 250 248 seq_printf(s, "#%d\t", i); 251 249 raw_spin_lock_irqsave(&gpio_dev->lock, flags); ··· 276 274 else 277 275 interrupt_mask = "😷"; 278 276 279 - seq_printf(s, "%s| %s| %s|", 277 + if (pin_reg & BIT(INTERRUPT_STS_OFF)) 278 + interrupt_sts = "🔥"; 279 + else 280 + interrupt_sts = " "; 281 + 282 + seq_printf(s, "%s %s| %s| %s|", 283 + interrupt_sts, 280 284 interrupt_mask, 281 285 active_level, 282 286 level_trig); 283 287 } else 284 - seq_puts(s, " ∅| | |"); 288 + seq_puts(s, " ∅| | |"); 285 289 286 290 if (pin_reg & BIT(WAKE_CNTRL_OFF_S0I3)) 287 291 wake_cntrl0 = "⏰"; ··· 312 304 else 313 305 wake_cntrlz = " "; 314 306 seq_printf(s, "%s|", wake_cntrlz); 307 + 308 + if (pin_reg & BIT(WAKE_STS_OFF)) 309 + wake_sts = "🔥"; 310 + else 311 + wake_sts = " "; 312 + seq_printf(s, " %s|", wake_sts); 315 313 316 314 if (pin_reg & BIT(PULL_UP_ENABLE_OFF)) { 317 315 if (pin_reg & BIT(PULL_UP_SEL_OFF))