Failed to load EDT-ft5x06 driver

Dear Sir,

I have touchscreen based on FT 5446 chipset. I have downloaded driver: edt_ft5x06.c

I have configured kernel to load the touchscreen on proper bus and proper IRQS, but after loading the module I`m facing the errors:

[   10.705363] edt_ft5x06 3-0038: crc error: 0xbd expected, got 0x43
[   10.722805] edt_ft5x06 3-0038: crc error: 0x8d expected, got 0x43
[   10.757676] edt_ft5x06 3-0038: crc error: 0x8c expected, got 0x43
[   10.779332] edt_ft5x06 3-0038: crc error: 0xb5 expected, got 0x43
[   10.790906] edt_ft5x06 3-0038: crc error: 0x8e expected, got 0x43
[   10.903588] edt_ft5x06 3-0038: crc error: 0x89 expected, got 0x43
[   10.924750] edt_ft5x06 3-0038: Model "", Rev. "", 65531x65531 sensors
[   10.951124] edt_ft5x06 3-0038: Unable to request touchscreen IRQ.
[   10.981674] edt_ft5x06: probe of 3-0038 failed with error -22

IRQ is failling in function:

error = request_threaded_irq(client->irq,
                        NULL, edt_ft5x06_ts_isr,
                        IRQF_TRIGGER_FALLING | IRQF_ONESHOT,
                        client->name, tsdata);

with check if failed as bellow:

if (!irq_settings_can_request(desc))

where irq_settings_can_request is as bellow:

static inline bool irq_settings_can_request(struct irq_desc *desc)
{
        return !(desc->status_use_accessors & _IRQ_NOREQUEST);
}

Thank you in advance for your assistance

Best regards,
Kamil

Can you check the value of client->irq? It is probably 0 which would explain the return value of EINVAL -22. In the probe function please make sure you get the correct values in pdata->reset_pin and pdata->irq_pin. In the probe function after requesting gpio for IRQ with gpio_request_one, make sure to call gpio_to_irq on pdata->irq_pin, assign this to client->irq and then pass this in devm_request_threaded_irq. Please have a look at our Fusion driver code.

What is the error value now and where exactly in probe does it fail now? pdata->irq_pin seems to have correct value as per your assignment of it to APALIS_GPIO7.

Thank you Sir for your help. I have added code as bellow:

        client->irq = gpio_to_irq(pdata->irq_pin);
        irq_set_irq_type(client->irq, IRQ_TYPE_LEVEL_LOW);

and now error disappeared, and driver is loading succesfully, but still not working correctly. Each touch on touchscreen generates error:

[  128.750050] edt_ft5x06 3-0038: Unexpected header: ffffff!

Any ideas how to resolve this problem?

I would like to mention, that I`m still facing errors during loading:

[   10.537908] edt_ft5x06 3-0038: probing for EDT FT5x06 I2C
[   11.074846] edt_ft5x06 3-0038: crc error: 0xbd expected, got 0x43
[   11.145905] edt_ft5x06 3-0038: crc error: 0x8d expected, got 0x43
[   11.218042] edt_ft5x06 3-0038: crc error: 0x8c expected, got 0x43
[   11.293364] edt_ft5x06 3-0038: crc error: 0xb5 expected, got 0x43
[   11.361944] edt_ft5x06 3-0038: crc error: 0x8e expected, got 0x43
[   11.431150] edt_ft5x06 3-0038: crc error: 0x89 expected, got 0x43
[   11.441337] edt_ft5x06 3-0038: Model "", Rev. "", 65531x65531 sensors

@kamil Can you share the error code after adding the change with gpio_to_irq and where it fails? For some reason, I cannot seem to see my comment and your original comment.

@kamil Are your sure edt-ft5x06 is also applicable for FT5446? May be FT5446 uses a different CRC which is calculated here or a different protocol as the message comes from here? Can you cross check with the datasheet and manufacturer?

I`m very sorry, but I have removed my post because it was my bug. During testing I have changed client->irq to pdata->irq_pin in request_threaded_irq function, and that was the issue. Now I have swapped back, and function request_threaded_irq is loading OK. I saw another question with similar issue here question

and maybe that guy would be still interested with resolving this problem.

Dear Sir,
Im not sure about it, and Im aware, that it could be the issue but still have to prepare a proper driver for this touchscreen. Do you have any idea, where can I find protocol documentation for the FT5446 chip? I was looking on the internet, but didn`t found anything. I have also emailed Focal Tech support but without any response.

Best regards,
Kamil

@kamil We do not have any particular information. Focaltech would be the best contact point. However looking at the driver in more recent kernels might give an idea. What exactly is the value of rdbuf[0], rdbuf1 and rdbuf2 in ISR edt_ft5x06_ts_isr? The driver in a more recent kernel like 4.4 which we use for Vybrid here looks for two different protocols viz. M06 and M09. Perhaps the FT5446 uses the M09 protocol. I know for a fact that FT6236 uses M09. The M09 protocol does not seem to use CRC or a header. You can try by adapting your existing driver to accomodate the M09 protocol using this driver in 4.4 kernel as reference.

Glad to know it’s working.

Hi kamil, I am that guy and thank you for your interest. I finally got the device working
Thanks

best regards