Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
760 views
in Technique[技术] by (71.8m points)

linux device driver - Need help in enable configuration when compile Kernel module

I am using 3.10.x kernel tree. My kernel module needs config VIDEOBUF2.

That is defined in drivers/media/v4l2-core/Kconfig:

# Used by drivers that need Videobuf2 modules
config VIDEOBUF2_CORE
    select DMA_SHARED_BUFFER
    tristate

So I put 'CONFIG_VIDEOBUF2_CORE=y' in my Kernel config file and compile. From the Kconfig it has CONFIG_VIDEOBUF2_CORE has no dependency and I think adding CONFIG_VIDEOBUF2_CORE=y to my kernel config should work. I am modify the right kernel config file since I set other flags like CONFIG_VIDEO_DEV=y and that works.

The generated .config does not contain 'CONFIG_VIDEOBUF2_CORE=y'

and the compilation fails with a bunch of

undefined reference to `vb2_buffer_done'
undefined reference to `vb2_buffer_done'
undefined reference to `vb2_buffer_done'
undefined reference to `vb2_buffer_done'

I really appreciate if someone can help me with this.

Thank you.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

I cant directly comment on the subject as it requires 50 reputations to have this privilege. You can do : make ARCH = target_architecture CROSS_COMPILE = toolchain defconfig_file. This command execution will create a .config file in home directory of your kernel source. This file would contain default configuration for the peripherals on your target SOC ( I assume you have knowledge pertaining to defconfig files). Now if you wish to manipulate it and want to add your device support to it do : make menuconfig and you could add your device support by selecting configuration say like VIDEOBUF2_CORE in your case and then your kernel soure is ready to be compiled/cross-compiled. PS: Avoid editing .config file manually.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...