高通开发笔记

1.CIT暗码:*#*#00#*#*,*#*#564548#*#*  *#889#

2.修改TP方向:echo 1 > sys/class/input/input0/device/flipx

3.修改手机方向分辨率:
    编译:device/qcom/d801/system.prop(ro.sf.lcd_density = 120  (没有就自己添加,120是240X320))
    persist.panel.orientation = 180    
    手机:system/build.prop修改权限644
4.搜索目录下文件中的字符串:grep -nr "mdss_wb_panel" ./arch/arm/boot/dts/
  搜索grep -r --include=*.c "qcom,camera-led-flash" .
5.反编译设备树文件product/q39/obj/KERNEL_OBJ$  ./scripts/dtc/dtc -I dtb -O dts -o ABC.dts arch/arm64/boot/dts/q39.dtb
6.手机的照片存储位置:adb pull /storage/sdcard0/DCIM/Camera/
            截屏的照片    ?/?/Pictures/Screenshots
7.使能虚拟按键:device/qcom/d801/ overlay/frameworks/base/core/res/res/values/config.xml    
        +   <bool name="config_showNavigationBar">true</bool> 
        build.prop  +  qemu.hw.mainkeys=0

8.固化TP方向参数:device/qcom/d801/init.target.rc
        +    write /sys/class/input/input1/device/flipx 1

9.修改logo图片: device/qcom/d801/logo.png,使用 python logo_gen.py logo.png生成splash.img下载splash.img,device/qcom/common/display/logo
10.在d801_defconfig中添加CONFIG_ARCH_MSM8226_D801=y,
需要在arch/arm/mach-msm/Kconfig中添加:才能使用
config ARCH_MSM8226_D801
       depends on ARCH_MSM8226
       default n
       bool "D801 product"
       help
         Macro for the MSM8226 D801 product

若添加CONFIG_TOUCHSCREEN_HANVON0868=y,
需要在drivers/input/touchscreen/Kconfig中添加才能使用
config TOUCHSCREEN_HANVON0868
       tristate "HANVON0868 I2C touchscreen"
       depends on I2C
       help
         Say Y here if you have a HANVON0868 I2C touchscreen
         connected to your system.

         If unsure, say N.

         To compile this driver as a module, choose M here: the
         module will be called hanvon0868.

11. TP固件firmware位置 ./device/qcom/d508/HD508-A-s3202_PR1521505.img

12. sensor不检查g-sensor
    sensors_qcom_hal.c------>_hal_sensors_get_sensors_list()
        // hal_sam_add_sensor_fusion_sensors();
        //hal_sam_add_step_detector_sensor();
        // hal_sam_add_step_counter_sensor();
13. 编译模块:mmm有Android.mk的目录vendor/qcom/proprietary/sensors/dsps/libhalsensors
13. SD卡自动检测:
    d801.dtsi add:
    &sdhc_2 {
        interrupt-map = <0 &intc 0 125 0
                1 &intc 0 221 0
                2 &msmgpio 51 0x3>;
        cd-gpios = <&msmgpio 51 0x1>;
    };
    board-8226-gpiomux.c msm_gpiomux_config sd_card_det __initdata  

14. PWM方式背光闪屏: 
    qpnp-pwm.c中去掉mdelay(1)
    
15. 按键键值映射:
    进入adb shell,输入getevent,按下按键 ,查看键值和设备,去代码中找
16. 组合键进入fastboot模式: bootable/bootloader/lk/app/aboot/aboot.c--->aboot_init()
17. app通过driver创建的开关控制节点device/qcom/d801/system.prop----->>>persist.sys.elecscreen.path=/sys/class/hanvon/hanvon0868/hanvon_state
19. 修改device/qcom/d801/overly/frameworks/base/core/res/res/values/config.xml
    使用命令:mmm frameworks/base/core/res/ 编译生成out/target/product/d801/system/framework/framework-res.apk
    push到手机:adb push framework-res.apk system/framework/
    重启

21 sensor测试命令   sns_cm_test -r 20 -d 1 -s 40 -t 0 
22. Setting添加新选项device/qcom/d801/overlay/packages/apps/Settings/res/values/bools.xml
    编译: mmm packages/apps/Settings/
    下载: adb push system/priv-app/Settings.apk system/priv-app/
23. otg设备树在msm8226.dtsi   usb_otg: usb@f9a55000

24. 
sudo vim /etc/udev/rules.d/70-Android.rules
sudo chmod a+rx /etc/udev/rules.d/70-Android.rules
手机Permission
adb shell setprop service.adb.root 1
vi ~/.android/adb_usb.ini
sudo adb kill-server
adb shell
修改SELinux 命令adb remount;adb shell;setenforce 0   查看命令getenforce.  如果root下仍不能向手机push,可以关闭SELinux试试

25. GPS代码hardware/qcom/gps/etc

26. 添加fastboot模式logo
进入fastboot模式是从bootable/bootloader/lk/app/aboot/aboot.c fastboot_init()函数开始进入的,只要在这个函数中添加图片即可。
添加图片code:
    struct fbimage *fbimg= NULL;
    struct fbimage default_fbimg = {0};
    fbcon_clear();//清屏
    fbimg = &default_fbimg;
    fbimg->header.width = SPLASH_IMAGE_HEIGHT;
    fbimg->header.height = SPLASH_IMAGE_WIDTH;
    fbimg->image = (unsigned char *)imageBuffer_rgb888;
    fbcon_putImage(fbimg, false);//可以在代码中搜一下,参考其它地方的用法使用;

27.抓log
ADB log (adb logcat -v time) 
radio log (adb logcat -b radio -v time) 
event log (adb logcat -b events -v time) 
adb shell cat proc/kmsg > ~/log/kernel.log
adb shell logcat -v time > adb.log
adb shell logcat -b events -v time > event.log
cat proc/kmsg > /data/nt35596.txt &
28.触摸屏自动旋转
驱动probe函数中添加
#ifdef INPUT_PROP_DIRECT
__set_bit(INPUT_PROP_DIRECT, input->propbit); 
#endif
在framesworks/base/services/input/InputReader.cpp中TouchInputMapper::configureParameters()中会根据它将
deviceType设置成DEVICE_TYPE_TOUCH_SCREEN

29. 串口测试:
  把mytty 放到手机system/bin/
  执行命令mytty ttyHSL1 RW //RW是随便写的,r只读,w只写,为空会错误,其它不为空就行

30. 高通sim卡热插拔
配置GPIO的文件,Non-HLOS/modem_proc/uim/uimdrv/src/hw/gpio_tlmm/uimdrv_gpio.c,搜索CARD_DETECT_GPIO
Please first make sure your HW detect GPIO work normal. 
Then this NV70210 need match HW detect GPIO. 
Set NV70210 
hw_config.uim[0].ENABLE_UIM_HOTSWAP: TRUE 
hw_config.UIM[0].UIM_HOTSWAP_POLARITY: ACTIVE_HIGH 
hw_config.UIM[0].UIM_CARD_DETECT_GPIO_NUM:1----->This your detect GPIO num 
hw_config.UIM[0].UIM_CARD_DETECT_GPIO_FUNC_SELECTION:0 
hw_config.UIM[0].UIM_CARD_DETECT_GPIO_DRV_STRENGTH: 2MA 
hw_config.UIM[0].UIM_CARD_DETECT_PULL_SETTING: No pull 

31. 获取framebuff  screencap /data/1.png

32. nt35596 在kernel和lk中0x51寄存器的值不同,lk是 0x7F,kernel是0x00
33. KTD2598要求PWM输入频率5--100KHZ
34. KTD2151读取寄存器协议不同
35. r61322初始化指令是最后方29,11,而且在lk中的命令格式为4位0x11, 0x00, 0x05, 0x80

37. 修改设备节点权限:system/core/rootdir/项目对应的init.rc
38. 系统通过led_brightness_store设置背光 
39. 自动生成.dtsi和.h文件的命令: device/qcom/common/display/tools$ perl parser.pl panel_nt35596_1080p_skuk_video.xml panel

40. 高通设置vendor/qcom/proprietary/QualcommSettings
41. 编译配置: . build/envsetup.sh, choosecombo选release,输入msm8916_64,选eng
42. 提交代码的时候删除尾部空格,在VI中如人如下命令操作即可。空格:%s/\s\+$//g
70. vim 删除列   %s/\%1c...// 
43. 按power按键命令:input keyevent POWER
44. system关闭cabc,修改system.prop 中   ro.qualcomm.cabl=2
45. 修改board信息:
    找到target对应项目的init.c里面void target_detect(struct board_data *board)
    board->platform_hw = 0x20;
    board->platform_subtyp = 1; 
46. 进download模式: adb reboot edl

48.     打开q39的build/envsetup.sh,找到java的环境变量
    export JAVA_HOME=/usr/lib/jvm/java-7-openjdk-amd64
    export JRE_HOME=/usr/lib/jvm/java-7-openjdk-amd64/jre
    export PATH=$JAVA_HOME/bin:$JAVA_HOME/jre/bin:$PATH
    export CLASSPATH=$CLASSPATH:.:$JAVA_HOME/lib:$JAVA_HOME/jre/lib
    在/CTS/android-cts/tools直接粘贴后按回车执行
    /CTS/android-cts/tools$export JAVA_HOME=/usr/lib/jvm/java-7-openjdk-amd64
    export JRE_HOME=/usr/lib/jvm/java-7-openjdk-amd64/jre
    export PATH=$JAVA_HOME/bin:$JAVA_HOME/jre/bin:$PATH
    export CLASSPATH=$CLASSPATH:.:$JAVA_HOME/lib:$JAVA_HOME/jre/lib
    使用java -version命令查看cts版本,之后就可以用了 

    在android-cts/repository/plans目录中一项一项的做
    android-cts/tools$ ./cts-tradefed
    run cts --plan Android -l INFO

    run cts -p packageName --disable-reboot
    run cts -c className --disable-reboot
49. logtools 存储位置 storage/sdcard0/logs/
50. external/sepolicy       git reset --hard 4a623715659a9c13ef292720bbcc066763bed2e5
    device/qcom/sepolicy/common             git reset --hard aa6104d70592c61bed839db3047175cc1d698bb5
    http://blog.csdn.net/modianwutong/article/details/43114883

51.CTS android.aadb 设置Select time zone GMT-07:00 Pacific Daylight Time
       android.admin 安装CtsDeviceAdmin.apk 只active前两项
52. 让上报的键值有效,需要gtp_request_input_dev中input_set_capability(ts->input_dev, EV_KEY, KEY_F13);
53. adb shell monkey -v --ignore-timeouts --ignore-crashes --ignore-security-exceptions -s 100 --throttle 500 2000000 | tee monkey.log
54. 高通下载代码网站:  www.codeaurora.org
55. sensor设备节点:  sys/class/sensors
56. sensor hal层修改: hardware/qcom/sensors

57. vim packages/tools/CIT/src/com/android/sim/testitem/RangeSensor.java
58. r61322 0x210000    nt35596    0xFF0A
59. vendor/qcom/opensource/wlan/prima/CORE/VOSS/src/vos_nvitem.c
    vendor/qcom/opensource/wlan/prima#mmm
    system/lib/modules/pronto/pronto_wlan.ko 

60. adb push lib/sensors.msm8916.so system/lib/hw/
    adb push lib64/sensors.msm8916.so system/lib64/hw/ 

61. Q39: Donot twinkle when turn off screen.
    Change-Id: I2ad1fd6564c2f5078c0ebf64640fdd548cb084ae

62. bootable/bootloader/lk/platform/msm8916_64/acpuclock.c----------->mdp_clock_enable()---->clk_get_set_enable

63. 长按power reset中断配置
&spmi_bus {
    qcom,pm8916@0 {
        pm8916_pon: qcom,power-on@800 {
            interrupts = <0x0 0x8 0x0>,
                        <0x0 0x8 0x1>,
                        <0x0 0x8 0x3>;
                 interrupt-names = "kpdpwr", "resin", "kpdpwr-bark";

            qcom,pon_1 {
                qcom,pon-type = <0>;
                qcom,support-reset = <1>;
                qcom,pull-up = <1>;
                qcom,s1-timer = <6720>;
                qcom,s2-timer = <2000>;
                qcom,s2-type = <7>;
                qcom,use-bark;
            };
        };
    };
};

会走drivers/platform/msm/qpnp-power-on.c-------->>>qpnp_kpdpwr_bark_irq,在此设置全局变量标志,在mdss_dsi_panel_bl_ctrl中判断,如果复位就将背光level设置为0

64. adb shell cat proc/cmdline
65. 判断用那个lcd     if(bl_level != 0 && strcmp(pinfo->panel_name, "nt35596 auo 1080p pwm video mode dsi panel skuk"))
66. 一般ic写入寄存器进入关闭后要保持reset 高,否则将退出之前设定的状态
66. HAL   http://blog.csdn.net/luoshengyang/article/details/6567257
67. gerrit上platform/vendor/qcom/s201就是代码device/qcom/s201
68. 登录服务器: ssh [email protected],密码: 123
69. dcs pwm freq  control by 0x08

80. /sys/class/leds/lcd-backlight # cat brightness
90. 自动背光去抖时间frameworks/base/services/core/java/com/android/server/display/AutomaticBrightnessController.java     BRIGHTENING_LIGHT_DEBOUNCE 
91. 查看gerrit修改 gitk .
92. 开机启动服务 device/qcom/q39/init.target.rc   例如service thermal-engine /system/bin/thermal-engine -r
93.中断详细介绍  http://www.wowotech.net/irq_subsystem/request_threaded_irq.html
    kernel/include/linux/interrupt.h中断触发方式值
94. clk节点: sys/kernel/debug/clk/gp1_clk_src
95. gpio节点: sys/kernel/debug # cat gpio
96. 8909 dtsi中的gpio号和.c 文件中的gpio值相差939-28=911
97. tp idc文件http://blog.csdn.net/wh_19910525/article/details/10828025
98. 修改整个目录权限:chmod -R 777 3/
99. 按键映射: frameworks/base/data/keyboards/Generic.kl
        device/qcom/s600/gpio-keys.kl
    按键驱动:compatible = "gpio-matrix-keypad";
        drivers/input/keyboard/matrix_keypad.c
100. 删除当前目录下所有文件: rm -r *
101. 打开当前文件夹 nautilus .
102. 从源码中查看基线版本: AMSS或Non-HLOS$ 目录下about.html  查找common
103. CIT代码路径:packages/apps/CIT/src/sim/android/cit/ 
104. 命令集:将要执行的命令写入.sh 脚本,然后执行sh systrace.sh即可
105. perl CheckCompositionType_v1.2.pl > sf.dump

--- a/services/core/java/com/android/server/display/RampAnimator.java
+++ b/services/core/java/com/android/server/display/RampAnimator.java
@@ -145,7 +145,7 @@ final class RampAnimator<T> {
                 // Animation off.
                 mAnimatedValue = mTargetValue;
             } else {
-                final float amount = timeDelta * mRate / scale;
+                final float amount = timeDelta * mRate / scale + 2;


please use follow cmd cat a kernel log:
adb shell cat proc/kmsg > kernel.log
http://blog.csdn.net/allen6268198/article/details/8112551
http://demo.netfoucs.com/fybon/article/details/18185441

你可能感兴趣的:(高通开发笔记)