This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

AM335x device tree questions

Other Parts Discussed in Thread: AM3358

Hello All,

In our developing board there is a led pin connecting to pin T13 (GPMC_CSn3) of AM3358. By searching TRM Table 9-10 and DM Table 4-1, I found that T13 (GPMC_CSn3)'s offset is 888 and muxed to GPIO2-0. To make it working, in the ourOwn.dtsi file I have following part of code:

/ {
......

/* the first part code */ 
leds {
pinctrl-names = "default";
pinctrl-0 = <&user_leds>;
compatible = "gpio-leds";

led@0 {
label = "ourBoard:green:usr0";
gpios = <&gpio2 0 GPIO_ACTIVE_LOW>;
linux, default-trigger = "heartbeat";
default-state = "off";
};
......
}
...... 

/* the second part code */
user_leds: pinmux_user_leds {
pinctrl-single, pins = <
0x88 ( PIN_OUTPUT | MUX_MODE7 ) /* (T13) gpmc_csn3.gpio2[0] */

......
>;
};
......
};

My questions are: Is above setting enough to control the led by changing the /sys/class/leds/ourBoard:green:usr0/brightness? 
Can I only have the first part code without the second part of code to make it work? Or are both parts are necessary and needed to be matched each other (offset address and gpio#)?

Hope I express it clearly.

Thanks again for your help.

Regards,
Finspoo