Commit 66ede6d7 authored by Frank Li's avatar Frank Li Committed by Hans Verkuil
Browse files

media: nxp: imx8-isi: Remove unused offset in mxc_isi_reg and use BIT() macro for mask



Preserve clarity by removing the unused 'offset' field in struct
mxc_isi_reg, as it duplicates information already indicated by the mask
and remains unused.

Improve readability by replacing hex value masks with the BIT() macro.

No functional change.

Reviewed-by: default avatarLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: default avatarFrank Li <Frank.Li@nxp.com>
Link: https://lore.kernel.org/r/20250522-8qxp_camera-v5-3-d4be869fdb7e@nxp.com


Signed-off-by: default avatarLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: default avatarHans Verkuil <hverkuil@xs4all.nl>
parent 2021b8d5
Loading
Loading
Loading
Loading
+13 −12
Original line number Diff line number Diff line
@@ -3,6 +3,7 @@
 * Copyright 2019-2020 NXP
 */

#include <linux/bits.h>
#include <linux/clk.h>
#include <linux/device.h>
#include <linux/errno.h>
@@ -247,24 +248,24 @@ static void mxc_isi_v4l2_cleanup(struct mxc_isi_dev *isi)

/* For i.MX8QXP C0 and i.MX8MN ISI IER version */
static const struct mxc_isi_ier_reg mxc_imx8_isi_ier_v1 = {
	.oflw_y_buf_en = { .offset = 19, .mask = 0x80000  },
	.oflw_u_buf_en = { .offset = 21, .mask = 0x200000 },
	.oflw_v_buf_en = { .offset = 23, .mask = 0x800000 },
	.oflw_y_buf_en = { .mask = BIT(19) },
	.oflw_u_buf_en = { .mask = BIT(21) },
	.oflw_v_buf_en = { .mask = BIT(23) },

	.panic_y_buf_en = {.offset = 20, .mask = 0x100000  },
	.panic_u_buf_en = {.offset = 22, .mask = 0x400000  },
	.panic_v_buf_en = {.offset = 24, .mask = 0x1000000 },
	.panic_y_buf_en = { .mask = BIT(20) },
	.panic_u_buf_en = { .mask = BIT(22) },
	.panic_v_buf_en = { .mask = BIT(24) },
};

/* For i.MX8MP ISI IER version */
static const struct mxc_isi_ier_reg mxc_imx8_isi_ier_v2 = {
	.oflw_y_buf_en = { .offset = 18, .mask = 0x40000  },
	.oflw_u_buf_en = { .offset = 20, .mask = 0x100000 },
	.oflw_v_buf_en = { .offset = 22, .mask = 0x400000 },
	.oflw_y_buf_en = { .mask = BIT(18) },
	.oflw_u_buf_en = { .mask = BIT(20) },
	.oflw_v_buf_en = { .mask = BIT(22) },

	.panic_y_buf_en = {.offset = 19, .mask = 0x80000  },
	.panic_u_buf_en = {.offset = 21, .mask = 0x200000 },
	.panic_v_buf_en = {.offset = 23, .mask = 0x800000 },
	.panic_y_buf_en = { .mask = BIT(19) },
	.panic_u_buf_en = { .mask = BIT(21) },
	.panic_v_buf_en = { .mask = BIT(23) },
};

/* Panic will assert when the buffers are 50% full */
+0 −1
Original line number Diff line number Diff line
@@ -114,7 +114,6 @@ struct mxc_isi_buffer {
};

struct mxc_isi_reg {
	u32 offset;
	u32 mask;
};