device/generic/common
Revision | 2eed4e42cd62987eda80be5d5fed7605084534c3 (tree) |
---|---|
Time | 2015-07-17 03:56:50 |
Author | Chih-Wei Huang <cwhuang@linu...> |
Commiter | Chih-Wei Huang |
init.sh: add support of iio sensors
@@ -54,11 +54,12 @@ PRODUCT_COPY_FILES += \ | ||
54 | 54 | frameworks/native/data/etc/android.hardware.ethernet.xml:system/etc/permissions/android.hardware.ethernet.xml \ |
55 | 55 | frameworks/native/data/etc/android.hardware.location.xml:system/etc/permissions/android.hardware.location.xml \ |
56 | 56 | frameworks/native/data/etc/android.hardware.location.gps.xml:system/etc/permissions/android.hardware.location.gps.xml \ |
57 | - frameworks/native/data/etc/android.hardware.sensor.proximity.xml:system/etc/permissions/android.hardware.sensor.proximity.xml \ | |
58 | - frameworks/native/data/etc/android.hardware.sensor.light.xml:system/etc/permissions/android.hardware.sensor.light.xml \ | |
59 | - frameworks/native/data/etc/android.hardware.sensor.gyroscope.xml:system/etc/permissions/android.hardware.sensor.gyroscope.xml \ | |
60 | - frameworks/native/data/etc/android.hardware.sensor.barometer.xml:system/etc/permissions/android.hardware.sensor.barometer.xml \ | |
61 | 57 | frameworks/native/data/etc/android.hardware.sensor.accelerometer.xml:system/etc/permissions/android.hardware.sensor.accelerometer.xml \ |
58 | + frameworks/native/data/etc/android.hardware.sensor.barometer.xml:system/etc/permissions/android.hardware.sensor.barometer.xml \ | |
59 | + frameworks/native/data/etc/android.hardware.sensor.compass.xml:system/etc/permissions/android.hardware.sensor.compass.xml \ | |
60 | + frameworks/native/data/etc/android.hardware.sensor.gyroscope.xml:system/etc/permissions/android.hardware.sensor.gyroscope.xml \ | |
61 | + frameworks/native/data/etc/android.hardware.sensor.light.xml:system/etc/permissions/android.hardware.sensor.light.xml \ | |
62 | + frameworks/native/data/etc/android.hardware.sensor.proximity.xml:system/etc/permissions/android.hardware.sensor.proximity.xml \ | |
62 | 63 | frameworks/native/data/etc/android.hardware.touchscreen.multitouch.distinct.xml:system/etc/permissions/android.hardware.touchscreen.multitouch.distinct.xml \ |
63 | 64 | frameworks/native/data/etc/android.hardware.touchscreen.multitouch.jazzhand.xml:system/etc/permissions/android.hardware.touchscreen.multitouch.jazzhand.xml \ |
64 | 65 | frameworks/native/data/etc/android.hardware.usb.accessory.xml:system/etc/permissions/android.hardware.usb.accessory.xml \ |
@@ -20,6 +20,7 @@ function init_misc() | ||
20 | 20 | |
21 | 21 | case "$PRODUCT" in |
22 | 22 | T10*TA) |
23 | + modprobe ak8975 | |
23 | 24 | ;; |
24 | 25 | *) |
25 | 26 | ;; |
@@ -206,11 +207,9 @@ function init_hal_sensors() | ||
206 | 207 | |
207 | 208 | # has sensor-hub? |
208 | 209 | for i in /sys/bus/iio/devices/iio:device?; do |
209 | - if [ -e $i/in_accel_scale ]; then | |
210 | - busybox chown -R 1000.1000 /sys/bus/iio/devices/iio:device?/ | |
211 | - hal_sensors=hsb | |
212 | - break | |
213 | - fi | |
210 | + busybox chown -R 1000.1000 /sys/bus/iio/devices/iio:device?/ | |
211 | + lsmod | grep -q hid_sensor_accel_3d && hal_sensors=hsb || hal_sensors=iio | |
212 | + break | |
214 | 213 | done |
215 | 214 | |
216 | 215 | set_property ro.hardware.sensors $hal_sensors |