From: "Éric Piel" <E.A.B.Piel@tudelft.nl>
To: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
Cc: "Éric Piel" <eric.piel@tremplin-utc.net>,
"Palatis Tseng" <palatis@gmail.com>,
"Pavel Machek" <pavel@suse.cz>,
LKML <linux-kernel@vger.kernel.org>,
"Andrew Morton" <akpm@linux-foundation.org>
Subject: Re: [PATCH] lis3lv02d: add axes knowledge of HP Pavilion dv5 models
Date: Tue, 10 Feb 2009 13:42:56 +0100 [thread overview]
Message-ID: <49917650.1060208@tudelft.nl> (raw)
In-Reply-To: <cb7bb73a0902100307m4eab8ff2nfe9be8bed6a3b5b5@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 2453 bytes --]
Giuseppe Bilotta schreef:
:
>
> With my patch applied:
>
> Left raised: 0 -> 32k
> Right raised: 0 -> -32k
>
> Front raised: 1 -> -32k
> back raised: 1 -> 32k
>
> Upside down: 2 -> 32k
>
> So it seems that my model inverts the Z axis too, I'll have to fix
> that. However, this last test is tricky because unless the laptop is
> completely upside down the Z axis can go from -32k to +32k with just a
> couple of degrees (around the 90°)
>
> I'll update my patch to invert the X and Z axis for my model.
Let's have a look at this once the "big noise" problem is fixed, because
for now it's rather impossible to deduce anything meaningful.
Andrew, could you drop the patch in the mean time?
>
>> Palatis, could you let us know if you also have a lot of "noise" in the
>> values. That is, if when using jstest /dev/input/js0 you see big changes
>> in the values. Is it like on Giuseppe's laptop of around 8000?
>>
>> Moreover I'm wondering if this could be an error on LSB/MSB ordering.
>> Maybe looking at the raw values (cat
>> /sys/devices/platform/lis3lv02d/position) would give more insight...
>
> amd64 architecture here. Laptop flat:
>
> oblomov@oblomov:~$ cat /sys/devices/platform/lis3lv02d/position
> (-256,256,14592)
> oblomov@oblomov:~$ cat /sys/devices/platform/lis3lv02d/position
> (0,256,14848)
> oblomov@oblomov:~$ cat /sys/devices/platform/lis3lv02d/position
> (-256,256,14848)
> oblomov@oblomov:~$ cat /sys/devices/platform/lis3lv02d/position
> (-256,0,14336)
> oblomov@oblomov:~$ cat /sys/devices/platform/lis3lv02d/position
> (-256,512,14336)
> oblomov@oblomov:~$ cat /sys/devices/platform/lis3lv02d/position
> (256,256,14592)
>
> Left edge raised:
> oblomov@oblomov:~$ cat /sys/devices/platform/lis3lv02d/position
> (5120,512,13312)
> oblomov@oblomov:~$ cat /sys/devices/platform/lis3lv02d/position
> (5632,512,13312)
>
> You might be onto something.
Yes, beautiful! All are multiples of 2⁸, so much a sign of MSB/LSB
inversion! And the good news is that the device just happens to have a
register to set the endianess: CTRL2/BLE . For now, in the driver, we
expect the device to be little endian (which is the default according to
the manual). So at initialization we could force the endianess and see
if that fix the problem.
Can you try something like this in lis3lv02d_poweron():
adev.read(handle, CTRL_REG2, &val);
val |= CTRL2_BDU | CTRL2_IEN;
+ val &= ~CTRL2_BLE;
adev.write(handle, CTRL_REG2, val);
Eric
[-- Attachment #2: E_A_B_Piel.vcf --]
[-- Type: text/x-vcard, Size: 380 bytes --]
begin:vcard
fn;quoted-printable:=C3=89ric Piel
n;quoted-printable:Piel;=C3=89ric
org:Technical University of Delft;Software Engineering Research Group
adr:HB 08.080;;Mekelweg 4;Delft;;2628 CD;The Netherlands
email;internet:E.A.B.Piel@tudelft.nl
tel;work:+31 15 278 6338
tel;cell:+31 6 2437 9135
x-mozilla-html:FALSE
url:http://pieleric.free.fr
version:2.1
end:vcard
next prev parent reply other threads:[~2009-02-10 13:12 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-02-07 0:48 [PATCH] lis3lv02d: add axes knowledge of HP Pavilion dv5 models Giuseppe Bilotta
2009-02-07 14:47 ` Éric Piel
2009-02-07 23:59 ` Giuseppe Bilotta
2009-02-09 9:47 ` Pavel Machek
2009-02-09 9:53 ` Giuseppe Bilotta
2009-02-09 9:58 ` Pavel Machek
2009-02-09 11:45 ` Giuseppe Bilotta
2009-02-09 13:33 ` Giuseppe Bilotta
2009-02-10 10:10 ` Pavel Machek
2009-02-10 21:39 ` Giuseppe Bilotta
2009-02-10 22:47 ` Éric Piel
2009-02-10 22:48 ` Giuseppe Bilotta
2009-02-10 23:17 ` Andrew Morton
2009-02-10 23:22 ` Éric Piel
2009-02-10 23:17 ` Éric Piel
2009-02-10 23:34 ` Éric Piel
[not found] ` <498E46F2.1020401@gmail.com>
2009-02-09 23:37 ` Éric Piel
[not found] ` <4990DEFD.4010700@gmail.com>
2009-02-10 10:34 ` Éric Piel
2009-02-10 11:07 ` Giuseppe Bilotta
2009-02-10 12:42 ` Éric Piel [this message]
2009-02-10 20:29 ` Giuseppe Bilotta
2009-02-10 20:31 ` Giuseppe Bilotta
2009-02-10 21:28 ` Giuseppe Bilotta
2009-02-10 21:33 ` Giuseppe Bilotta
2009-02-09 9:44 ` Pavel Machek
2009-02-09 9:50 ` Giuseppe Bilotta
[not found] ` <1234191743.3156.2.camel@localhost.localdomain>
2009-02-09 16:50 ` Giuseppe Bilotta
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=49917650.1060208@tudelft.nl \
--to=e.a.b.piel@tudelft.nl \
--cc=akpm@linux-foundation.org \
--cc=eric.piel@tremplin-utc.net \
--cc=giuseppe.bilotta@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=palatis@gmail.com \
--cc=pavel@suse.cz \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox