* Handling interrupts in spidev
@ 2014-01-26 12:25 Amit Mahadik
2014-01-26 15:23 ` Richard Weinberger
0 siblings, 1 reply; 12+ messages in thread
From: Amit Mahadik @ 2014-01-26 12:25 UTC (permalink / raw)
To: kernelnewbies
Hello,
? ? ? ? ? I am using a custom ARM board. I have a SPI slave device and using the spidev_test utility I am able to do ioctls on the slave device.
However, I have a problem. The SPI slave device has an interrupt pin and I want to process the interrupt and send some data into the userspace when I receive the interrupt. Can anybody please suggest me a way to do this using spidev driver?
Regards,
Amit.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20140126/8a32cba9/attachment.html
^ permalink raw reply [flat|nested] 12+ messages in thread
* Handling interrupts in spidev
2014-01-26 12:25 Handling interrupts in spidev Amit Mahadik
@ 2014-01-26 15:23 ` Richard Weinberger
2014-01-27 5:37 ` Amit Mahadik
0 siblings, 1 reply; 12+ messages in thread
From: Richard Weinberger @ 2014-01-26 15:23 UTC (permalink / raw)
To: kernelnewbies
On Sun, Jan 26, 2014 at 1:25 PM, Amit Mahadik <amitmahadik35@yahoo.com> wrote:
> Hello,
> I am using a custom ARM board. I have a SPI slave device and using
> the spidev_test utility I am able to do ioctls on the slave device.
> However, I have a problem. The SPI slave device has an interrupt pin and I
> want to process the interrupt and send some data into the userspace when I
> receive the interrupt. Can anybody please suggest me a way to do this using
> spidev driver?
Is the interrupt pin a gpio?
If so, you can access it from userspace and identify interrupts using poll().
--
Thanks,
//richard
^ permalink raw reply [flat|nested] 12+ messages in thread
* Handling interrupts in spidev
2014-01-26 15:23 ` Richard Weinberger
@ 2014-01-27 5:37 ` Amit Mahadik
2014-01-27 6:51 ` Richard Weinberger
0 siblings, 1 reply; 12+ messages in thread
From: Amit Mahadik @ 2014-01-27 5:37 UTC (permalink / raw)
To: kernelnewbies
Thanks for the reply Richard.
??????? The interrupt is not a GPIO? pin. I have read something about UIO (userspace I/O).
Also, I want the operation to be asynchronous. Any pointer to such mechanism will be very helpful.
Regards,
Amit.
On Sunday, 26 January 2014 8:53 PM, Richard Weinberger <richard.weinberger@gmail.com> wrote:
On Sun, Jan 26, 2014 at 1:25 PM, Amit Mahadik <amitmahadik35@yahoo.com> wrote:
> Hello,
>? ? ? ? ? I am using a custom ARM board. I have a SPI slave device and using
> the spidev_test utility I am able to do ioctls on the slave device.
> However, I have a problem. The SPI slave device has an interrupt pin and I
> want to process the interrupt and send some data into the userspace when I
> receive the interrupt. Can anybody please suggest me a way to do this using
> spidev driver?
Is the interrupt pin a gpio?
If so, you can access it from userspace and identify interrupts using poll().
--
Thanks,
//richard
_______________________________________________
Kernelnewbies mailing list
Kernelnewbies at kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20140126/3cc8cf8e/attachment.html
^ permalink raw reply [flat|nested] 12+ messages in thread
* Handling interrupts in spidev
2014-01-27 5:37 ` Amit Mahadik
@ 2014-01-27 6:51 ` Richard Weinberger
2014-01-27 9:21 ` Amit Mahadik
0 siblings, 1 reply; 12+ messages in thread
From: Richard Weinberger @ 2014-01-27 6:51 UTC (permalink / raw)
To: kernelnewbies
Am 27.01.2014 06:37, schrieb Amit Mahadik:
> Thanks for the reply Richard.
> The interrupt is not a GPIO pin. I have read something about UIO (userspace I/O).
> Also, I want the operation to be asynchronous. Any pointer to such mechanism will be very helpful.
Using UIO you can also catch an interrupt in userspace.
You can have a read() which blocks till data is available.
Thanks,
//richard
^ permalink raw reply [flat|nested] 12+ messages in thread
* Handling interrupts in spidev
2014-01-27 6:51 ` Richard Weinberger
@ 2014-01-27 9:21 ` Amit Mahadik
2014-01-27 9:23 ` Richard Weinberger
0 siblings, 1 reply; 12+ messages in thread
From: Amit Mahadik @ 2014-01-27 9:21 UTC (permalink / raw)
To: kernelnewbies
Thanks for your input. But I dont want to block the read call. Also I dont want to miss the interrupts.
Regards,
Amit.
On Monday, 27 January 2014 12:22 PM, Richard Weinberger <richard@nod.at> wrote:
Am 27.01.2014 06:37, schrieb Amit Mahadik:
> Thanks for the reply Richard.
>? ? ? ? The interrupt is not a GPIO? pin. I have read something about UIO (userspace I/O).
> Also, I want the operation to be asynchronous. Any pointer to such mechanism will be very helpful.
Using UIO you can also catch an interrupt in userspace.
You can have a read() which blocks till data is available.
Thanks,
//richard
_______________________________________________
Kernelnewbies mailing list
Kernelnewbies at kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20140127/77656f7d/attachment.html
^ permalink raw reply [flat|nested] 12+ messages in thread
* Handling interrupts in spidev
2014-01-27 9:21 ` Amit Mahadik
@ 2014-01-27 9:23 ` Richard Weinberger
2014-01-28 14:12 ` Amit Mahadik
0 siblings, 1 reply; 12+ messages in thread
From: Richard Weinberger @ 2014-01-27 9:23 UTC (permalink / raw)
To: kernelnewbies
Am 27.01.2014 10:21, schrieb Amit Mahadik:
> Thanks for your input. But I dont want to block the read call. Also I dont want to miss the interrupts.
Look how other drivers/programs deal with that...
Thanks,
//richard
> Regards,
> Amit.
>
>
> On Monday, 27 January 2014 12:22 PM, Richard Weinberger <richard@nod.at> wrote:
> Am 27.01.2014 06:37, schrieb Amit Mahadik:
>> Thanks for the reply Richard.
>> The interrupt is not a GPIO pin. I have read something about UIO (userspace I/O).
>> Also, I want the operation to be asynchronous. Any pointer to such mechanism will be very helpful.
>
> Using UIO you can also catch an interrupt in userspace.
> You can have a read() which blocks till data is available.
>
>
> Thanks,
> //richard
>
> _______________________________________________
> Kernelnewbies mailing list
> Kernelnewbies at kernelnewbies.org <mailto:Kernelnewbies@kernelnewbies.org>
> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>
>
^ permalink raw reply [flat|nested] 12+ messages in thread
* Handling interrupts in spidev
2014-01-27 9:23 ` Richard Weinberger
@ 2014-01-28 14:12 ` Amit Mahadik
2014-01-28 15:54 ` Richard Weinberger
0 siblings, 1 reply; 12+ messages in thread
From: Amit Mahadik @ 2014-01-28 14:12 UTC (permalink / raw)
To: kernelnewbies
Thanks Richard. One more question. If I register an SPI irq ?struct spi_board_info spi_board_info[] structure in machine board.c file; then the request irq api and irq handler should be written in board.c file or in the spidev driver.
Regards,
Amit.
On Monday, 27 January 2014 2:54 PM, Richard Weinberger <richard@nod.at> wrote:
Am 27.01.2014 10:21, schrieb Amit Mahadik:
> Thanks for your input. But I dont want to block the read call. Also I dont want to miss the interrupts.
Look how other drivers/programs deal with that...
Thanks,
//richard
> Regards,
> Amit.
>
>
> On Monday, 27 January 2014 12:22 PM, Richard Weinberger <richard@nod.at> wrote:
> Am 27.01.2014 06:37, schrieb Amit Mahadik:
>> Thanks for the reply Richard.
>>? ? ? ? The interrupt is not a GPIO? pin. I have read something about UIO (userspace I/O).
>> Also, I want the operation to be asynchronous. Any pointer to such mechanism will be very helpful.
>
> Using UIO you can also catch an interrupt in userspace.
> You can have a read() which blocks till data is available.
>
>
> Thanks,
> //richard
>
> _______________________________________________
> Kernelnewbies mailing list
> Kernelnewbies at kernelnewbies.org <mailto:Kernelnewbies@kernelnewbies.org>
> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>
>
_______________________________________________
Kernelnewbies mailing list
Kernelnewbies at kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20140128/a86e3f23/attachment.html
^ permalink raw reply [flat|nested] 12+ messages in thread
* Handling interrupts in spidev
2014-01-28 14:12 ` Amit Mahadik
@ 2014-01-28 15:54 ` Richard Weinberger
2014-01-28 16:17 ` Vishwanath Govind
0 siblings, 1 reply; 12+ messages in thread
From: Richard Weinberger @ 2014-01-28 15:54 UTC (permalink / raw)
To: kernelnewbies
Am 28.01.2014 15:12, schrieb Amit Mahadik:
> Thanks Richard. One more question. If I register an SPI irq struct spi_board_info spi_board_info[] structure in machine board.c file; then the request irq api and irq handler
> should be written in board.c file or in the spidev driver.
Never do any programming in the board file.
The purpose if the board file it describing the hardware.
Please note, board files go away, device tree is the way to go.
Thanks,
//richard
^ permalink raw reply [flat|nested] 12+ messages in thread
* Handling interrupts in spidev
2014-01-28 15:54 ` Richard Weinberger
@ 2014-01-28 16:17 ` Vishwanath Govind
2014-02-14 6:19 ` Nilesh Bacchewar
0 siblings, 1 reply; 12+ messages in thread
From: Vishwanath Govind @ 2014-01-28 16:17 UTC (permalink / raw)
To: kernelnewbies
You can implement irq handler in spi driver itself. SPI specific platform
data can pass it from board file.
Regards
Vishwa
On Tue, Jan 28, 2014 at 9:24 PM, Richard Weinberger <richard@nod.at> wrote:
> Am 28.01.2014 15:12, schrieb Amit Mahadik:
> > Thanks Richard. One more question. If I register an SPI irq struct
> spi_board_info spi_board_info[] structure in machine board.c file; then the
> request irq api and irq handler
> > should be written in board.c file or in the spidev driver.
>
> Never do any programming in the board file.
> The purpose if the board file it describing the hardware.
> Please note, board files go away, device tree is the way to go.
>
> Thanks,
> //richard
>
> _______________________________________________
> Kernelnewbies mailing list
> Kernelnewbies at kernelnewbies.org
> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20140128/f71ef90b/attachment-0001.html
^ permalink raw reply [flat|nested] 12+ messages in thread
* Handling interrupts in spidev
2014-01-28 16:17 ` Vishwanath Govind
@ 2014-02-14 6:19 ` Nilesh Bacchewar
2014-02-14 18:49 ` Anand Moon
0 siblings, 1 reply; 12+ messages in thread
From: Nilesh Bacchewar @ 2014-02-14 6:19 UTC (permalink / raw)
To: kernelnewbies
you can use Asynchronous notification , FASYNC .
http://www.makelinux.net/ldd3/chp-6-sect-4
Regards,
Nilesh
On Tue, Jan 28, 2014 at 9:47 PM, Vishwanath Govind <
vishwanath.govind@gmail.com> wrote:
> You can implement irq handler in spi driver itself. SPI specific platform
> data can pass it from board file.
> Regards
> Vishwa
>
>
> On Tue, Jan 28, 2014 at 9:24 PM, Richard Weinberger <richard@nod.at>wrote:
>
>> Am 28.01.2014 15:12, schrieb Amit Mahadik:
>> > Thanks Richard. One more question. If I register an SPI irq struct
>> spi_board_info spi_board_info[] structure in machine board.c file; then the
>> request irq api and irq handler
>> > should be written in board.c file or in the spidev driver.
>>
>> Never do any programming in the board file.
>> The purpose if the board file it describing the hardware.
>> Please note, board files go away, device tree is the way to go.
>>
>> Thanks,
>> //richard
>>
>> _______________________________________________
>> Kernelnewbies mailing list
>> Kernelnewbies at kernelnewbies.org
>> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>>
>
>
> _______________________________________________
> Kernelnewbies mailing list
> Kernelnewbies at kernelnewbies.org
> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20140214/00926916/attachment.html
^ permalink raw reply [flat|nested] 12+ messages in thread
* Handling interrupts in spidev
2014-02-14 6:19 ` Nilesh Bacchewar
@ 2014-02-14 18:49 ` Anand Moon
2014-02-19 15:01 ` Amit Mahadik
0 siblings, 1 reply; 12+ messages in thread
From: Anand Moon @ 2014-02-14 18:49 UTC (permalink / raw)
To: kernelnewbies
Hi All,
You can use netlink socket to send data from kernel to user space.
-Anand Moon
On Friday, February 14, 2014 11:51 AM, Nilesh Bacchewar <b.nilesh2005@gmail.com> wrote:
you can use Asynchronous notification ?, FASYNC .
http://www.makelinux.net/ldd3/chp-6-sect-4
Regards,
Nilesh
On Tue, Jan 28, 2014 at 9:47 PM, Vishwanath Govind <vishwanath.govind@gmail.com> wrote:
You can implement irq handler in spi driver itself. SPI specific platform data can pass it from board file.
>Regards
>Vishwa
>
>
>
>
>On Tue, Jan 28, 2014 at 9:24 PM, Richard Weinberger <richard@nod.at> wrote:
>
>Am 28.01.2014 15:12, schrieb Amit Mahadik:
>>
>>> Thanks Richard. One more question. If I register an SPI irq ?struct spi_board_info spi_board_info[] structure in machine board.c file; then the request irq api and irq handler
>>> should be written in board.c file or in the spidev driver.
>>
>>Never do any programming in the board file.
>>The purpose if the board file it describing the hardware.
>>Please note, board files go away, device tree is the way to go.
>>
>>
>>Thanks,
>>//richard
>>
>>_______________________________________________
>>Kernelnewbies mailing list
>>Kernelnewbies at kernelnewbies.org
>>http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>>
>
>_______________________________________________
>Kernelnewbies mailing list
>Kernelnewbies at kernelnewbies.org
>http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>
>
_______________________________________________
Kernelnewbies mailing list
Kernelnewbies at kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20140214/8c5a5aae/attachment.html
^ permalink raw reply [flat|nested] 12+ messages in thread
* Handling interrupts in spidev
2014-02-14 18:49 ` Anand Moon
@ 2014-02-19 15:01 ` Amit Mahadik
0 siblings, 0 replies; 12+ messages in thread
From: Amit Mahadik @ 2014-02-19 15:01 UTC (permalink / raw)
To: kernelnewbies
Hi All,
???????????? I am using versatile express board and have tried to allocate four interrupts (36 to 39) using IRQF_SHARED and IRQF_TRIGGER_HIGH flags in spidev.c file. However only INT 38 and 39 gets registered. For 36 and 37 I am getting errno 16 (Resource busy). In versatile express motherboard.h file INT 36 is RTC and 37 is UART0.Please help
Regards,
Amit.
On Saturday, 15 February 2014 12:21 AM, Anand Moon <moon.linux@yahoo.com> wrote:
Hi All,
You can use netlink socket to send data from kernel to user space.
-Anand Moon
On Friday, February 14, 2014 11:51 AM, Nilesh Bacchewar <b.nilesh2005@gmail.com> wrote:
you can use Asynchronous notification ?, FASYNC .
?
http://www.makelinux.net/ldd3/chp-6-sect-4
?
Regards,
Nilesh
On Tue, Jan 28, 2014 at 9:47 PM, Vishwanath Govind <vishwanath.govind@gmail.com> wrote:
You can implement irq handler in spi driver itself. SPI specific platform data can pass it from board file.
>Regards
>Vishwa
>
>
>
>
>On Tue, Jan 28, 2014 at 9:24 PM, Richard Weinberger <richard@nod.at> wrote:
>
>Am 28.01.2014 15:12, schrieb Amit Mahadik:
>>
>>> Thanks Richard. One more question. If I register an SPI irq ?struct spi_board_info spi_board_info[] structure in machine board.c file; then the request irq api and irq handler
>>> should be written in board.c file or in the spidev driver.
>>
>>Never do any programming in the board file.
>>The purpose if the board file it describing the hardware.
>>Please note, board files go away, device tree is the way to go.
>>
>>
>>Thanks,
>>//richard
>>
>>_______________________________________________
>>Kernelnewbies mailing list
>>Kernelnewbies at kernelnewbies.org
>>http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>>
>
>_______________________________________________
>Kernelnewbies mailing list
>Kernelnewbies at kernelnewbies.org
>http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>
>
_______________________________________________
Kernelnewbies mailing list
Kernelnewbies at kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
_______________________________________________
Kernelnewbies mailing list
Kernelnewbies at kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20140219/f839ab58/attachment.html
^ permalink raw reply [flat|nested] 12+ messages in thread
end of thread, other threads:[~2014-02-19 15:01 UTC | newest]
Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-01-26 12:25 Handling interrupts in spidev Amit Mahadik
2014-01-26 15:23 ` Richard Weinberger
2014-01-27 5:37 ` Amit Mahadik
2014-01-27 6:51 ` Richard Weinberger
2014-01-27 9:21 ` Amit Mahadik
2014-01-27 9:23 ` Richard Weinberger
2014-01-28 14:12 ` Amit Mahadik
2014-01-28 15:54 ` Richard Weinberger
2014-01-28 16:17 ` Vishwanath Govind
2014-02-14 6:19 ` Nilesh Bacchewar
2014-02-14 18:49 ` Anand Moon
2014-02-19 15:01 ` Amit Mahadik
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).