Hi all,
I have an issue regarding multiple GPIO interrupts. Following case:
I am using MCP251xfd can module connected via SPI and an interrupt GPIP
int-gpios = <&gpio0 26 GPIO_ACTIVE_LOW>; // <&gpio0 11 GPIO_ACTIVE_LOW>;
&spi2 {
status = "okay";
cs-gpios = <&gpio0 22 GPIO_ACTIVE_LOW>;
mcp251xfd: can@0 {
compatible = "microchip,mcp251xfd";
reg = <0x0>;
bitrate = <500000>; // 500kBit
sample-point = <800>; // 80%
bitrate-data = <2000000>; // 2000 kBit
sample-point-data = <800>; // 80%
osc-freq = <40000000>; // <16000000>; // 40 MHz
spi-max-frequency = <1000000>; // <18000000>;
int-gpios = <&gpio0 26 GPIO_ACTIVE_LOW>; // <&gpio0 11 GPIO_ACTIVE_LOW>;
status = "okay";
};
};
I used this setup for long time and it worked flawlessly.
Then I added an external Interrupt to a "seemingly" unrelated GPIO. PIN 0 13:
gpio_keys {
compatible = "gpio-keys";
input_fast: input_fast {
gpios = <&gpio0 13 (GPIO_PULL_UP | GPIO_ACTIVE_HIGH)>;
};
};
I set it up like this:
int InputFast::setup()
{
int ret;
if (!device_is_ready(input_fast.port) )
{
printk("Error: Input fast device not ready\n");
return -ENODEV;
}
// Configure fast pins as input with pull-ups
ret = gpio_pin_configure_dt(&input_fast, GPIO_INPUT);
if (ret < 0)
{
printk("Error: Input fast GPIO devices not ready\n");
return ret;
}
gpio_init_callback(&input_fast_cb_data, input_fast_handler, BIT(input_fast.pin));
gpio_add_callback(input_fast.port, &input_fast_cb_data);
// Configure interrupt
ret = gpio_pin_interrupt_configure_dt(&input_fast, GPIO_INT_EDGE_RISING);// GPIO_INT_EDGE_BOTH);
if (ret < 0)
{
printk("Error: Input fast interrupt not ready\n");
return ret;
}
printk("Initialized Input fast\n");
return 0;
}
But whenever I setup this GPIO Interrupt, then the CAN interrupt stops functioning. I Understand that they are underlying connected by the same GPIOE and use the same InterruptHandler at the bottom. But I think they should use different channels for the input event and the InterruptHandler should be able to forward the callback accordingly?