1. 放置代码
在./source/driver/char下放置模块文件夹
2. Makefile和Kconfig
makefile文件参考
obj-$(AAA_LED) += AAA-led.o
Kconfig文件参考
config AAA_LED
tristate "Phytium macb led control module"
depends on XXX
default m
help
If you have a network (Ethernet) controller of this type and
want 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编译