diff mbox series

[v5,16/24] v4l: Add CSI-2 bus configuration to frame descriptors

Message ID 20210415130450.421168-17-tomi.valkeinen@ideasonboard.com
State Superseded
Headers show
Series v4l: subdev internal routing | expand

Commit Message

Tomi Valkeinen April 15, 2021, 1:04 p.m. UTC
From: Sakari Ailus <sakari.ailus@linux.intel.com>

Add CSI-2 bus specific configuration to the frame descriptors. This allows
obtaining the virtual channel and data type information for each stream
the transmitter is sending.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Reviewed-by: Jacopo Mondi <jacopo+renesas@jmondi.org>
---
 include/media/v4l2-subdev.h | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

Comments

Laurent Pinchart April 18, 2021, 7:24 p.m. UTC | #1
Hi Tomi and Sakari,

Thank you for the patch.

On Thu, Apr 15, 2021 at 04:04:42PM +0300, Tomi Valkeinen wrote:
> From: Sakari Ailus <sakari.ailus@linux.intel.com>

> 

> Add CSI-2 bus specific configuration to the frame descriptors. This allows

> obtaining the virtual channel and data type information for each stream

> the transmitter is sending.

> 

> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>

> Reviewed-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>

> Reviewed-by: Jacopo Mondi <jacopo+renesas@jmondi.org>

> ---

>  include/media/v4l2-subdev.h | 16 ++++++++++++++++

>  1 file changed, 16 insertions(+)

> 

> diff --git a/include/media/v4l2-subdev.h b/include/media/v4l2-subdev.h

> index 85977abbea46..30ec011d31e3 100644

> --- a/include/media/v4l2-subdev.h

> +++ b/include/media/v4l2-subdev.h

> @@ -308,6 +308,17 @@ struct v4l2_subdev_audio_ops {

>  	int (*s_stream)(struct v4l2_subdev *sd, int enable);

>  };

>  

> +/**

> + * struct v4l2_mbus_frame_desc_entry_csi2

> + *

> + * @channel: CSI-2 virtual channel


Maybe s/channel/virtual_channel/ ? Or vc and dt ?

> + * @data_type: CSI-2 data type ID

> + */

> +struct v4l2_mbus_frame_desc_entry_csi2 {

> +	u8 channel;

> +	u8 data_type;

> +};

> +

>  /**

>   * enum v4l2_mbus_frame_desc_flags - media bus frame description flags

>   *

> @@ -331,11 +342,16 @@ enum v4l2_mbus_frame_desc_flags {

>   *		%FRAME_DESC_FL_BLOB is not set.

>   * @length:	number of octets per frame, valid if @flags

>   *		%V4L2_MBUS_FRAME_DESC_FL_LEN_MAX is set.

> + * @bus:	Bus specific frame descriptor parameters


s/Bus specific/Bus-specific/

> + * @bus.csi2:	CSI-2 specific bus configuration


Ditto.

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>


>   */

>  struct v4l2_mbus_frame_desc_entry {

>  	enum v4l2_mbus_frame_desc_flags flags;

>  	u32 pixelcode;

>  	u32 length;

> +	union {

> +		struct v4l2_mbus_frame_desc_entry_csi2 csi2;

> +	} bus;

>  };

>  

>  #define V4L2_FRAME_DESC_ENTRY_MAX	4


-- 
Regards,

Laurent Pinchart
Sakari Ailus April 20, 2021, 4:32 p.m. UTC | #2
Hi Laurent,

On Sun, Apr 18, 2021 at 10:24:54PM +0300, Laurent Pinchart wrote:
> Hi Tomi and Sakari,

> 

> Thank you for the patch.

> 

> On Thu, Apr 15, 2021 at 04:04:42PM +0300, Tomi Valkeinen wrote:

> > From: Sakari Ailus <sakari.ailus@linux.intel.com>

> > 

> > Add CSI-2 bus specific configuration to the frame descriptors. This allows

> > obtaining the virtual channel and data type information for each stream

> > the transmitter is sending.

> > 

> > Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>

> > Reviewed-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>

> > Reviewed-by: Jacopo Mondi <jacopo+renesas@jmondi.org>

> > ---

> >  include/media/v4l2-subdev.h | 16 ++++++++++++++++

> >  1 file changed, 16 insertions(+)

> > 

> > diff --git a/include/media/v4l2-subdev.h b/include/media/v4l2-subdev.h

> > index 85977abbea46..30ec011d31e3 100644

> > --- a/include/media/v4l2-subdev.h

> > +++ b/include/media/v4l2-subdev.h

> > @@ -308,6 +308,17 @@ struct v4l2_subdev_audio_ops {

> >  	int (*s_stream)(struct v4l2_subdev *sd, int enable);

> >  };

> >  

> > +/**

> > + * struct v4l2_mbus_frame_desc_entry_csi2

> > + *

> > + * @channel: CSI-2 virtual channel

> 

> Maybe s/channel/virtual_channel/ ? Or vc and dt ?


Either seems good.

It's inherently about CSI-2 so maybe vc and dt below?

> 

> > + * @data_type: CSI-2 data type ID

> > + */

> > +struct v4l2_mbus_frame_desc_entry_csi2 {

> > +	u8 channel;

> > +	u8 data_type;

> > +};

> > +

> >  /**

> >   * enum v4l2_mbus_frame_desc_flags - media bus frame description flags

> >   *

> > @@ -331,11 +342,16 @@ enum v4l2_mbus_frame_desc_flags {

> >   *		%FRAME_DESC_FL_BLOB is not set.

> >   * @length:	number of octets per frame, valid if @flags

> >   *		%V4L2_MBUS_FRAME_DESC_FL_LEN_MAX is set.

> > + * @bus:	Bus specific frame descriptor parameters

> 

> s/Bus specific/Bus-specific/

> 

> > + * @bus.csi2:	CSI-2 specific bus configuration

> 

> Ditto.

> 

> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>


Thanks!

-- 
Sakari Ailus
diff mbox series

Patch

diff --git a/include/media/v4l2-subdev.h b/include/media/v4l2-subdev.h
index 85977abbea46..30ec011d31e3 100644
--- a/include/media/v4l2-subdev.h
+++ b/include/media/v4l2-subdev.h
@@ -308,6 +308,17 @@  struct v4l2_subdev_audio_ops {
 	int (*s_stream)(struct v4l2_subdev *sd, int enable);
 };
 
+/**
+ * struct v4l2_mbus_frame_desc_entry_csi2
+ *
+ * @channel: CSI-2 virtual channel
+ * @data_type: CSI-2 data type ID
+ */
+struct v4l2_mbus_frame_desc_entry_csi2 {
+	u8 channel;
+	u8 data_type;
+};
+
 /**
  * enum v4l2_mbus_frame_desc_flags - media bus frame description flags
  *
@@ -331,11 +342,16 @@  enum v4l2_mbus_frame_desc_flags {
  *		%FRAME_DESC_FL_BLOB is not set.
  * @length:	number of octets per frame, valid if @flags
  *		%V4L2_MBUS_FRAME_DESC_FL_LEN_MAX is set.
+ * @bus:	Bus specific frame descriptor parameters
+ * @bus.csi2:	CSI-2 specific bus configuration
  */
 struct v4l2_mbus_frame_desc_entry {
 	enum v4l2_mbus_frame_desc_flags flags;
 	u32 pixelcode;
 	u32 length;
+	union {
+		struct v4l2_mbus_frame_desc_entry_csi2 csi2;
+	} bus;
 };
 
 #define V4L2_FRAME_DESC_ENTRY_MAX	4