[Question: Drivers/input/evdev.c] How to get instance of struct evdev in some driver ?

3 messages, 2 authors, 2014-08-03 · open the first message on its own page

[Question: Drivers/input/evdev.c] How to get instance of struct evdev in some driver ?

From: Aniroop Mathur <hidden>
Date: 2014-08-03 06:35:13

Dear Mr. Torokhov and Linux-Input Community,
Greetings of the day !! :)

I am stuck at one point and could not find the solution over internet.
Can you please help in answering my query below:

As you know, struct evdev is defined in evdev.c and not in some header file.
So, Is it possible to get instance of struct evdev in some input
peripheral driver ?
If possible, then how can we get it ?

In the input peripheral driver,
we can get instance struct input_dev by including input.h file
and then calling input_allocate_device().
struct input_dev = input_allocate_device();

May be evdev is embedded somewhere in input_dev.
So, can we get the instance of evdev using input_dev ?

Thanks in Advance !

-- Aniroop Mathur

Re: [Question: Drivers/input/evdev.c] How to get instance of struct evdev in some driver ?

From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Date: 2014-08-03 06:42:40

Hi Aniroop,

On Sun, Aug 03, 2014 at 12:05:11PM +0530, Aniroop Mathur wrote:
Dear Mr. Torokhov and Linux-Input Community,
Greetings of the day !! :)

I am stuck at one point and could not find the solution over internet.
Can you please help in answering my query below:

As you know, struct evdev is defined in evdev.c and not in some header file.
So, Is it possible to get instance of struct evdev in some input
peripheral driver ?
If possible, then how can we get it ?

In the input peripheral driver,
we can get instance struct input_dev by including input.h file
and then calling input_allocate_device().
struct input_dev = input_allocate_device();

May be evdev is embedded somewhere in input_dev.
So, can we get the instance of evdev using input_dev ?
Not really. Technically speaking the evdev cam be compiled as a module and it
will not be bound to the input device until later.

Input devices should be ignorant of the input handlers bound to them, they
should just supply event stream and not care about anything else. Also evdev
internal structure is exactly that - internal - and the rest of the kernel
should not try to poke into it.

Thanks.

-- 
Dmitry

Re: [Question: Drivers/input/evdev.c] How to get instance of struct evdev in some driver ?

From: Aniroop Mathur <hidden>
Date: 2014-08-03 06:53:02

Hi Mr. Torokhov,

Thank you for your quick reply and clearing my doubt. :)

On Sun, Aug 3, 2014 at 12:12 PM, Dmitry Torokhov
[off-list ref] wrote:
Hi Aniroop,

On Sun, Aug 03, 2014 at 12:05:11PM +0530, Aniroop Mathur wrote:
quoted
Dear Mr. Torokhov and Linux-Input Community,
Greetings of the day !! :)

I am stuck at one point and could not find the solution over internet.
Can you please help in answering my query below:

As you know, struct evdev is defined in evdev.c and not in some header file.
So, Is it possible to get instance of struct evdev in some input
peripheral driver ?
If possible, then how can we get it ?

In the input peripheral driver,
we can get instance struct input_dev by including input.h file
and then calling input_allocate_device().
struct input_dev = input_allocate_device();

May be evdev is embedded somewhere in input_dev.
So, can we get the instance of evdev using input_dev ?
Not really. Technically speaking the evdev cam be compiled as a module and it
will not be bound to the input device until later.

Input devices should be ignorant of the input handlers bound to them, they
should just supply event stream and not care about anything else. Also evdev
internal structure is exactly that - internal - and the rest of the kernel
should not try to poke into it.

Thanks.

--
Dmitry
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help