Failed to obtain GPIO pin due to ACPI issue while porting BSP from kernel 5 to 6.5 for Goodix touch screen

I am currently in the process of migrating bsp5.4 to bsp 6.x on verdin imx8mm. I am encountering a problem with the Goodix touchscreen - I am able to detect the touch, but I am not receiving any events when using evtest.(see the image below)

Below you will find the dmsg log message.

Upon reviewing the message log, it has come to my attention that the driver is unable to locate the GPIO IRQ and reset using the function “gpiod = devm_gpiod_get_optional(dev, GOODIX_GPIO_INT_NAME, GPIOD_IN);” as depicted in the image provided.

After examining the driver provided in the following link: linux/drivers/input/touchscreen/goodix.c at v6.5 · torvalds/linux · GitHub, I observed that the driver identifies the GPIO pins through ACPI. Consequently, I proceeded to inspect the ACPI GPIO message as shown below.

After reviewing the information provided in this link, gpio / ACPI: ignore GpioInt() GPIOs when requesting GPIO_OUT_* - Patchwork, it is explained that in cases where firmware does not utilize _DSD properties to appropriately name GPIO resources, the kernel resorts to parsing _CRS resources. As a result, the kernel will identify entries described as GpioInt() as general purpose GPIOs. Consequently, I proceeded to examine the DSD logs I obtained.

The touchscreen functions properly in bsp5.x with /sys/class/gpio configuration, however, it is unable to locate the GPIO in bsp6 when using libgpio. The display is facing a similar problem in finding the GPIO. How can this issue be resolved? Any suggestions?

Hi, I’m the Toradex AI Assistant. I’m in early beta, and I would appreciate your feedback.
The Toradex Support team will follow up with you shortly!

Did you like my answer?

:+1: :-1:


Transitioning from BSP 5.4 to 6.x involves significant changes, especially with the move from the deprecated sysfs GPIO interface to the newer GPIO Char Device API (libgpiod). The issue you’re encountering with the Goodix touchscreen driver not being able to locate the GPIO for IRQ and reset lines is likely related to these changes.

Given that the driver is attempting to locate the GPIO pins through ACPI, and considering that it worked with the sysfs interface but not with libgpiod, it suggests that the ACPI tables or the device tree configuration might not be correctly specifying the GPIOs for the Goodix touchscreen in the new BSP version.

Here are some steps to troubleshoot and potentially resolve this issue:

  1. Verify ACPI/Device Tree Configuration: Ensure that the ACPI tables (if you’re using ACPI) or the device tree (if you’re using device tree) correctly specify the GPIOs used by the Goodix touchscreen. For the Verdin iMX8MM, you would typically use a device tree. Check that the GPIOs are correctly defined and that their names match what the Goodix driver expects.

  2. Update the Device Tree: If you’re using a device tree, you might need to update it to correctly reference the GPIOs for the touchscreen. This could involve specifying the GPIOs in the same manner as the driver expects, using the libgpiod names if necessary.

  3. Check libgpiod Configuration: Since the driver is now using libgpiod to access GPIOs, ensure that libgpiod is correctly installed and configured on your system. You might also need to adapt the driver to use libgpiod more effectively, especially if it was originally designed with sysfs in mind.

  4. Driver Adaptation: It’s possible that the Goodix driver needs to be adapted for the newer BSP and libgpiod. Review the driver code for compatibility with libgpiod and BSP 6.x. This might involve changes to how the driver requests and interacts with GPIOs.

  5. Debugging Tools: Use tools like gpioinfo and gpioset from the libgpiod package to manually check the availability and status of the GPIOs in question. This can help verify that the GPIOs are accessible and functioning as expected under the new BSP.

  6. Kernel Logs: Pay close attention to the kernel log messages related to ACPI and

Please, also check if these links can help you solve your problem:

GPIO (Linux) | Toradex Developer Center.

I apologize, but the Toradex AI solution does not provide any assistance as I have already reviewed all of these suggestions.

Hello @Rabeb,

There is no need to apologize, the ToradexAI is only intended as a first response, which may be helpful in some problems, but will not always be able to solve the problem.
Feedback about its utility is always welcome.

Regarding the touchscreen driver, please note that the driver used in BSP 6 for the Verdin iMX8M Mini is the one on the linux-toradex repository.
The drivers should be relatively similar, but they are not identical.
That being said, I did not check if the differences are meaningful for this problem.

Also note that while the touchscreen driver supports the use of ACPI to find the GPIO pins, ACPI is not used on the Verdin iMX8M Mini.
Therefore, the GPIO pins need to be configured on the device tree.

Can you provide the device tree snippets for the touchscreen used for BSP 5 and BSP 6?

Best Regards,

Hello @Rabeb,

The messages you get on dmesg related to ACPI indicate that it is disabled.
These massages are expected, as ACPI is disabled on the Verdin iMX8M Mini.
A device tree and device tree overlays are used for device and peripheral configurations.

The entries on the /sys/kernel/debug/dynamic_debug/control are not errors.
These are just configurations that can be used with the Linux Dynamic Debug functionality.

Best Regards,

Thank you, @bruno.tx. I understand now. This the device tree configuration of the touch screen

Do you have any suggestions?

Hello @Rabeb,

I am not too familiar with the goodix touchscreen specifically, so to have a better understanding of what may be the problem, can you send the device tree snippets that you have for both BSP 5 and BSP 6?

Best Regards,