blob: 21f09025220936300e727c681f0870275e23e152 [file] [log] [blame]
Pavel Machek455fbdd2008-11-12 13:27:02 -08001Kernel driver lis3lv02d
Pavel Machek2b872902009-03-31 15:24:25 -07002=======================
Pavel Machek455fbdd2008-11-12 13:27:02 -08003
4Supported chips:
5
Éric Pielbc62c142009-12-14 18:01:39 -08006 * STMicroelectronics LIS3LV02DL, LIS3LV02DQ (12 bits precision)
7 * STMicroelectronics LIS302DL, LIS3L02DQ, LIS331DL (8 bits)
Pavel Machek455fbdd2008-11-12 13:27:02 -08008
Pavel Machek2b872902009-03-31 15:24:25 -07009Authors:
Pavel Machek455fbdd2008-11-12 13:27:02 -080010 Yan Burman <burman.yan@gmail.com>
11 Eric Piel <eric.piel@tremplin-utc.net>
12
13
14Description
15-----------
16
Éric Pielbc62c142009-12-14 18:01:39 -080017This driver provides support for the accelerometer found in various HP laptops
18sporting the feature officially called "HP Mobile Data Protection System 3D" or
19"HP 3D DriveGuard". It detects automatically laptops with this sensor. Known
20models (full list can be found in drivers/hwmon/hp_accel.c) will have their
21axis automatically oriented on standard way (eg: you can directly play
22neverball). The accelerometer data is readable via
Pavel Machek455fbdd2008-11-12 13:27:02 -080023/sys/devices/platform/lis3lv02d.
24
25Sysfs attributes under /sys/devices/platform/lis3lv02d/:
26position - 3D position that the accelerometer reports. Format: "(x,y,z)"
Pavel Machek219beb22009-01-15 13:51:24 -080027calibrate - read: values (x, y, z) that are used as the base for input
28 class device operation.
29 write: forces the base to be recalibrated with the current
Pavel Machek2b872902009-03-31 15:24:25 -070030 position.
Pavel Machek455fbdd2008-11-12 13:27:02 -080031rate - reports the sampling rate of the accelerometer device in HZ
32
33This driver also provides an absolute input class device, allowing
34the laptop to act as a pinball machine-esque joystick.
35
Éric Pielbc62c142009-12-14 18:01:39 -080036On HP laptops, if the led infrastructure is activated, support for a led
37indicating disk protection will be provided as /sys/class/leds/hp::hddprotect.
38
Pavel Machekef2cfc72009-02-18 14:48:23 -080039Another feature of the driver is misc device called "freefall" that
40acts similar to /dev/rtc and reacts on free-fall interrupts received
41from the device. It supports blocking operations, poll/select and
42fasync operation modes. You must read 1 bytes from the device. The
43result is number of free-fall interrupts since the last successful
Éric Pielbc62c142009-12-14 18:01:39 -080044read (or 255 if number of interrupts would not fit). See the hpfall.c
45file for an example on using the device.
Pavel Machekef2cfc72009-02-18 14:48:23 -080046
47
Pavel Machek455fbdd2008-11-12 13:27:02 -080048Axes orientation
49----------------
50
51For better compatibility between the various laptops. The values reported by
52the accelerometer are converted into a "standard" organisation of the axes
53(aka "can play neverball out of the box"):
54 * When the laptop is horizontal the position reported is about 0 for X and Y
Pavel Machek2b872902009-03-31 15:24:25 -070055 and a positive value for Z
Pavel Machek455fbdd2008-11-12 13:27:02 -080056 * If the left side is elevated, X increases (becomes positive)
Pavel Machek219beb22009-01-15 13:51:24 -080057 * If the front side (where the touchpad is) is elevated, Y decreases
58 (becomes negative)
Pavel Machek455fbdd2008-11-12 13:27:02 -080059 * If the laptop is put upside-down, Z becomes negative
60
Pavel Machek219beb22009-01-15 13:51:24 -080061If your laptop model is not recognized (cf "dmesg"), you can send an
Éric Pielbc62c142009-12-14 18:01:39 -080062email to the maintainer to add it to the database. When reporting a new
Pavel Machek219beb22009-01-15 13:51:24 -080063laptop, please include the output of "dmidecode" plus the value of
64/sys/devices/platform/lis3lv02d/position in these four cases.
Pavel Machek455fbdd2008-11-12 13:27:02 -080065
Pavel Machek2b872902009-03-31 15:24:25 -070066Q&A
67---
68
69Q: How do I safely simulate freefall? I have an HP "portable
70workstation" which has about 3.5kg and a plastic case, so letting it
71fall to the ground is out of question...
72
73A: The sensor is pretty sensitive, so your hands can do it. Lift it
74into free space, follow the fall with your hands for like 10
75centimeters. That should be enough to trigger the detection.