Interrupt on Up2 Board GPIO(pin number 29, linux gpio 430)

snc
snc New Member Posts: 2

Hi,

We are using a Up2 board with Yocto Sumo branch(linux kernel 4.14.92)

We are trying to use linux gpio 430 for interrupt handling. But, we dont see the interrupt handler invoked. Is it a known issue with workarounds as I see some fixes for 4.19 kernel

Code:
+static int register_gpio(void)
++{
++ if(gpio_request_one(IRQ_GPIO, GPIOF_IN, "MCU_sel") < 0) {
++ printk(KERN_ALERT "GPIO %d cannot be used\n", IRQ_GPIO);
++ return -EBUSY;
++ }
++ if ( (irq_line = gpio_to_irq(MCU_IRQ_GPIO)) < 0)
++ {
++ printk(KERN_ALERT "Gpio %d cannot be used as interrupt\n",IRQ_GPIO);
++ return -EINVAL;
++ }
++ if ( (irq_req_res = request_irq(irq_line, MCU_irq_handler, IRQF_TRIGGER_FALLING, "MCU_IRQ_GPIO", NULL)) < 0)
++ {
++ printk(KERN_ERR " registering irq failed\n");
++ return -EINVAL;
++ }
++ printk(KERN_INFO "select switch GPIO is registred\n");

++ return 0;
++}
++

Comments

Privacy Policy