Hi Experts
i am using custom board with am6412 soc, In that i need access my leds connected to OSPI Pins,how can we put the device tree entry for those leds access,can you suggest some points for this query
Thanks in advance
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.
Hi Experts
i am using custom board with am6412 soc, In that i need access my leds connected to OSPI Pins,how can we put the device tree entry for those leds access,can you suggest some points for this query
Thanks in advance
Hey Uthaya,
I'm working on some graphics patches right now. Please give me another day to respond to this.
Regards,
Randolph
Hi Uthaya,
The schematics snipet seems showing all the OSPI pins will be used in GPIO mode, is it correct?
Hi Uthaya,
Generally, here are the steps:
1. define the pinmux settings in device tree to configure these pins in GPIO mode.
2. add the "pinctrl-names" and "pinctrl-0" DT properties witch point to the pinmux settings to the DT node which controls the GPIO pins.
3. add "xxx-gpios" DT property to the DT node which controls the GPIO pins;
4. in the kernel driver which controls the GPIO pins, use kernel gpiod framework API to query and use the GPIO pins.
Please search the GPIO pin usage in kernel k3-am642-sk.dts for examples.
Hi Bin
&main_gpio0 { pinctrl-names = "default"; pinctrl-0 = <&ospi0_pins_default>; gpio0-3 { gpio-hog; gpios = <3 GPIO_ACTIVE_HIGH>; output-high; line-name = "ospi_pins"; }; }; leds { compatible = "gpio-leds"; pinctrl-names = "default"; pinctrl-0 = <&ospi0_pins_default>; led-0 { label = "am64-gp:red:heartbeat"; gpios = <&main_gpio0 3 GPIO_ACTIVE_HIGH>; linux,default-trigger = "heartbeat"; function = LED_FUNCTION_HEARTBEAT; default-state = "off"; }; };
Can you check this is fine ?
Hi Uthaya,
Mostly looks good to me, but I don't think you should use <&ospi0_pins_default> pinmux more than once. I never did this, and I don't know if it is correct or not.