<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=big5">
<META NAME="Generator" CONTENT="MS Exchange Server version 6.5.7650.28">
<TITLE>RE: [production-testing] Re: Key buttom test</TITLE>
</HEAD>
<BODY>
<!-- Converted from text/plain format -->

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

</BODY>
</HTML>