Hello Community,
We are using GPIO1_IO4 pin as Back-light Enable in our hardware. So if that pin sets to high display will turn on and vise-versa.
/* Apalis BKL1 /
backlight: backlight {
compatible = “pwm-backlight”;
pinctrl-names = “default”;
pinctrl-0 = <&pinctrl_gpio_bkl_on>;
enable-gpios = <&lsio_gpio1 4 GPIO_ACTIVE_HIGH>; / Apalis BKL1_ON */
};
…
/* Apalis BKL_ON */
pinctrl_gpio_bkl_on: gpio-bkl-on {
fsl,pins = <
IMX8QM_LVDS0_GPIO00_LSIO_GPIO1_IO04 0x00000041
>;
};
Like this in our .dtsi files. But for a specific application we need that pin to be low. We have released this image to field, so now can’t change that image. How to achieve that after booting in terminal(that means after kernel load completion) .
When i am trying to export that pin, it showing like resource busy.
Thank You,
Muthyam D.
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!
Hello,
It seems you’re encountering a situation where the GPIO pin (GPIO1_IO4) used for backlight control is locked by the kernel due to its configuration in the device tree, which prevents changing its state post-boot. This is a common scenario when a pin is allocated by a driver and thus marked as “busy” when you attempt to manipulate it directly through sysfs or similar interfaces.
To address this without modifying the device tree and rebuilding the image, you might consider a few approaches:
-
Use sysfs Interface (if available): In some cases, even if the pin is marked as busy, the driver exposing the pin might provide a sysfs interface to control it. For backlight, there could be a sysfs entry under /sys/class/backlight/
or /sys/class/leds/
that allows turning the backlight on or off without directly manipulating the GPIO.
-
Unload the Driver: If the pin is controlled by a kernel module, unloading the module using rmmod
might release the GPIO, allowing you to control it. However, this approach depends on whether the driver controlling the backlight is built as a module and can be safely removed without affecting system stability.
-
Use Debugfs: If debugfs is enabled in your kernel, it might be possible to change the GPIO state through it. However, this requires debugfs to be mounted and the specific GPIO debug interface to be available, which varies based on kernel configuration.
-
Runtime Device Tree (RDT) Updates: Some newer kernels support modifying the device tree at runtime. This feature, if available and enabled, could potentially be used to detach the GPIO from its current driver, allowing manual control. This approach is advanced and requires careful manipulation to avoid system instability.
-
Custom User-space Application: If the driver provides an IOCTL interface or other user-space accessible means to control the GPIO, writing a custom application to interact with this interface might be a solution.
Unfortunately, without the ability to modify the device tree and rebuild the image, options are limited. The best approach depends on the specific kernel version, configuration, and whether the controlling driver provides any interface for runtime control.
Given the constraints, I recommend exploring the sysfs interface first, as it’s the most common and straightforward method for controlling device features like backlight without needing to modify the kernel or device tree.
Best regards,
Toradex AI Assistant
Please, also check if these links can help you solve your problem:
GPIO (Linux) | Toradex Developer Center.
How did you like my response?

Hello,
While browsing about the issue , i got to know about unbinding .
In the following path, before unbinding
root@apalis-imx8-14945433:/sys/bus/platform/drivers/pwm-backlight
gpiochip1 - 32 lines:
line 3: unnamed unused input active-high
line 4: “MXM3_286” “enable” output active-high [used]
line 5: unnamed unused input active-high
line 6: “MXM3_87” unused input active-high
root@apalis-imx8-14945433:/sys/bus/platform/drivers/pwm-backlight# ls
backlight bind uevent unbind
root@apalis-imx8-14945433:/sys/bus/platform/drivers/pwm-backlight# ls -al
total 0
drwxr-xr-x 2 root root 0 Sep 20 10:43 .
drwxr-xr-x 290 root root 0 Sep 20 10:43 …
lrwxrwxrwx 1 root root 0 Sep 20 10:51 backlight → …/…/…/…/devices/platform/backlight
–w------- 1 root root 4096 Sep 20 10:53 bind
–w------- 1 root root 4096 Sep 20 10:43 uevent
–w------- 1 root root 4096 Sep 20 10:52 unbind
After unbinding ,
root@apalis-imx8-14945433:/sys/bus/platform/drivers/pwm-backlight# echo backlight>unbind
root@apalis-imx8-14945433:/sys/bus/platform/drivers/pwm-backlight# gpioinfo gpiochip1
gpiochip1 - 32 lines:
line 3: unnamed unused input active-high
line 4: “MXM3_286” unused output active-high
line 5: unnamed unused input active-high
line 6: “MXM3_87” unused input active-high
the pin got free, But changes are not impacted.
root@apalis-imx8-14945433:/sys/bus/platform/drivers/pwm-backlight# gpioset 1 4=1
root@apalis-imx8-14945433:/sys/bus/platform/drivers/pwm-backlight# gpioset 1 4=0
root@apalis-imx8-14945433:/sys/class/gpio# echo 452 > export
root@apalis-imx8-14945433:/sys/class/gpio# cd gpio452
root@apalis-imx8-14945433:/sys/class/gpio/gpio452# cat direction
out
root@apalis-imx8-14945433:/sys/class/gpio/gpio452# cat value
0
root@apalis-imx8-14945433:/sys/class/gpio/gpio452# echo 1 > value
root@apalis-imx8-14945433:/sys/class/gpio/gpio452# cat value
1
root@apalis-imx8-14945433:/sys/class/gpio/gpio452# echo 0 > value
root@apalis-imx8-14945433:/sys/class/gpio/gpio452# cat value
0
root@apalis-imx8-14945433:/sys/class/gpio/gpio452# gpioinfo gpiochip1
gpiochip1 - 32 lines:
line 3: unnamed unused input active-high
line 4: “MXM3_286” “sysfs” output active-high [used]
line 5: unnamed unused input active-high
root@apalis-imx8-14945433:/sys/class/gpio/gpio452# cat value
0
root@apalis-imx8-14945433:/sys/class/gpio/gpio452#
What is correct way to do this.
Thank You,
Muthyam D.
Hi @Muthyam ,
I tested the pin used for bkl_on which is GPIO1_IO04 (MXM_286) and found it to be working after unbinding from pwm-backlight driver.
root@apalis-imx8-06548582:~# echo backlight > /sys/bus/platform/drivers/pwm-backlight/unbind
root@apalis-imx8-06548582:~# gpioset 1 4=1
root@apalis-imx8-06548582:~# gpioget 1 4
1
root@apalis-imx8-06548582:~# gpioset 1 4=0
root@apalis-imx8-06548582:~# gpioget 1 4
0
I also confirmed by connecting the pin to the led and found to be working as expected.
Let me know if I correctly uderstood your question and the above solves your issue.