All of lore.kernel.org
 help / color / mirror / Atom feed
* Gpio interrupt shall pass the signal to application
@ 2012-10-06  8:20 jeshwanth Kumar N K
  2012-10-06  8:59 ` Fabio Pozzi
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: jeshwanth Kumar N K @ 2012-10-06  8:20 UTC (permalink / raw)
  To: kernelnewbies

Hello All,

I am writing a kernel module that shall pass the signal to application running in user space. So which signal i should use? And how to achieve this? Thank you.

Sent from my HTC
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20121006/b9ab4fde/attachment.html 

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

* Gpio interrupt shall pass the signal to application
  2012-10-06  8:20 Gpio interrupt shall pass the signal to application jeshwanth Kumar N K
@ 2012-10-06  8:59 ` Fabio Pozzi
  2012-10-06 12:45 ` devendra.aaru
  2012-10-06 16:59 ` Jonathan Neuschäfer
  2 siblings, 0 replies; 7+ messages in thread
From: Fabio Pozzi @ 2012-10-06  8:59 UTC (permalink / raw)
  To: kernelnewbies

I think you could use sysfs_notify to send the notification and use
select() or poll() to wait for changes in the sysfs file in the interrupt
handler routine. You can find an example of this in the gpio-fan driver.
Hope it helps

-- 
Saluti,
Fabio Pozzi
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20121006/a4cdb23e/attachment.html 

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

* Gpio interrupt shall pass the signal to application
  2012-10-06  8:20 Gpio interrupt shall pass the signal to application jeshwanth Kumar N K
  2012-10-06  8:59 ` Fabio Pozzi
@ 2012-10-06 12:45 ` devendra.aaru
  2012-10-06 16:59 ` Jonathan Neuschäfer
  2 siblings, 0 replies; 7+ messages in thread
From: devendra.aaru @ 2012-10-06 12:45 UTC (permalink / raw)
  To: kernelnewbies

On Sat, Oct 6, 2012 at 4:20 AM, jeshwanth Kumar N K
<jeshkumar555@gmail.com> wrote:
> Hello All,
>
> I am writing a kernel module that shall pass the signal to application
> running in user space. So which signal i should use? And how to achieve
> this? Thank you.
>
if any interrupt comes wake up a workqueue or a wait queue and
interrupt the poll wait.

that makes your application wakeup from a select.
> Sent from my HTC
>
>
> _______________________________________________
> Kernelnewbies mailing list
> Kernelnewbies at kernelnewbies.org
> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>

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

* Gpio interrupt shall pass the signal to application
  2012-10-06  8:20 Gpio interrupt shall pass the signal to application jeshwanth Kumar N K
  2012-10-06  8:59 ` Fabio Pozzi
  2012-10-06 12:45 ` devendra.aaru
@ 2012-10-06 16:59 ` Jonathan Neuschäfer
  2 siblings, 0 replies; 7+ messages in thread
From: Jonathan Neuschäfer @ 2012-10-06 16:59 UTC (permalink / raw)
  To: kernelnewbies

On Sat, Oct 06, 2012 at 01:50:55PM +0530, jeshwanth Kumar N K wrote:
> Hello All,
> 
> I am writing a kernel module that shall pass the signal to application running in user space. So which signal i should use? And how to achieve this? Thank you.

What kind of information need to be transmitted from your device to the
application?


Jonathan Neusch?fer

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

* Re: Gpio interrupt shall pass the signal to application
@ 2012-10-06 17:46 jeshwanth Kumar N K
  0 siblings, 0 replies; 7+ messages in thread
From: jeshwanth Kumar N K @ 2012-10-06 17:46 UTC (permalink / raw)
  To: kernelnewbies

Actually what I am doing is, I have 3 inputs to beaglebone from  BLDC motor hall sensor. If there is any change in any of 3 inputs, the kernel module has to send signal to my beaglebone. From the interrupt my application reads the input from sysfs and pass the next sequence to pwm. PWM I am using userspace only. 
So is my design right for handling fast input change, I mean 50 micro seconds ? Any suggestion ? I am new to device driver concept, please suggest.
Thanks :)

Sent from my HTC

----- Reply message -----
From: "Jonathan Neusch?fer" <j.neuschaefer@gmx.net>
Date: Sat, Oct 6, 2012 10:29 pm
Subject: Gpio interrupt shall pass the signal to application
To: "jeshwanth Kumar N K" <jeshkumar555@gmail.com>
Cc: "kernelnewbies" <kernelnewbies@kernelnewbies.org>


On Sat, Oct 06, 2012 at 01:50:55PM +0530, jeshwanth Kumar N K wrote:
> Hello All,
> 
> I am writing a kernel module that shall pass the signal to application running in user space. So which signal i should use? And how to achieve this? Thank you.

What kind of information need to be transmitted from your device to the
application?


Jonathan Neusch?fer
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20121006/bf6bba1b/attachment.html 

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

* Gpio interrupt shall pass the signal to application
  2012-10-06 12:14 jeshwanth Kumar N K
@ 2012-10-06 12:26 ` Fabio Pozzi
  0 siblings, 0 replies; 7+ messages in thread
From: Fabio Pozzi @ 2012-10-06 12:26 UTC (permalink / raw)
  To: kernelnewbies

Hi Jeshwanth,
I'm not an expert in kernel development, but I think that if you receive an
interrupt every 50_micro_seconds IMHO you should definitely deal with it in
kernel mode and maybe also think about enabling Real Time to be more
certain about kernel latencies and scheduling.
The context switch time between kernel and user space I think it's too long
to delegate the elaboration to userspace.

-- 
Fabio Pozzi
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20121006/4c286067/attachment.html 

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

* Re: Gpio interrupt shall pass the signal to application
@ 2012-10-06 12:14 jeshwanth Kumar N K
  2012-10-06 12:26 ` Fabio Pozzi
  0 siblings, 1 reply; 7+ messages in thread
From: jeshwanth Kumar N K @ 2012-10-06 12:14 UTC (permalink / raw)
  To: kernelnewbies

Hi Fabio,

Thanks for the reply. Ya I got your point, and I did the same thing by exporting the sysfs gpio and poll for value attribute It works fine but the thing is time. Actually my interrupts may be every 50 micro seconds. So I thought of dealing in kernel mode itself. What's your suggestion ?
Sent from my HTC

----- Reply message -----
From: "Fabio Pozzi" <pozzi.fabio@gmail.com>
Date: Sat, Oct 6, 2012 2:29 pm
Subject: Gpio interrupt shall pass the signal to application
To: "jeshwanth Kumar N K" <jeshkumar555@gmail.com>
Cc: "kernelnewbies" <kernelnewbies@kernelnewbies.org>


I think you could use sysfs_notify to send the notification and use
select() or poll() to wait for changes in the sysfs file in the interrupt
handler routine. You can find an example of this in the gpio-fan driver.
Hope it helps

-- 
Saluti,
Fabio Pozzi
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20121006/abd6a365/attachment.html 

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

end of thread, other threads:[~2012-10-06 17:46 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-10-06  8:20 Gpio interrupt shall pass the signal to application jeshwanth Kumar N K
2012-10-06  8:59 ` Fabio Pozzi
2012-10-06 12:45 ` devendra.aaru
2012-10-06 16:59 ` Jonathan Neuschäfer
2012-10-06 12:14 jeshwanth Kumar N K
2012-10-06 12:26 ` Fabio Pozzi
2012-10-06 17:46 jeshwanth Kumar N K

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.