• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Frequently used words (click to add to your profile)

javaandroidc++linuxc#objective-c誰得cocoaqtpythonrubywindowsphpgameguibathyscaphec翻訳omegat計画中(planning stage)frameworktwitterdombtronvb.nettestarduinodirectxpreviewerゲームエンジン

device/generic/x86


Commit MetaInfo

Revision629e30983cbe67af5cfaada24aa3f3be9a6e0e1d (tree)
Time2015-06-06 08:58:07
AuthorChih-Wei Huang <cwhuang@linu...>
CommiterChih-Wei Huang

Log Message

init.sh: add support of iio sensors

Change Summary

Incremental Difference

--- a/device.mk
+++ b/device.mk
@@ -57,6 +57,7 @@ PRODUCT_COPY_FILES += \
5757 frameworks/native/data/etc/android.hardware.sensor.gyroscope.xml:system/etc/permissions/android.hardware.sensor.gyroscope.xml \
5858 frameworks/native/data/etc/android.hardware.sensor.barometer.xml:system/etc/permissions/android.hardware.sensor.barometer.xml \
5959 frameworks/native/data/etc/android.hardware.sensor.accelerometer.xml:system/etc/permissions/android.hardware.sensor.accelerometer.xml \
60+ frameworks/native/data/etc/android.hardware.sensor.compass.xml:system/etc/permissions/android.hardware.sensor.compass.xml \
6061 frameworks/native/data/etc/android.hardware.touchscreen.multitouch.distinct.xml:system/etc/permissions/android.hardware.touchscreen.multitouch.distinct.xml \
6162 frameworks/native/data/etc/android.hardware.touchscreen.multitouch.jazzhand.xml:system/etc/permissions/android.hardware.touchscreen.multitouch.jazzhand.xml \
6263 frameworks/native/data/etc/android.software.sip.voip.xml:system/etc/permissions/android.software.sip.voip.xml \
--- a/init.sh
+++ b/init.sh
@@ -20,6 +20,7 @@ function init_misc()
2020
2121 case "$PRODUCT" in
2222 T10*TA)
23+ modprobe ak8975
2324 ;;
2425 *)
2526 ;;
@@ -139,34 +140,32 @@ function init_hal_power()
139140
140141 function init_hal_sensors()
141142 {
143+ local hal_sensors=kbd
142144 case "$(cat $DMIPATH/uevent)" in
143145 *Lucid-MWE*)
144146 set_property ro.ignore_atkbd 1
145- set_property hal.sensors hdaps
147+ hal_sensors=hdaps
146148 ;;
147149 *ICONIA*W5*)
148- set_property hal.sensors w500
150+ hal_sensors=w500
149151 ;;
150152 *S10-3t*)
151- set_property hal.sensors s103t
153+ hal_sensors=s103t
152154 ;;
153155 *Inagua*)
154156 #setkeycodes 0x62 29
155157 #setkeycodes 0x74 56
156158 set_property ro.ignore_atkbd 1
157- set_property hal.sensors kbd
158159 set_property hal.sensors.kbd.type 2
159160 ;;
160161 *TEGA*|*2010:svnIntel:*)
161162 set_property ro.ignore_atkbd 1
162- set_property hal.sensors kbd
163163 set_property hal.sensors.kbd.type 1
164164 io_switch 0x0 0x1
165165 setkeycodes 0x6d 125
166166 ;;
167167 *DLI*)
168168 set_property ro.ignore_atkbd 1
169- set_property hal.sensors kbd
170169 set_property hal.sensors.kbd.type 1
171170 setkeycodes 0x64 1
172171 setkeycodes 0x65 172
@@ -180,7 +179,6 @@ function init_hal_sensors()
180179 *tx2*)
181180 setkeycodes 0xb1 138
182181 setkeycodes 0x8a 152
183- set_property hal.sensors kbd
184182 set_property hal.sensors.kbd.type 6
185183 set_property poweroff.doubleclick 0
186184 set_property qemu.hw.mainkeys 1
@@ -193,26 +191,25 @@ function init_hal_sensors()
193191 ;;
194192 *Aspire1*25*)
195193 modprobe lis3lv02d_i2c
196- set_property hal.sensors hdaps
194+ hal_sensors=hdaps
197195 echo -n "enabled" > /sys/class/thermal/thermal_zone0/mode
198196 ;;
199197 *ThinkPad*Tablet*)
200198 modprobe hdaps
201- set_property hal.sensors hdaps
199+ hal_sensors=hdaps
202200 ;;
203201 *)
204- set_property hal.sensors kbd
205202 ;;
206203 esac
207204
208205 # has sensor-hub?
209206 for i in /sys/bus/iio/devices/iio:device?; do
210- if [ -e $i/in_accel_scale ]; then
211- busybox chown -R 1000.1000 /sys/bus/iio/devices/iio:device?/
212- set_property hal.sensors hsb
213- break
214- fi
207+ busybox chown -R 1000.1000 /sys/bus/iio/devices/iio:device?/
208+ lsmod | grep -q hid_sensor_accel_3d && hal_sensors=hsb || hal_sensors=iio
209+ break
215210 done
211+
212+ set_property hal.sensors $hal_sensors
216213 }
217214
218215 function create_pointercal()