如果想改变一条config的状态,按tab空格键可以选择编译成m还是*
做了个7180的驱动,打算放在内核里编译成模块,我的c文件目录是/driver/media/video/下
所以先在video目录下的makefile里加obj-$(CONFIG_VIDEO_ADV7180_HYC) += adv7180_hyc.o
然后到video目录下的kconfig加
config VIDEO_ADV7180_HYC
tristate "Analog Devices ADV7180 HYC decoder"
default m
---help---
Support for the Analog Devices ADV7180 video decoder.
To compile this driver as a module, choose M here: the
module will be called adv7180.
做完这个之后,在kernel目录下终端输入:
make ARCH=arm CROSS_COMPILE=arm-hisiv300-linux- menuconfig
然后按键盘的?/按键搜索7180发现
# CONFIG_MEDIA_SUPPORT is not set
│ Symbol: VIDEO_ADV7180_HYC [=n] │
│ Type : tristate │
│ Prompt: Analog Devices ADV7180 decoder │
│ Defined at drivers/media/video/Kconfig:276 │
│ Depends on: MEDIA_SUPPORT [=n] && VIDEO_CAPTURE_DRIVERS [=n] && VIDEO_V4L2 [=n] && !VIDEO_HELPER_CHIPS_AUTO [=n] │
│ Location: │
│ -> Device Drivers │
│ -> Multimedia support (MEDIA_SUPPORT [=n]) │
│ -> Video capture adapters (VIDEO_CAPTURE_DRIVERS [=n]) │
│ -> Encoders, decoders, sensors and other helper chips
所以先找一级目录Multimedia support
在arch/arm/configs/hi3516a_full_defconfig里
# CONFIG_REGULATOR_TPS6524X is not set本来是not set 所以[=n]
改成CONFIG_MEDIA_SUPPORT=y
然后看二级目录Video capture adapters
在./media/video/Kconfig:menuconfig VIDEO_CAPTURE_DRIVERS
menuconfig VIDEO_CAPTURE_DRIVERS
bool "Video capture adapters"
#depends on VIDEO_V4L2 本来基于v4l2但是这个没生效所以[=n]让它生效就注释这句话
default y
---help---
Say Y here to enable selecting the video adapters for
webcams, analog TV, and hybrid analog/digital TV.
Some of those devices also supports FM radio.
#if VIDEO_CAPTURE_DRIVERS && VIDEO_V4L2 本来是这两个条件同时生效才产生下面的菜单,现在注释一个
if VIDEO_CAPTURE_DRIVERS
config VIDEO_ADV7180_HYC 把config加在这个if里就可以生成在VIDEO_CAPTURE_DRIVERS的下级菜单中
tristate "Analog Devices ADV7180 HYC decoder"
default m
---help---
Support for the Analog Devices ADV7180 video decoder.
To compile this driver as a module, choose M here: the
module will be called adv7180.