2009-04-07 05:10:37 spi gives no IRQ
Sergey Kuznetsov (RUSSIAN FEDERATION)
Message: 72305
Hi all!
I`m using BF537-stamp with 2.6.28.7 kernel. Spi driver is spi_bfin5xx(with DMA enabled). I`m trying to create irq handler in my custom spi driver. There request_irq() gets spi->irq as an irq in order to create handler. But spi->irq == 0. Including printk in spi_bfin5xx driver shows that spi->irq is 0. Than, in /proc/interrupts is shown that spi_bfin5xx in my case uses corresponding DMA interrupt (17, BF53x_SPI_DMA). Attempt to request 17 irq failed, as it is really busy.
The question is how can I request_irq(), or even how can I read smth from spi?
There are a number of drivers, which use spi, but in my case the same approach doesn`t work as I`ve got irq ==0.
What have I done wrong or there to look at for the answer?
Thank you!
QuoteReplyEditDelete
2009-04-07 05:19:30 Re: spi gives no IRQ
Mike Frysinger (UNITED STATES)
Message: 72308
you do not manage the SPI peripheral at all, especially the SPI IRQs. those are all taken care of by the Blackfin SPI bus driver.
if you wish to talk to a SPI device, then use the SPI framework as documented:
docs.blackfin.uclinux.org/doku.php?id=spi
QuoteReplyEditDelete
2009-04-07 05:25:41 Re: spi gives no IRQ
Sergey Kuznetsov (RUSSIAN FEDERATION)
Message: 72310
Thank you, Mike!
But is there any way I can get event or smth like this that spi got or ready to receive a message?
QuoteReplyEditDelete
2009-04-07 05:37:14 Re: spi gives no IRQ
Mike Frysinger (UNITED STATES)
Message: 72314
there is no such thing in the SPI world as "ready to receive". you either do a transfer or you dont.
you can do asynchronous or synchronous transfers as laid out in the kernel API. sync transfers will sleep until it is finished where async transfers have optional callback functions.
QuoteReplyEditDelete
2009-04-07 07:22:00 Re: spi gives no IRQ
Sergey Kuznetsov (RUSSIAN FEDERATION)
Message: 72321
Thank you, then I wrote previous post I realized that was a strange question and realized what to do
Thank you!
QuoteReplyEditDelete
2009-04-07 07:30:17 Re: spi gives no IRQ
Sergey Kuznetsov (RUSSIAN FEDERATION)
Message: 72322
Hm, but still is interesting the way and the cause of the use of irqhandlers in spi drivers(like rtc-ds1511, touchscreen ads7846 and other spi using devices)? There is request_irq(spi->irq, ...) and handlers?Just to know...
Thank you!
QuoteReplyEditDelete
2009-04-07 09:08:23 Re: spi gives no IRQ
Sergey Kuznetsov (RUSSIAN FEDERATION)
Message: 72327
I mean, if I do not manage anything hardware related to spi, what do those handlers handle if not spi->irq as written in that drivers in request_irq(spi->irq, ...)?
LDD3 gave me a little clue. I started thinking about shared irq use, but there is nothing similar in rtc, touchscreen and other drivers.
Thank you.
QuoteReplyEditDelete
2009-04-07 15:05:30 Re: spi gives no IRQ
Mike Frysinger (UNITED STATES)
Message: 72347
those irqs have nothing to do with the SPI irq. they have dedicated interrupt lines.
QuoteReplyEditDelete
2009-04-08 03:24:19 Re: spi gives no IRQ
Sergey Kuznetsov (RUSSIAN FEDERATION)
Message: 72385
Hm, now I got it.
Thank you!