求解V4L2相关知识
在V4L2驱动中有这么两个文件:
V4l2-device.h 和 V4l2-dev.h
这两个文件都都定义了个啥?
具体一点的:
分别两个注册函数:
/* Initialize v4l2_dev and make dev->driver_data point to v4l2_dev.
dev may be NULL in rare cases (ISA devices). In that case you
must fill in the v4l2_dev->name field before calling this function. */
int __must_check v4l2_device_register(struct device *dev, struct v4l2_device
*v4l2_dev);
/* Register video devices. Note that if video_register_device fails,
the release() callback of the video_device structure is *not* called, so
the caller is responsible for freeing any data. Usually that means that
you call video_device_release() on failure. */
static inline int __must_check video_register_device(struct video_device *vdev,
int type, int nr)
一个是v4l2 device 一个解释是video devices
这两个device有什么区别和关联呢? 谢谢
[解决办法]
个人理解无非是登记不同信息的连个全局变量。
代码注释里面其实已经有说明了。