[PATCH 02/16] media: v4l2-device: Add struct v4l2_device.flags

Nicolas Dufresne nicolas at ndufresne.ca
Tue Nov 3 05:51:33 PST 2026


Le mardi 03 novembre 2026 à 10:09 +0200, Gjorgji Rosikopulos (Consultant) a
écrit :
> Hi Daniel,
> 
> On 11/3/2026 9:40 AM, Daniel Scally wrote:
> > Add a flags field to struct v4l2_device, along with a single flag
> > value that is designed to tell v4l2-async in which direction data
> > flows for this v4l2 device so that it knows how to set up device
> > links between subdevices connected using the async APIs.
> > 
> > Signed-off-by: Daniel Scally <dan.scally at ideasonboard.com>
> > ---
> >  include/media/v4l2-device.h | 7 +++++++
> >  1 file changed, 7 insertions(+)
> > 
> > diff --git a/include/media/v4l2-device.h b/include/media/v4l2-device.h
> > index 25f69b1b8db03d077f7570471d5c6910fcafe110..9b17916d63641ba637cf8c37aa925749bd4e2134 100644
> > --- a/include/media/v4l2-device.h
> > +++ b/include/media/v4l2-device.h
> > @@ -15,6 +15,9 @@
> >  
> >  struct v4l2_ctrl_handler;
> >  
> > +/* Set this flag if this V4L2 device is an "output" rather than an "input". */
> > +#define V4L2_DEVICE_FL_IS_OUTPUT			BIT(0)
> 
> Just for the clarification do we change the meaning of output->capture to input->output?
> I know that output is confusing for everyone including me but somehow i get used to it.
> However to clarify what this means will be helpful :-)

I agree this is confusing. To avoid all the legacy, we could use PRODUCER /
CONSUMER, or does anyone has a better idea?

Nicolas

> 
> ~Gjorgji
> 
> > +
> >  /**
> >   * struct v4l2_device - main struct to for V4L2 device drivers
> >   *
> > @@ -30,6 +33,9 @@ struct v4l2_ctrl_handler;
> >   * @ref: Keep track of the references to this struct.
> >   * @release: Release function that is called when the ref count
> >   *	goes to 0.
> > + * @flags: device flags. Can be:
> > + *   %V4L2_DEVICE_FL_IS_OUTPUT - Set this flag if this V4L2 device is an
> > + *   "output" rather than an "input"
> >   *
> >   * Each instance of a V4L2 device should create the v4l2_device struct,
> >   * either stand-alone or embedded in a larger struct.
> > @@ -54,6 +60,7 @@ struct v4l2_device {
> >  	struct v4l2_prio_state prio;
> >  	struct kref ref;
> >  	void (*release)(struct v4l2_device *v4l2_dev);
> > +	u32 flags;
> >  };
> >  
> >  /**
> > 
> 
> 
> _______________________________________________
> Linux-rockchip mailing list
> Linux-rockchip at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-rockchip
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 228 bytes
Desc: This is a digitally signed message part
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20261103/a8ebdaf1/attachment.sig>


More information about the linux-arm-kernel mailing list