milkv-duo / duo-buildroot-sdk

Milk-V Duo Official buildroot SDK
411 stars 174 forks source link

No interrupts from the FT6236 touch panel (i.e. standard Linux drivers do not process interrupts from GPIO) #67

Open ur8us opened 9 months ago

ur8us commented 9 months ago

Milk-V Duo:

The Focaltech touch panel driver does not process interrupts, although the settings in the cv1800b_milkv_duo_sd.dts file are complete:

&i2c0 { status = "okay"; clock-frequency = <100000>;

    touchscreen@38 {
    compatible = "focaltech,ft6236";
    reg = <0x38>;

    interrupt-parent = <&porta>;
    interrupts = <14 2>;

    touchscreen-size-x = <320>;
    touchscreen-size-y = <480>;
    touchscreen-swapped-x-y;
    touchscreen-inverted-y;
    status = "okay";
    reset-gpios = <&porta 15  GPIO_ACTIVE_LOW>;
    };

};

Of course, GPIOA15 is configured as GPIO and the FT6235 is compiled with the kernel.

Solution:

Please add the "#interrupt-cells=<2>" line for porta in the cv180x_base_riscv.dtsi file:

gpio0: gpio@03020000 {
        porta: gpio-controller@0 {
                interrupt-controller;
                interrupts = <60 IRQ_TYPE_LEVEL_HIGH>;
                interrupt-parent = <&plic0>;
                #interrupt-cells = <2>;
        };
};

Now interrupts from GPIO are correctly propagated to the interrupt controller driver.

https://community.milkv.io/t/gpio/1251/4