MT6580 Android N TP 调试
1.硬件电路
如下图所示,主要是iic、rst、int、avdd的配置。
2.kernel 配置
2.1config配置
以下一墩泰TP为例:
vim kernel-3.18/arch/arm/configs/zechin6580_we_n_debug_defconfig
vim kernel-3.18/arch/arm/configs/zechin6580_we_n_debug_defconfig
CONFIG_TOUCHSCREEN_MTK_FT5206=y
2.2driver code移植
kernel-3.18/drivers/input/touchscreen/mediatek/
+FT5206/
修改同级目录下的Makefile和Kconfig。把供应商提供的源码嵌入平台。
vim kernel-3.18/drivers/input/touchscreen/mediatek/Makefile
obj-$(CONFIG_TOUCHSCREEN_MTK_FT5206) += ft5206/
vim kernel-3.18/drivers/input/touchscreen/mediatek/Kconfig
config TOUCHSCREEN_MTK_FT5206
bool "FT5206 for Mediatek package" default n
help
Say Y here if you have FT5206 touch panel.
If unsure, say N. To compile this dirver as a module, choose M here: the module will be called. source "drivers/input/touchscreen/mediatek/ft5206/Kconfig"
2.3DTS配置
vim kernel-3.18/arch/arm/boot/dts/zechin6580_we_n.dts
/* TOUCH GPIO standardization */
&touch {
tpd-resolution = <720 1280>; use-tpd-button = <0>;
tpd-key-num = <3>;
tpd-key-local= <158 172 139 0>;
tpd-key-dim-local = <80 900 40 20 240 900 40 20 400 900 40 20 0 0 0 0>;
tpd-max-touch-num = <5>;
tpd-filter-enable = <0>;
tpd-filter-pixel-density = <124>;
tpd-filter-custom-prameters = <0 0 0 0 0 0 0 0 0 0 0 0>;
tpd-filter-custom-speed = <0 0 0>;
pinctrl-names = "default", "state_eint_as_int", "state_eint_output0", "state_eint_output1", "state_rst_output0", "state_rst_output1";
pinctrl-0 = <&ctp_pins_default>;
pinctrl-1 = <&ctp_pins_eint_as_int>;
pinctrl-2 = <&ctp_pins_eint_output0>;
pinctrl-3 = <&ctp_pins_eint_output1>;
pinctrl-4 = <&ctp_pins_rst_output0>;
pinctrl-5 = <&ctp_pins_rst_output1>; status = "okay";
};
&pio {
ctp_pins_default: toucheint5default {
};
ctp_pins_eint_as_int: toucheint@5 {
pins_cmd_dat {
pins = <PINMUX_GPIO5__FUNC_EINT5>; slew-rate = <0>;
bias-disable;
};
};
ctp_pins_eint_output0: eintoutput0 {
pins_cmd_dat {
pins = <PINMUX_GPIO5__FUNC_GPIO5>; slew-rate = <0>;
};
};
ctp_pins_eint_output1: eintoutput1 {
pins_cmd_dat {
pins = <PINMUX_GPIO5__FUNC_GPIO5>; slew-rate = <0>;
};
};
ctp_pins_rst_output0: rstoutput0 {
pins_cmd_dat {
pins = <PINMUX_GPIO4__FUNC_GPIO4>; slew-rate = <1>; output-low;
};
};
ctp_pins_rst_output1: rstoutput1 {
pins_cmd_dat {
pins = <PINMUX_GPIO4__FUNC_GPIO4>; slew-rate = <1>; output-high;
};
};
};
/* TOUCH end */
3.DEBUG
3.1 TP跳点/效果优化
平台主要能调试要TP有上报坐标,即tp的基本功能实现,基于跳点、优化等问题就得找FAE,他们会有对应的调试工具。调试好后更新TP固件就行了。
3.2 TP兼容
- 不同IC做兼容。正常通过硬件接出一个pin_id管脚。硬件赋值不同的电平,然后软件通过读取电平值从而在驱动入口函数加载相应的驱动源码。
- 同款IC不同供应商的TP兼容。通过读取供应商TP固件对应的ID来实现固件的兼容。
3.3 TP固件刷新
在实际开发中通常一个版本的软件会兼容不同的TP固件版本。如何解决这个问题呢。很简单,首先获取TP固件的版本,通过条件判断是否要刷新TP固件。可以通过询问FAE读取那个寄存器的值能获取TP固件的版本,最后通case条件判断刷新固件。