【问题标题】:Interfacing ft5x06 touchscreen with yocto将 ft5x06 触摸屏与 yocto 连接
【发布时间】:2016-10-08 13:42:48
【问题描述】:

我从使用 yocto 创建的内核中得到以下 dmesg 输出。

bus: 'i2c': add driver edt_ft5x06
bus: 'i2c': driver_probe_device: matched device 1-0038 with driver edt_ft5x06
bus: 'i2c': really_probe: probing driver edt_ft5x06 with device 1-0038
edt_ft5x06 1-0038: no default pinctrl state
edt_ft5x06 1-0038: probe
edt_ft5x06 1-0038: no platform data?
edt_ft5x06: probe of 1-0038 failed with error -22
i2c-core: driver [edt_ft5x06] registered

我的设备树包含:

smarc_i2c_cam: i2c-gpio-1 {
    compatible = "i2c-gpio";
    pinctrl-names = "default";
    pinctrl-0 = <&pinctrl_smx6_i2c_gpio_1>;
    gpios =
        <&gpio4 10 0>, /* sda */
        <&gpio1 6 0>;  /* scl */
    #address-cells = <1>;
    #size-cells = <0>;
    i2c-gpio,delay-us = <2>;
};

polytouch: edt-ft5x06@38 {
    compatible = "edt,edt-ft5x06";
    reg = <0x38>;
    pinctrl-names = "default";
    //pinctrl-1 = <&edt_ft5x06_pins>;
    interrupt-parent = <&gpio3>;
    interrupts = <1 8>;
};

我的主板是 smarc-samx6i(imx6q“飞思卡尔”处理器)。
Linux 内核是 3.10.17。

但是触摸没有响应;甚至 i2c 也没有响应。还有什么需要我照顾的吗?

【问题讨论】:

  • 您的设备树中有错误。但我认为你只是把它们弄错了,否则你的整个形象就无法创建。
  • 内核编译成功,我可以理解我的设备树在中断引脚配置中有一些配置。你能有任何文件显示这两种语法如何定义“interrupt-parent = ; interrupts = ;”

标签: embedded interrupt yocto device-tree imx6


【解决方案1】:

我在运行主线 linux 内核 4.6 的 Lenmaker BananaPro (A20) 上有一个带有“EDT-FT5x06”触摸控制器的 lenmaker 7 英寸触摸屏。

这是我的设备树的补丁。查看wake-gpiosinterrupts

diff --git a/arch/arm/boot/dts/sun7i-a20-bananapro.dts b/arch/arm/boot/dts/sun7i-a20-bananapro.dts
index 18fcc87..50f1a36 100644
--- a/arch/arm/boot/dts/sun7i-a20-bananapro.dts
+++ b/arch/arm/boot/dts/sun7i-a20-bananapro.dts
@@ -147,6 +147,26 @@
status = "okay";
 };

+&i2c3 {
+   status = "okay";
+   pinctrl-names = "default";
+   pinctrl-0 = <&i2c3_pins_a>;
+   edt: edt-ft5x06@38 {
+           compatible = "edt,edt-ft5x06";
+           reg = <0x38>;
+           interrupt-parent = <&pio>;
+           interrupts = <7 9 IRQ_TYPE_EDGE_FALLING>;
+           wake-gpios = <7 7 GPIO_ACTIVE_LOW>;
+           pinctrl-names = "default";
+           pinctrl-0 = <&edt_ft5x06_pins>;
+           touchscreen-size-x = <1024>;
+           touchscreen-size-y = <600>;
+           touchscreen-inverted-x;
+           touchscreen-swapped-x-y;
+   };
+};
+
+
&ir0 {
  pinctrl-names = "default";
  pinctrl-0 = <&ir0_rx_pins_a>;
@@ -222,6 +242,14 @@
allwinner,drive = <SUN4I_PINCTRL_10_MA>;
  allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
  };
+
+   edt_ft5x06_pins: edt_ft5x06_pins@0 {
+       allwinner,pins = "PH7", "PH9";
+       allwinner,function = "gpio_out";
+       allwinner,drive = <SUN4I_PINCTRL_40_MA>;
+       allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
+   };
+
};

 &reg_usb1_vbus {

也许您在 linux 内核模块的此文档中找到了更多信息:https://www.kernel.org/doc/Documentation/devicetree/bindings/input/touchscreen/edt-ft5x06.txt

或在这里:http://linux-sunxi.org/Touchscreen

【讨论】:

  • 我按照上述指南提供了所有信息,我发现我正在使用 gpio i2c 并且两个设备共享同一总线,因此我在设备树中再次添加 i2cmux 时出现错误edt-ft5x06 与 edt_ft5x06 1-0038 相同:没有平台数据? edt_ft5x06:1-0038 探测失败,错误 -22 i2c i2c-1:new_device:在 0x38 处实例化设备 edt-ft5x06
【解决方案2】:

3.10.17 内核中的 edt ft5x06 驱动程序未启用设备树。您必须从更新的内核(如 4.1 或更高版本)向后移植驱动程序,然后才能将设备树与驱动程序一起使用。

【讨论】:

  • 除了使用设备树外,我可以手动将触摸屏模块加载到内核 3.10.17 并使用它吗?
  • 我不太明白你的问题。如果设备树的驱动修改正确,并且编译时使用了正确的设备树,就可以动态加载模块了。
  • 我使用 menuconfig add make it 添加了模块。可以从 cd /lib/modules/3.10.17-rel1.0\+g232293e/kernel/drivers/input/touchscreen/ 手动添加吗启动内核后。
  • 用于 Yocto 的 3.10.17 内核已启用设备树。
  • 是的,但 edt-ft5x06 驱动程序不是。见here
猜你喜欢
  • 2016-11-13
  • 1970-01-01
  • 2017-09-22
  • 1970-01-01
  • 2012-09-24
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多