4418GPIO port calling process

4418GPIO port calling process

 

1. Start level-by-level search from the itop4418_led.c file

E:\iTOP4418\linux\kernel\kernel-3.4.39\drivers\char\itop4418_led.c

Find the gpio_set_value(LED_GPIO,0) in it;

2. gpio_set_value is a macro defined in E:\iTOP4418\linux\kernel\kernel-3.4.39\arch\arm\include\asm\gpio.h file

 

3. Find __gpio_set_value in the E:\iTOP4418\linux\kernel\kernel-3.4.39\drivers\gpio\gpiolib.c file

After testing and printing, the chip->set function is called, which is initialized in gpio_nxp.c

4. Initialize chip->set in E:\iTOP4418\linux\kernel\kernel-3.4.39\drivers\gpio\gpio_nxp.c

   

As can be seen from the above figure, chip->set points to the nxp_gpio_set_value function

5. Find the nxp_gpio_set_value function in E:\iTOP4418\linux\kernel\kernel-3.4.39\drivers\gpio\gpio_nxp.c

The nxp_soc_gpio_set_io_dir function is used to set the direction of io, and nxp_soc_gpio_set_out_value is used to set the value of the corresponding IO port.

6. Check nxp_soc_gpio_set_out_value in E:\iTOP4418\linux\kernel\kernel-3.4.39\arch\arm\mach-s5p4418\soc\gpio.c file

Check NX_GPIO_Setoutputvalue function

7. In the nx_gpio.c file in the E:\iTOP4418\linux\prototype\s5p4418\module or E:\iTOP4418\linux\kernel\kernel-3.4.39\arch\arm\mach-s5p4418\prototype\module directory There is NX_GPIO_SetOutputValue function

8. In the nx_gpio.c file in the E:\iTOP4418\linux\prototype\s5p4418\module or E:\iTOP4418\linux\kernel\kernel-3.4.39\arch\arm\mach-s5p4418\prototype\module directory There is NX_GPIO_SetBit function

Here, the register is controlled by the wirteIO32 function to control the IO port

 

  

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324578765&siteId=291194637