GPIO - Device tree no effect

So i am trying to configure Pin 10 & 12 of the expansion header of the viola board which is labelled as GPIO133 and GPIO101

I want them to operate with a internal pull up resistor and activate when the press of the button takes the signal low.

I believe that GPIO133 = GPIO4 14 , GPIO101 = GPIO4_21

In the file imx6ull-colibri.dtsi i have added two lines as shown for the above two pins

pinctrl_snvs_gpiokeys: snvs-gpiokeys-grp {
		fsl,pins = <
			MX6ULL_PAD_SNVS_TAMPER1__GPIO5_IO01	0x130a0	/* SODIMM 45 */
                        MX6UL_PAD_CSI_DATA00__GPIO4_IO21        0x1b040
                        MX6UL_PAD_NAND_CE1_B__GPIO4_IO14        0x1b040
		>;
	};

In the file imx6ull-colibri-eval-v3.dtsi i have update the gpio-keys section

gpio-keys {
		compatible = "gpio-keys";
                autorepeat;
		pinctrl-names = "default";
		pinctrl-0 = <&pinctrl_snvs_gpiokeys>;

		power {
			label = "Wake-Up";
			gpios = <&gpio5 1 GPIO_ACTIVE_HIGH>;
			linux,code = <KEY_WAKEUP>;
			debounce-interval = <10>;
			wakeup-source;
		};

 		button@1 {
			label = "Button1";
			gpios = <&gpio4 21 GPIO_ACTIVE_LOW>;
			linux,code = <12345>;
		};
	};

I have built the dtb file and updated my module ( I changed the model name to ensure it was taking effect)

When i run gpioinfo i get

root@colibri-imx6ull:~# gpioinfo
gpiochip0 - 32 lines:
        line   0:      unnamed       unused   input  active-high
        line   1:      unnamed       unused   input  active-high
        line   2:      unnamed "VCC_USB[1-4]" output active-high [used]
        line   3:      unnamed       unused   input  active-high
        line   4:      unnamed       unused   input  active-high
        line   5:      unnamed       unused   input  active-high
        line   6:      unnamed       unused   input  active-high
        line   7:      unnamed       unused   input  active-high
        line   8:      unnamed       unused   input  active-high
        line   9:      unnamed       unused   input  active-high
        line  10:      unnamed       unused   input  active-high
        line  11:      unnamed     "enable"  output  active-high [used]
        line  12:      unnamed       unused   input  active-high
        line  13:      unnamed       unused   input  active-high
        line  14:      unnamed       unused   input  active-high
        line  15:      unnamed       unused   input  active-high
        line  16:      unnamed       unused   input  active-high
        line  17:      unnamed       unused   input  active-high
        line  18:      unnamed       unused   input  active-high
        line  19:      unnamed       unused   input  active-high
        line  20:      unnamed       unused   input  active-high
        line  21:      unnamed       unused   input  active-high
        line  22:      unnamed       unused   input  active-high
        line  23:      unnamed       unused   input  active-high
        line  24:      unnamed       unused   input  active-high
        line  25:      unnamed       unused   input  active-high
        line  26:      unnamed       unused   input  active-high
        line  27:      unnamed       unused   input  active-high
        line  28:      unnamed       unused   input  active-high
        line  29:      unnamed       unused   input  active-high
        line  30:      unnamed       unused   input  active-high
        line  31:      unnamed       unused   input  active-high
gpiochip1 - 32 lines:
        line   0:      unnamed       unused   input  active-high
        line   1:      unnamed       unused   input  active-high
        line   2:      unnamed       unused   input  active-high
        line   3:      unnamed       unused   input  active-high
        line   4:      unnamed       unused   input  active-high
        line   5:      unnamed       unused   input  active-high
        line   6:      unnamed       unused   input  active-high
        line   7:      unnamed       unused   input  active-high
        line   8:      unnamed       unused   input  active-high
        line   9:      unnamed       unused   input  active-high
        line  10:      unnamed       unused   input  active-high
        line  11:      unnamed       unused   input  active-high
        line  12:      unnamed       unused   input  active-high
        line  13:      unnamed       unused   input  active-high
        line  14:      unnamed       unused   input  active-high
        line  15:      unnamed       unused   input  active-high
        line  16:      unnamed       unused   input  active-high
        line  17:      unnamed       unused   input  active-high
        line  18:      unnamed       unused   input  active-high
        line  19:      unnamed       unused   input  active-high
        line  20:      unnamed       unused   input  active-high
        line  21:      unnamed       unused   input  active-high
        line  22:      unnamed       unused   input  active-high
        line  23:      unnamed       unused   input  active-high
        line  24:      unnamed       unused   input  active-high
        line  25:      unnamed       unused   input  active-high
        line  26:      unnamed       unused   input  active-high
        line  27:      unnamed       unused   input  active-high
        line  28:      unnamed       unused   input  active-high
        line  29:      unnamed       unused   input  active-high
        line  30:      unnamed       unused   input  active-high
        line  31:      unnamed       unused   input  active-high
gpiochip2 - 32 lines:
        line   0:      unnamed       unused   input  active-high
        line   1:      unnamed       unused   input  active-high
        line   2:      unnamed       unused   input  active-high
        line   3:      unnamed       unused   input  active-high
        line   4:      unnamed       unused   input  active-high
        line   5:      unnamed       unused   input  active-high
        line   6:      unnamed       unused   input  active-high
        line   7:      unnamed       unused   input  active-high
        line   8:      unnamed       unused   input  active-high
        line   9:      unnamed       unused   input  active-high
        line  10:      unnamed       unused   input  active-high
        line  11:      unnamed       unused   input  active-high
        line  12:      unnamed       unused   input  active-high
        line  13:      unnamed       unused   input  active-high
        line  14:      unnamed       unused   input  active-high
        line  15:      unnamed       unused   input  active-high
        line  16:      unnamed       unused   input  active-high
        line  17:      unnamed       unused   input  active-high
        line  18:      unnamed       unused   input  active-high
        line  19:      unnamed       unused   input  active-high
        line  20:      unnamed       unused   input  active-high
        line  21:      unnamed       unused   input  active-high
        line  22:      unnamed       unused   input  active-high
        line  23:      unnamed       unused   input  active-high
        line  24:      unnamed       unused   input  active-high
        line  25:      unnamed       unused   input  active-high
        line  26:      unnamed    "spi_imx"  output  active-high [used]
        line  27:      unnamed       unused   input  active-high
        line  28:      unnamed       unused   input  active-high
        line  29:      unnamed       unused   input  active-high
        line  30:      unnamed       unused   input  active-high
        line  31:      unnamed       unused   input  active-high
gpiochip3 - 32 lines:
        line   0:      unnamed       unused   input  active-high
        line   1:      unnamed       unused   input  active-high
        line   2:      unnamed       unused   input  active-high
        line   3:      unnamed       unused   input  active-high
        line   4:      unnamed       unused   input  active-high
        line   5:      unnamed       unused   input  active-high
        line   6:      unnamed       unused   input  active-high
        line   7:      unnamed       unused   input  active-high
        line   8:      unnamed       unused   input  active-high
        line   9:      unnamed       unused   input  active-high
        line  10:      unnamed       unused   input  active-high
        line  11:      unnamed       unused  output  active-high
        line  12:      unnamed       unused   input  active-high
        line  13:      unnamed       unused   input  active-high
        line  14:      unnamed       unused   input  active-high
        line  15:      unnamed       unused   input  active-high
        line  16:      unnamed       unused   input  active-high
        line  17:      unnamed       unused   input  active-high
        line  18:      unnamed       unused   input  active-high
        line  19:      unnamed       unused   input  active-high
        line  20:      unnamed       unused   input  active-high
        line  21:      unnamed       unused   input  active-high
        line  22:      unnamed       unused   input  active-high
        line  23:      unnamed       unused   input  active-high
        line  24:      unnamed       unused   input  active-high
        line  25:      unnamed       unused   input  active-high
        line  26:      unnamed       unused   input  active-high
        line  27:      unnamed       unused   input  active-high
        line  28:      unnamed       unused   input  active-high
        line  29:      unnamed       unused   input  active-high
        line  30:      unnamed       unused   input  active-high
        line  31:      unnamed       unused   input  active-high
gpiochip4 - 32 lines:
        line   0:      unnamed         "cd"   input   active-low [used]
        line   1:      unnamed       unused   input  active-high
        line   2:      unnamed         "id"   input  active-high [used]
        line   3:      unnamed       unused   input  active-high
        line   4:      unnamed       unused   input  active-high
        line   5:      unnamed       unused   input  active-high
        line   6:      unnamed       unused   input  active-high
        line   7:      unnamed       unused   input  active-high
        line   8:      unnamed       unused   input  active-high
        line   9:      unnamed          "?"  output  active-high [used]
        line  10:      unnamed       unused   input  active-high
        line  11:      unnamed      "reset"  output   active-low [used]
        line  12:      unnamed       unused   input  active-high
        line  13:      unnamed       unused   input  active-high
        line  14:      unnamed       unused   input  active-high
        line  15:      unnamed       unused   input  active-high
        line  16:      unnamed       unused   input  active-high
        line  17:      unnamed       unused   input  active-high
        line  18:      unnamed       unused   input  active-high
        line  19:      unnamed       unused   input  active-high
        line  20:      unnamed       unused   input  active-high
        line  21:      unnamed       unused   input  active-high
        line  22:      unnamed       unused   input  active-high
        line  23:      unnamed       unused   input  active-high
        line  24:      unnamed       unused   input  active-high
        line  25:      unnamed       unused   input  active-high
        line  26:      unnamed       unused   input  active-high
        line  27:      unnamed       unused   input  active-high
        line  28:      unnamed       unused   input  active-high
        line  29:      unnamed       unused   input  active-high
        line  30:      unnamed       unused   input  active-high
        line  31:      unnamed       unused   input  active-high

No sign of my Button

When i was using BSP2.8 i did similar and could see my button such as

gpiochip4 - 32 lines:
        line   0:      unnamed         "cd"   input   active-low [kernel]
        line   1:      unnamed    "Wake-Up"   input  active-high [kernel]
        line   2:      unnamed         "id"   input  active-high [kernel]
        line   3:      unnamed       unused   input  active-high
        line   4:      unnamed       unused   input  active-high
        line   5:      unnamed       unused   input  active-high
        line   6:      unnamed       unused   input  active-high
        line   7:      unnamed       unused   input  active-high [kernel]
        line   8:      unnamed       unused   input  active-high
        line   9:      unnamed          "?"  output  active-high [kernel]
        line  10:      unnamed       unused   input  active-high
        line  11:      unnamed      "reset"  output   active-low [kernel]
        line  12:      unnamed       unused   input  active-high
        line  13:      unnamed       unused   input  active-high
        line  14:      unnamed    "Button0"   input   active-low [kernel]
        line  15:      unnamed       unused   input  active-high

What am i missing ?

root@colibri-imx6ull:~# cat /sys/kernel/debug/gpio
gpiochip0: GPIOs 0-31, parent: platform/209c000.gpio, 209c000.gpio:
 gpio-2   (                    |VCC_USB[1-4]        ) out lo
 gpio-11  (                    |enable              ) out hi

gpiochip1: GPIOs 32-63, parent: platform/20a0000.gpio, 20a0000.gpio:

gpiochip2: GPIOs 64-95, parent: platform/20a4000.gpio, 20a4000.gpio:
 gpio-90  (                    |spi_imx             ) out hi

gpiochip3: GPIOs 96-127, parent: platform/20a8000.gpio, 20a8000.gpio:

gpiochip4: GPIOs 128-159, parent: platform/20ac000.gpio, 20ac000.gpio:
 gpio-128 (                    |cd                  ) in  hi IRQ
 gpio-130 (                    |id                  ) in  lo IRQ
 gpio-137 (                    |?                   ) out lo
 gpio-139 (                    |reset               ) out hi

The issue i found was that i am using the imx6ull module with wifi and from the pin design tool i found that GPIO 101 is used by the wifi so cannot be used as GPIO

In imx6ull-colibri-eval-v3.dtsi there is a definition for pinctrl_gpio1: which sets GPIO 135 to be used as UART3_TX which is not configured for use or available on my viola dev board. Discovering this allowed me to change this pin to GPIO

&iomuxc {
  imx6ull-colibri {
  
  pinctrl_gpio1: gpio1-grp {
    		fsl,pins = <
    			MX6UL_PAD_UART3_RX_DATA__GPIO1_IO25	0x10b0 /* SODIMM 77 */
    			MX6UL_PAD_JTAG_TCK__GPIO1_IO14		0x70a0 /* SODIMM 99 */
    			MX6UL_PAD_NAND_CE1_B__GPIO4_IO14	0x10b0 /* SODIMM 133 */
    			MX6UL_PAD_UART3_TX_DATA__GPIO1_IO24	0x1b040 /* SODIMM 135 */
    			MX6UL_PAD_UART3_CTS_B__GPIO1_IO26	0x10b0 /* SODIMM 100 */
    			MX6UL_PAD_JTAG_TRST_B__GPIO1_IO15	0x70a0 /* SODIMM 102 */
    			MX6UL_PAD_ENET1_RX_ER__GPIO2_IO07	0x10b0 /* SODIMM 104 */
    			MX6UL_PAD_UART3_RTS_B__GPIO1_IO27	0x10b0 /* SODIMM 186 */
    		>;
    	};

I then figured out how to name my pins (so they show up in gpioinfo)

&gpio1 {
	gpio-line-names = "", "", "a3", "a4", "", "", "", "",
			  "", "", "", "", "", "", "", "",
 			  "", "", "", "", "", "", "", "",
			  "Button2", "", "", "", "", "", "", ""; 
};

You can then use these names to access the pins using the gpiod.h library

struct gpiod_line* button1_line;
int btn1;

button1_line = gpiod_line_find("Button1");
 if (!button1_line) {
    return -1;
  }

req = gpiod_line_request_input(button1_line, "gpio_state");
  if (req) {
    return -1;
  }

printf("%s \n", gpiod_line_name(button1_line));

btn1 = gpiod_line_get_value(button1_line);
printf("GPIO value is: %d\n", btn1);

HI @adrian

Perfect that it works. Thanks for your Input.

Best regards,
Jaski