ti-processor-sdk-linux-am335x-evm-02.00.01.07-Linux-x86 电阻触摸屏驱动调试

最近在学习am335x,在触摸屏驱动这块遇到了问题,添加printk()打印坐标信息我触摸时会不断打印坐标;把inux-4.1.6 /drivers/input/touchscreen/ti_am335x_tsc.c下的驱动看了个遍终于找到了问题现在贴出来:

错误修改:
1、ti_am335x_tscadc.c
static    int ti_tscadc_probe(struct platform_device *pdev)
of_property_read_u32(node, "ti, coordiante-readouts", &readouts);   应为coordinate

2、 ti_am335x_tsc.c
static int titsc_parse_dt(struct platform_device *pdev
if (err < 0) {
        dev_warn(&pdev->dev, "please use 'ti,coordinate-readouts' instead\n");
        err = of_property_read_u32(node, "ti, coordiante-readouts",        =》修改为coordinate
                &ts_dev->coordinate_readouts);
    }

3
static irqreturn_t titsc_irq(int irq, void *dev)
    z = z1 - z2;              =》修改为z=z2-z1
            z *= x;                                                  修改后:触摸打印坐标
            z *= ts_dev->x_plate_resistance;
            z /= z2;                   =》修改为z1
4
z = (z + 2047) >> 12;
 
                      if (z <= MAX_12BIT) {
+                             x=MAX_12BIT-x;  #添加
+                             y=MAX_12BIT-y;      #添加
                              input_report_abs(input_dev, ABS_X, x);
                              input_report_abs(input_dev, ABS_Y, y);
                              input_report_abs(input_dev, ABS_PRESSURE, z);

你可能感兴趣的:(ti-processor-sdk-linux-am335x-evm-02.00.01.07-Linux-x86 电阻触摸屏驱动调试)