msm8953_64:/ $ dmesg |grep HXTP
[ 5.787139] [HXTP] Himax common touch panel driver init
[ 5.787168] [HXTP] himax_common_init_async:Enter
[ 5.787337] [HXTP] DT-himax_parse_dt:panel-coords = 0, 720, 0, 1280
[ 5.787363] [HXTP] DT-himax_parse_dt:display-coords = (720, 1280)[HXTP] DT:gpio_3v3_en value is not valid
[ 5.789832] [HXTP] DT:gpio_irq=65, gpio_rst=64, gpio_3v3_en=-2[HXTP] DT:protocol_type=1[HXTP] DT-No vk info in DT
[ 6.118727] [HXTP] Himax IC package 852x ES
[ 6.178014] [HXTP] sensor_id=22.
[ 6.180196] [HXTP] fw_ver=e502.
[ 6.183321] [HXTP] config_ver=3.
[ 6.518257] [HXTP] himax_calculateChecksum 0xAD[0,1,2,3] = 0,0,0,0
[ 6.523604] [HXTP] himax_loadSensorConfig: initialization complete
[ 6.529653] [HXTP] himax_power_on_init:
[ 6.748033] [HXTP] himax_touch_information:IC_TYPE =6
[ 6.848397] [HXTP] himax_touch_information:Touch Panel Type=170
[ 6.928022] [HXTP] himax_touch_information:HX_RX_NUM =24,HX_TX_NUM =12,HX_MAX_PT=5
[ 6.934823] [HXTP] config_ver=3.
[ 7.038082] [HXTP] calcDataSize: coord_data_size: 20, area_data_size:8, raw_data_frame_size:91, raw_data_nframes:1[HXTP] himax_chip_common_probe: calcDataSize complete
[ 7.038085] [HXTP] himax_chip_common_probe: Use Protocol Type B
[ 7.038123] [HXTP] input_set_abs_params: mix_x 0, max_x 720, min_y 0, max_y 1280
[ 7.039291] [HXTP] himax_report_data_init: ic_data->HX_MAX_PT:5,hx_raw_cnt_max:1,hx_raw_cnt_rmd:1,g_hx_rawdata_size:91,hx_touch_data->touch_info_size:32
[ 7.039904] [HXTP] himax_ts_register_interrupt edge triiger falling
[ 7.039904] [HXTP] himax_ts_register_interrupt: irq enabled at qpio: 72
[ 22.088541] [HXTP] himax_fb_register in
[ 38.080311] [HXTP] S1@405, 464
[ 38.182155] [HXTP] E1@405, 464
调一个TP,昨晚没想出来
现象是probe正常跑完,gpio正常,event有,但是中断也有,但是事件上报只有按下和弹起,不能滑动报点
驱动在另外一个项目上跑过,我就比较郁闷,以为是本项目哪里改动影响到tp驱动报点了,
然后去看dmesg|grep i2c,看到:
[ 1.966828] i2c-msm-v2 78b6000.i2c: probing driver i2c-msm-v2
[ 1.971839] i2c-msm-v2 78b6000.i2c: error on clk_get(core_clk):-517
[ 1.977794] i2c-msm-v2 78b6000.i2c: error probe() failed with err:-517
[ 1.985366] i2c-msm-v2 78b7000.i2c: probing driver i2c-msm-v2
[ 1.990333] i2c-msm-v2 78b7000.i2c: error on clk_get(core_clk):-517
[ 1.996330] i2c-msm-v2 78b7000.i2c: error probe() failed with err:-517
[ 2.360078] i2c-msm-v2 78b6000.i2c: probing driver i2c-msm-v2
[ 2.360390] i2c-msm-v2 78b6000.i2c: error on clk_get(core_clk):-517
[ 2.360407] i2c-msm-v2 78b6000.i2c: error probe() failed with err:-517
[ 2.361435] i2c-msm-v2 78b7000.i2c: probing driver i2c-msm-v2
[ 2.361667] i2c-msm-v2 78b7000.i2c: error on clk_get(core_clk):-517
[ 2.361682] i2c-msm-v2 78b7000.i2c: error probe() failed with err:-517
[ 2.909256] i2c-msm-v2 78b6000.i2c: probing driver i2c-msm-v2
[ 2.923115] i2c-msm-v2 78b6000.i2c: msm_bus_scale_register_client(mstr-id:86):0 (not a problem)
[ 2.945424] i2c-msm-v2 78b7000.i2c: probing driver i2c-msm-v2
[ 2.959281] i2c-msm-v2 78b7000.i2c: msm_bus_scale_register_client(mstr-id:86):0 (not a problem)
-----------------------------------------------
78b6000刚好又是i2_3, 昨天我就立马去怀疑是不是i2c probe有问题,但是我又是一台整机调tp,又不能去量i2c,昨天就没有解决
今天早上我就把代码回退到最初版本,重新把驱动移植一遍,然后tp立马正常了,我就郁闷了,然后就打了一下成功的log。
log一对比,就知道了dts获取分辨率的地方有问题,没有正确获取到屏幕的分辨率。
我就去检查了dtsi,发现 himax,panel-coords = <0 720 0 1280>;这里我手敲coords敲掉了(coors)
实际驱动中:
if (of_property_read_u32_array(dt, "himax,panel-coords", coords, coords_size) == 0) {
pdata->abs_x_min = coords[0], pdata->abs_x_max = coords[1];
pdata->abs_y_min = coords[2], pdata->abs_y_max = coords[3];
I(" DT-%s:panel-coords = %d, %d, %d, %d\n", __func__, pdata->abs_x_min,
pdata->abs_x_max, pdata->abs_y_min, pdata->abs_y_max);
}
abs_x和abs_y没有获取到,为0也不会报错。
------------------------
总结:
实际操作中容易只看probe是否成功,实际一些log未必有认真注意到,现象不敏感,如果不是这份驱动跑过,
甚至会想到是不是固件或者驱动本身的问题。
一份正确的log很重要,对比一下两份log能很快发现问题。
然后i2c-msm-v2 78b6000.i2c: error on clk_get(core_clk):-517这个问题,也说下
stackoverflow说这个是应为i2c probe顺序先与clk,然后改下driver/Makefile。
我这份源码实际去调整clk的位置,好像没啥用,clk改的太前导致机器起不来,改的不够前还是会有错误。
看了下别的kernel4.9的项目,clk的位置确实高于i2c。