User space <==> kernel space for device wakeups.

Jeshwanth Kumar N K jeshkumar555 at gmail.com
Wed Oct 8 13:47:41 EDT 2014


On Wed, Oct 8, 2014 at 11:02 PM, Greg Kroah-Hartman <greg at kroah.com> wrote:

> On Wed, Oct 08, 2014 at 10:23:32PM +0530, Jeshwanth Kumar N K wrote:
> > My case was: I have a hall sensor connected to Beaglebone black, And
> Userspace
> > needed a wakeup once the interrupt occur (example: every rising edge of
> GPIO).
> > Before that, the program will register (ioctl) the User space task
> pointer with
> > my kernel module, then my kernel module start sending signal for every
> > interrupt occur. We can consider roughly around 100 to 200 interrupts per
> > second maximum. ( I have not done this, but may be we can consider
> kernel will
> > get notified when userspace program stops. so that it will not send any
> > signal). So for this case, any other alternative implementation ?
>
> select() on the GPIO sysfs file instead of a custom ioctl?
>
> And what do you do in userspace with that information?
>
> greg k-h
>

With hall sensor input I can get the position of motor, and in userspace I
drive the motor (brushless) for next position by passing the values to
sysfs attribute of PWM driver. It's a closed loop, until I drive the PWM I
will not get an interrupt. But what solution I had was, anyway PWM driver
is available, my sensor driver sends the current position to the PWM driver
(altered), then it will send to the motor directly (no need to user space
intervention in driving PWM), But controlling through application in
userspace like start/stop/speed etc. But I have not implemented and tested
this.

-- 
Regards
Jeshwanth Kumar N K
Bangalore, India
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20141008/f9579604/attachment.html 


More information about the Kernelnewbies mailing list