Re: [Question: Drivers/input/evdev.c] What is the use of write function in evdev_fops?

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

 



Hi Aniroop,

On Wed, Aug 13, 2014 at 10:16:34PM +0530, Aniroop Mathur wrote:
> Dear Mr. Torokhov and Linux-Input Community,
> Greetings of the day !! :)
> 
> I have not seen some good use of write function in input subsystem.
> I am trying find the good uses of write function in Input subsystem,
> but could not find the solution over internet.
> Can you please help in answering my query below:
> 
> As you know, in evdev.c file, fops is defined as below
> struct file_operations evdev_fops = {
> .read           = evdev_read,
> .write          = evdev_write,
> ...
> }
> 
> So in what cases, evdev_write function is used ?
> One case I can think of is that, it can be used in input device simulator
> to write the recorded data back into buffer.

You are right, majority of times you are reading from the buffer. Still,
sometimes you want to control hardware state, for example, toggle keyboard LED.
That can be achieved by writing appropriate event to the event device.

For simulators I think uinput is suited the best.

Thanks.

-- 
Dmitry
--
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