1. 前言
蓝牙移植内核修改的较少,
android层由于使用broadcom提供bplus,framework和package改动较多,
android部份的移植只提及重要的修改。
2. 内核配置
修改.config文件以支持蓝牙的low power mode和唤醒休眠主控功能和支持android4.2 hid设备。
蓝牙low power mode和唤醒休眠主控的支持。
linux-3.3目录下,输入make ARCH=arm menuconfig
选择 -> Networking support (NET [=y])
-> Bluetooth subsystem support (BT [=y])
-> Bluetooth device drivers
-> Bluetooth Low Power Manager Support
An inverter between bt hostwake pin and cpu
ap6476模组是支持蓝牙唤醒休眠主控,需要在wakeup_src_para主键下把蓝牙的唤醒源添加上,唤醒源要跟wifi配置下的ap6xxx_bt_host_wake一致。
linux-3.3目录下,输入make ARCH=arm menuconfig
选择 -> Device Drivers --->
-> HID Devices --->
-> User-space I/O driver support for HID subsystem
3. sys_config修改
sys_config.fex是系统的配置文件,蓝牙功能是否有、蓝牙功能脚、接口定义等均是在sys_config.fex中设定。
;--------------------------------------------------------------------------------
;blue tooth
;bt_used ---- blue tooth used (0- no used, 1- used)
;bt_uard_id ---- uart index
;--------------------------------------------------------------------------------
[bt_para]
bt_used = 1
bt_uart_id = 2
bt_wakeup =
bt_gpio =
bt_rst =
bt_para是蓝牙配置的主键名,在sys_config.fex中是唯一的,会在脚本解释中被用到。
bt_used子键值为1代指平台使用蓝牙功能,值为0代指平台无蓝牙功能,bt_used会被rf电源管理驱动通过脚本解释读取其值,若值为0则不注册rfkill,直接返回空。
bt_uart_id子键值代指使用哪一路串口作为数据交互的通道,会在uart注册时被读取。
[uart_para2]
uart_used = 1
uart_port = 2
uart_type