AnsweredAssumed Answered

Unable to hook my GPIO into gpio-leds driver

Question asked by colinhelliwell on Oct 22, 2016
Latest reply on Oct 26, 2016 by colinhelliwell

I'm attempting to modify a Device Tree for an off-the-shelf i.MX6 Solo dev board. I'll need drivers to control my own IO signals, but to start with (and to avoid added problems with my own driver code!), I'm trying to just hook a GPIO onto the gpio-leds driver, e.g. to show 'heartbeat'.
I'm working with the Yocto build envoronment, and have created my own top-level dts, including the chip/soc/board include files which are used in the manufacturer's own example dts.

The board boots fine with the new tree. I can see cpuLed1 in /sys/class/leds; I can see the pin in /sys/kernel/debug/pinctrl/20e0000.iomuxc/pinmux-pins ("pin 110 (MX6DL_PAD_EIM_DA7): 20e0000.iomuxc (GPIO UNCLAIMED) (HOG) function iomuxc group hoggrp")
But I can't get the pin to do anything but sit high - I've tried writing to 'trigger' and to 'brightness'. I also tried it on a different pin (GPIO4_29), and that seems to just sit low.

Anyone spot what I've got wrong? Or can give me some tips on how/where to further debug what is/isn't getting set up?
I'm not even sure whether the gpio-leds driver is starting up (though the 'compatible' means it should?) - the build is currently putting all drivers statically into the uImage, even ones set as M in the config. But that's another story...

The manufacturer's imx6qdl-tx6.dtsi file sets up another heartbeat LED (GPIO2_20), which I've followed in setting up mine. Not yet able to see if theirs is flashing or not (microscope needed).

#include "imx6dl.dtsi"
#include "imx6qdl-tx6.dtsi"


    model = "MyBoard";
    compatible = "karo,imx6dl-tx6dl", "fsl,imx6dl";

    cpus {
        /delete-node/ cpu@1;

    leds {
        compatible = "gpio-leds";

        cpuLed1 {
            label = "cpuLed1";
            gpios = <&gpio3 7 GPIO_ACTIVE_HIGH>; // J7-26
            linux,default-trigger = "heartbeat";



&iomuxc {

    pinctrl-names = "default";
    pinctrl-0 = <&pinctrl_hog>;


    // delete the inherited hoggrp and re-create here with extra pin

    /delete-node/ hoggrp;


    pinctrl_hog: hoggrp {
    fsl,pins = <
        MX6QDL_PAD_EIM_A18__GPIO2_IO20 0x1b0b1 /* LED */
        MX6QDL_PAD_SD3_DAT2__GPIO7_IO06 0x1b0b1 /* ETN PHY RESET */
        MX6QDL_PAD_SD3_DAT4__GPIO7_IO01 0x1b0b1 /* ETN PHY INT */
        MX6QDL_PAD_EIM_A25__GPIO5_IO02 0x1b0b1 /* PWR BTN */
        MX6QDL_PAD_EIM_DA7__GPIO3_IO07 0x1b0b1



    pinctrl_usdhc4: usdhc4grp {
        fsl,pins = <
            MX6QDL_PAD_SD4_CMD__SD4_CMD 0x070b1
            MX6QDL_PAD_SD4_CLK__SD4_CLK 0x070b1
            MX6QDL_PAD_SD4_DAT0__SD4_DATA0 0x070b1
            MX6QDL_PAD_SD4_DAT1__SD4_DATA1 0x070b1
            MX6QDL_PAD_SD4_DAT2__SD4_DATA2 0x070b1
            MX6QDL_PAD_SD4_DAT3__SD4_DATA3 0x070b1
            MX6QDL_PAD_NANDF_ALE__SD4_RESET 0x0b0b1




&usdhc4 {
    pinctrl-names = "default";
    pinctrl-0 = <&pinctrl_usdhc4>;
    bus-width = <4>;
    status = "okay";