All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sakari Ailus <sakari.ailus@maxwell.research.nokia.com>
To: Hans Verkuil <hverkuil@xs4all.nl>
Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
	linux-media@vger.kernel.org
Subject: Re: [PATCH v6 7/7] v4l: subdev: Events support
Date: Fri, 04 Feb 2011 14:03:13 +0200	[thread overview]
Message-ID: <4D4BEB01.9000502@maxwell.research.nokia.com> (raw)
In-Reply-To: <201102041112.14105.hverkuil@xs4all.nl>

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
sakari.ailus@maxwell.research.nokia.com

  reply	other threads:[~2011-02-04 12:03 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-27 12:28 [PATCH v6 0/7] V4L2 subdev userspace API Laurent Pinchart
2011-01-27 12:28 ` [PATCH v6 1/7] v4l: Share code between video_usercopy and video_ioctl2 Laurent Pinchart
2011-01-27 12:28 ` [PATCH v6 2/7] v4l: subdev: Don't require core operations Laurent Pinchart
2011-01-27 12:28 ` [PATCH v6 3/7] v4l: subdev: Merge v4l2_i2c_new_subdev_cfg and v4l2_i2c_new_subdev Laurent Pinchart
2011-01-27 12:28 ` [PATCH v6 4/7] v4l: subdev: Add device node support Laurent Pinchart
2011-02-04 10:09   ` Hans Verkuil
2011-02-09 17:37     ` Laurent Pinchart
2011-01-27 12:28 ` [PATCH v6 5/7] v4l: subdev: Uninline the v4l2_subdev_init function Laurent Pinchart
2011-01-27 12:28 ` [PATCH v6 6/7] v4l: subdev: Control ioctls support Laurent Pinchart
2011-01-27 12:28 ` [PATCH v6 7/7] v4l: subdev: Events support Laurent Pinchart
2011-02-04 10:12   ` Hans Verkuil
2011-02-04 12:03     ` Sakari Ailus [this message]
2011-02-04 12:10       ` Hans Verkuil

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4D4BEB01.9000502@maxwell.research.nokia.com \
    --to=sakari.ailus@maxwell.research.nokia.com \
    --cc=hverkuil@xs4all.nl \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-media@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.