Re: Interacting with a input kernel driver from user space

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Nuno

On Mon, Nov 14, 2011 at 1:24 PM, Nuno Santos <nsantos@xxxxxxxxxx> wrote:
> Hi,
>
> I'm developing a linux kernel driver for a multitouch device. Right now I
> have already touch being injected to the linux kernel subsystem and it is
> working. The problem is that I also need to interact with the device to
> change settings an so on.
>
> While the kernel is grabbing the device I can't grab it in user space, so I
> need to find a way to interact with the kernel driver.
>
> My first driver test (missile laucnher example found on the internet) had
> some extra operations that I can't find on the current model i'm using
> (usbtouchscreen driver was my starting point).
>
> It had open, close, read, write operations that I could perform from user
> space.

There are open/close callbacks but they are only called for the first
and last application that opens/closes the device.
You should avoid character-devices with special ioctl()s if you
thought about that, though.

> How can I do such things with input drivers? Is there any official way?

The best way probably is using sysfs. Register one sysfs attribute per
value and configure your callbacks.
There are several other subsystems that provide wrappers for them. If
you could be more specific about the user-space interaction or
configuration values, then we could also be more specific (hopefully
;)).

Per driver values can be provided with module-parameters. Per device
values can be provided by sysfs attributes. For per-application/user
values you probably need special character-devices.

> Thanks in advance,
>
> With my best regards,
>
> Nuno Santos

Regards
David
--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Media Devel]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Linux Wireless Networking]     [Linux Omap]

  Powered by Linux