1. 放置代碼
在./source/driver/char下放置模塊文件夾
2. Makefile和Kconfig
makefile文件參考
obj-$(AAA_LED) += AAA-led.o
Kconfig文件參考
config AAA_LEDtristate "Phytium macb led control module"depends on XXXdefault mhelpIf you have a network (Ethernet) controller of this type andwant to use it control port led say Y or M here.
3. 修改字符設備驅動文件
修改./source/driver/char/Kconfig
添加
source "drivers/char/AAA_led/Kconfig"
與其AAA的kconfig關聯
修改./source/driver/char/Makefile
添加
obj-$(CONFIG_AAA_LED) += AAA/AAA-led.o
告訴char根據這個config編譯