分类: LINUX
2010-11-10 22:54:54
linux GPIO driver analyze
不同平台上GPIO使用方法:
输入输出设置:
s3c2440 platform:
在linux\arch\arm\mach-s3c2410 define a serial func that can config GPIO with pin num and func parameter, so anyone driver can refer it. void s3c2410_gpio_cfgpin(unsigned int pin, unsigned int function) EXPORT_SYMBOL(s3c2410_gpio_cfgpin);
MX27 platform: first in file: linux\arch\arm\mach-mx27\mx27mdkv0_gpio.c define a serial of func for GPIO use, such as : void gpio_si4702_active(void); void gpio_si4702_inactive(void); void gpio_si4702_reset(void); void gpio_si4702_powerdown(void); ... and EXPORT_SYMBOL, then in drivers such as si4702, then it use these funcs prepared in kernel. 可见,要修改MX27平台中GPIO的使用,一定要修改内核内码,至少要在mx27mdkv0_gpio.c中增加新使用的gpio函数。