Use Pins used on Ixora's LEDs as GPIOs in custom carrier board

Hello.

We’re currently producing a custom carrier board and we would like to use the current pins assigned to the Ixora’s LEDs as GPIOs.

My question is: On my custom device tree, if I change the pins used on ixora’s leds to the general gpio node directly can I use them as such?

I.e. by removing:

	leds_ixora {
		pinctrl_leds_ixora: ledsixoragrp {
			fsl,pins = <
				MX6QDL_PAD_SD2_DAT1__GPIO1_IO14 PAD_CTRL_HYS_PU
				MX6QDL_PAD_SD2_DAT3__GPIO1_IO12 PAD_CTRL_HYS_PU
				MX6QDL_PAD_NANDF_D1__GPIO2_IO01 PAD_CTRL_HYS_PU
				MX6QDL_PAD_NANDF_D2__GPIO2_IO02 PAD_CTRL_HYS_PU
			>;
		};

And adding them to:

&iomuxc {
	/*
	 * Mux the Apalis GPIOs, GPIO7 used for PCIe reset,
	 * GPIO5, 6 used by optional fusion_F0710A kernel module 
	 */
	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_apalis_gpio1 &pinctrl_apalis_gpio2
		     &pinctrl_apalis_gpio7 &pinctrl_apalis_gpio8>;

Best Regards,

Joao

Hi

I am sorry, but I did not understand your question. Could you please rephrase the question, maybe with an example?

Thanks and best regards, Jaski

Hi jaski,

I hope it’s clearer now.

Hi @Joao

Probably you will get an error when compiling the DTB because leds_ixora will still be referenced. If you don’t need any LEDs, better remove this block as well:

	leds {
		compatible = "gpio-leds";

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

		led4-green {
			label = "LED_4_GREEN";
			gpios = <&gpio1 17 GPIO_ACTIVE_HIGH>;
		};

        ....

      };

After that, you should be able to use them as GPIOs.

Regards,
Stefan

Hi Stefan, thanks for your answer.

OK, that confirms my assumptions, I knew I had to remove that as well. I will re-define the pinctrl like the gpios and remove the pinctrl of leds-ixora and that led definition.

Best regards,

Joao