本文主要是介绍全志A133方案CTP新增(GT9XX系列),希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
i2c触摸屏:
一.此部分为添加kernel驱动宏开关:
1>.longan\kernel\linux-4.9\arch\arm64\configs\sun50iw10p1smp_a133_android_defconfig
CONFIG_INPUT_TOUCHSCREEN=y
+CONFIG_TOUCHSCREEN_GT9XXNEW_TS=y
二.此部分为在设备树中修改所挂的i2c的pin脚:
2>.longan\device\config\chips\a133\configs\c3\board.dts
twi1_pins_a: twi1@0 {
- allwinner,pins = "PE2", "PE3";
+ allwinner,pins = "PB4", "PB5";
allwinner,pname = "twi1_scl", "twi1_sda";
allwinner,function = "twi1";
allwinner,muxsel = ;
allwinner,drive = ;
allwinner,pull = ;
};
twi1_pins_b: twi1@1 {
- allwinner,pins = "PE2", "PE3";
+ allwinner,pins = "PB4", "PB5";
allwinner,function = "io_disabled";
allwinner,muxsel = ;
allwinner,drive = ;
allwinner,pull = ;
};
twi1: twi@0x05002400{ //TP
clock-frequency = ;
pinctrl-0 = ;
pinctrl-1 = ;
+ status = "okay";
+ ctp {
compatible = "allwinner,goodix";
reg = ;
device_type = "ctp";
status = "okay";
ctp_name = "gt9xxnew_ts";
ctp_twi_id = ;
ctp_twi_addr = ;
ctp_screen_max_x = ;
ctp_screen_max_y = ;
+/- ctp_revert_x_flag = ;
+/- ctp_revert_y_flag = ;
+/- ctp_exchange_x_y_flag = ;
ctp_int_port = ;
ctp_wakeup = ;
ctp-supply = ;
ctp_power_ldo_vol = ;
+ };
};
三.此部分为新增数据点传输:
3>.longan\kernel\linux-4.9\drivers\input\init-input.c //使用的是方法1
方法1:直接使用sdk2.2中的init-input.c_2.2-ok.bak文件;
方法2:使用sdk2.4中的init-input.c文件,更改下面
if (!data->dev) {
pr_err("-----get device_node fail\n");
return -1;
}
pr_err("tang sunxi_ctp_startup----------2\n");
+ np = data->dev->of_node;
ret = of_property_read_u32(np, "ctp_twi_id", &data->twi_id);
if (ret) {
pr_err("get twi_id is fail, %d\n", ret);
goto devicetree_get_item_err;
}
这篇关于全志A133方案CTP新增(GT9XX系列)的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!