device/generic/x86
修訂 | 61645aa2dda1df5f7f339fd65aad7523e2db273c (tree) |
---|---|
時間 | 2015-07-17 16:06:31 |
作者 | Chih-Wei Huang <cwhuang@linu...> |
Commiter | Chih-Wei Huang |
android-x86-4.4-r3 release (20150717)
@@ -14,9 +14,6 @@ TARGET_BOARD_PLATFORM := android-x86 | ||
14 | 14 | |
15 | 15 | # Some framework code requires this to enable BT |
16 | 16 | BOARD_HAVE_BLUETOOTH := true |
17 | -BLUETOOTH_HCI_USE_USB := true | |
18 | -BOARD_HAVE_BLUETOOTH_BCM := true | |
19 | -BOARD_BLUETOOTH_BDROID_BUILDCFG_INCLUDE_DIR := device/generic/x86/bluetooth | |
20 | 17 | |
21 | 18 | # customize the malloced address to be 16-byte aligned |
22 | 19 | BOARD_MALLOC_ALIGNMENT := 16 |
@@ -1,26 +0,0 @@ | ||
1 | -/* | |
2 | - * Copyright (C) 2013 The Android-x86 Open Source Project | |
3 | - * | |
4 | - * Licensed under the Apache License, Version 2.0 (the "License"); | |
5 | - * you may not use this file except in compliance with the License. | |
6 | - * You may obtain a copy of the License at | |
7 | - * | |
8 | - * http://www.apache.org/licenses/LICENSE-2.0 | |
9 | - * | |
10 | - * Unless required by applicable law or agreed to in writing, software | |
11 | - * distributed under the License is distributed on an "AS IS" BASIS, | |
12 | - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
13 | - * See the License for the specific language governing permissions and | |
14 | - * limitations under the License. | |
15 | - */ | |
16 | - | |
17 | -#ifndef _BDROID_BUILDCFG_H | |
18 | -#define _BDROID_BUILDCFG_H | |
19 | - | |
20 | -#define BTM_DEF_LOCAL_NAME "Android-x86" | |
21 | -// At present either USB or UART is supported | |
22 | -#define BLUETOOTH_HCI_USE_USB TRUE | |
23 | -// Bluetooth Low Power Mode is supported on BT4.0 | |
24 | -#define HCILP_INCLUDED FALSE | |
25 | - | |
26 | -#endif |
@@ -17,14 +17,6 @@ function init_misc() | ||
17 | 17 | |
18 | 18 | # in case no cpu governor driver autoloads |
19 | 19 | [ -d /sys/devices/system/cpu/cpu0/cpufreq ] || modprobe acpi-cpufreq |
20 | - | |
21 | - case "$PRODUCT" in | |
22 | - T10*TA) | |
23 | - modprobe ak8975 | |
24 | - ;; | |
25 | - *) | |
26 | - ;; | |
27 | - esac | |
28 | 20 | } |
29 | 21 | |
30 | 22 | function init_hal_audio() |
@@ -45,11 +37,26 @@ function init_hal_bluetooth() | ||
45 | 37 | [ "$type" = "wlan" -o "$type" = "bluetooth" ] && echo 1 > $r/state |
46 | 38 | done |
47 | 39 | |
48 | - # these modules are incompatible with bluedroid | |
49 | - rmmod ath3k | |
50 | - rmmod btusb | |
51 | - rmmod bluetooth | |
52 | - set_property ro.rfkilldisabled 1 | |
40 | + case "$PRODUCT" in | |
41 | + T10*TA) | |
42 | + modprobe ak8975 | |
43 | + modprobe hci-uart | |
44 | + BTUART_PORT=/dev/ttyS1 | |
45 | + brcm_patchram_plus -d --no2bytes --enable_hci --patchram /system/lib/firmware/brcm/bcm43241b4.hcd $BTUART_PORT | |
46 | + ;; | |
47 | + *) | |
48 | + for bt in $(lsusb -v | awk ' /Class:.E0/ { print $9 } '); do | |
49 | + chown 1002.1002 $bt && chmod 660 $bt | |
50 | + done | |
51 | + [ -n "$bt" ] && modprobe btusb | |
52 | + ;; | |
53 | + esac | |
54 | + | |
55 | + if [ -n "$BTUART_PORT" ]; then | |
56 | + set_property hal.bluetooth.uart $BTUART_PORT | |
57 | + chown bluetooth.bluetooth $BTUART_PORT | |
58 | + log -t hciconfig -p i "`hciconfig`" | |
59 | + fi | |
53 | 60 | } |
54 | 61 | |
55 | 62 | function init_hal_camera() |
@@ -202,12 +209,11 @@ function init_hal_sensors() | ||
202 | 209 | ;; |
203 | 210 | esac |
204 | 211 | |
205 | - # has sensor-hub? | |
206 | - for i in /sys/bus/iio/devices/iio:device?; do | |
207 | - busybox chown -R 1000.1000 /sys/bus/iio/devices/iio:device?/ | |
212 | + # has iio sensor-hub? | |
213 | + if [ -n "`ls /sys/bus/iio/devices/iio:device* 2> /dev/null`" ]; then | |
214 | + busybox chown -R 1000.1000 /sys/bus/iio/devices/iio:device*/ | |
208 | 215 | lsmod | grep -q hid_sensor_accel_3d && hal_sensors=hsb || hal_sensors=iio |
209 | - break | |
210 | - done | |
216 | + fi | |
211 | 217 | |
212 | 218 | set_property hal.sensors $hal_sensors |
213 | 219 | } |
@@ -305,11 +311,6 @@ function do_bootcomplete() | ||
305 | 311 | |
306 | 312 | lsmod | grep -e brcmfmac && setprop wlan.no-unload-driver 1 |
307 | 313 | |
308 | - for bt in $(lsusb -v | awk ' /Class:.E0/ { print $9 } '); do | |
309 | - chown 1002.1002 $bt && chmod 660 $bt | |
310 | - done | |
311 | -# am force-stop com.android.bluetooth | |
312 | - | |
313 | 314 | case "$PRODUCT" in |
314 | 315 | 1866???|1867???|1869???) # ThinkPad X41 Tablet |
315 | 316 | start tablet-mode |
@@ -366,6 +367,16 @@ function do_bootcomplete() | ||
366 | 367 | done |
367 | 368 | } |
368 | 369 | |
370 | +function do_hci() | |
371 | +{ | |
372 | + local hci=`hciconfig | grep ^hci | cut -d: -f1` | |
373 | + local btd="`getprop init.svc.bluetoothd`" | |
374 | + log -t bluetoothd -p i "$btd ($hci)" | |
375 | + if [ -n "`getprop hal.bluetooth.uart`" ]; then | |
376 | + [ "`getprop init.svc.bluetoothd`" = "running" ] && hciconfig $hci up | |
377 | + fi | |
378 | +} | |
379 | + | |
369 | 380 | PATH=/system/bin:/system/xbin |
370 | 381 | |
371 | 382 | DMIPATH=/sys/class/dmi/id |
@@ -396,6 +407,9 @@ case "$1" in | ||
396 | 407 | bootcomplete) |
397 | 408 | do_bootcomplete |
398 | 409 | ;; |
410 | + hci) | |
411 | + do_hci | |
412 | + ;; | |
399 | 413 | init|"") |
400 | 414 | do_init |
401 | 415 | ;; |
@@ -1,3 +1,4 @@ | ||
1 | +import /init.bluetooth.rc | |
1 | 2 | import /init.superuser.rc |
2 | 3 | |
3 | 4 | on early-init |
@@ -176,6 +177,12 @@ on property:sys.boot_completed=1 | ||
176 | 177 | write /proc/sys/kernel/ctrl-alt-del 0 |
177 | 178 | exec /system/bin/logwrapper /system/bin/sh /system/etc/init.sh bootcomplete |
178 | 179 | |
180 | +on property:init.svc.bluetoothd=running | |
181 | + exec /system/bin/logwrapper /system/bin/sh /system/etc/init.sh hci | |
182 | + | |
183 | +on property:init.svc.bluetoothd=stopped | |
184 | + exec /system/bin/logwrapper /system/bin/sh /system/etc/init.sh hci | |
185 | + | |
179 | 186 | on property:net.dns1=* |
180 | 187 | exec /system/bin/logwrapper /system/bin/sh /system/etc/init.sh netconsole |
181 | 188 |