嵌入式开发者社区

标题: AM437X移植ads7846有中断,没事件,急急急在线等 [打印本页]

作者: xjtxzg    时间: 2019-5-24 10:11
标题: AM437X移植ads7846有中断,没事件,急急急在线等
root@am437x-evm:/dev/input# cat /proc/interrupts
.....
97:       1107  48322000.gpio   7 Edge      ads7846
root@am437x-evm:/dev/input# cat /proc/bus/input/devices
I: Bus=0000 Vendor=0000 Product=0000 Version=0000
N: Name="ADS7846 Touchscreen"
P: Phys=spi1.0/input0
S: Sysfs=/devices/platform/44000000.ocp/481a2000.spi/spi_master/spi1/spi1.0/input/input0
U: Uniq=
H: Handlers=event0
B: PROP=0
B: EV=b
B: KEY=400 0 0 0 0 0 0 0 0 0 0
B: ABS=1000003

root@am437x-evm:/dev/input# cat event0

触摸屏幕,没有任何打印。。。。。。。。。。。。。。。。。。





作者: 梁淑怡-Tronlong    时间: 2019-5-24 11:37
您好,
  1.请确认设备树文件已配置好Pinmux和节点。2.确认设备树文件已替换成功。
  3.查看在文件系统/dev/input/目录下有没有产生eventX的节点。
    再执行od -x /dev/input/eventX ,然后触摸LCD看是否有打印东西。有打印信息就表示配置正常。

作者: xjtxzg    时间: 2019-5-24 13:48
梁工您好
dts文件相关部分:
ads7846reg: ads7846-reg {   /* 4 line touch screen driver */
        compatible = "regulator-fixed";
        regulator-name = "ads7846-reg";
        regulator-min-microvolt = <3300000>;
        regulator-max-microvolt = <3300000>;
    };

#if 0
    pixcir_ts_pins: pixcir_ts_pins {
        pinctrl-single,pins = <
            AM4372_IOPAD(0xa64, PIN_INPUT_PULLUP | MUX_MODE7)  /* spi2_d0.gpio3_22 */
        >;
    };
#endif

    spi2_pins: spi2_pins {           /*4 wire touch screen driver chip */
        pinctrl-single,pins = <
            AM4372_IOPAD(0xa60, INPUT_EN | MUX_MODE0)  /* mcspi2_sclk mode 0*/
            AM4372_IOPAD(0xa64, INPUT_EN | MUX_MODE0)  /* 268 mcspi2_d0 mode 0*/
            AM4372_IOPAD(0xa68, INPUT_EN | MUX_MODE0)  /* 264 mcspi2_d1 mode 0*/
            AM4372_IOPAD(0xa6c, PIN_OUTPUT_PULLUP | MUX_MODE0)  /* mcspi2_cs0 mode 0*/
        >;
    };

    ads7846_pins: ads7846_pins {
        pinctrl-single,pins = <
            AM4372_IOPAD(0xa5c, PIN_INPUT_PULLUP | MUX_MODE7)  /* spi4_cs0..gpio5_7 */
        >;
    };

&spi2 {
    status = "okay";
    pinctrl-names = "default";
    pinctrl-0 = <&spi2_pins>;

    ads7846@0 {
        pinctrl-names = "default";
        pinctrl-0 = <&ads7846_pins>;

        compatible = "ti,ads7846";
        vcc-supply = <&ads7846reg>;

        reg = <0>;            /* CS0 */
        spi-max-frequency = <1500000>;

        interrupt-parent = <&gpio5>;
        interrupts = <7 0>;        /* gpio5_7 */
        pendown-gpio = <&gpio5 7 0>;

        ti,x-min = /bits/ 16 <0x0>;
        ti,x-max = /bits/ 16 <0x0fff>;
        ti,y-min = /bits/ 16 <0x0>;
        ti,y-max = /bits/ 16 <0x0fff>;

        ti,x-plate-ohms = /bits/ 16 <180>;
        ti,pressure-max = /bits/ 16 <255>;

        ti,debounce-max = /bits/ 16 <10>;
        ti,debounce-tol = /bits/ 16 <30>;
        ti,debounce-rep = /bits/ 16 <1>;

        ti,settle-delay-usec = /bits/ 16 <150>;
        ti,keep-vref-on = <1>;

        linux,wakeup;
    };
};

   

作者: xjtxzg    时间: 2019-5-28 14:16
梁淑怡-Tronlong 发表于 2019-5-24 11:37
您好,
  1.请确认设备树文件已配置好Pinmux和节点。2.确认设备树文件已替换成功。
  3.查看在文件系统/dev ...

梁工您好
dts文件相关部分:
ads7846reg: ads7846-reg {   /* 4 line touch screen driver */
        compatible = "regulator-fixed";
        regulator-name = "ads7846-reg";
        regulator-min-microvolt = <3300000>;
        regulator-max-microvolt = <3300000>;
    };

#if 0
    pixcir_ts_pins: pixcir_ts_pins {
        pinctrl-single,pins = <
            AM4372_IOPAD(0xa64, PIN_INPUT_PULLUP | MUX_MODE7)  /* spi2_d0.gpio3_22 */
        >;
    };
#endif

    spi2_pins: spi2_pins {           /*4 wire touch screen driver chip */
        pinctrl-single,pins = <
            AM4372_IOPAD(0xa60, INPUT_EN | MUX_MODE0)  /* mcspi2_sclk mode 0*/
            AM4372_IOPAD(0xa64, INPUT_EN | MUX_MODE0)  /* 268 mcspi2_d0 mode 0*/
            AM4372_IOPAD(0xa68, INPUT_EN | MUX_MODE0)  /* 264 mcspi2_d1 mode 0*/
            AM4372_IOPAD(0xa6c, PIN_OUTPUT_PULLUP | MUX_MODE0)  /* mcspi2_cs0 mode 0*/
        >;
    };

    ads7846_pins: ads7846_pins {
        pinctrl-single,pins = <
            AM4372_IOPAD(0xa5c, PIN_INPUT_PULLUP | MUX_MODE7)  /* spi4_cs0..gpio5_7 */
        >;
    };

&spi2 {
    status = "okay";
    pinctrl-names = "default";
    pinctrl-0 = <&spi2_pins>;

    ads7846@0 {
        pinctrl-names = "default";
        pinctrl-0 = <&ads7846_pins>;

        compatible = "ti,ads7846";
        vcc-supply = <&ads7846reg>;

        reg = <0>;            /* CS0 */
        spi-max-frequency = <1500000>;

        interrupt-parent = <&gpio5>;
        interrupts = <7 0>;        /* gpio5_7 */
        pendown-gpio = <&gpio5 7 0>;

        ti,x-min = /bits/ 16 <0x0>;
        ti,x-max = /bits/ 16 <0x0fff>;
        ti,y-min = /bits/ 16 <0x0>;
        ti,y-max = /bits/ 16 <0x0fff>;

        ti,x-plate-ohms = /bits/ 16 <180>;
        ti,pressure-max = /bits/ 16 <255>;

        ti,debounce-max = /bits/ 16 <10>;
        ti,debounce-tol = /bits/ 16 <30>;
        ti,debounce-rep = /bits/ 16 <1>;

        ti,settle-delay-usec = /bits/ 16 <150>;
        ti,keep-vref-on = <1>;

        linux,wakeup;
    };
};

作者: czs----Tronlong    时间: 2019-6-4 21:38
Dear ,

         根据您的实际调试情况,需要修改设备树配置

ti,x-plate-ohms = / bits / 16 <180>;




欢迎光临 嵌入式开发者社区 (https://www.51ele.net/) Powered by Discuz! X3.4