[PATCH v1.1 4/5] media: rkisp1: Use correct macro for gradient registers

Dafna Hirschfeld dafna at fastmail.com
Fri Aug 26 12:06:58 PDT 2022


On 23.08.2022 20:21, Laurent Pinchart wrote:
>The rkisp1_lsc_config() function incorrectly uses the
>RKISP1_CIF_ISP_LSC_SECT_SIZE() macro for the gradient registers. Replace
>it with the correct macro, and rename it from
>RKISP1_CIF_ISP_LSC_GRAD_SIZE() to RKISP1_CIF_ISP_LSC_SECT_GRAD() as the
>corresponding registers store the gradients for each sector, not a size.
>This doesn't cause any functional change as the two macros are defined
>identically (the size and gradient registers store fields in the same
>number of bits at the same positions).
>
>Signed-off-by: Laurent Pinchart <laurent.pinchart at ideasonboard.com>

Reviewed-by: Dafna Hirschfeld <dafna at fastmail.com>

>---
>Changes since v1:
>
>- Rename RKISP1_CIF_ISP_LSC_GRAD_SIZE to RKISP1_CIF_ISP_LSC_SECT_GRAD
>---
> drivers/media/platform/rockchip/rkisp1/rkisp1-params.c | 4 ++--
> drivers/media/platform/rockchip/rkisp1/rkisp1-regs.h   | 2 +-
> 2 files changed, 3 insertions(+), 3 deletions(-)
>
>diff --git a/drivers/media/platform/rockchip/rkisp1/rkisp1-params.c b/drivers/media/platform/rockchip/rkisp1/rkisp1-params.c
>index aa6efa4c6e9e..123c26fc1679 100644
>--- a/drivers/media/platform/rockchip/rkisp1/rkisp1-params.c
>+++ b/drivers/media/platform/rockchip/rkisp1/rkisp1-params.c
>@@ -334,7 +334,7 @@ static void rkisp1_lsc_config(struct rkisp1_params *params,
> 		rkisp1_write(rkisp1, RKISP1_CIF_ISP_LSC_XSIZE(i), data);
>
> 		/* program x grad tables */
>-		data = RKISP1_CIF_ISP_LSC_SECT_SIZE(arg->x_grad_tbl[i * 2],
>+		data = RKISP1_CIF_ISP_LSC_SECT_GRAD(arg->x_grad_tbl[i * 2],
> 						    arg->x_grad_tbl[i * 2 + 1]);
> 		rkisp1_write(rkisp1, RKISP1_CIF_ISP_LSC_XGRAD(i), data);
>
>@@ -344,7 +344,7 @@ static void rkisp1_lsc_config(struct rkisp1_params *params,
> 		rkisp1_write(rkisp1, RKISP1_CIF_ISP_LSC_YSIZE(i), data);
>
> 		/* program y grad tables */
>-		data = RKISP1_CIF_ISP_LSC_SECT_SIZE(arg->y_grad_tbl[i * 2],
>+		data = RKISP1_CIF_ISP_LSC_SECT_GRAD(arg->y_grad_tbl[i * 2],
> 						    arg->y_grad_tbl[i * 2 + 1]);
> 		rkisp1_write(rkisp1, RKISP1_CIF_ISP_LSC_YGRAD(i), data);
> 	}
>diff --git a/drivers/media/platform/rockchip/rkisp1/rkisp1-regs.h b/drivers/media/platform/rockchip/rkisp1/rkisp1-regs.h
>index 2ad24deedec8..39b2ac58196e 100644
>--- a/drivers/media/platform/rockchip/rkisp1/rkisp1-regs.h
>+++ b/drivers/media/platform/rockchip/rkisp1/rkisp1-regs.h
>@@ -619,7 +619,7 @@
> 	(((v0) & 0x1FFF) | (((v1) & 0x1FFF) << 13))
> #define RKISP1_CIF_ISP_LSC_SECT_SIZE(v0, v1)      \
> 	(((v0) & 0xFFF) | (((v1) & 0xFFF) << 16))
>-#define RKISP1_CIF_ISP_LSC_GRAD_SIZE(v0, v1)      \
>+#define RKISP1_CIF_ISP_LSC_SECT_GRAD(v0, v1)      \
> 	(((v0) & 0xFFF) | (((v1) & 0xFFF) << 16))
>
> /* LSC: ISP_LSC_TABLE_SEL */
>-- 
>Regards,
>
>Laurent Pinchart
>
>
>_______________________________________________
>Linux-rockchip mailing list
>Linux-rockchip at lists.infradead.org
>http://lists.infradead.org/mailman/listinfo/linux-rockchip



More information about the Linux-rockchip mailing list