Re: [PATCH] lis3lv02d: add axes knowledge of HP Pavilion dv5 models

From: Giuseppe Bilotta
Date: Tue Feb 10 2009 - 15:29:42 EST


On Tue, Feb 10, 2009 at 1:42 PM, Ãric Piel <E.A.B.Piel@xxxxxxxxxx> wrote:
> Giuseppe Bilotta schreef:
>> 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);

I reverted both my patch and the 'minimal init' patch from Pavel, then
added this line. However, it seems to change nothing. Even using
CTRL2_BLE instead of its negation doesn't seem to change much: same
fluctuations, and cat'ing the sysfs file still gives 256, 512 etc.


--
Giuseppe "Oblomov" Bilotta
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/