RK3188笔记

1. 

电量检测用SARADC_ANI0通道,platform_device代码在 arch/arm/mach-rk30/devices.c 中:

struct platform_device device_adc = {
    .name       = "rk30-adc",
    .id     = -1,
    .num_resources  = ARRAY_SIZE(rk30_adc_resource),
    .resource   = rk30_adc_resource,
        .dev            = {  
        .platform_data = &rk30_adc_pdata,
        },   
};

platform_driver代码在drivers/adc/plat/rk30_adc.c 中,实现了start, stop, read函数;

接着电量检测上报代码在power/rk30_factory_adc_battery.c中,注册到drivers/adc/core.c中,通过回调start, read等进行电量的读取上报动作;

上层system/core/charger/charger.c 中检测上报的事件,如果全部offline或者超时则会重启机子。


power上报机制:

drivers/power/power_supply_core.c power_supply_register函数中

[cpp]  view plain copy
  1. dev->class = power_supply_class;  
  2. dev->type = &power_supply_dev_type;                                                                                                                          
  3. dev->parent = parent;  
  4. dev->release = power_supply_dev_release;  
  5. dev_set_drvdata(dev, psy);  
  6. psy->dev = dev;  

主要是为 dev->type和psy->dev赋值,并且power_supply_class_init函数中:

[cpp]  view plain copy
  1. power_supply_class->dev_uevent = power_supply_uevent;  

使得后续kobject_uevent上报的是power_supply_uevent的内容,位于 drivers/power/power_supply_sysfs.c中;

在上层cat时候显示的则为power_supply_sysfs.c中

[cpp]  view plain copy
  1. #define POWER_SUPPLY_ATTR(_name)                    \  
  2. {                                   \  
  3.     .attr = { .name = #_name },                 \  
  4.     .show = power_supply_show_property,             \  
  5.     .store = power_supply_store_property,               \  
  6. }  
所定义的内容。


2.

3G

3G唤醒主机原理:

在3G中断到来时候调用wake_lock_timeout(&bp->bp_wakelock, 10 * HZ); 上层会保持不休眠


平台的gpio定义在board-rk3188-rk616-3gonlydataABC.c 中:

static int mu509_io_deinit(void)
{

    return 0;
}

struct rk29_mu509_data rk29_mu509_info = {
    .io_init = mu509_io_init,
    .io_deinit = mu509_io_deinit,
    .modem_power_en = RK30_PIN0_PC6,
    .bp_power = RK30_PIN2_PD5,
    .bp_reset = RK30_PIN0_PB4,
    .ap_wakeup_bp = RK30_PIN0_PC4,
    .bp_wakeup_ap = RK30_PIN0_PC5,
};
struct platform_device rk29_device_mu509 = {
        .name = "mu509",
        .id = -1,
    .dev        = {
        .platform_data = &rk29_mu509_info,
    }
    };

GPIO逻辑控制代码在kernel/drivers/misc/bp/chips中


3.

编译步骤

kernel:

cd kernel;

make ARCH=arm rk3188_ABC_3gonlydata_defconfig  menuconfig

make ARCH=arm rk3188_ABC_3gonlydata_defconfig 

make kernel.img 


android:

A. 高清屏需要配置:vim device/rockchip/rk30sdk/BoardConfig.mk将下面两个宏改为
true
BOARD_USE_LCDC_COMPOSER := true
BOARD_LCDC_COMPOSER_LANDSCAPE_ONLY := true
B. 执行 make
C. 执行./mkimage.sh
即可在 rockdev/Image 目录下生成以下 4 个 img
system.img boot.img recovery.img misc.img


4. 

wifi-bt模块AP6210

看/sys/class/rkwifi节点有没有出来,接着cat  /sys/class/rkwifi/chip看芯片型号对不对,这部分的实现代码在kernel/drivers/net/wireless/wifi_sys/rkwifi_sys_iface.c中。

照着RK的文档配置好了WIFI,log提示没有问题,点击后界面一直提示正在搜索网络,但是一直没有结果出来。原来是由于kernel中WIFI模块晶振配置不正确,应该为26M,却是配置成了24M。修改完成重烧kernel后启动,马上搜索到网络了

bt打开马上关闭,提示如下log:

D/AudioHardware(  108): AudioHardware pcm playback is exiting standby.
D/AudioHardware(  108): openPcmOut_l() mPcmOpenCnt: 0
D/alsa_pcm(  108): pcm_open(0x0003f000)
D/alsa_pcm(  108): pcm_open() period sz multiplier 16
D/alsa_pcm(  108): pcm_open() period cnt 6
D/alsa_pcm(  108): pcm_open() period_cnt 6 period_sz 1024 channels 2
I/alsa_mix(  108): -->Playback Path access 3
D/BluetoothManagerService(  362): enable():  mBluetooth =android.bluetooth.IBluetooth$Stub$Proxy@413b1880 mBinding = false
D/BluetoothManagerService(  362): Message: MESSAGE_ENABLE
D/BluetoothManagerService(  362): MESSAGE_ENABLE: mBluetooth = android.bluetooth.IBluetooth$Stub$Proxy@413b1880
D/BluetoothAdapterService(  810): Broadcasting updateAdapterState() to 1 receivers.
D/BluetoothBondStateMachine(  810): make
D/BluetoothManagerService(  362): Message: MESSAGE_BLUETOOTH_STATE_CHANGE
D/BluetoothManagerService(  362): MESSAGE_BLUETOOTH_STATE_CHANGE: prevState = 10, newState=11
D/BluetoothManagerService(  362): Bluetooth State Change Intent: 10 -> 11
I/bluedroid(  810): enable
D/BTIF_CORE(  810): not disabled
E/BluetoothAdapterState(  810): Error while turning Bluetooth On
D/BluetoothAdapterService(  810): Broadcasting updateAdapterState() to 1 receivers.
I/BluetoothBondStateMachine(  810): StableState(): Entering Off State
D/BluetoothManagerService(  362): Message: MESSAGE_BLUETOOTH_STATE_CHANGE
D/BluetoothManagerService(  362): MESSAGE_BLUETOOTH_STATE_CHANGE: prevState = 11, newState=10
D/BluetoothManagerService(  362): Broadcasting onBluetoothStateChange(false) to 7 receivers.
D/BluetoothHeadset(  591): onBluetoothStateChange: up=false
E/BluetoothHeadset(  591): 
E/BluetoothHeadset(  591): java.lang.IllegalArgumentException: Service not registered: android.bluetooth.BluetoothHeadset$2@410d4f70
E/BluetoothHeadset(  591): at android.app.LoadedApk.forgetServiceDispatcher(LoadedApk.java:921)
E/BluetoothHeadset(  591): at android.app.ContextImpl.unbindService(ContextImpl.java:1460)
E/BluetoothHeadset(  591): at android.content.ContextWrapper.unbindService(ContextWrapper.java:484)
E/BluetoothHeadset(  591): at android.bluetooth.BluetoothHeadset$1.onBluetoothStateChange(BluetoothHeadset.java:234)
E/BluetoothHeadset(  591): at android.bluetooth.IBluetoothStateChangeCallback$Stub.onTransact(IBluetoothStateChangeCallback.java:55)
E/BluetoothHeadset(  591): at android.os.Binder.execTransact(Binder.java:351)
E/BluetoothHeadset(  591): at dalvik.system.NativeStart.run(Native Method)
D/BluetoothA2dp(  362): onBluetoothStateChange: up=false
D/BluetoothAdapterService(1091175776)(  810): getState(): mAdapterProperties: com.android.bluetooth.btservice.AdapterProperties@410a1ea0
E/BluetoothA2dp(  362): 
E/BluetoothA2dp(  362): java.lang.IllegalArgumentException: Service not registered: android.bluetooth.BluetoothA2dp$2@413f3418
E/BluetoothA2dp(  362): at android.app.LoadedApk.forgetServiceDispatcher(LoadedApk.java:921)
E/BluetoothA2dp(  362): at android.app.ContextImpl.unbindService(ContextImpl.java:1460)
E/BluetoothA2dp(  362): at android.bluetooth.BluetoothA2dp$1.onBluetoothStateChange(BluetoothA2dp.java:121)
E/BluetoothA2dp(  362): at com.android.server.BluetoothManagerService.sendBluetoothStateCallback(BluetoothManagerService.java:575)
E/BluetoothA2dp(  362): at com.android.server.BluetoothManagerService.bluetoothStateChangeHandler(BluetoothManagerService.java:1189)
E/BluetoothA2dp(  362): at com.android.server.BluetoothManagerService.access$3000(BluetoothManagerService.java:47)
E/BluetoothA2dp(  362): at com.android.server.BluetoothManagerService$BluetoothHandler.handleMessage(BluetoothManagerService.java:941)
E/BluetoothA2dp(  362): at android.os.Handler.dispatchMessage(Handler.java:99)
E/BluetoothA2dp(  362): at android.os.Looper.loop(Looper.java:137)
E/BluetoothA2dp(  362): at android.os.HandlerThread.run(HandlerThread.java:60)
E/BluetoothPan(  516): 
E/BluetoothPan(  516): java.lang.IllegalArgumentException: Service not registered: android.bluetooth.BluetoothPan$2@410ab038
E/BluetoothPan(  516): at android.app.LoadedApk.forgetServiceDispatcher(LoadedApk.java:921)
E/BluetoothPan(  516): at android.app.ContextImpl.unbindService(ContextImpl.java:1460)
E/BluetoothPan(  516): at android.content.ContextWrapper.unbindService(ContextWrapper.java:484)
E/BluetoothPan(  516): at android.bluetooth.BluetoothPan$1.onBluetoothStateChange(BluetoothPan.java:183)
E/BluetoothPan(  516): at android.bluetooth.IBluetoothStateChangeCallback$Stub.onTransact(IBluetoothStateChangeCallback.java:55)
E/BluetoothPan(  516): at android.os.Binder.execTransact(Binder.java:351)
E/BluetoothPan(  516): at dalvik.system.NativeStart.run(Native Method)
D/BluetoothInputDevice(  516): onBluetoothStateChange: up=false
E/BluetoothInputDevice(  516): 
E/BluetoothInputDevice(  516): java.lang.IllegalArgumentException: Service not registered: android.bluetooth.BluetoothInputDevice$2@410a5b68
E/BluetoothInputDevice(  516): at android.app.LoadedApk.forgetServiceDispatcher(LoadedApk.java:921)
E/BluetoothInputDevice(  516): at android.app.ContextImpl.unbindService(ContextImpl.java:1460)
E/BluetoothInputDevice(  516): at android.content.ContextWrapper.unbindService(ContextWrapper.java:484)
E/BluetoothInputDevice(  516): at android.bluetooth.BluetoothInputDevice$1.onBluetoothStateChange(BluetoothInputDevice.java:199)
E/BluetoothInputDevice(  516): at android.bluetooth.IBluetoothStateChangeCallback$Stub.onTransact(IBluetoothStateChangeCallback.java:55)
E/BluetoothInputDevice(  516): at android.os.Binder.execTransact(Binder.java:351)
E/BluetoothInputDevice(  516): at dalvik.system.NativeStart.run(Native Method)
D/BluetoothHeadset(  362): onBluetoothStateChange: up=false
D/BluetoothAdapterService(1091175776)(  810): getState(): mAdapterProperties: com.android.bluetooth.btservice.AdapterProperties@410a1ea0
E/BluetoothHeadset(  362): 
E/BluetoothHeadset(  362): java.lang.IllegalArgumentException: Service not registered: android.bluetooth.BluetoothHeadset$2@41249b68
E/BluetoothHeadset(  362): at android.app.LoadedApk.forgetServiceDispatcher(LoadedApk.java:921)
E/BluetoothHeadset(  362): at android.app.ContextImpl.unbindService(ContextImpl.java:1460)
E/BluetoothHeadset(  362): at android.bluetooth.BluetoothHeadset$1.onBluetoothStateChange(BluetoothHeadset.java:234)
E/BluetoothHeadset(  362): at com.android.server.BluetoothManagerService.sendBluetoothStateCallback(BluetoothManagerService.java:575)
E/BluetoothHeadset(  362): at com.android.server.BluetoothManagerService.bluetoothStateChangeHandler(BluetoothManagerService.java:1189)
E/BluetoothHeadset(  362): at com.android.server.BluetoothManagerService.access$3000(BluetoothManagerService.java:47)
E/BluetoothHeadset(  362): at com.android.server.BluetoothManagerService$BluetoothHandler.handleMessage(BluetoothManagerService.java:941)
E/BluetoothHeadset(  362): at android.os.Handler.dispatchMessage(Handler.java:99)
E/BluetoothHeadset(  362): at android.os.Looper.loop(Looper.java:137)
E/BluetoothHeadset(  362): at android.os.HandlerThread.run(HandlerThread.java:60)
D/BluetoothHeadset(  591): onBluetoothStateChange: up=false
E/BluetoothHeadset(  591): 
E/BluetoothHeadset(  591): java.lang.IllegalArgumentException: Service not registered: android.bluetooth.BluetoothHeadset$2@410ac518
E/BluetoothHeadset(  591): at android.app.LoadedApk.forgetServiceDispatcher(LoadedApk.java:921)
E/BluetoothHeadset(  591): at android.app.ContextImpl.unbindService(ContextImpl.java:1460)
E/BluetoothHeadset(  591): at android.content.ContextWrapper.unbindService(ContextWrapper.java:484)
E/BluetoothHeadset(  591): at android.bluetooth.BluetoothHeadset$1.onBluetoothStateChange(BluetoothHeadset.java:234)
E/BluetoothHeadset(  591): at android.bluetooth.IBluetoothStateChangeCallback$Stub.onTransact(IBluetoothStateChangeCallback.java:55)
E/BluetoothHeadset(  591): at android.os.Binder.execTransact(Binder.java:351)
E/BluetoothHeadset(  591): at dalvik.system.NativeStart.run(Native Method)
D/BluetoothPbap(  516): onBluetoothStateChange: up=false
E/BluetoothPbap(  516): 
E/BluetoothPbap(  516): java.lang.IllegalArgumentException: Service not registered: android.bluetooth.BluetoothPbap$2@410b0368
E/BluetoothPbap(  516): at android.app.LoadedApk.forgetServiceDispatcher(LoadedApk.java:921)
E/BluetoothPbap(  516): at android.app.ContextImpl.unbindService(ContextImpl.java:1460)
E/BluetoothPbap(  516): at android.content.ContextWrapper.unbindService(ContextWrapper.java:484)
E/BluetoothPbap(  516): at android.bluetooth.BluetoothPbap$1.onBluetoothStateChange(BluetoothPbap.java:122)
E/BluetoothPbap(  516): at android.bluetooth.IBluetoothStateChangeCallback$Stub.onTransact(IBluetoothStateChangeCallback.java:55)
E/BluetoothPbap(  516): at android.os.Binder.execTransact(Binder.java:351)
E/BluetoothPbap(  516): at dalvik.system.NativeStart.run(Native Method)
D/BluetoothManagerService(  362): Bluetooth State Change Intent: 11 -> 10
D/BluetoothAdapterService(1091175776)(  810): getState(): mAdapterProperties: com.android.bluetooth.btservice.AdapterProperties@410a1ea0
D/BluetoothAdapterService(1091175776)(  810): getState(): mAdapterProperties: com.android.bluetooth.btservice.AdapterProperties@410a1ea0
D/BluetoothAdapterService(1091175776)(  810): getState(): mAdapterProperties: com.android.bluetooth.btservice.AdapterProperties@410a1ea0
D/BluetoothAdapterService(1091175776)(  810): getState(): mAdapterProperties: com.android.bluetooth.btservice.AdapterProperties@410a1ea0
D/BluetoothAdapterService(1091175776)(  810): getState(): mAdapterProperties: com.android.bluetooth.btservice.AdapterProperties@410a1ea0
D/BluetoothAdapterService(1091175776)(  810): getState(): mAdapterProperties: com.android.bluetooth.btservice.AdapterProperties@410a1ea0
D/BluetoothAdapterService(1091175776)(  810): getState(): mAdapterProperties: com.android.bluetooth.btservice.AdapterProperties@410a1ea0
D/dalvikvm(  516): GC_CONCURRENT freed 438K, 15% free 4671K/5476K, paused 2ms+4ms, total 28ms
W/ContextImpl(  516): Calling a method in the system process without a qualified user: android.app.ContextImpl.startService:1361 android.content.ContextWrapper.startService:450 android.content.ContextWrapper.startService:450 com.android.settings.bluetooth.DockEventReceiver.beginStartingService:134 com.android.settings.bluetooth.DockEventReceiver.onReceive:115 
D/DockEventReceiver(  516): finishStartingService: stopping service
D/BluetoothAdapterService(1091175776)(  810): getState(): mAdapterProperties: com.android.bluetooth.btservice.AdapterProperties@410a1ea0
D/AudioHardware(  108): AudioHardware pcm playback is going to standby.
I/alsa_mix(  108): -->Playback Path access 3
D/AudioHardware(  108): closePcmOut_l() mPcmOpenCnt: 1

原因,kernel/net/rfkill/rfkill-rk.c 中是控制BT GPIO的驱动,由于二合一模块共用一个电源,WIFI已经打开了模块电源,BT时候又申请该GPIO去控制电源,导致直接返回,没有往下执行其他动作,把BT的电源控制GPIO去掉即可,成功的LOG如下:

D/BluetoothManagerService(  364): enable():  mBluetooth =null mBinding = false
D/BluetoothManagerService(  364): Message: MESSAGE_ENABLE
D/BluetoothManagerService(  364): MESSAGE_ENABLE: mBluetooth = null
D/BluetoothAdapterService(  802): REFCOUNT: CREATED. INSTANCE_COUNT2
D/BluetoothAdapterState(  802): make
I/bluedroid(  802): init
I/bte_conf(  802): Attempt to load stack conf from /etc/bluetooth/bt_stack.conf
I/bluedroid(  802): get_profile_interface socket
I/GKI_LINUX(  802): gki_task_entry: gki_task_entry task_id=1 [BTIF] starting
D/BluetoothManagerService(  364): BluetoothServiceConnection: connected to AdapterService
D/BluetoothManagerService(  364): Message: MESSAGE_BLUETOOTH_SERVICE_CONNECTED
D/BluetoothManagerService(  364): MESSAGE_BLUETOOTH_SERVICE_CONNECTED
D/BluetoothManagerService(  364): Calling onBluetoothServiceUp callbacks
D/BluetoothManagerService(  364): Broadcasting onBluetoothServiceUp() to 5 receivers.
D/BluetoothAdapter(  441): onBluetoothServiceUp: android.bluetooth.IBluetooth$Stub$Proxy@436b8cc0
D/BluetoothAdapter(  703): onBluetoothServiceUp: android.bluetooth.IBluetooth$Stub$Proxy@42369fa0
D/BluetoothAdapter(  546): onBluetoothServiceUp: android.bluetooth.IBluetooth$Stub$Proxy@42268250
D/BluetoothManagerService(  364): Bluetooth Adapter name changed to ABC
D/BluetoothManagerService(  364): Stored Bluetooth name: ABC
D/BluetoothAdapter(  364): onBluetoothServiceUp: android.bluetooth.IBluetooth$Stub$Proxy@426800e0
D/BluetoothAdapter(  802): onBluetoothServiceUp: com.android.bluetooth.btservice.AdapterService$AdapterServiceBinder@4228f608
D/BluetoothAdapterService(  802): Broadcasting updateAdapterState() to 1 receivers.
D/BluetoothBondStateMachine(  802): make
D/BluetoothManagerService(  364): Message: MESSAGE_BLUETOOTH_STATE_CHANGE
D/BluetoothManagerService(  364): MESSAGE_BLUETOOTH_STATE_CHANGE: prevState = 10, newState=11
D/BluetoothManagerService(  364): Bluetooth State Change Intent: 10 -> 11
I/BluetoothBondStateMachine(  802): StableState(): Entering Off State
D/BluetoothAdapterService(1109812520)(  802): getState(): mAdapterProperties: com.android.bluetooth.btservice.AdapterProperties@4228f650
D/HeadsetService(  802): Received start request. Starting profile...
D/HeadsetStateMachine(  802): make
I/bluedroid(  802): get_profile_interface handsfree
E/bt-btif (  802): btif_enable_service: current services:0x100040
D/A2dpService(  802): Received start request. Starting profile...
D/A2dpStateMachine(  802): make
I/bluedroid(  802): get_profile_interface a2dp
I/GKI_LINUX(  802): gki_task_entry: gki_task_entry task_id=2 [A2DP-MEDIA] starting
E/bt-btif (  802): btif_enable_service: current services:0x140040
D/A2dpStateMachine(  802): Enter Disconnected: -2
D/HidService(  802): Received start request. Starting profile...
I/bluedroid(  802): get_profile_interface hidhost
E/bt-btif (  802): btif_enable_service: current services:0x140040
D/BluetoothAdapterService(  802): Profile still not running:com.android.bluetooth.hdp.HealthService
D/HeadsetPhoneState(  802): sendDeviceStateChanged. mService=0 mSignal=0 mRoam=0 mBatteryCharge=4
D/HealthService(  802): Received start request. Starting profile...
I/bluedroid(  802): get_profile_interface health
D/BluetoothAdapterService(  802): Profile still not running:com.android.bluetooth.hdp.HealthService
D/BluetoothAdapterService(  802): Profile still not running:com.android.bluetooth.hdp.HealthService
D/PanService(  802): Received start request. Starting profile...
D/BluetoothPanServiceJni(  802): initializeNative(L110): pan
I/bluedroid(  802): get_profile_interface pan
D/BluetoothAdapterService(  802): Profile still not running:com.android.bluetooth.pan.PanService
I/bluedroid(  802): enable
I/bt_hci_bdroid(  802): init
I/bt_vendor(  802): init
I/bt_vnd_conf(  802): Attempt to load conf from /etc/bluetooth/bt_vendor.conf
I/bt_vnd_conf(  802): vnd_load_conf file >/etc/bluetooth/bt_vendor.conf< not found
D/bt_vendor(  802): op for 5
I/bt_hci_bdroid(  802): bt_hc_worker_thread started
D/bt_vendor(  802): op for 0
D/bt_upio (  802): is_emulator_context : 0
D/bt_upio (  802): is_rfkill_disabled ? [0]
D/bt_upio (  802): Delay 500ms for bluetooth power up
D/bt_vendor(  802): op for 0
D/bt_upio (  802): is_emulator_context : 0
D/bt_upio (  802): is_rfkill_disabled ? [0]
D/bt_upio (  802): Delay 500ms for bluetooth power up
D/bt_vendor(  802): op for 3
I/bt_userial_vendor(  802): userial vendor open: opening /dev/ttyS0
I/bt_userial_vendor(  802): device fd = 79 open
I/GKI_LINUX(  802): gki_task_entry: gki_task_entry task_id=0 [BTU] starting
D/bt_vendor(  802): op for 1
I/bt_hwcfg(  802): bt vendor lib: set UART baud 1500000
D/bt_hwcfg(  802): Chipset BCM20702A
D/bt_hwcfg(  802): Target name = [BCM20702A]
I/bt_hwcfg(  802): BT module name is: ap6210
I/bt_hwcfg(  802): Target HCD file name is: bcm20710a1.hcd
I/bt_hwcfg(  802): Found patchfile: /vendor/firmware//bcm20710a1.hcd
I/bt_hwcfg(  802): bt vendor lib: set UART baud 115200
D/bt_hwcfg(  802): Settlement delay -- 100 ms
I/bt_hwcfg(  802): bt vendor lib: set UART baud 1500000
I/bt_hwcfg(  802): Setting local bd addr to 54:04:05:C1:02:FE
I/bt_hwcfg(  802): vendor lib fwcfg completed
I/        (  802): BTE_InitTraceLevels -- TRC_HCI
I/        (  802): BTE_InitTraceLevels -- TRC_L2CAP
I/        (  802): BTE_InitTraceLevels -- TRC_RFCOMM
I/        (  802): BTE_InitTraceLevels -- TRC_AVDT
I/        (  802): BTE_InitTraceLevels -- TRC_AVRC
I/        (  802): BTE_InitTraceLevels -- TRC_A2D
I/        (  802): BTE_InitTraceLevels -- TRC_BNEP
I/        (  802): BTE_InitTraceLevels -- TRC_BTM
I/        (  802): BTE_InitTraceLevels -- TRC_PAN
I/        (  802): BTE_InitTraceLevels -- TRC_SDP
I/        (  802): BTE_InitTraceLevels -- TRC_BTAPP
I/        (  802): BTE_InitTraceLevels -- TRC_BTIF
E/bt-btif (  802): Calling BTA_HhEnable
E/bt-btif (  802): ## btif_config_get assert section && *section && key && *key && name && *name && bytes && type failed at line:182 ##
E/bt-btif (  802): btif_storage_get_adapter_property service_mask:0x140040
D/BluetoothManagerService(  364): Bluetooth Adapter name changed to ABC
D/BluetoothManagerService(  364): Stored Bluetooth name: ABC
D/bt_vendor(  802): op for 2
I/bt_hwcfg(  802): SCO PCM configure {0, 1, 0, 0, 0}
D/bt_vendor(  802): op for 6
D/        (  802): bta_pan_co_init
I/bte_conf(  802): Attempt to load did conf from /etc/bluetooth/bt_did.conf
I/bte_conf(  802): [1] primary_record=1 vendor_id=0x000F vendor_id_source=0x0001 product_id=0x1200 version=0x1436
I/bte_conf(  802): Attempt to load did conf from /etc/bluetooth/bt_did.conf
I/bte_conf(  802): Attempt to load did conf from /etc/bluetooth/bt_did.conf
E/bt-btif (  802): ## btif_config_get assert section && *section && key && *key && name && *name && bytes && type failed at line:182 ##
D/BluetoothAdapterProperties(  802): ScanMode =  20
D/BluetoothAdapterProperties(  802): State =  11
D/BluetoothPanServiceJni(  802): control_state_callback(L61): state:0, local_role:0, ifname:bt-pan
D/BluetoothAdapterService(  802): Broadcasting updateAdapterState() to 1 receivers.
D/bt_vendor(  802): op for 7
D/bt_upio (  802): proc btwrite assertion
D/bt_vendor(  802): op for 7
D/bt_upio (  802): BT_WAKE is asserted already
D/BluetoothManagerService(  364): Message: MESSAGE_BLUETOOTH_STATE_CHANGE
D/bt_vendor(  802): op for 7
D/bt_upio (  802): BT_WAKE is asserted already
D/bt_vendor(  802): op for 7
D/bt_upio (  802): BT_WAKE is asserted already
D/BluetoothAdapterService(1109812520)(  802): getState(): mAdapterProperties: com.android.bluetooth.btservice.AdapterProperties@4228f650
D/BluetoothManagerService(  364): MESSAGE_BLUETOOTH_STATE_CHANGE: prevState = 11, newState=12
D/BluetoothManagerService(  364): Broadcasting onBluetoothStateChange(true) to 9 receivers.
D/BluetoothHeadset(  703): onBluetoothStateChange: up=true
D/BluetoothInputDevice(  703): onBluetoothStateChange: up=true
D/BluetoothAdapterService(1109812520)(  802): Get Bonded Devices being called
D/BluetoothHeadset(  703): Proxy object connected
D/HeadsetProfile(  703): Bluetooth service connected
D/BluetoothAdapterService(1109812520)(  802): Get Bonded Devices being called
D/BluetoothAdapterService(1109812520)(  802): getState(): mAdapterProperties: com.android.bluetooth.btservice.AdapterProperties@4228f650
D/BluetoothPbap(  703): onBluetoothStateChange: up=true
D/BluetoothInputDevice(  703): Proxy object connected
D/HidProfile(  703): Bluetooth service connected
D/BluetoothA2dp(  364): onBluetoothStateChange: up=true
W/ContextImpl(  703): Calling a method in the system process without a qualified user: android.app.ContextImpl.bindService:1415 android.content.ContextWrapper.bindService:473 android.bluetooth.BluetoothHeadset$1.onBluetoothStateChange:244 android.bluetooth.IBluetoothStateChangeCallback$Stub.onTransact:55 android.os.Binder.execTransact:351 
W/ContextImpl(  703): Calling a method in the system process without a qualified user: android.app.ContextImpl.bindService:1415 android.content.ContextWrapper.bindService:473 android.bluetooth.BluetoothInputDevice$1.onBluetoothStateChange:209 android.bluetooth.IBluetoothStateChangeCallback$Stub.onTransact:55 android.os.Binder.execTransact:351 
W/ContextImpl(  703): Calling a method in the system process without a qualified user: android.app.ContextImpl.bindService:1415 android.content.ContextWrapper.bindService:473 android.bluetooth.BluetoothPbap$1.onBluetoothStateChange:132 android.bluetooth.IBluetoothStateChangeCallback$Stub.onTransact:55 android.os.Binder.execTransact:351 
W/ContextImpl(  364): Calling a method in the system process without a qualified user: android.app.ContextImpl.bindService:1415 android.bluetooth.BluetoothA2dp$1.onBluetoothStateChange:131 com.android.server.BluetoothManagerService.sendBluetoothStateCallback:575 com.android.server.BluetoothManagerService.bluetoothStateChangeHandler:1189 com.android.server.BluetoothManagerService.access$3000:47 
D/BluetoothHeadset(  364): onBluetoothStateChange: up=true
D/BluetoothA2dp(  364): Proxy object connected
D/BluetoothAdapterService(1109812520)(  802): getState(): mAdapterProperties: com.android.bluetooth.btservice.AdapterProperties@4228f650
D/BluetoothHeadset(  546): onBluetoothStateChange: up=true
D/bt_vendor(  802): op for 7
D/bt_upio (  802): BT_WAKE is asserted already
D/BluetoothHeadset(  364): Proxy object connected
D/bt_vendor(  802): op for 7
D/bt_upio (  802): BT_WAKE is asserted already
D/bt_vendor(  802): op for 7
D/bt_upio (  802): BT_WAKE is asserted already
D/BluetoothAdapterService(1109812520)(  802): getState(): mAdapterProperties: com.android.bluetooth.btservice.AdapterProperties@4228f650
D/bt_vendor(  802): op for 7
D/bt_upio (  802): BT_WAKE is asserted already
E/bt_h4   (  802): vendor lib postload completed
D/BluetoothHeadset(  546): Proxy object connected
D/BluetoothPan(  703): onBluetoothStateChange(on) call bindService
W/ContextImpl(  364): Calling a method in the system process without a qualified user: android.app.ContextImpl.bindService:1415 android.bluetooth.BluetoothHeadset$1.onBluetoothStateChange:244 com.android.server.BluetoothManagerService.sendBluetoothStateCallback:575 com.android.server.BluetoothManagerService.bluetoothStateChangeHandler:1189 com.android.server.BluetoothManagerService.access$3000:47 
W/ContextImpl(  703): Calling a method in the system process without a qualified user: android.app.ContextImpl.bindService:1415 android.content.ContextWrapper.bindService:473 android.bluetooth.BluetoothPan$1.onBluetoothStateChange:173 android.bluetooth.IBluetoothStateChangeCallback$Stub.onTransact:55 android.os.Binder.execTransact:351 
D/bt_vendor(  802): op for 7
D/bt_upio (  802): BT_WAKE is asserted already
D/BluetoothPan(  703): BluetoothPan(), bindService called
D/BluetoothPan(  703): BluetoothPAN Proxy object connected
D/PanProfile(  703): Bluetooth service connected
D/BluetoothHeadset(  546): onBluetoothStateChange: up=true
D/bt_vendor(  802): op for 7
D/bt_upio (  802): BT_WAKE is asserted already
D/bt_vendor(  802): op for 7
D/bt_upio (  802): BT_WAKE is asserted already
D/bt_vendor(  802): op for 7
D/bt_upio (  802): BT_WAKE is asserted already
D/bt_vendor(  802): op for 7
D/bt_upio (  802): BT_WAKE is asserted already
D/bt_vendor(  802): op for 7
D/bt_upio (  802): BT_WAKE is asserted already
D/BluetoothHeadset(  546): Proxy object connected
D/BluetoothA2dp(  703): onBluetoothStateChange: up=true
D/bt_vendor(  802): op for 7
D/bt_upio (  802): BT_WAKE is asserted already
D/CallNotifier(  546): - Got BluetoothHeadset: android.bluetooth.BluetoothHeadset@4223eba0
W/ContextImpl(  703): Calling a method in the system process without a qualified user: android.app.ContextImpl.bindService:1415 android.content.ContextWrapper.bindService:473 android.bluetooth.BluetoothA2dp$1.onBluetoothStateChange:131 android.bluetooth.IBluetoothStateChangeCallback$Stub.onTransact:55 android.os.Binder.execTransact:351 
D/BluetoothA2dp(  703): Proxy object connected
D/BluetoothManagerService(  364): Bluetooth State Change Intent: 11 -> 12
D/A2dpProfile(  703): Bluetooth service connected
D/bt_vendor(  802): op for 7
D/bt_upio (  802): BT_WAKE is asserted already
D/bt_vendor(  802): op for 7
D/bt_upio (  802): BT_WAKE is asserted already
D/BluetoothAdapterService(1109812520)(  802): getState(): mAdapterProperties: com.android.bluetooth.btservice.AdapterProperties@4228f650
D/bt_vendor(  802): op for 7
D/bt_upio (  802): BT_WAKE is asserted already
D/BluetoothAdapterService(1109812520)(  802): getState(): mAdapterProperties: com.android.bluetooth.btservice.AdapterProperties@4228f650
D/BluetoothAdapterService(1109812520)(  802): Get Bonded Devices being called
D/bt_vendor(  802): op for 7
D/bt_upio (  802): BT_WAKE is asserted already
D/bt_vendor(  802): op for 7
D/bt_upio (  802): BT_WAKE is asserted already
D/BluetoothAdapterService(1109812520)(  802): getState(): mAdapterProperties: com.android.bluetooth.btservice.AdapterProperties@4228f650
D/bt_vendor(  802): op for 7
D/bt_upio (  802): BT_WAKE is asserted already
D/BluetoothAdapterService(1109812520)(  802): Get Bonded Devices being called
D/bt_vendor(  802): op for 7
D/bt_upio (  802): BT_WAKE is asserted already
D/bt_vendor(  802): op for 7
D/bt_upio (  802): BT_WAKE is asserted already
W/ContextImpl(  703): Calling a method in the system process without a qualified user: android.app.ContextImpl.startService:1361 android.content.ContextWrapper.startService:450 android.content.ContextWrapper.startService:450 com.android.settings.bluetooth.DockEventReceiver.beginStartingService:134 com.android.settings.bluetooth.DockEventReceiver.onReceive:115 
D/bt_vendor(  802): op for 7
D/bt_upio (  802): BT_WAKE is asserted already
D/bt_vendor(  802): op for 7
D/bt_upio (  802): BT_WAKE is asserted already
D/bt_vendor(  802): op for 7
D/bt_upio (  802): BT_WAKE is asserted already
D/BluetoothAdapterService(1109812520)(  802): getState(): mAdapterProperties: com.android.bluetooth.btservice.AdapterProperties@4228f650
D/BluetoothManagerService(  364): checkIfCallerIsForegroundUser: valid=true callingUser=0 foregroundUser=0
W/BluetoothAdapter(  802): getBluetoothService() called with no BluetoothManagerCallback
E/BluetoothServiceJni(  802): SOCK FLAG = 1 ***********************
D/bt_vendor(  802): op for 7
D/bt_upio (  802): BT_WAKE is asserted already
D/DockEventReceiver(  703): finishStartingService: stopping service
D/BluetoothAdapterService(1109812520)(  802): getState(): mAdapterProperties: com.android.bluetooth.btservice.AdapterProperties@4228f650
D/dalvikvm(  364): GC_CONCURRENT freed 906K, 13% free 8034K/9136K, paused 3ms+7ms, total 84ms
D/BluetoothPbap(  703): Proxy object connected
D/PbapServerProfile(  703): Bluetooth service connected
D/BluetoothManagerService(  364): checkIfCallerIsForegroundUser: valid=true callingUser=0 foregroundUser=0
W/BluetoothAdapter(  802): getBluetoothService() called with no BluetoothManagerCallback
E/BluetoothServiceJni(  802): SOCK FLAG = 0 ***********************
D/bt_vendor(  802): op for 7
D/bt_upio (  802): BT_WAKE is asserted already
I/BtOppRfcommListener(  802): Accept thread started.
D/AudioHardware(  107): AudioHardware pcm playback is going to standby.
I/alsa_mix(  107): -->Playback Path access 3
D/AudioHardware(  107): closePcmOut_l() mPcmOpenCnt: 1
D/bt_vendor(  802): op for 7
E/Lights  (  364): write_int failed to open sys/class/leds/battery_led/brightness
D/bt_upio (  802): ..proc_btwrite_timeout..
I/AudioService(  364):  AudioFocus  abandonAudioFocus() from android.media.AudioManager@42243eb8com.android.music.MediaPlaybackService$3@42242aa8
I/ActivityManager(  364): Start proc com.android.musicfx for broadcast com.android.musicfx/.ControlPanelReceiver: pid=1320 uid=10023 gids={50023, 3003, 3002, 1028}
V/MusicFXControlPanelReceiver( 1320): onReceive
V/MusicFXControlPanelReceiver( 1320): Action: android.media.action.CLOSE_AUDIO_EFFECT_CONTROL_SESSION
V/MusicFXControlPanelReceiver( 1320): Package name: com.android.music
V/MusicFXControlPanelReceiver( 1320): Audio session: 8
V/MusicFXControlPanelEffect( 1320): closeSession(android.app.ReceiverRestrictedContext@4223a0c0, com.android.music, 8)
I/ActivityManager(  364): No longer want com.android.music (pid 858): empty #17


5. 开机静态LOGO的制作

取一张和屏幕分辨率一样的bmp或者png格式图片(其他格式应该也可以),用GIMP图片编辑器打开,在图像->模式->索引中,将最大颜色数量由256改成224,然后点击“转换”进行转换,接着 文件->导出,选择文件类型为ppm格式,然后导出,接着弹出的对话框选择ASCII码保存,即可生成ppm格式图片;

进入kernel/driver/video/logo中,找到logo_linux_clut224.ppm和logo_linux_clut224.c文件删除,刚才制作的图片重命名为logo_linux_clut224.ppm,然后编译kernel即可

注意生成的ppm图片比较大,但是编译出来的kernel是很小的。

全志平台第一张开机logo制作又不一样:

首先用ps打开bmp logo,在右边点击“通道”,如果显示的不是RGB,而是索引;那么在菜单 图像->模式中选择RGB颜色。这时候再看“通道”就可以显示RGB 红绿蓝图层了,但是还不行,点击”通道“旁边的按钮选择”新建通道“ ,默认名字alpha 1通道即可,这样红绿蓝图层后就多了一个alpha 1图层,将图片另存为bmp格式即可


编译RK4.2.2错误解决方法:

Copying: out/target/common/obj/APPS/ContactsProvider_intermediates/emma_out/lib/classes-jarjar.jar
错误:读取 out/target/common/obj/JAVA_LIBRARIES/core-tests_intermediates/javalib.jar 时出错;invalid header field
1 错误
Copying: out/target/common/obj/JAVA_LIBRARIES/android.test.runner_intermediates/noproguard.classes.dex
make: *** [out/target/common/obj/APPS/KeyChainTests_intermediates/classes-full-debug.jar] 错误 41
make: *** 正在等待未完成的任务....

解决:

$ cd out/target/common/obj/JAVA_LIBRARIES/core-tests_intermediates/

$ rm javalib.jar classes-full-debug.jar

$ sudo update-alternatives --config jar

有 2 个候选项可用于替换 jar (提供 /usr/bin/jar)。


  选择       路径                           优先级  状态
------------------------------------------------------------
* 0            /usr/bin/fastjar                  100       自动模式
  1            /usr/bin/fastjar                  100       手动模式
  2            /usr/lib/jvm/java-6-sun/bin/jar   63        手动模式


要维持当前值[*]请按回车键,或者键入选择的编号:2
update-alternatives: using /usr/lib/jvm/java-6-sun/bin/jar to provide /usr/bin/jar (jar) in 手动模式

$ croot

$ make -j4

完毕!


RK system.img 的打包方法:

./out/host/linux-x86/bin/make_ext4fs -s  -l 536870912 -a system out/target/product/rk30sdk/obj/PACKAGING/systemimage_intermediates/system.img out/target/product/rk30sdk/system


RK lcd参数配置:

新曾一个LCD,在kernel/drivers/video/rockchip/screen中增加一个文件如lcd_ZS070IH5030B3H7.c,lcd.h是自动生成的,具体看Makefile文件

其中一些参数的意义:

#define OUT_FORMAT      LVDS_8BIT_2 
#define OUT_FACE OUT_P888//OUT_D888_P666  
#define OUT_CLK 65000000 // LCD _DCLK
#define LCDC_ACLK        500000000//312000000           //29 lcdc axi DMA 频率
 
/* Timing */
#define H_PW 10              //同步信号宽度
#define H_BP 150//160     //同步信号后消隐
#define H_VD 1024          //可视区域
#define H_FP 160            //同步信号前清隐
 
#define V_PW 10
#define V_BP 13//25
#define V_VD 768
#define V_FP 15
 
#define LCD_WIDTH       162             //LCD可视区域物理宽度(mm)
#define LCD_HEIGHT      121    //LCD可视区域物理高度(mm)
 
...
 
#define S_DCLK_POL       0   //双屏时 DCLK反向
 
/* Other */
#define DCLK_POL 0          // LCD DCLK 反向
#define SWAP_RB 0          // LCD 红绿颜色交换
 
 
调试scaler参数(lcd上显示有横线等时序出错的现象)
cd ./sys/devices/platform/rk29_i2c.1/i2c-1/1--40/
catreg_ctl
屏驱动中的S_V_ST={reg[0x14],reg[13]};
echo13xx>reg_ctl(向0x13寄存器写入值xx);
echo14xx>reg_ctl(向0x14寄存器写入值xx)
 
 
RGB屏定义:
#defineOUT_TYPE SCREEN_RGB
LVDS屏定义:
#defineOUT_TYPE SCREEN_LVDS //LVDS屏要配成SCREEN_LVDS
#defineOUT_FORMAT LVDS_8BIT_2 //LVDS的接线方式
Scaler时钟反向:
#defineDCLK_POL 0 //bypass显示时,画面抖动,可以尝试将这个取反
#defineS_DCLK_POL 0 //当双屏显示画面抖动时,可以尝试将这个取反
 
查看/sys/class/hdmi/hdmi-0/state
/sys/class/hdmi/hdmi-0/enable
 
发现屏的显示有问题,先查一下外围环境是否正常。再作软件调节:
解锁屏闪、开机屏闪,可以延时一下背光。
屏闪、屏抖,可以修改一下帧率,时序。
clk = v_tal * h_tal * m hz  
延时可以调时序,也可以避免不稳定的信号。
有些屏,每次初始化都会关背光,可能跟屏有关。
有些屏,供电过低,会导致上电时白屏,可以调节一下电压。

RK3026 android4.2修改kernel logo:

#pngtopnm logo_linux_clut224.png>logo_linux.pnm

#pnmquant 224 logo_linux.pnm > logo_linux_224.pnm
#pnmtoplainpnm logo_linux_224.pnm>logo_linux_clut224.ppm 


RK3126 android4.4.4的调试问题:

kernel启动logo的制作,用PS制作bmp图片时候要在菜单 图像->模式中选索引颜色,弹出的确定用默认值即可,保存时候选window和8位

否则制作出来的logo混乱;

recovery和充电logo转了180度,修改device中BOARD_HAS_FLIPPED_SCREEN即可,不过记得要进到bootable/recovery/minui中去mm -B;然后到bootable/recovery/中 mm -B,否则不生效啊

RK g-sensor方向调试:

最好的办法是在上报ABS_X,ABS_Y,ABS_Z中打印出上报的xyz三个值,把平板平放桌面上,xy值接近或等于0,z接近98000;

y轴竖起与桌面垂直,xz接近0,y接近98000;x轴竖起与桌面垂直,yz接近0,X接近98000;

一般要修改的地方:xyz为负数,上报时候加上-号即可;xy对调了,那么ABS_X上报y的值,ABS_Y上报x的值即可



你可能感兴趣的:(RK3188笔记)