OSDN Git Service

init.sh: set sensor hal to hdaps if lis3lv02d_i2c is loaded
authorChih-Wei Huang <cwhuang@linux.org.tw>
Wed, 22 Jun 2016 12:02:36 +0000 (20:02 +0800)
committerChih-Wei Huang <cwhuang@linux.org.tw>
Wed, 22 Jun 2016 12:02:36 +0000 (20:02 +0800)
A patch proposed by Hypo Turtle <hypoturtle@gmail.com>.

init.sh

diff --git a/init.sh b/init.sh
index 4bb9c40..6cdd1ba 100644 (file)
--- a/init.sh
+++ b/init.sh
@@ -223,16 +223,12 @@ function init_hal_sensors()
                        ;;
                *Aspire1*25*)
                        modprobe lis3lv02d_i2c
-                       hal_sensors=hdaps
                        echo -n "enabled" > /sys/class/thermal/thermal_zone0/mode
                        ;;
                *ThinkPad*Tablet*)
                        modprobe hdaps
                        hal_sensors=hdaps
                        ;;
-               *HPPaviliong*)
-                       hal_sensors=hdaps
-                       ;;
                *i7Stylus*)
                        set_property hal.sensors.iio.accel.matrix 1,0,0,0,-1,0,0,0,-1
                        ;;
@@ -244,6 +240,8 @@ function init_hal_sensors()
        if [ -n "`ls /sys/bus/iio/devices/iio:device* 2> /dev/null`" ]; then
                busybox chown -R 1000.1000 /sys/bus/iio/devices/iio:device*/
                lsmod | grep -q hid_sensor_accel_3d && hal_sensors=hsb || hal_sensors=iio
+       elif lsmod | grep -q lis3lv02d_i2c; then
+               hal_sensors=hdaps
        fi
 
        set_property ro.hardware.sensors $hal_sensors