diff mbox series

[RFC,7/8] media: v4l2-mediabus: Drop legacy V4L2_MBUS_CSI2_CHANNEL_* flags

Message ID 20220103162414.27723-8-laurent.pinchart+renesas@ideasonboard.com (mailing list archive)
State Mainlined
Commit 5a6ac3f4b46fd86d13e1d8ab4a55e4d89f3ab400
Delegated to: Kieran Bingham
Headers show
Series media: Drop .set_mbus_config(), improve .get_mbus_config() | expand

Commit Message

Laurent Pinchart Jan. 3, 2022, 4:24 p.m. UTC
The V4L2_MBUS_CSI2_CHANNEL_* flags are a legacy API. Only
V4L2_MBUS_CSI2_CHANNEL_0 is used, set in a single driver, and never
read. Drop those flags. Virtual channel information should be conveyed
through frame descriptors instead.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
---
 drivers/media/i2c/adv7180.c   |  1 -
 include/media/v4l2-mediabus.h | 10 ----------
 2 files changed, 11 deletions(-)

Comments

Jacopo Mondi Feb. 15, 2022, 11:01 a.m. UTC | #1
Hi Laurent

On Mon, Jan 03, 2022 at 06:24:13PM +0200, Laurent Pinchart wrote:
> The V4L2_MBUS_CSI2_CHANNEL_* flags are a legacy API. Only
> V4L2_MBUS_CSI2_CHANNEL_0 is used, set in a single driver, and never
> read. Drop those flags. Virtual channel information should be conveyed
> through frame descriptors instead.

I see one more user in the latest media master
drivers/media/platform/atmel/microchip-csi2dc.c:        if (mbus_config.flags & V4L2_MBUS_CSI2_CHANNEL_0)

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

Thanks
  j

>
> Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
> ---
>  drivers/media/i2c/adv7180.c   |  1 -
>  include/media/v4l2-mediabus.h | 10 ----------
>  2 files changed, 11 deletions(-)
>
> diff --git a/drivers/media/i2c/adv7180.c b/drivers/media/i2c/adv7180.c
> index 286f5017d9c3..3ff37a550810 100644
> --- a/drivers/media/i2c/adv7180.c
> +++ b/drivers/media/i2c/adv7180.c
> @@ -786,7 +786,6 @@ static int adv7180_get_mbus_config(struct v4l2_subdev *sd,
>  		cfg->type = V4L2_MBUS_CSI2_DPHY;
>  		cfg->bus.mipi_csi2.num_data_lanes = 1;
>  		cfg->bus.mipi_csi2.flags =
> -				V4L2_MBUS_CSI2_CHANNEL_0 |
>  				V4L2_MBUS_CSI2_CONTINUOUS_CLOCK;
>  	} else {
>  		/*
> diff --git a/include/media/v4l2-mediabus.h b/include/media/v4l2-mediabus.h
> index 44195ceeccca..c6626a22b394 100644
> --- a/include/media/v4l2-mediabus.h
> +++ b/include/media/v4l2-mediabus.h
> @@ -67,20 +67,10 @@
>  #define V4L2_MBUS_DATA_ENABLE_LOW		BIT(15)
>
>  /* Serial flags */
> -/* CSI-2 Virtual Channel identifiers. */
> -#define V4L2_MBUS_CSI2_CHANNEL_0		BIT(4)
> -#define V4L2_MBUS_CSI2_CHANNEL_1		BIT(5)
> -#define V4L2_MBUS_CSI2_CHANNEL_2		BIT(6)
> -#define V4L2_MBUS_CSI2_CHANNEL_3		BIT(7)
>  /* Clock non-continuous mode support. */
>  #define V4L2_MBUS_CSI2_CONTINUOUS_CLOCK		BIT(8)
>  #define V4L2_MBUS_CSI2_NONCONTINUOUS_CLOCK	BIT(9)
>
> -#define V4L2_MBUS_CSI2_CHANNELS		(V4L2_MBUS_CSI2_CHANNEL_0 | \
> -					 V4L2_MBUS_CSI2_CHANNEL_1 | \
> -					 V4L2_MBUS_CSI2_CHANNEL_2 | \
> -					 V4L2_MBUS_CSI2_CHANNEL_3)
> -
>  #define V4L2_MBUS_CSI2_MAX_DATA_LANES		8
>
>  /**
> --
> Regards,
>
> Laurent Pinchart
>
Laurent Pinchart Feb. 15, 2022, 11:10 a.m. UTC | #2
Hi Jacopo,

On Tue, Feb 15, 2022 at 12:01:41PM +0100, Jacopo Mondi wrote:
> On Mon, Jan 03, 2022 at 06:24:13PM +0200, Laurent Pinchart wrote:
> > The V4L2_MBUS_CSI2_CHANNEL_* flags are a legacy API. Only
> > V4L2_MBUS_CSI2_CHANNEL_0 is used, set in a single driver, and never
> > read. Drop those flags. Virtual channel information should be conveyed
> > through frame descriptors instead.
> 
> I see one more user in the latest media master
> drivers/media/platform/atmel/microchip-csi2dc.c:        if (mbus_config.flags & V4L2_MBUS_CSI2_CHANNEL_0)

Sakari has sent
https://lore.kernel.org/linux-media/20220202153609.240387-1-sakari.ailus@linux.intel.com
to address this.

Sakari, will you take the remainder of this series in your tree ?

> With that fixed
> Reviewed-by: Jacopo Mondi <jacopo+renesas@jmondi.org>
> 
> > Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
> > ---
> >  drivers/media/i2c/adv7180.c   |  1 -
> >  include/media/v4l2-mediabus.h | 10 ----------
> >  2 files changed, 11 deletions(-)
> >
> > diff --git a/drivers/media/i2c/adv7180.c b/drivers/media/i2c/adv7180.c
> > index 286f5017d9c3..3ff37a550810 100644
> > --- a/drivers/media/i2c/adv7180.c
> > +++ b/drivers/media/i2c/adv7180.c
> > @@ -786,7 +786,6 @@ static int adv7180_get_mbus_config(struct v4l2_subdev *sd,
> >  		cfg->type = V4L2_MBUS_CSI2_DPHY;
> >  		cfg->bus.mipi_csi2.num_data_lanes = 1;
> >  		cfg->bus.mipi_csi2.flags =
> > -				V4L2_MBUS_CSI2_CHANNEL_0 |
> >  				V4L2_MBUS_CSI2_CONTINUOUS_CLOCK;
> >  	} else {
> >  		/*
> > diff --git a/include/media/v4l2-mediabus.h b/include/media/v4l2-mediabus.h
> > index 44195ceeccca..c6626a22b394 100644
> > --- a/include/media/v4l2-mediabus.h
> > +++ b/include/media/v4l2-mediabus.h
> > @@ -67,20 +67,10 @@
> >  #define V4L2_MBUS_DATA_ENABLE_LOW		BIT(15)
> >
> >  /* Serial flags */
> > -/* CSI-2 Virtual Channel identifiers. */
> > -#define V4L2_MBUS_CSI2_CHANNEL_0		BIT(4)
> > -#define V4L2_MBUS_CSI2_CHANNEL_1		BIT(5)
> > -#define V4L2_MBUS_CSI2_CHANNEL_2		BIT(6)
> > -#define V4L2_MBUS_CSI2_CHANNEL_3		BIT(7)
> >  /* Clock non-continuous mode support. */
> >  #define V4L2_MBUS_CSI2_CONTINUOUS_CLOCK		BIT(8)
> >  #define V4L2_MBUS_CSI2_NONCONTINUOUS_CLOCK	BIT(9)
> >
> > -#define V4L2_MBUS_CSI2_CHANNELS		(V4L2_MBUS_CSI2_CHANNEL_0 | \
> > -					 V4L2_MBUS_CSI2_CHANNEL_1 | \
> > -					 V4L2_MBUS_CSI2_CHANNEL_2 | \
> > -					 V4L2_MBUS_CSI2_CHANNEL_3)
> > -
> >  #define V4L2_MBUS_CSI2_MAX_DATA_LANES		8
> >
> >  /**
diff mbox series

Patch

diff --git a/drivers/media/i2c/adv7180.c b/drivers/media/i2c/adv7180.c
index 286f5017d9c3..3ff37a550810 100644
--- a/drivers/media/i2c/adv7180.c
+++ b/drivers/media/i2c/adv7180.c
@@ -786,7 +786,6 @@  static int adv7180_get_mbus_config(struct v4l2_subdev *sd,
 		cfg->type = V4L2_MBUS_CSI2_DPHY;
 		cfg->bus.mipi_csi2.num_data_lanes = 1;
 		cfg->bus.mipi_csi2.flags =
-				V4L2_MBUS_CSI2_CHANNEL_0 |
 				V4L2_MBUS_CSI2_CONTINUOUS_CLOCK;
 	} else {
 		/*
diff --git a/include/media/v4l2-mediabus.h b/include/media/v4l2-mediabus.h
index 44195ceeccca..c6626a22b394 100644
--- a/include/media/v4l2-mediabus.h
+++ b/include/media/v4l2-mediabus.h
@@ -67,20 +67,10 @@ 
 #define V4L2_MBUS_DATA_ENABLE_LOW		BIT(15)
 
 /* Serial flags */
-/* CSI-2 Virtual Channel identifiers. */
-#define V4L2_MBUS_CSI2_CHANNEL_0		BIT(4)
-#define V4L2_MBUS_CSI2_CHANNEL_1		BIT(5)
-#define V4L2_MBUS_CSI2_CHANNEL_2		BIT(6)
-#define V4L2_MBUS_CSI2_CHANNEL_3		BIT(7)
 /* Clock non-continuous mode support. */
 #define V4L2_MBUS_CSI2_CONTINUOUS_CLOCK		BIT(8)
 #define V4L2_MBUS_CSI2_NONCONTINUOUS_CLOCK	BIT(9)
 
-#define V4L2_MBUS_CSI2_CHANNELS		(V4L2_MBUS_CSI2_CHANNEL_0 | \
-					 V4L2_MBUS_CSI2_CHANNEL_1 | \
-					 V4L2_MBUS_CSI2_CHANNEL_2 | \
-					 V4L2_MBUS_CSI2_CHANNEL_3)
-
 #define V4L2_MBUS_CSI2_MAX_DATA_LANES		8
 
 /**