We have a custom board with GPIO_X1_AUD_PX1 connected to an LED. I want to set up the device tree such that this LED is a heartbeat. I’ve added the following to the device tree, but don’t see any new entries under /sys/class/leds (the only thing there is mmc0::). I’ve made sure that CONFIG_LEDS_GPIO is configured, so it seems like there should be something there, even if it doesn’t work:
leds {
compatible = "gpio-leds";
heartbeat {
label = "heartbeat";
gpios = <&gpio TEGRA_GPIO(X, 1) 0>;
linux,default-trigger = "heartbeat";
};
};
I’ve observed that by adding TEGRA_GPIO(X, 1) to gpio-output-low (shown below) I can get the LED to turn on, which tells me that I’m referencing the right pin, at least.
gpio: gpio@6000d000 {
gpio-init-names = "default";
gpio-init-0 = <&gpio_default>;
gpio_default: default {
gpio-input = <
...
>;
gpio-output-low = <
...
TEGRA_GPIO(X, 1)
>;
gpio-output-high = <
...
>;
};
};
For the sake of completeness, here is where it is in the pinmux of the device tree:
pinmux: pinmux {
status = "okay";
pinctrl-names = "default", "drive", "unused";
pinctrl-0 = <&pinmux_default>;
pinctrl-1 = <>;
pinctrl-2 = <&pinmux_unused>;
pinmux_default: common {
...
gpio_x1_aud_px1 {
nvidia,pins = "gpio_x1_aud_px1";
nvidia,function = "safe";
nvidia,pull = <TEGRA_PIN_PULL_DOWN>;
nvidia,tristate = <TEGRA_PIN_DISABLE>;
nvidia,enable-input = <TEGRA_PIN_DISABLE>;
};
};
pinmux_unused: unused {
...
};
};
I’ve looked at all the documentation in the kernel related to GPIOs and LEDs and several forum posts about related issues, but haven’t found anything. Any advice would be appreciated!