Hi Hans,
Thanks for the comments!
Hans Verkuil wrote:
...
>> @@ -424,6 +430,8 @@ struct v4l2_subdev_ops {
>> #define V4L2_SUBDEV_FL_IS_SPI (1U << 1)
>> /* Set this flag if this subdev needs a device node. */
>> #define V4L2_SUBDEV_FL_HAS_DEVNODE (1U << 2)
>> +/* Set this flag if this subdev generates events. */
>> +#define V4L2_SUBDEV_FL_HAS_EVENTS (1U << 3)
>
> Do we need this flag...
>
>>
>> /* Each instance of a subdev driver should create this struct, either
>> stand-alone or embedded in a larger struct.
>> @@ -446,6 +454,8 @@ struct v4l2_subdev {
>> /* subdev device node */
>> struct video_device devnode;
>> unsigned int initialized;
>> + /* number of events to be allocated on open */
>> + unsigned int nevents;
>
> ...when we have this field? We could just test whether nevents > 0.
Not necessarily. But:
- It's easy to check whether events are expected to be supported by the
driver using the flag and
- AFAIR it was agreed that as the driver is free to allocate more events
using v4l2_event_alloc(), it may choose not to allocate any at
initialisation but e.g. do it in in VIDIOC_SUBSCRIBE_EVENT only.
What do you think?
--
Sakari Ailus
[email protected]
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html