1. v4l2_async_notifier的概念 v4l2_async_notifier是Linux V4L2(Video for Linux 2)异步框架中的一个关键组件,用于实现子设备(v4l2_subdev)的异步注册和管理。它允许设备驱动程序在设备实际准备好之前进行注册,并通过回调机制在设备准备就绪时通知V4L2核心进行后续处理。
3.1.1.3.1 v4l2_async_notifier structv4l2_async_notifier{conststructv4l2_async_notifier_operations*ops;//异步通知操作的函数指针,用于处理注册和注销子设备的回调函数。structv4l2_device*v4l2_dev;structv4l2_subdev*sd;structv4l2_async_notifier*parent;structlist_headasd_list;structlist_headwaiting;structlist_...
当subdev初始化时, 它会调用v4l2_async_notifier_register, 例如ov2640.c, 该函数会扫描notifier链表, 并进行匹配(匹配规则详见v4l2_async_find_match). 当匹配成功后, 会调用v4l2_device_register_subdev(v4l2_dev, sd)把subdev与v4l2_dev关联起来. 最后会调用notifier中定义的complete回调函数, 主控器代码在该...
To unregister the +notifier the driver has to call v4l2_async_notifier_unregister(). The former of +the two functions takes two arguments: a pointer to struct v4l2_device and a +pointer to struct v4l2_async_notifier. The latter contains a pointer to an array +of pointers to subdevice ...
* @unbind: a subdevice is leaving */ struct v4l2_async_notifier_operations { // 驱动匹配到从设备后调用此函数 int (*bound)(struct v4l2_async_notifier *notifier, struct v4l2_subdev *subdev, struct v4l2_async_subdev *asd); // 所有从设备被probed成功,调用此函数 int (*complete)(struct v4l2_...