二:实例讲解步骤
我们以添加oloir红外驱动为例讲解_
1:先选择一个放置驱动代码的位置:drivers/olo_ir,把代码放到这个目录中?
2:在drivers/olo_ir添加Kconfig文件,内容如下:
menu "OLO ir support"
config OLOIR
tristate "OLO ir support"
---help---
olo ir use gpio as ir input .
If you want olo ir support, you should say Y here and also to the
specific driver for your bus adapter(s) below.
This olo ir support can be built as a module.
endmenu
3:编写makefile,内容很简单:
obj-$(CONFIG_OLOIR) += oloir.o
4:修改上一级Makefile和Kconfig
在Makefile中添加:obj-$(CONFIG_OLOIR) += olo_ir/
在Kconfig中添势:source "drivers/olo_ir/Kconfig"
5:在arch/arm的Kconfig中添势
source "drivers/olo_ir/Kconfig"
这个位置按照你的平台的架构而定
|