Linux Media Controller development
 help / color / mirror / Atom feed
From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Tomi Valkeinen <tomi.valkeinen@ti.com>
Cc: linux-media@vger.kernel.org, Benoit Parrot <bparrot@ti.com>,
	Mauro Carvalho Chehab <mchehab@kernel.org>
Subject: Re: [PATCH 06/16] media: ti-vpe: cal: remove useless CAL_GEN_* macros
Date: Mon, 16 Mar 2020 14:24:05 +0200	[thread overview]
Message-ID: <20200316122405.GW4732@pendragon.ideasonboard.com> (raw)
In-Reply-To: <20200313114121.32182-6-tomi.valkeinen@ti.com>

Hi Tomi,

Thank you for the patch.

On Fri, Mar 13, 2020 at 01:41:11PM +0200, Tomi Valkeinen wrote:
> These macros only obfuscate the code, so drop them.
> 
> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>

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

> ---
>  drivers/media/platform/ti-vpe/cal.c      | 20 ++++++++------------
>  drivers/media/platform/ti-vpe/cal_regs.h |  9 ---------
>  2 files changed, 8 insertions(+), 21 deletions(-)
> 
> diff --git a/drivers/media/platform/ti-vpe/cal.c b/drivers/media/platform/ti-vpe/cal.c
> index 0888d6aac3f4..cd788c6687cb 100644
> --- a/drivers/media/platform/ti-vpe/cal.c
> +++ b/drivers/media/platform/ti-vpe/cal.c
> @@ -775,10 +775,8 @@ static void csi2_phy_init(struct cal_ctx *ctx)
>  
>  	/* 3.B. Program Stop States */
>  	val = reg_read(ctx->dev, CAL_CSI2_TIMING(ctx->csi2_port));
> -	set_field(&val, CAL_GEN_ENABLE,
> -		  CAL_CSI2_TIMING_STOP_STATE_X16_IO1_MASK);
> -	set_field(&val, CAL_GEN_DISABLE,
> -		  CAL_CSI2_TIMING_STOP_STATE_X4_IO1_MASK);
> +	set_field(&val, 1, CAL_CSI2_TIMING_STOP_STATE_X16_IO1_MASK);
> +	set_field(&val, 0, CAL_CSI2_TIMING_STOP_STATE_X4_IO1_MASK);
>  	set_field(&val, 407, CAL_CSI2_TIMING_STOP_STATE_COUNTER_IO1_MASK);
>  	reg_write(ctx->dev, CAL_CSI2_TIMING(ctx->csi2_port), val);
>  	ctx_dbg(3, ctx, "CAL_CSI2_TIMING(%d) = 0x%08x Stop States\n",
> @@ -787,8 +785,7 @@ static void csi2_phy_init(struct cal_ctx *ctx)
>  
>  	/* 4. Force FORCERXMODE */
>  	val = reg_read(ctx->dev, CAL_CSI2_TIMING(ctx->csi2_port));
> -	set_field(&val, CAL_GEN_ENABLE,
> -		  CAL_CSI2_TIMING_FORCE_RX_MODE_IO1_MASK);
> +	set_field(&val, 1, CAL_CSI2_TIMING_FORCE_RX_MODE_IO1_MASK);
>  	reg_write(ctx->dev, CAL_CSI2_TIMING(ctx->csi2_port), val);
>  	ctx_dbg(3, ctx, "CAL_CSI2_TIMING(%d) = 0x%08x Force RXMODE\n",
>  		ctx->csi2_port,
> @@ -851,8 +848,7 @@ static void csi2_wait_for_phy(struct cal_ctx *ctx)
>  	for (i = 0; i < 10; i++) {
>  		if (reg_read_field(ctx->dev,
>  				   CAL_CSI2_TIMING(ctx->csi2_port),
> -				   CAL_CSI2_TIMING_FORCE_RX_MODE_IO1_MASK) ==
> -		    CAL_GEN_DISABLE)
> +				   CAL_CSI2_TIMING_FORCE_RX_MODE_IO1_MASK) == 0)
>  			break;
>  		usleep_range(1000, 1100);
>  	}
> @@ -949,13 +945,13 @@ static void csi2_ppi_enable(struct cal_ctx *ctx)
>  {
>  	reg_write(ctx->dev, CAL_CSI2_PPI_CTRL(ctx->csi2_port), BIT(3));
>  	reg_write_field(ctx->dev, CAL_CSI2_PPI_CTRL(ctx->csi2_port),
> -			CAL_GEN_ENABLE, CAL_CSI2_PPI_CTRL_IF_EN_MASK);
> +			1, CAL_CSI2_PPI_CTRL_IF_EN_MASK);
>  }
>  
>  static void csi2_ppi_disable(struct cal_ctx *ctx)
>  {
>  	reg_write_field(ctx->dev, CAL_CSI2_PPI_CTRL(ctx->csi2_port),
> -			CAL_GEN_DISABLE, CAL_CSI2_PPI_CTRL_IF_EN_MASK);
> +			0, CAL_CSI2_PPI_CTRL_IF_EN_MASK);
>  }
>  
>  static void csi2_ctx_config(struct cal_ctx *ctx)
> @@ -1030,7 +1026,7 @@ static void pix_proc_config(struct cal_ctx *ctx)
>  	set_field(&val, CAL_PIX_PROC_DPCME_BYPASS, CAL_PIX_PROC_DPCME_MASK);
>  	set_field(&val, pack, CAL_PIX_PROC_PACK_MASK);
>  	set_field(&val, ctx->csi2_port, CAL_PIX_PROC_CPORT_MASK);
> -	set_field(&val, CAL_GEN_ENABLE, CAL_PIX_PROC_EN_MASK);
> +	set_field(&val, 1, CAL_PIX_PROC_EN_MASK);
>  	reg_write(ctx->dev, CAL_PIX_PROC(ctx->csi2_port), val);
>  	ctx_dbg(3, ctx, "CAL_PIX_PROC(%d) = 0x%08x\n", ctx->csi2_port,
>  		reg_read(ctx->dev, CAL_PIX_PROC(ctx->csi2_port)));
> @@ -1050,7 +1046,7 @@ static void cal_wr_dma_config(struct cal_ctx *ctx,
>  		  CAL_WR_DMA_CTRL_MODE_MASK);
>  	set_field(&val, CAL_WR_DMA_CTRL_PATTERN_LINEAR,
>  		  CAL_WR_DMA_CTRL_PATTERN_MASK);
> -	set_field(&val, CAL_GEN_ENABLE, CAL_WR_DMA_CTRL_STALL_RD_MASK);
> +	set_field(&val, 1, CAL_WR_DMA_CTRL_STALL_RD_MASK);
>  	reg_write(ctx->dev, CAL_WR_DMA_CTRL(ctx->csi2_port), val);
>  	ctx_dbg(3, ctx, "CAL_WR_DMA_CTRL(%d) = 0x%08x\n", ctx->csi2_port,
>  		reg_read(ctx->dev, CAL_WR_DMA_CTRL(ctx->csi2_port)));
> diff --git a/drivers/media/platform/ti-vpe/cal_regs.h b/drivers/media/platform/ti-vpe/cal_regs.h
> index a29198cc3efe..532d4a95740a 100644
> --- a/drivers/media/platform/ti-vpe/cal_regs.h
> +++ b/drivers/media/platform/ti-vpe/cal_regs.h
> @@ -100,15 +100,6 @@
>  /* CAL Control Module Core Camerrx Control register offsets */
>  #define CM_CTRL_CORE_CAMERRX_CONTROL	0x000
>  
> -/*********************************************************************
> -* Generic value used in various field below
> -*********************************************************************/
> -
> -#define CAL_GEN_DISABLE			0
> -#define CAL_GEN_ENABLE			1
> -#define CAL_GEN_FALSE			0
> -#define CAL_GEN_TRUE			1
> -
>  /*********************************************************************
>  * Field Definition Macros
>  *********************************************************************/

-- 
Regards,

Laurent Pinchart

  reply	other threads:[~2020-03-16 12:25 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-13 11:41 [PATCH 01/16] media: ti-vpe: cal: fix use of wrong macro Tomi Valkeinen
2020-03-13 11:41 ` [PATCH 02/16] media: ti-vpe: cal: use runtime_resume for errata handling Tomi Valkeinen
2020-03-16 12:28   ` Laurent Pinchart
2020-03-17  8:54     ` Tomi Valkeinen
2020-03-13 11:41 ` [PATCH 03/16] media: ti-vpe: cal: catch error irqs and print errors Tomi Valkeinen
2020-03-16 10:06   ` Hans Verkuil
2020-03-16 10:51     ` Hans Verkuil
2020-03-16 12:00       ` Tomi Valkeinen
2020-03-16 12:16         ` Hans Verkuil
2020-03-16 12:22   ` Laurent Pinchart
2020-03-17  8:56     ` Tomi Valkeinen
2020-03-13 11:41 ` [PATCH 04/16] media: ti-vpe: cal: print errors on timeouts Tomi Valkeinen
2020-03-13 11:41 ` [PATCH 05/16] media: ti-vpe: cal: simplify irq handling Tomi Valkeinen
2020-03-13 11:41 ` [PATCH 06/16] media: ti-vpe: cal: remove useless CAL_GEN_* macros Tomi Valkeinen
2020-03-16 12:24   ` Laurent Pinchart [this message]
2020-03-13 11:41 ` [PATCH 07/16] media: ti-vpe: cal: remove unused defines Tomi Valkeinen
2020-03-16 12:31   ` Laurent Pinchart
2020-03-13 11:41 ` [PATCH 08/16] media: ti-vpe: cal: use reg_write_field Tomi Valkeinen
2020-03-16 12:32   ` Laurent Pinchart
2020-03-13 11:41 ` [PATCH 09/16] media: ti-vpe: cal: cleanup CIO power enable/disable Tomi Valkeinen
2020-03-16 12:35   ` Laurent Pinchart
2020-03-13 11:41 ` [PATCH 10/16] media: ti-vpe: cal: fix dummy read to phy Tomi Valkeinen
2020-03-16 12:36   ` Laurent Pinchart
2020-03-13 11:41 ` [PATCH 11/16] media: ti-vpe: cal: program number of lines properly Tomi Valkeinen
2020-03-16 12:37   ` Laurent Pinchart
2020-03-16 13:13     ` Tomi Valkeinen
2020-03-13 11:41 ` [PATCH 12/16] media: ti-vpe: cal: set DMA max seg size Tomi Valkeinen
2020-03-16 12:39   ` Laurent Pinchart
2020-03-13 11:41 ` [PATCH 13/16] media: ti-vpe: cal: move code to separate functions Tomi Valkeinen
2020-03-16 12:41   ` Laurent Pinchart
2020-03-17  9:04     ` Tomi Valkeinen
2020-03-13 11:41 ` [PATCH 14/16] media: ti-vpe: cal: improve wait for CIO resetdone Tomi Valkeinen
2020-03-16 10:05   ` Hans Verkuil
2020-03-16 10:11     ` Tomi Valkeinen
2020-03-16 12:43   ` Laurent Pinchart
2020-03-17 11:34     ` Tomi Valkeinen
2020-03-13 11:41 ` [PATCH 15/16] media: ti-vpe: cal: improve wait for stop-state Tomi Valkeinen
2020-03-16 12:45   ` Laurent Pinchart
2020-03-17 11:44     ` Tomi Valkeinen
2020-03-13 11:41 ` [PATCH 16/16] media: ti-vpe: cal: fix stop state timeout Tomi Valkeinen
2020-03-16 12:49   ` Laurent Pinchart
2020-03-16 12:28 ` [PATCH 01/16] media: ti-vpe: cal: fix use of wrong macro Laurent Pinchart

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=20200316122405.GW4732@pendragon.ideasonboard.com \
    --to=laurent.pinchart@ideasonboard.com \
    --cc=bparrot@ti.com \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@kernel.org \
    --cc=tomi.valkeinen@ti.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox