linux-i2c.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* trouble with PCA9555 driver on AIMB 210
@ 2012-12-11 14:02 Aleksander Dutkowski
       [not found] ` <CABkKHSZQqaegLW4Kg8OSh4d30qd5V98JBHtPn7M=Luz1qeTMFA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  0 siblings, 1 reply; 2+ messages in thread
From: Aleksander Dutkowski @ 2012-12-11 14:02 UTC (permalink / raw)
  To: linux-i2c-u79uwXL29TY76Z2rM5mHXA

hello!

I have AIMB 210 motherboard with PCA9555 gpio chipset:

$ uname -a
Linux 3.4.7 #14 SMP i686 GNU/Linux


I compiled the PCA953x driver, but failed to run it:

# echo pca9555 0x20 > /sys/bus/i2c/devices/i2c-0/new_device
pca953x: 0-0020: failed to request irq 0
pca953x: probe of 0-0020 failed with error -16
i2c i2c-0: new_device: Instantiated device pca9555 at 0x20
# ls /sys/class/gpio
export unexport

I started to dig into the driver, and when disabling interrupt by
seting pca953x_probe variable irq_base to -1:
int irq_base = -1;

I got this:
# echo pca9555 0x20 > /sys/bus/i2c/devices/i2c-0/new_device
gpiochip_add: registered GPIOs 240 to 255 on device: pca9555
i2c i2c-0: new_device: Instantiated device pca9555 at 0x20
# ls /sys/class/gpio/gpiochip240
export gpiochip240 unexport
# ls /sys/class/gpio/gpiochip240
base device label gpio power/ subsystem uevent

There is lack of gpio folder, where I could read/write gpio values. So
it seems like, interrupt code is buggy. I dont use FDT, so I dont have
interrupts property.
Since, I'm not fluent with linux device drivers, I ask for some help.
It seems like, there is a bug in pca953x_irq_setup() (the one for IRQ
enabled)
irq_alloc_descs() from line 498 returns 50, so I suppose, the first
interrupt to allocate should be 50, not 0.

PS: I have kernel 3.4.7, but I copied the driver source from latest git tree:
https://github.com/mirrors/linux-2.6/commit/ca3ffe910f9935d24e02bb5628a8cbcab119fd9a#drivers/gpio/gpio-pca953x.c
https://github.com/mirrors/linux-2.6/blob/6a7b36aa4b0afbe7a9798feac16de47ad856f358/include/linux/i2c/pca953x.h

thanks in advance
Aleksander D.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-12-11 14:07 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-12-11 14:02 trouble with PCA9555 driver on AIMB 210 Aleksander Dutkowski
     [not found] ` <CABkKHSZQqaegLW4Kg8OSh4d30qd5V98JBHtPn7M=Luz1qeTMFA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-12-11 14:07   ` Wolfram Sang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).