# I noticed my kernel has found an HP Accelerometer

## lyallp

My HP EliteBook 8540w has an accelerometer.

```

input: ST LIS3LV02DL Accelerometer as /devices/platform/lis3lv02d/input/input8

```

I was wondering if there is any software that uses it?

Say, like HP do, hard drive protection - park the drives in an emergency situation, or maybe something cool like rotate the screen?

----------

## lyallp

Well, it appears that I can sense the orientation and position of my laptop by 

```
 watch -n 1 'cat /sys/devices/platform/lis3lv02d/position'

```

This requires me to enable the kernel driver for it

```
CONFIG_SENSORS_LIS3LV02D=m

```

It appears that games-puzzle/neverball uses this, but, for Gentoo, I am unsure how. 

As an additional bonus, a nifty sample program

```
/{Kernel Source Root}/Documentation/hwmon/hpfall.c
```

 is able to sense the laptop is in freefall and to park the hard drives for a short time, enough to prevent hard drive platter damage over your precious data, not to save the rest of the laptop, however.

I have yet to do an ebuild of this, but the program is trivial to compile and run. It is remarkably accurate, it senses my laptop going into freefall within about 10cm of being let go. Obviously, I have not tested it to the point of letting the laptop actually land.  :Smile: 

Finally, I found that the Light Sensor in this model also is an option, by setting 

```
CONFIG_HP_WMI=m

```

 and then enabling 

```
echo 1 > /sys/devices/platform/hp-wmi/als 
```

 in /etc/conf.d/local.start

Most of the feedback I have indicate that all this 'just works' in Ubuntu, but, at this stage, I have been unable to determine how to setup the light sensor to work in Gentoo. (I have only spent a few minutes on it).

----------

## nikulinpi

to sense inclination, you will need a hall effect sensor, not accelerometer. BTW you are almost like my friend who has found that his sony laptop has a "secret" GPS gps receiver. The case was that sony just masked it in windows to pass FCC faster.

----------

## lyallp

The accelerometer works, I found that I needed to enable joysticks in my kernel config, This will teach me to have a lean mean kernel. Stuff that others say 'just works', doesn't for me.  :Sad: 

Regardless, I now have a /dev/input/js0 which reacts when I jiggle the laptop.

I installed games-misc/sdljoytest and it works.

I don't seem to be able to get neverball to find it, however.

----------

