fuzz1981
Posts: 2
Joined: Sat Jan 05, 2013 4:09 pm

IRQ Patch/MPU6050

Sat Jan 05, 2013 4:25 pm

Hi,

I ran into a problem when trying to use industrialio (iio) drivers in the kernel using a gpio interrupt.
-ENOMEM was returned when trying to allocate an interrupt descriptor since NR_IRQS were already allocated.

This adds NR_BCM2708_IRQS to initialize the platform IRQs and adds an additional 64 to NR_IRQS for the kernel to use.

I've ported the MPU6050 accelerometer/gyro driver from Android into 3.6.11 at https://github.com/wtfuzz/linux

arch/arm/mach-bcm2708/include/mach/irqs.h

Code: Select all

@@ -193,7 +193,8 @@
 #define FIQ_IRQS              (64 + 21)
 #define GPIO_IRQS        (32*5)
-#define NR_IRQS          HARD_IRQS+FIQ_IRQS+GPIO_IRQS
+#define NR_BCM2708_IRQS          HARD_IRQS+FIQ_IRQS+GPIO_IRQS
+#define NR_IRQS                  NR_BCM2708_IRQS + 64
arch/arm/mach-bcm2708/armctrl.c

Code: Select all

@@ -210,7 +210,7 @@ int __init armctrl_init(void __iomem * base, unsigned int irq_start,
 {
   unsigned int irq;
-  for (irq = 0; irq < NR_IRQS; irq++) {
+  for (irq = 0; irq < NR_BCM2708_IRQS; irq++) {
     unsigned int data = irq;
     if (irq >= INTERRUPT_JPEG && irq <= INTERRUPT_ARASANSDIO)
       data = remap_irqs[irq - INTERRUPT_JPEG];

gregoiregentil
Posts: 1
Joined: Tue Jan 15, 2013 5:22 am

Re: IRQ Patch/MPU6050

Tue Jan 15, 2013 6:12 am

Sorry to crash your question. I have MPU-6050 with industrialIO working on an ARM system. I'm looking for some user space code that polls the kernel driver and dump quaternion. Have you achieved this? Thanks in advance if you could share anything ([email protected]).

niluje
Posts: 1
Joined: Sat Nov 02, 2013 3:53 pm

Re: IRQ Patch/MPU6050

Sat Nov 02, 2013 3:56 pm

Just a few words to say thank you. Your patch will save me some work hours.

Return to “Linux Kernel”