lis302dl OUT_X&Y&Z value converted to "g" type

hamody at
Tue Oct 21 10:40:53 CEST 2008

Andy Green wrote:
> Hash: SHA1
> Somebody in the thread at some point said:
> | Hello all
> |
> | Lis302dl(also LIS331DL) generate 3 axis values in register OUT_X OUT_Y
> | OUT_Z as 2's complement type.When APP layer get the value,I supose app
> act
> | according the value in g type.So My question is how you convert the
> value in
> | "byte" to g?For example,when the FS bit is 0,the sensor in a steady
> | state,the OUT_Z value will be 55~60.And now it's 1g.
> |
> | How do you perform that?
> You can see the code here:
> input_report_rel(lis->input_dev, REL_X, mg_per_sample * (s8)read[0]);
> mg_per_sample is 18 for the default sensitivity, it just scales the
> reading up before passing it to the input subsystem.
> - -Andy
> Version: GnuPG v1.4.9 (GNU/Linux)
> Comment: Using GnuPG with Fedora -
> iEYEARECAAYFAkj9dswACgkQOjLpvpq7dMpZPQCgipaaEtLL6WwY1eqBJsII1U7L
> HhsAn0zGjm0KHMBhZ2+l1aN+Bi+hP79f
> =1A90

Hello Andy

I've again taken a quick look of Simon's
lis302dl-queue-work-in-interrupt-handler.patch .
The work_queue has been replaced in the git tree code you gave above.
I have a question and a suggestion.How to exactly count the escaped
interrupt in work_queue way?In my opinion,
System will feel too have with work_queue when flood interrupt comes,and it
may miss some.Right?

If so,I think the follow suggestion is valuable.

In my driver,I use a work_struct+timer_list to solve this problem.If too
much interrupt comes at a time,I would only recognize the last one with a
delay in timer_list.

There is also problem here.If interrupt is always generating,the timer_list
make the system quiet,just as nothing happen.Even in the git tree code,irq
is disabled ,this problem becomes you will also miss some interrupt.Right?


China is a great country.Welcome to Beijing.
View this message in context:
Sent from the Openmoko Kernel mailing list archive at

More information about the openmoko-kernel mailing list