Changes for making GPIO as heartbeat trigger indicator

Hi,

What changes are required in tegra210-jetson-cv-pinmux-p2597-2180-a00.dtsi file for making GPIO13 of J21 header of TX1 to get LED connected on this pin as heartbeat indicator using heartbeat trigger of linux LED subsystem?
Has anybody tried that?

Thanks,
Prathamesh

hello patyarahate,

there’s forum topic for your reference, thanks
[url]https://devtalk.nvidia.com/default/topic/1029697/[/url] gpio interrupts from user space

Hi,

Thanks, for your reply, but it did not help.
I did try few changes to configure pin 32 of J21 header as heartbeat and it could work well with following changes, but same set of changes doesn’t work for any other pin.

Following are the changes in dts file-
leds {
compatible = “gpio-leds”;
led_status_led {
label = “led-status”;
gpios = <&gpio 36 0>;
linux,default-trigger = “heartbeat”;
};
};

I tried to do change pin from gpio36 to gpio63 but it did not work.
I see that only difference between these two pins is that gpio36 is unused and gpio63 is used for AP wake.
so my question is, what changes i need to do in order to get gpio63 to work as heartbeat indicator driving LED on that pin?

Thanks,
Prathamesh

See the definition of the TEGRA_GPIO(bank, offset) macro in dt-bindings/gpio/tegra_gpio.h file to understand what number to use in the device tree source.

You can look up the name of the pin and sometimes the bank and offset in the pinmux spreadsheet. The bank and offset should be the PX.YY suffix at the end of the name, e.g., for gpio63 = BT_WAKE_AP = PH.06 the number calculated by the TEGRA_GPIO macro would be for bank H, offset 06: 7 * 8 + 6 = 62.

If that is not the actual bank or offset, you can find the actual values in the .dts or source files. Let me know what works please, I’d be interested in having a heartbeat LED too.