Based on imx6ulevk EVK, I would like to write a helloworld GPIO module for char driver, and think the ON/OFF hardware button on board can be a reference design.
From schema and pin tool, I see that ON/OFF button is on R8 pin, peripheral is System Reset Controllor(SRC) , with src.RESET_B in IOMUX
However, where is the source code for this driver? I tried various of searching ways, including searching keywords in source, in build directory, and in running board /proc, but none of them had got me there. I had written drivers for linux 2.6 many years ago, but when trying to refresh self and picking things up in yocto + Linux 4.x recently, confusion are confronted more than expected.
Could anyone tell me what is the correct steps to search for its driver? Or... is it a pure hardware button and just power off CPU without any source code..?
Thanks & Regards
-Shawn
Hi Shawn
I doubt if "ON/OFF" driver exists, but for usage System Reset Controllor(SRC) may be
useful to look at FreeRTOS examples
..boards/evkmcimx6ul/demo_apps/power_mode_switch/power_mode_switch.c
..boards/evkmcimx6ul/driver_examples/src/src_reset_source/src_reset_source.c
..boards/evkmcimx6ul/driver_examples/wdog/wdog.c
Board Support Packages (7)
SDK2.2_iMX6UL_WIN(REV SDK2.2)
http://www.nxp.com/products/microcontrollers-and-processors/arm-processors/i.mx-processors/i.mx-6-pr...
for hello world one can look at
IMX Hello World - Variscite Wiki
Best regards
igor
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Thanks. as you said, on/off button doesn't have driver. Then I found a proper pin and mux'd it as GPIO, then had written a userspace driver. It was enough for the experiment.