[production-testing] Re: Key buttom test
JELAN at FIC.COM.TW
JELAN at FIC.COM.TW
Thu Mar 8 13:19:40 CET 2007
According to boot message:
/
mice: PS/2 mouse device common for all mice
input: GTA01 Buttons as /class/input/input0
wake enabled for irq 50
wake enabled for irq 51
s3c2410 TouchScreen successfully loaded
input: s3c2410 TouchScreen as /class/input/input1
i2c /dev entries driver
s3c2410-i2c s3c2410-i2c: slave address 0x10
s3c2410-i2c s3c2410-i2c: bus frequency set to 98 KHz
s3c2410-i2c s3c2410-i2c: i2c-0: S3C I2C adapter
pcf50606_init: entering, calling i2c_add_driver
pcf50606_attach_adapter: entering, calling i2c_probe
pcf50606_detect: entering
pcf50606_irq: entering(irq=60, pcf=c0549e00): scheduling work
PCF50606: IRQ 1 cannot be enabled as wake-upsource in this hardware revision!<7>pcf50606 0-0008: rtc intf: sysfs
pcf50606 0-0008: rtc intf: proc
pcf50606 0-0008: rtc intf: dev (254:0)
pcf50606 0-0008: rtc core: registered pcf50606 as rtc0
input: FIC Neo1973 PMU events as /class/input/input2
/
I believe :
(GTA01 Buttons as /class/input/input0) == /dev/input/event0 ; 911 key
(s3c2410 TouchScreen as /class/input/input1) == /dev/input/event1
(FIC Neo1973 PMU events as /class/input/input2) == /dev/input/event2 ; Power button
Am I right?
to assume it is right, I wrote the test program as below:
int main(int argc,char *argv[])
{
int fd;
int val=0;
struct input_event ev;
int nBytes, i;
fd = open("/dev/input/event0",O_RDONLY);
if(fd<0)
{
perror("can not open device");
exit(1);
}
while(1)
{
nBytes = read( fd, (char *)&ev, sizeof(struct input_event));
if (nBytes > 0)
{
printf("key value =%d",ev.value);
return 0;
}
else
{
sleep(1);
printf("N key value =%d\r\n",ev.value);
}
}
}
But, this test program will wait at read function and has no response when I press the 911 key.
What is wrong ?
What is that I didn't do?
Wish some one could give some suggestions.
Best regards
Jelan /Fic
-----Original Message-----
From: production-testing-bounces at lists.internal.openmoko.org 代理 Harald Welte
Sent: 2007/3/6 [星期二] 下午 06:10
To: WILLIE_CHEN(陳威名)
Cc: production-testing at lists.internal.openmoko.org
Subject: [production-testing] Re: Key buttom test
On Tue, Mar 06, 2007 at 11:05:13AM +0800, WILLIE_CHEN at fic.com.tw wrote:
> Hi Harald,
>
> Do we have method to know the key buttom (power key and 911 key)
> status? We need to know whether key buttom can work or not. Thanks.
The keys are just regular linux input event devices in /dev/input/event*
You can check the documentation in linux-2.6.20.1/Documentation/input/
in the kernel source code on how the API looks like. Especially
linux-2.6.20.1/Documentation/input/input.txt Chapter 5 "Event interface"
is what we are using.
we currently have three event devices (event0 through event2). event0
is currently the touchscreen device, where event0/event1 are the devices
for GPIO buttons and PMU buttons.
For the key bindings, see:
http://wiki.openmoko.org/wiki/Kernel#AUX_Button
http://wiki.openmoko.org/wiki/Kernel#Power_Button.2C_Charger_insertion
Furthermore, I would like to ask you to send questions about kernel
API's to openmoko-kernel at lists.openmoko.org. There might be other
developers with similar questions, who can then access the list archive
of this public list.
production-testing at lists.internal.openmoko.org should only be used for
internal communication about actual production testing effort. Anything
that is generic, such as how to read key events, can be on a public
mailinglist.
Thanks!
--
- Harald Welte <laforge at openmoko.org> http://openmoko.org/
============================================================================
Software for the world's first truly open Free Software mobile phone
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.openmoko.org/pipermail/openmoko-kernel/attachments/20070308/25b6a78c/attachment.htm
More information about the openmoko-kernel
mailing list