* Re: How to use omap keypad driver function
2006-08-19 0:26 ` andrzej zaborowski
@ 2006-08-19 11:25 ` Devendra Kumar Madhesia
2006-08-19 16:14 ` lamikr
2006-08-22 12:00 ` Devendra Kumar Madhesia
1 sibling, 1 reply; 5+ messages in thread
From: Devendra Kumar Madhesia @ 2006-08-19 11:25 UTC (permalink / raw)
To: linux-omap-open-source
Hi,
Thanks for giving such useful idea.
But I have also some doubt.
The omap keypad driver is based on interrupt.
Will this idea also useful for omap keypad driver?
Plz find source code for omap keypad driver from:
/usr/src/armlinux/linux-2.6.16/drivers/input/keyboard/omap-keypad.c
Best Regards,
Devendra
"andrzej
zaborowski"
<balrog@zabor.org To
> Devendra Kumar Madhesia/HSS@HSS
Sent by: cc
balrogg@gmail.com linux-omap-open-source@linux.omap.c
om
Subject
08/19/2006 05:56 Re: How to use omap keypad driver
AM function
Please respond to
balrogg@gmail.com
Hi,
On 18/08/06, Devendra Kumar Madhesia
<devendra.madhesia@flextronicssoftware.com> wrote:
>
>
>
>
> Hi,
>
> My objective is to create a user application program that will handle
> keypad interrupt.
>
> like in my program some method e.g
>
> keyEvent(keyCode)
> {
> switch(keyCode)
> {
> case '1':
> do some operation;
> case 'a':
> do some operation;
> ...............
>
> }
> }
>
> But how can get these key event with keycode from omap keypad driver?
> How to call omap keypad driver function from user space program?
I think you shouldn't call the driver directly and rather use the
evdev interface or read from console. If evdev is enabled in your
kernel, the keypad driver will be accessible through /dev/input/eventX
(for example /dev/input/event0 if it's the only input device).
Your program should open() this node and read() from it data in form
of struct input_event (defined in <linux/input.h>). When read()
returns, probably a key has been pressed and .code contains a key
code.
if (buffer->type == EV_KEY)
switch (buffer->code) {
case KEY_A:
etc, that's what an X server does for example.
>
> In normal device driver, there is entry function (like ioctl,read,write
> etc) in device driver but
> in omap keypad driver code no entry function exists like this.
>
>
> Thanks a lot.
> Best Regards,
> Devendra
>
> *********************** FSS-Unclassified ***********************
> "DISCLAIMER: This message is proprietary to Flextronics Software
> Systems Limited (FSS) and is intended solely for the use of the
> individual to whom it is addressed. It may contain privileged or
> confidential information and should not be circulated or used for
> any purpose other than for what it is intended. If you have received
> this message in error, please notify the originator immediately.
> If you are not the intended recipient, you are notified that you are
> strictly prohibited from using, copying, altering, or disclosing
> the contents of this message. FSS accepts no responsibility for
> loss or damage arising from the use of the information transmitted
> by this email including damage from virus."
>
>
>
>
> _______________________________________________
> Linux-omap-open-source mailing list
> Linux-omap-open-source@linux.omap.com
> http://linux.omap.com/mailman/listinfo/linux-omap-open-source
>
--
balrog 2oo6
*********************** FSS-Unclassified ***********************
"DISCLAIMER: This message is proprietary to Flextronics Software
Systems Limited (FSS) and is intended solely for the use of the
individual to whom it is addressed. It may contain privileged or
confidential information and should not be circulated or used for
any purpose other than for what it is intended. If you have received
this message in error, please notify the originator immediately.
If you are not the intended recipient, you are notified that you are
strictly prohibited from using, copying, altering, or disclosing
the contents of this message. FSS accepts no responsibility for
loss or damage arising from the use of the information transmitted
by this email including damage from virus."
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: How to use omap keypad driver function
2006-08-19 0:26 ` andrzej zaborowski
2006-08-19 11:25 ` Devendra Kumar Madhesia
@ 2006-08-22 12:00 ` Devendra Kumar Madhesia
1 sibling, 0 replies; 5+ messages in thread
From: Devendra Kumar Madhesia @ 2006-08-22 12:00 UTC (permalink / raw)
To: linux-omap-open-source
Hi,
I am trying to open() and read() device file /dev/input/event0.
But read() system call doesn't return it hanged during that call.
Actually read() for /dev/input/event0 file return struct input_event
through which i want to get keycode.
Please help!
Code for reference is :
int main(int argc,char** argv)
{
.......................
.........................
fd = open(/dev/input/event0,O_RDONLY);
IOCTL(fd,EVIOCGNAME,&devName);
printf("Device name:%s,devName);
IOCTL(fd,EVIOCGPHYS,&location);
printf("Device physical location:%s,version);
struct input_event event[64];
while(1)
{
rd = read(fd,event,sizeof(struct input_event)*64);
for (i=0; i< rd/sizeof (input_event),i++)
{
if( event[i].type == EV_KEY)
{
switch(event[i].code)
{
case KEY_1:
........................
}
}
}
}
}
output is : Device name AT Translated set 2 keyboard
Device physical location: isa0060/serio0/input0
;;;;;;;;;;;;;;;;;;;;;;;;after that blocked even while pressing key
reason: read() doesn't return
May be that it not recognizing keyboard.I am using PS2 keyboard.
if this is problem then what is device node for this keyborad?
Thanks
Best Regards,
Devendra
"andrzej
zaborowski"
<balrog@zabor.org To
> Devendra Kumar Madhesia/HSS@HSS
Sent by: cc
balrogg@gmail.com linux-omap-open-source@linux.omap.c
om
Subject
08/19/2006 05:56 Re: How to use omap keypad driver
AM function
Please respond to
balrogg@gmail.com
Hi,
On 18/08/06, Devendra Kumar Madhesia
<devendra.madhesia@flextronicssoftware.com> wrote:
>
>
>
>
> Hi,
>
> My objective is to create a user application program that will handle
> keypad interrupt.
>
> like in my program some method e.g
>
> keyEvent(keyCode)
> {
> switch(keyCode)
> {
> case '1':
> do some operation;
> case 'a':
> do some operation;
> ...............
>
> }
> }
>
> But how can get these key event with keycode from omap keypad driver?
> How to call omap keypad driver function from user space program?
I think you shouldn't call the driver directly and rather use the
evdev interface or read from console. If evdev is enabled in your
kernel, the keypad driver will be accessible through /dev/input/eventX
(for example /dev/input/event0 if it's the only input device).
Your program should open() this node and read() from it data in form
of struct input_event (defined in <linux/input.h>). When read()
returns, probably a key has been pressed and .code contains a key
code.
if (buffer->type == EV_KEY)
switch (buffer->code) {
case KEY_A:
etc, that's what an X server does for example.
>
> In normal device driver, there is entry function (like ioctl,read,write
> etc) in device driver but
> in omap keypad driver code no entry function exists like this.
>
>
> Thanks a lot.
> Best Regards,
> Devendra
>
> *********************** FSS-Unclassified ***********************
> "DISCLAIMER: This message is proprietary to Flextronics Software
> Systems Limited (FSS) and is intended solely for the use of the
> individual to whom it is addressed. It may contain privileged or
> confidential information and should not be circulated or used for
> any purpose other than for what it is intended. If you have received
> this message in error, please notify the originator immediately.
> If you are not the intended recipient, you are notified that you are
> strictly prohibited from using, copying, altering, or disclosing
> the contents of this message. FSS accepts no responsibility for
> loss or damage arising from the use of the information transmitted
> by this email including damage from virus."
>
>
>
>
> _______________________________________________
> Linux-omap-open-source mailing list
> Linux-omap-open-source@linux.omap.com
> http://linux.omap.com/mailman/listinfo/linux-omap-open-source
>
--
balrog 2oo6
*********************** FSS-Unclassified ***********************
"DISCLAIMER: This message is proprietary to Flextronics Software
Systems Limited (FSS) and is intended solely for the use of the
individual to whom it is addressed. It may contain privileged or
confidential information and should not be circulated or used for
any purpose other than for what it is intended. If you have received
this message in error, please notify the originator immediately.
If you are not the intended recipient, you are notified that you are
strictly prohibited from using, copying, altering, or disclosing
the contents of this message. FSS accepts no responsibility for
loss or damage arising from the use of the information transmitted
by this email including damage from virus."
^ permalink raw reply [flat|nested] 5+ messages in thread