LED4 and LED5 ON Ixora Apalis imx6 not working

Hi,

I am using imx6q-apalis-ixora.dtb file , where LED4 and LED5 configured by default low. So while power on it will be off. If i change the .dtb files “led{” structure i can able to see the difference.

But for some reason my sysfs no not allowing me to change the LED4 and LED5 value from low to high.

echo 33 > export
-sh: echo: write error: Device or resource busy

Could you please reply quickly.

Regards,

Suju

Hi

The imx6q-apalis-ixora.dtb does configure the 4 LED’s to be available as led classes, so you would need to control them from /sys/class/leds/…

You access the leds like this, e.g. switch on all 4 LED, wait a second, switch them off again:

echo 1 > /sys/class/leds/LED_4_GREEN/brightness
echo 1 > /sys/class/leds/LED_4_RED/brightness
echo 1 > /sys/class/leds/LED_5_GREEN/brightness
echo 1 > /sys/class/leds/LED_5_RED/brightness
sleep 1
echo 0 > /sys/class/leds/LED_4_GREEN/brightness
echo 0 > /sys/class/leds/LED_4_RED/brightness
echo 0 > /sys/class/leds/LED_5_GREEN/brightness
echo 0 > /sys/class/leds/LED_5_RED/brightness

Because the led driver did already reserve the gpio your effort to export one of the gpio’s used for the LEDs fails.

If you want the pins to be exportable as gpios you would have to change the device tree so that the pins are muxed to be gpios but not used by any kernel driver.

Max