Reconfiguring pin as GPIO LED on Colibri T20

I’d like to configure two pins as GPIO LEDs, these are physical pins 79 and 81, also called D2 and L6 and GPIO30 and GPIO90. I have spent quite some time getting Linux 4.1 to run on this thing and most peripherals work, but I can’t figure out what I’m doing wrong with the GPIO.

The pins are tied to one LED each. I want to control these with the gpio sysfs API. From the pinmux documentation, I have interpreted these pins to be “dtc” and “dtd”, which are tied to the “vi” pin function node in tegra20-colibri-512.dtsi.

Now, I can

echo 30 > /sys/class/gpio/export
cd gpio30
echo out > direction
echo 1 > value

which should mean that the pin is FREE for gpio use, right? But while cat value outputs ‘1’, the LED doesn’t change state (and indeed the actual cpu pin isn’t flipped either).

So what could be causing this? I’ve also tried modding the device tree, like:

leds {
	compatible = "gpio-leds";
	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_gpio_leds>;

	usb {
		/* note: dtd */
		label = "led-usb";
		gpios = <&gpio TEGRA_GPIO(L, 2) GPIO_ACTIVE_HIGH>;
            vehicle {
		/* note: dtc */
                    label= "led-vehicle";
		gpios = <&gpio TEGRA_GPIO(D, 6) GPIO_ACTIVE_HIGH>;
pinctrl_gpio_leds: gpioleds {
	nvidia,pins = "dtc", "dtd";
	nvidia,pull = <TEGRA_PIN_PULL_UP>;
	nvidia,tristate = <TEGRA_PIN_DISABLE>;

which had the same problem (the pins and their expected values show up in /sys/kernel/debug/gpio, but the physical pin doesn’t change state).

I should add that this is the Colibri T20 256 MB IT version, i.e. 256MB ram.


Could you provide information about the hardware and software for your module?
Which carrier board are you using?

Best regards, Jaski

Linux 4.1 on a custom carrier board (using the tegra20-colibri-512.dtsi base DT).

X1(79) - GPIO_L2 /LCD_D6 - GPIO90

At tegra20-colibri-512.dtsi they are referred as ld6 and lvs. And they belong to displaya node. So you have to remove that pins from displaya.

Thanks! Tried removing those but nothing changes…

Well actually on my datasheet it says X1(79/81) are dtd and dtc (vi node), not ld6 and lvs. But either way, I removed both the displaya node and the vi node completely, but still nothing. Some general tips on how to find out which pins are conflicting would be nice.

Yes, you are right they belong to VI node. Let me try to reproduce your issue next Monday.

Unfortunately we are only supporting Tegra T20 linux based on kernel version 3.1
Pinmux there done by “old way” using c files. Please see root/arch/arm/mach-tegra/board-colibri_t20-pinmux.c

If you wish you can try to build newer mainline kernel. In that case I’d recommend to use 4.9 version instead of 4.1 you are using now.