Nios® V/II Embedded Design Suite (EDS)
Support for Embedded Development Tools, Processors (SoCs and Nios® V/II processor), Embedded Development Suites (EDSs), Boot and Configuration, Operating Systems, C and C++
12603 Discussions

Register interrupt return -22 error

Altera_Forum
Honored Contributor II
1,224 Views

I have a problem, return to the -22 error in the request_irq function call. 

Register interrupt device is the FPGA side PushButton, offset address is 0x000100c0 

The following is the content of the button_pio device tree. 

The priority of button_pio is FPGA_IRQ5,Find in Handbook, 

The 77 is the corresponding interrupt number(#define FPGA_BUTTON_DSR_IRQ 77). 

 

button_pio: gpio@0x1000100C0 {compatible = "ALTR,pio-13.1", "ALTR,pio-1.0", "altr,pio-1.0"; 

reg = < 0x00000001 0x000100C0 0x00000010 >; 

interrupt-parent = < &hps_0_arm_gic_0 >; 

interrupts = < 0 45 1 >; 

width = < 2 >; /* embeddedsw.dts.params.width type NUMBER */ 

resetvalue = < 0 >; /* embeddedsw.dts.params.resetvalue type NUMBER */ 

edge_type = < 1 >; /* embeddedsw.dts.params.edge_type type NUMBER */ 

level_trigger = < 0 >; /* embeddedsw.dts.params.level_trigger type NUMBER */ 

#gpio-cells = < 2 >; 

gpio-controller; 

 

 

The following is the driver code. 

 

writel(pst_pio->np_pioedgecapture|0x1, &pst_pio->np_pioedgecapture); 

writel(pst_pio->np_piodirection&0xfffffffe, &pst_pio->np_piodirection); 

ret = request_irq(FPGA_BUTTON_DSR_IRQ, button_dsr_isr, IRQF_DISABLED, "button_dsr_fpga", (void*)(pst_dev)); 

if (ret != 0)  

printk("button_dsr: unable to register interrupt %d\n", ret);  

return -1; 

 

writel(pst_pio->np_piointerruptmask|1, &pst_pio->np_piointerruptmask); 

 

 

 

comment out "interrupts = < 0 45 1 >;" after successful registration, interrupt can also be normal response. 

what is the reason&#65311; 

 

If you have any ideas would be greatly appreciated.Thanks 

 

 

 

 

 

 

 

0 Kudos
1 Reply
Altera_Forum
Honored Contributor II
492 Views

Help please! Somebody help me!

0 Kudos
Reply