Kconfig Setup

本文介绍了如何在Linux内核2.6.25.8中添加CHAOZANG LED设备驱动的支持。首先,在arch/arm/Kconfig中引入相应配置文件,然后在drivers/chaozang目录下创建Kconfig和Makefile,定义LED设备测试菜单及编译选项。通过make menuconfig可以查看并启用CHAOZANG_LEDS选项,最后编译drivers/chaozang模块完成驱动集成。
摘要由CSDN通过智能技术生成

Step 1:

root@chaozang:/home/linux-2.6.25.8/arch/arm# vim Kconfig

source "net/Kconfig"

menu "Device Drivers"

source "drivers/chaozang/Kconfig"<-----------------------------------------------------------------------------New added!!!! by CZ,  This is the top level. 2013-01-28 19:28

source "drivers/base/Kconfig"

source "drivers/connector/Kconfig"

 

Step 2:

root@chaozang:/home/linux-2.6.25.8/drivers/chaozang# ls
chaozang_drv1.c  Kconfig  Makefile

 

Step 3:

root@chaozang:/home/linux-2.6.25.8/drivers/chaozang# vim Kconfig

menu "LED devices test"
        depends on HAS_IOMEM

config CHAOZANG_LEDS
        bool "CHAOZANG LED Support"
        help
           nothing to say! just test! 2013-01-28

endmenu

 

Step 4:

root@chaozang:/home/linux-2.6.25.8/drivers/chaozang# vim Makefile

# LED Core
obj-$(CONFIG_CHAOZANG_LEDS)                     += chaozang_drv1.o

 

Step 5:

root@chaozang:/home/linux-2.6.25.8# make menuconfig

x CONFIG_CHAOZANG_LEDS:                                                                                   x 
  x                                                                                                         x 
  x nothing to say! just test! 2013-01-28                                                                   x 
  x                                                                                                         x 
  x Symbol: CHAOZANG_LEDS [=n]                                                                              x 
  x Prompt: CHAOZANG LED Support                                                                            x 
  x   Defined at drivers/chaozang/Kconfig:5                                                                 x 
  x   Depends on: HAS_IOMEM                                                                                 x 
  x   Location:                                                                                             x 
  x     -> Device Drivers                                                                                   x 
  x       -> LED devices test                                                               x 

--------------------------------------------------

Attention:

if

 tristate "CHAOZANG LED Support"

then

root@chaozang:/home/linux-2.6.25.8# make SUBDIR=drivers/chaozang/ modules

----------------------------------------------------------------------------------

Contact:zangchao.cn@gmail.com

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值