AnsweredAssumed Answered

[imx6ull 14x14 evk] Modifying dts to use arduino pins for GPIO LEDs

Question asked by Stefan Mayrhofer on Apr 4, 2019
Latest reply on Apr 8, 2019 by gusarambula

I am currently trying to use the arduino headers on the evalkit to control LEDs via the generic leds-gpio driver. My problem is, that I can not use most of the pins and I don't know why.


What I did:

I changed the imx6ull-14x14-evk.dts to include the following:


leds {
compatible = "gpio-leds";
my_red_led {
label = "rgb_r";
gpios = <&gpio1 20 GPIO_ACTIVE_HIGH>;
my_green_led {
label = "rgb_g";
gpios = <&gpio1 21 GPIO_ACTIVE_HIGH>;
my_blue_led {
label = "rgb_b";
gpios = <&gpio1 24 GPIO_ACTIVE_HIGH>;
my_white_led {
label = "white_led";
gpios = <&gpio1 25 GPIO_ACTIVE_HIGH>;

In addition to that, I commented out the following sections: 

pinctrl_uart2: uart2grp{...};

&uart2 {...};

What works:

All 4 LEDs show up under /sys/class/leds/

When I call 

echo 255 > /sys/class/leds/{name_of_led}/brightness

the LEDs on pin 20, 21 and 25 can be turned on.

The pins 30,31 also work when I take out I2C (but I need it so I can not use those pins).


What doesn't work:

The LED on pin 24 can not be turned on.

I put some printk()-calls in the kernel module to check for errors, but the driver is working correctly.

I also tried some other arduino pins (those named GPIO0-4, SD1_DATA0-3, SD1_CLK, SD1_CMD and ECSPI4_* on the schematics) but they also don't work.

I always took out the components that use the pins in the dts-file to make sure the drivers don't re-configure the pins.

I also tried manually setting the pins using the following (adapted to each individual pin)

gpioset gpiochip0 24=1

When I call:


I can see that the pin is configured as "output" with "active-high" value.


My question:

What do I have to do/change in the dts-file in order to use pin 24 (or one of the other pins mentioned)?