device/generic/x86
Revision | 629e30983cbe67af5cfaada24aa3f3be9a6e0e1d (tree) |
---|---|
Zeit | 2015-06-06 08:58:07 |
Autor | Chih-Wei Huang <cwhuang@linu...> |
Commiter | Chih-Wei Huang |
init.sh: add support of iio sensors
@@ -57,6 +57,7 @@ PRODUCT_COPY_FILES += \ | ||
57 | 57 | frameworks/native/data/etc/android.hardware.sensor.gyroscope.xml:system/etc/permissions/android.hardware.sensor.gyroscope.xml \ |
58 | 58 | frameworks/native/data/etc/android.hardware.sensor.barometer.xml:system/etc/permissions/android.hardware.sensor.barometer.xml \ |
59 | 59 | 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 \ | |
60 | 61 | frameworks/native/data/etc/android.hardware.touchscreen.multitouch.distinct.xml:system/etc/permissions/android.hardware.touchscreen.multitouch.distinct.xml \ |
61 | 62 | frameworks/native/data/etc/android.hardware.touchscreen.multitouch.jazzhand.xml:system/etc/permissions/android.hardware.touchscreen.multitouch.jazzhand.xml \ |
62 | 63 | frameworks/native/data/etc/android.software.sip.voip.xml:system/etc/permissions/android.software.sip.voip.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 | ;; |
@@ -139,34 +140,32 @@ function init_hal_power() | ||
139 | 140 | |
140 | 141 | function init_hal_sensors() |
141 | 142 | { |
143 | + local hal_sensors=kbd | |
142 | 144 | case "$(cat $DMIPATH/uevent)" in |
143 | 145 | *Lucid-MWE*) |
144 | 146 | set_property ro.ignore_atkbd 1 |
145 | - set_property hal.sensors hdaps | |
147 | + hal_sensors=hdaps | |
146 | 148 | ;; |
147 | 149 | *ICONIA*W5*) |
148 | - set_property hal.sensors w500 | |
150 | + hal_sensors=w500 | |
149 | 151 | ;; |
150 | 152 | *S10-3t*) |
151 | - set_property hal.sensors s103t | |
153 | + hal_sensors=s103t | |
152 | 154 | ;; |
153 | 155 | *Inagua*) |
154 | 156 | #setkeycodes 0x62 29 |
155 | 157 | #setkeycodes 0x74 56 |
156 | 158 | set_property ro.ignore_atkbd 1 |
157 | - set_property hal.sensors kbd | |
158 | 159 | set_property hal.sensors.kbd.type 2 |
159 | 160 | ;; |
160 | 161 | *TEGA*|*2010:svnIntel:*) |
161 | 162 | set_property ro.ignore_atkbd 1 |
162 | - set_property hal.sensors kbd | |
163 | 163 | set_property hal.sensors.kbd.type 1 |
164 | 164 | io_switch 0x0 0x1 |
165 | 165 | setkeycodes 0x6d 125 |
166 | 166 | ;; |
167 | 167 | *DLI*) |
168 | 168 | set_property ro.ignore_atkbd 1 |
169 | - set_property hal.sensors kbd | |
170 | 169 | set_property hal.sensors.kbd.type 1 |
171 | 170 | setkeycodes 0x64 1 |
172 | 171 | setkeycodes 0x65 172 |
@@ -180,7 +179,6 @@ function init_hal_sensors() | ||
180 | 179 | *tx2*) |
181 | 180 | setkeycodes 0xb1 138 |
182 | 181 | setkeycodes 0x8a 152 |
183 | - set_property hal.sensors kbd | |
184 | 182 | set_property hal.sensors.kbd.type 6 |
185 | 183 | set_property poweroff.doubleclick 0 |
186 | 184 | set_property qemu.hw.mainkeys 1 |
@@ -193,26 +191,25 @@ function init_hal_sensors() | ||
193 | 191 | ;; |
194 | 192 | *Aspire1*25*) |
195 | 193 | modprobe lis3lv02d_i2c |
196 | - set_property hal.sensors hdaps | |
194 | + hal_sensors=hdaps | |
197 | 195 | echo -n "enabled" > /sys/class/thermal/thermal_zone0/mode |
198 | 196 | ;; |
199 | 197 | *ThinkPad*Tablet*) |
200 | 198 | modprobe hdaps |
201 | - set_property hal.sensors hdaps | |
199 | + hal_sensors=hdaps | |
202 | 200 | ;; |
203 | 201 | *) |
204 | - set_property hal.sensors kbd | |
205 | 202 | ;; |
206 | 203 | esac |
207 | 204 | |
208 | 205 | # has sensor-hub? |
209 | 206 | 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 | |
215 | 210 | done |
211 | + | |
212 | + set_property hal.sensors $hal_sensors | |
216 | 213 | } |
217 | 214 | |
218 | 215 | function create_pointercal() |