[PATCH v1 10/11] media: platform: neoisp: Add debugfs support

Antoine Bouyer
2026-04-13T16:05:07Z

Add debugfs entries to dump ISP registers, and some internal memory
regions used to store Vignetting, DRC global and DRC local coefficients.

Debug mode is activated with the `enable_debugfs` module's parameter, to
avoid runtime suspend which blocks register access when IP is not active,
so we can capture an ISP snapshot after a frame is decoded.

Signed-off-by: Antoine Bouyer <antoine.bouyer@nxp.com>
---
drivers/media/platform/nxp/neoisp/Makefile | 2 +
drivers/media/platform/nxp/neoisp/neoisp.h | 16 +
.../platform/nxp/neoisp/neoisp_debugfs.c | 494 ++++++++++++++++++
.../media/platform/nxp/neoisp/neoisp_main.c | 15 +
4 files changed, 527 insertions(+)
create mode 100644 drivers/media/platform/nxp/neoisp/neoisp_debugfs.c

diff --git a/drivers/media/platform/nxp/neoisp/Makefile b/drivers/media/platform/nxp/neoisp/Makefile
index 7652df785e98..c68e216980dc 100644
--- a/drivers/media/platform/nxp/neoisp/Makefile
+++ b/drivers/media/platform/nxp/neoisp/Makefile
@@ -4,3 +4,5 @@ obj-$(CONFIG_VIDEO_NXP_NEOISP) += neoisp.o

neoisp-objs := neoisp_ctx.o \
neoisp_main.o
+
+neoisp-$(CONFIG_DEBUG_FS) += neoisp_debugfs.o
diff --git a/drivers/media/platform/nxp/neoisp/neoisp.h b/drivers/media/platform/nxp/neoisp/neoisp.h
index eff86c3a08e1..fe4ca935d6bc 100644
--- a/drivers/media/platform/nxp/neoisp/neoisp.h
+++ b/drivers/media/platform/nxp/neoisp/neoisp.h
@@ -9,6 +9,7 @@
#define __NXP_NEOISP_H

#include <linux/bits.h>
+#include <linux/debugfs.h>
#include <linux/media/nxp/nxp_neoisp.h>
#include <media/v4l2-ctrls.h>
#include <media/v4l2-device.h>
@@ -225,8 +226,23 @@ struct neoisp_dev_s {
dma_addr_t dummy_dma;
u32 dummy_size;
struct neoisp_context_s *context;
+ struct dentry *debugfs_entry;
+ struct debugfs_regset32 *regset;
};

+#if IS_ENABLED(CONFIG_DEBUG_FS)
+void neoisp_debugfs_init(struct neoisp_dev_s *neoispd);
+void neoisp_debugfs_exit(struct neoisp_dev_s *neoispd);
+#else
+static inline void neoisp_debugfs_init(struct neoisp_dev_s *neoispd)
+{
+}
+
+static inline void neoisp_debugfs_exit(struct neoisp_dev_s *neoispd)
+{
+}
+#endif
+
static inline int neoisp_node_link_is_enabled(struct neoisp_node_s *node)
{
return (node->intf_link->flags & MEDIA_LNK_FL_ENABLED);
diff --git a/drivers/media/platform/nxp/neoisp/neoisp_debugfs.c b/drivers/media/platform/nxp/neoisp/neoisp_debugfs.c
new file mode 100644
index 000000000000..656475c8b9d1
--- /dev/null
+++ b/drivers/media/platform/nxp/neoisp/neoisp_debugfs.c
@@ -0,0 +1,494 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * NEOISP debugfs definition
+ *
+ * Copyright 2024-2026 NXP
+ */
+
+#include <linux/debugfs.h>
+
+#include "neoisp.h"
+#include "neoisp_ctx.h"
+#include "neoisp_regs.h"
+
+#define NEOISP_DFS_REG(reg) {.name = #reg, .offset = reg}
+
+static const struct debugfs_reg32 neoisp_dfs_regs[] = {
+ NEOISP_DFS_REG(NEO_PIPE_CONF_SOFT_RESET),
+ NEOISP_DFS_REG(NEO_PIPE_CONF_BUS_TXPARAM),
+ NEOISP_DFS_REG(NEO_PIPE_CONF_REG_XFR_DIS),
+ NEOISP_DFS_REG(NEO_PIPE_CONF_CSI_CTRL),
+ NEOISP_DFS_REG(NEO_PIPE_CONF_FRAME_NUM),
+ NEOISP_DFS_REG(NEO_PIPE_CONF_REG_SHD_CTRL),
+ NEOISP_DFS_REG(NEO_PIPE_CONF_REG_SHD_CMD),
+ NEOISP_DFS_REG(NEO_PIPE_CONF_TRIG_CAM0),
+ NEOISP_DFS_REG(NEO_PIPE_CONF_INT_EN0),
+ NEOISP_DFS_REG(NEO_PIPE_CONF_INT_STAT0),
+ NEOISP_DFS_REG(NEO_PIPE_CONF_CSI_STAT),
+ NEOISP_DFS_REG(NEO_PIPE_CONF_IMG_CONF_CAM0),
+ NEOISP_DFS_REG(NEO_PIPE_CONF_IMG_SIZE_CAM0),
+ NEOISP_DFS_REG(NEO_PIPE_CONF_IMG0_IN_ADDR_CAM0),
+ NEOISP_DFS_REG(NEO_PIPE_CONF_IMG1_IN_ADDR_CAM0),
+ NEOISP_DFS_REG(NEO_PIPE_CONF_OUTCH0_ADDR_CAM0),
+ NEOISP_DFS_REG(NEO_PIPE_CONF_OUTCH1_ADDR_CAM0),
+ NEOISP_DFS_REG(NEO_PIPE_CONF_OUTIR_ADDR_CAM0),
+ NEOISP_DFS_REG(NEO_PIPE_CONF_IMG0_IN_LS_CAM0),
+ NEOISP_DFS_REG(NEO_PIPE_CONF_IMG1_IN_LS_CAM0),
+ NEOISP_DFS_REG(NEO_PIPE_CONF_OUTCH0_LS_CAM0),
+ NEOISP_DFS_REG(NEO_PIPE_CONF_OUTCH1_LS_CAM0),
+ NEOISP_DFS_REG(NEO_PIPE_CONF_OUTIR_LS_CAM0),
+ NEOISP_DFS_REG(NEO_PIPE_CONF_SKIP_CTRL0),
+ NEOISP_DFS_REG(NEO_HC_CTRL_CAM0),
+ NEOISP_DFS_REG(NEO_HDR_DECOMPRESS0_CTRL_CAM0),
+ NEOISP_DFS_REG(NEO_HDR_DECOMPRESS0_KNEE_POINT1_CAM0),
+ NEOISP_DFS_REG(NEO_HDR_DECOMPRESS0_KNEE_POINT2_CAM0),
+ NEOISP_DFS_REG(NEO_HDR_DECOMPRESS0_KNEE_POINT3_CAM0),
+ NEOISP_DFS_REG(NEO_HDR_DECOMPRESS0_KNEE_POINT4_CAM0),
+ NEOISP_DFS_REG(NEO_HDR_DECOMPRESS0_KNEE_OFFSET0_CAM0),
+ NEOISP_DFS_REG(NEO_HDR_DECOMPRESS0_KNEE_OFFSET1_CAM0),
+ NEOISP_DFS_REG(NEO_HDR_DECOMPRESS0_KNEE_OFFSET2_CAM0),
+ NEOISP_DFS_REG(NEO_HDR_DECOMPRESS0_KNEE_OFFSET3_CAM0),
+ NEOISP_DFS_REG(NEO_HDR_DECOMPRESS0_KNEE_OFFSET4_CAM0),
+ NEOISP_DFS_REG(NEO_HDR_DECOMPRESS0_KNEE_RATIO01_CAM0),
+ NEOISP_DFS_REG(NEO_HDR_DECOMPRESS0_KNEE_RATIO23_CAM0),
+ NEOISP_DFS_REG(NEO_HDR_DECOMPRESS0_KNEE_RATIO4_CAM0),
+ NEOISP_DFS_REG(NEO_HDR_DECOMPRESS0_KNEE_NPOINT0_CAM0),
+ NEOISP_DFS_REG(NEO_HDR_DECOMPRESS0_KNEE_NPOINT1_CAM0),
+ NEOISP_DFS_REG(NEO_HDR_DECOMPRESS0_KNEE_NPOINT2_CAM0),
+ NEOISP_DFS_REG(NEO_HDR_DECOMPRESS0_KNEE_NPOINT3_CAM0),
+ NEOISP_DFS_REG(NEO_HDR_DECOMPRESS0_KNEE_NPOINT4_CAM0),
+ NEOISP_DFS_REG(NEO_HDR_DECOMPRESS1_CTRL_CAM0),
+ NEOISP_DFS_REG(NEO_HDR_DECOMPRESS1_KNEE_POINT1_CAM0),
+ NEOISP_DFS_REG(NEO_HDR_DECOMPRESS1_KNEE_POINT2_CAM0),
+ NEOISP_DFS_REG(NEO_HDR_DECOMPRESS1_KNEE_POINT3_CAM0),
+ NEOISP_DFS_REG(NEO_HDR_DECOMPRESS1_KNEE_POINT4_CAM0),
+ NEOISP_DFS_REG(NEO_HDR_DECOMPRESS1_KNEE_OFFSET0_CAM0),
+ NEOISP_DFS_REG(NEO_HDR_DECOMPRESS1_KNEE_OFFSET1_CAM0),
+ NEOISP_DFS_REG(NEO_HDR_DECOMPRESS1_KNEE_OFFSET2_CAM0),
+ NEOISP_DFS_REG(NEO_HDR_DECOMPRESS1_KNEE_OFFSET3_CAM0),
+ NEOISP_DFS_REG(NEO_HDR_DECOMPRESS1_KNEE_OFFSET4_CAM0),
+ NEOISP_DFS_REG(NEO_HDR_DECOMPRESS1_KNEE_RATIO01_CAM0),
+ NEOISP_DF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S_REG(NEO_HDR_MERGE_GAIN_SCALE_CAM0),
+ NEOISP_DFS_REG(NEO_HDR_MERGE_GAIN_SHIFT_CAM0),
+ NEOISP_DFS_REG(NEO_HDR_MERGE_LUMA_TH_CAM0),
+ NEOISP_DFS_REG(NEO_HDR_MERGE_LUMA_SCALE_CAM0),
+ NEOISP_DFS_REG(NEO_HDR_MERGE_DOWNSCALE_CAM0),
+ NEOISP_DFS_REG(NEO_HDR_MERGE_UPSCALE_CAM0),
+ NEOISP_DFS_REG(NEO_HDR_MERGE_POST_SCALE_CAM0),
+ NEOISP_DFS_REG(NEO_HDR_MERGE_S_GAIN_OFFSET_CAM0),
+ NEOISP_DFS_REG(NEO_HDR_MERGE_S_GAIN_SCALE_CAM0),
+ NEOISP_DFS_REG(NEO_HDR_MERGE_S_GAIN_SHIFT_CAM0),
+ NEOISP_DFS_REG(NEO_HDR_MERGE_S_LUMA_TH_CAM0),
+ NEOISP_DFS_REG(NEO_HDR_MERGE_S_LUMA_SCALE_CAM0),
+ NEOISP_DFS_REG(NEO_HDR_MERGE_S_DOWNSCALE_CAM0),
+ NEOISP_DFS_REG(NEO_HDR_MERGE_S_UPSCALE_CAM0),
+ NEOISP_DFS_REG(NEO_HDR_MERGE_S_POST_SCALE_CAM0),
+ NEOISP_DFS_REG(NEO_HDR_MERGE_S_LINE_NUM_CAM0),
+ NEOISP_DFS_REG(NEO_COLOR_TEMP_CTRL_CAM0),
+ NEOISP_DFS_REG(NEO_COLOR_TEMP_ROI_POS_CAM0),
+ NEOISP_DFS_REG(NEO_COLOR_TEMP_ROI_SIZE_CAM0),
+ NEOISP_DFS_REG(NEO_COLOR_TEMP_REDGAIN_CAM0),
+ NEOISP_DFS_REG(NEO_COLOR_TEMP_BLUEGAIN_CAM0),
+ NEOISP_DFS_REG(NEO_COLOR_TEMP_POINT1_CAM0),
+ NEOISP_DFS_REG(NEO_COLOR_TEMP_POINT2_CAM0),
+ NEOISP_DFS_REG(NEO_COLOR_TEMP_HOFFSET_CAM0),
+ NEOISP_DFS_REG(NEO_COLOR_TEMP_VOFFSET_CAM0),
+ NEOISP_DFS_REG(NEO_COLOR_TEMP_POINT1_SLOPE_CAM0),
+ NEOISP_DFS_REG(NEO_COLOR_TEMP_POINT2_SLOPE_CAM0),
+ NEOISP_DFS_REG(NEO_COLOR_TEMP_LUMA_TH_CAM0),
+ NEOISP_DFS_REG(NEO_COLOR_TEMP_CSC_MAT0_CAM0),
+ NEOISP_DFS_REG(NEO_COLOR_TEMP_CSC_MAT1_CAM0),
+ NEOISP_DFS_REG(NEO_COLOR_TEMP_CSC_MAT2_CAM0),
+ NEOISP_DFS_REG(NEO_COLOR_TEMP_CSC_MAT3_CAM0),
+ NEOISP_DFS_REG(NEO_COLOR_TEMP_CSC_MAT4_CAM0),
+ NEOISP_DFS_REG(NEO_COLOR_TEMP_R_GR_OFFSET_CAM0),
+ NEOISP_DFS_REG(NEO_COLOR_TEMP_GB_B_OFFSET_CAM0),
+ NEOISP_DFS_REG(NEO_COLOR_TEMP_CNT_WHITE_CAM0),
+ NEOISP_DFS_REG(NEO_COLOR_TEMP_SUMRL_CAM0),
+ NEOISP_DFS_REG(NEO_COLOR_TEMP_SUMRH_CAM0),
+ NEOISP_DFS_REG(NEO_COLOR_TEMP_SUMGL_CAM0),
+ NEOISP_DFS_REG(NEO_COLOR_TEMP_SUMGH_CAM0),
+ NEOISP_DFS_REG(NEO_COLOR_TEMP_SUMBL_CAM0),
+ NEOISP_DFS_REG(NEO_COLOR_TEMP_SUMBH_CAM0),
+ NEOISP_DFS_REG(NEO_COLOR_TEMP_SUMRGL_CAM0),
+ NEOISP_DFS_REG(NEO_COLOR_TEMP_SUMRGH_CAM0),
+ NEOISP_DFS_REG(NEO_COLOR_TEMP_SUMBGL_CAM0),
+ NEOISP_DFS_REG(NEO_COLOR_TEMP_SUMBGH_CAM0),
+ NEOISP_DFS_REG(NEO_COLOR_TEMP_STAT_BLK_SIZE0),
+ NEOISP_DFS_REG(NEO_COLOR_TEMP_STAT_CURR_BLK_Y0),
+ NEOISP_DFS_REG(NEO_COLOR_TEMP_CROI0_POS_CAM0),
+ NEOISP_DFS_REG(NEO_COLOR_TEMP_CROI0_PIXCNT_CAM0),
+ NEOISP_DFS_REG(NEO_COLOR_TEMP_CROI0_SUMRED_CAM0),
+ NEOISP_DFS_REG(NEO_COLOR_TEMP_CROI0_SUMGREEN_CAM0),
+ NEOISP_DFS_REG(NEO_COLOR_TEMP_CROI0_SUMBLUE_CAM0),
+ NEOISP_DFS_REG(NEO_COLOR_TEMP_CROI1_POS_CAM0),
+ NEOISP_DFS_REG(NEO_COLOR_TEMP_CROI1_PIXCNT_CAM0),
+ NEOISP_DFS_REG(NEO_COLOR_TEMP_CROI1_SUMRED_CAM0),
+ NEOISP_DFS_REG(NEO_COLOR_TEMP_CROI1_SUMGREEN_CAM0),
+ NEOISP_DFS_REG(NEO_COLOR_TEMP_CROI1_SUMBLUE_CAM0),
+ NEOISP_DFS_REG(NEO_COLOR_TEMP_CROI2_POS_CAM0),
+ NEOISP_DFS_REG(NEO_COLOR_TEMP_CROI2_PIXCNT_CAM0),
+ NEOISP_DFS_REG(NEO_COLOR_TEMP_CROI2_SUMRED_CAM0),
+ NEOISP_DFS_REG(NEO_COLOR_TEMP_CROI2_SUMGREEN_CAM0),
+ NEOISP_DFS_REG(NEO_COLOR_TEMP_CROI2_SUMBLUE_CAM0),
+ NEOISP_DFS_REG(NEO_COLOR_TEMP_CROI3_POS_CAM0),
+ NEOISP_DFS_REG(NEO_COLOR_TEMP_CROI3_PIXCNT_CAM0),
+ NEOISP_DFS_REG(NEO_COLOR_TEMP_CROI3_SUMRED_CAM0),
+ NEOISP_DFS_REG(NEO_COLOR_TEMP_CROI3_SUMGREEN_CAM0),
+ NEOISP_DFS_REG(NEO_COLOR_TEMP_CROI3_SUMBLUE_CAM0),
+ NEOISP_DFS_REG(NEO_COLOR_TEMP_CROI4_POS_CAM0),
+ NEOISP_DFS_REG(NEO_COLOR_TEMP_CROI4_PIXCNT_CAM0),
+ NEOISP_DFS_REG(NEO_COLOR_TEMP_CROI4_SUMRED_CAM0),
+ NEOISP_DFS_REG(NEO_COLOR_TEMP_CROI4_SUMGREEN_CAM0),
+ NEOISP_DFS_REG(NEO_COLOR_TEMP_CROI4_SUMBLUE_CAM0),
+ NEOISP_DFS_REG(NEO_COLOR_TEMP_CROI5_POS_CAM0),
+ NEOISP_DFS_REG(NEO_COLOR_TEMP_CROI5_PIXCNT_CAM0),
+ NEOISP_DFS_REG(NEO_COLOR_TEMP_CROI5_SUMRED_CAM0),
+ NEOISP_DFS_REG(NEO_COLOR_TEMP_CROI5_SUMGREEN_CAM0),
+ NEOISP_DFS_REG(NEO_COLOR_TEMP_CROI5_SUMBLUE_CAM0),
+ NEOISP_DFS_REG(NEO_COLOR_TEMP_CROI6_POS_CAM0),
+ NEOISP_DFS_REG(NEO_COLOR_TEMP_CROI6_PIXCNT_CAM0),
+ NEOISP_DFS_REG(NEO_COLOR_TEMP_CROI6_SUMRED_CAM0),
+ NEOISP_DFS_REG(NEO_COLOR_TEMP_CROI6_SUMGREEN_CAM0),
+ NEOISP_DFS_REG(NEO_COLOR_TEMP_CROI6_SUMBLUE_CAM0),
+ NEOISP_DFS_REG(NEO_COLOR_TEMP_CROI7_POS_CAM0),
+ NEOISP_DFS_REG(NEO_COLOR_TEMP_CROI7_PIXCNT_CAM0),
+ NEOISP_DFS_REG(NEO_COLOR_TEMP_CROI7_SUMRED_CAM0),
+ NEOISP_DFS_REG(NEO_COLOR_TEMP_CROI7_SUMGREEN_CAM0),
+ NEOISP_DFS_REG(NEO_COLOR_TEMP_CROI7_SUMBLUE_CAM0),
+ NEOISP_DFS_REG(NEO_COLOR_TEMP_CROI8_POS_CAM0),
+ NEOISP_DFS_REG(NEO_COLOR_TEMP_CROI8_PIXCNT_CAM0),
+ NEOISP_DFS_REG(NEO_COLOR_TEMP_CROI8_SUMRED_CAM0),
+ NEOISP_DFS_REG(NEO_COLOR_TEMP_CROI8_SU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EOISP_DFS_REG(NEO_RGBIR_ROI1_SIZE_CAM0),
+ NEOISP_DFS_REG(NEO_RGBIR_HIST0_CTRL_CAM0),
+ NEOISP_DFS_REG(NEO_RGBIR_HIST0_SCALE_CAM0),
+ NEOISP_DFS_REG(NEO_RGBIR_HIST1_CTRL_CAM0),
+ NEOISP_DFS_REG(NEO_RGBIR_HIST1_SCALE_CAM0),
+ NEOISP_DFS_REG(NEO_STAT_ROI0_POS_CAM0),
+ NEOISP_DFS_REG(NEO_STAT_ROI0_SIZE_CAM0),
+ NEOISP_DFS_REG(NEO_STAT_ROI1_POS_CAM0),
+ NEOISP_DFS_REG(NEO_STAT_ROI1_SIZE_CAM0),
+ NEOISP_DFS_REG(NEO_STAT_HIST0_CTRL_CAM0),
+ NEOISP_DFS_REG(NEO_STAT_HIST0_SCALE_CAM0),
+ NEOISP_DFS_REG(NEO_STAT_HIST1_CTRL_CAM0),
+ NEOISP_DFS_REG(NEO_STAT_HIST1_SCALE_CAM0),
+ NEOISP_DFS_REG(NEO_STAT_HIST2_CTRL_CAM0),
+ NEOISP_DFS_REG(NEO_STAT_HIST2_SCALE_CAM0),
+ NEOISP_DFS_REG(NEO_STAT_HIST3_CTRL_CAM0),
+ NEOISP_DFS_REG(NEO_STAT_HIST3_SCALE_CAM0),
+ NEOISP_DFS_REG(NEO_IR_COMPRESS_CTRL_CAM0),
+ NEOISP_DFS_REG(NEO_IR_COMPRESS_KNEE_POINT1_CAM0),
+ NEOISP_DFS_REG(NEO_IR_COMPRESS_KNEE_POINT2_CAM0),
+ NEOISP_DFS_REG(NEO_IR_COMPRESS_KNEE_POINT3_CAM0),
+ NEOISP_DFS_REG(NEO_IR_COMPRESS_KNEE_POINT4_CAM0),
+ NEOISP_DFS_REG(NEO_IR_COMPRESS_KNEE_OFFSET0_CAM0),
+ NEOISP_DFS_REG(NEO_IR_COMPRESS_KNEE_OFFSET1_CAM0),
+ NEOISP_DFS_REG(NEO_IR_COMPRESS_KNEE_OFFSET2_CAM0),
+ NEOISP_DFS_REG(NEO_IR_COMPRESS_KNEE_OFFSET3_CAM0),
+ NEOISP_DFS_REG(NEO_IR_COMPRESS_KNEE_OFFSET4_CAM0),
+ NEOISP_DFS_REG(NEO_IR_COMPRESS_KNEE_RATIO01_CAM0),
+ NEOISP_DFS_REG(NEO_IR_COMPRESS_KNEE_RATIO23_CAM0),
+ NEOISP_DFS_REG(NEO_IR_COMPRESS_KNEE_RATIO4_CAM0),
+ NEOISP_DFS_REG(NEO_IR_COMPRESS_KNEE_NPOINT0_CAM0),
+ NEOISP_DFS_REG(NEO_IR_COMPRESS_KNEE_NPOINT1_CAM0),
+ NEOISP_DFS_REG(NEO_IR_COMPRESS_KNEE_NPOINT2_CAM0),
+ NEOISP_DFS_REG(NEO_IR_COMPRESS_KNEE_NPOINT3_CAM0),
+ NEOISP_DFS_REG(NEO_IR_COMPRESS_KNEE_NPOINT4_CAM0),
+ NEOISP_DFS_REG(NEO_BNR_CTRL_CAM0),
+ NEOISP_DFS_REG(NEO_BNR_YPEAK_CAM0),
+ NEOISP_DFS_REG(NEO_BNR_YEDGE_TH0_CAM0),
+ NEOISP_DFS_REG(NEO_BNR_YEDGE_SCALE_CAM0),
+ NEOISP_DFS_REG(NEO_BNR_YEDGES_TH0_CAM0),
+ NEOISP_DFS_REG(NEO_BNR_YEDGES_SCALE_CAM0),
+ NEOISP_DFS_REG(NEO_BNR_YEDGEA_TH0_CAM0),
+ NEOISP_DFS_REG(NEO_BNR_YEDGEA_SCALE_CAM0),
+ NEOISP_DFS_REG(NEO_BNR_YLUMA_X_TH0_CAM0),
+ NEOISP_DFS_REG(NEO_BNR_YLUMA_Y_TH_CAM0),
+ NEOISP_DFS_REG(NEO_BNR_YLUMA_SCALE_CAM0),
+ NEOISP_DFS_REG(NEO_BNR_YALPHA_GAIN_CAM0),
+ NEOISP_DFS_REG(NEO_BNR_CPEAK_CAM0),
+ NEOISP_DFS_REG(NEO_BNR_CEDGE_TH0_CAM0),
+ NEOISP_DFS_REG(NEO_BNR_CEDGE_SCALE_CAM0),
+ NEOISP_DFS_REG(NEO_BNR_CEDGES_TH0_CAM0),
+ NEOISP_DFS_REG(NEO_BNR_CEDGES_SCALE_CAM0),
+ NEOISP_DFS_REG(NEO_BNR_CEDGEA_TH0_CAM0),
+ NEOISP_DFS_REG(NEO_BNR_CEDGEA_SCALE_CAM0),
+ NEOISP_DFS_REG(NEO_BNR_CLUMA_X_TH0_CAM0),
+ NEOISP_DFS_REG(NEO_BNR_CLUMA_Y_TH_CAM0),
+ NEOISP_DFS_REG(NEO_BNR_CLUMA_SCALE_CAM0),
+ NEOISP_DFS_REG(NEO_BNR_CALPHA_GAIN_CAM0),
+ NEOISP_DFS_REG(NEO_BNR_EDGE_STAT_CAM0),
+ NEOISP_DFS_REG(NEO_BNR_EDGES_STAT_CAM0),
+ NEOISP_DFS_REG(NEO_BNR_STRETCH_CAM0),
+ NEOISP_DFS_REG(NEO_VIGNETTING_CTRL_CAM0),
+ NEOISP_DFS_REG(NEO_VIGNETTING_BLK_CONF_CAM0),
+ NEOISP_DFS_REG(NEO_VIGNETTING_BLK_SIZE_CAM0),
+ NEOISP_DFS_REG(NEO_VIGNETTING_BLK_STEPY_CAM0),
+ NEOISP_DFS_REG(NEO_VIGNETTING_BLK_STEPX_CAM0),
+ NEOISP_DFS_REG(NEO_VIGNETTING_BLK_C_LINE_CAM0),
+ NEOISP_DFS_REG(NEO_VIGNETTING_BLK_C_ROW_CAM0),
+ NEOISP_DFS_REG(NEO_VIGNETTING_BLK_C_FRACY_CAM0),
+ NEOISP_DFS_REG(NEO_IDBG1_LINE_NUM),
+ NEOISP_DFS_REG(NEO_IDBG1_CURR_LINE_NUM),
+ NEOISP_DFS_REG(NEO_IDBG1_IMA),
+ NEOISP_DFS_REG(NEO_IDBG1_IMD),
+ NEOISP_DFS_REG(NEO_IDBG1_DONE_STAT),
+ NEOISP_DFS_REG(NEO_DEMOSAIC_CTRL_CAM0),
+ NEOISP_DFS_REG(NEO_DE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DFS_REG(NEO_DRC_GROI0_SUM_CAM0),
+ NEOISP_DFS_REG(NEO_DRC_GROI1_SUM_CAM0),
+ NEOISP_DFS_REG(NEO_DRC_STAT_BLK_Y_CAM0),
+ NEOISP_DFS_REG(NEO_DRC_CURR_YFRACT_CAM0),
+ NEOISP_DFS_REG(NEO_NR_CTRL_CAM0),
+ NEOISP_DFS_REG(NEO_NR_BLEND_SCALE_CAM0),
+ NEOISP_DFS_REG(NEO_NR_BLEND_TH0_CAM0),
+ NEOISP_DFS_REG(NEO_NR_EDGECNT_CAM0),
+ NEOISP_DFS_REG(NEO_DF_CTRL_CAM0),
+ NEOISP_DFS_REG(NEO_DF_TH_SCALE_CAM0),
+ NEOISP_DFS_REG(NEO_DF_BLEND_SHIFT_CAM0),
+ NEOISP_DFS_REG(NEO_DF_BLEND_TH0_CAM0),
+ NEOISP_DFS_REG(NEO_DF_EDGECNT_CAM0),
+ NEOISP_DFS_REG(NEO_EE_CTRL_CAM0),
+ NEOISP_DFS_REG(NEO_EE_CORING_CAM0),
+ NEOISP_DFS_REG(NEO_EE_CLIP_CAM0),
+ NEOISP_DFS_REG(NEO_EE_MASKGAIN_CAM0),
+ NEOISP_DFS_REG(NEO_EE_EDGECNT_CAM0),
+ NEOISP_DFS_REG(NEO_CCONVMED_CTRL_CAM0),
+ NEOISP_DFS_REG(NEO_CAS_GAIN_CAM0),
+ NEOISP_DFS_REG(NEO_CAS_CORR_CAM0),
+ NEOISP_DFS_REG(NEO_CAS_OFFSET_CAM0),
+ NEOISP_DFS_REG(NEO_PACKETIZER_CH0_CTRL_CAM0),
+ NEOISP_DFS_REG(NEO_PACKETIZER_CH12_CTRL_CAM0),
+ NEOISP_DFS_REG(NEO_PACKETIZER_PACK_CTRL_CAM0),
+ NEOISP_DFS_REG(NEO_GCM_IMAT0_CAM0),
+ NEOISP_DFS_REG(NEO_GCM_IMAT1_CAM0),
+ NEOISP_DFS_REG(NEO_GCM_IMAT2_CAM0),
+ NEOISP_DFS_REG(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P_DFS_REG(NEO_AUTOFOCUS_ROI0_SUM0_CAM0),
+ NEOISP_DFS_REG(NEO_AUTOFOCUS_ROI0_SUM1_CAM0),
+ NEOISP_DFS_REG(NEO_AUTOFOCUS_ROI1_SUM0_CAM0),
+ NEOISP_DFS_REG(NEO_AUTOFOCUS_ROI1_SUM1_CAM0),
+ NEOISP_DFS_REG(NEO_AUTOFOCUS_ROI2_SUM0_CAM0),
+ NEOISP_DFS_REG(NEO_AUTOFOCUS_ROI2_SUM1_CAM0),
+ NEOISP_DFS_REG(NEO_AUTOFOCUS_ROI3_SUM0_CAM0),
+ NEOISP_DFS_REG(NEO_AUTOFOCUS_ROI3_SUM1_CAM0),
+ NEOISP_DFS_REG(NEO_AUTOFOCUS_ROI4_SUM0_CAM0),
+ NEOISP_DFS_REG(NEO_AUTOFOCUS_ROI4_SUM1_CAM0),
+ NEOISP_DFS_REG(NEO_AUTOFOCUS_ROI5_SUM0_CAM0),
+ NEOISP_DFS_REG(NEO_AUTOFOCUS_ROI5_SUM1_CAM0),
+ NEOISP_DFS_REG(NEO_AUTOFOCUS_ROI6_SUM0_CAM0),
+ NEOISP_DFS_REG(NEO_AUTOFOCUS_ROI6_SUM1_CAM0),
+ NEOISP_DFS_REG(NEO_AUTOFOCUS_ROI7_SUM0_CAM0),
+ NEOISP_DFS_REG(NEO_AUTOFOCUS_ROI7_SUM1_CAM0),
+ NEOISP_DFS_REG(NEO_AUTOFOCUS_ROI8_SUM0_CAM0),
+ NEOISP_DFS_REG(NEO_AUTOFOCUS_ROI8_SUM1_CAM0),
+ NEOISP_DFS_REG(NEO_IDBG2_LINE_NUM),
+ NEOISP_DFS_REG(NEO_IDBG2_CURR_LINE_NUM),
+ NEOISP_DFS_REG(NEO_IDBG2_IMA),
+ NEOISP_DFS_REG(NEO_IDBG2_IMD),
+ NEOISP_DFS_REG(NEO_IDBG2_DONE_STAT),
+};
+
+/* Structure to store word when reading memory */
+union udata_t {
+ u8 byte[4];
+ u16 half[2];
+ u32 word;
+};
+
+static inline int neoisp_dump_memory(struct seq_file *m, enum isp_block_map_e map, int wsize)
+{
+ struct neoisp_dev_s *neoispd = m->private;
+ union udata_t data;
+ u32 addr;
+ u32 *src = (u32 *)(uintptr_t)neoispd->mmio_tcm;
+ u32 offset = ISP_GET_OFF(map) / sizeof(u32);
+ u32 size = ISP_GET_SZ(map) / sizeof(u32);
+ int i, j;
+
+ for (i = 0; i < size; i++) {
+ addr = (offset + i) * sizeof(u32);
+ data.word = src[offset + i];
+
+ if (wsize == sizeof(u8)) {
+ for (j = 0; j < ARRAY_SIZE(data.byte); j++)
+ seq_printf(m, "%#x: %#x\n",
+ addr + (j * wsize), data.byte[j]);
+ }
+
+ if (wsize == sizeof(u16)) {
+ for (j = 0; j < ARRAY_SIZE(data.half); j++)
+ seq_printf(m, "%#x: %#x\n",
+ addr + (j * wsize), data.half[j]);
+ }
+ }
+
+ return 0;
+}
+
+static int neoisp_dump_vignetting_show(struct seq_file *m, void *private)
+{
+ return neoisp_dump_memory(m, NEO_VIGNETTING_TABLE_MAP, sizeof(u16));
+}
+DEFINE_SHOW_ATTRIBUTE(neoisp_dump_vignetting);
+
+static int neoisp_dump_drc_global_show(struct seq_file *m, void *private)
+{
+ return neoisp_dump_memory(m, NEO_DRC_GLOBAL_TONEMAP_MAP, sizeof(u16));
+}
+DEFINE_SHOW_ATTRIBUTE(neoisp_dump_drc_global);
+
+static int neoisp_dump_drc_local_show(struct seq_file *m, void *private)
+{
+ return neoisp_dump_memory(m, NEO_DRC_LOCAL_TONEMAP_MAP, sizeof(u8));
+}
+DEFINE_SHOW_ATTRIBUTE(neoisp_dump_drc_local);
+
+void neoisp_debugfs_init(struct neoisp_dev_s *neoispd)
+{
+ neoispd->regset = devm_kzalloc(neoispd->dev, sizeof(*neoispd->regset), GFP_KERNEL);
+ if (!neoispd->regset)
+ return;
+
+ neoispd->regset->regs = neoisp_dfs_regs;
+ neoispd->regset->nregs = ARRAY_SIZE(neoisp_dfs_regs);
+ neoispd->regset->base = neoispd->mmio;
+
+ neoispd->debugfs_entry = debugfs_create_dir(dev_name(neoispd->dev), NULL);
+
+ debugfs_create_regset32("registers", 0400, neoispd->debugfs_entry, neoispd->regset);
+
+ debugfs_create_file("vignetting", 0400, neoispd->debugfs_entry, neoispd,
+ &neoisp_dump_vignetting_fops);
+ debugfs_create_file("drc_global", 0400, neoispd->debugfs_entry, neoispd,
+ &neoisp_dump_drc_global_fops);
+ debugfs_create_file("drc_local", 0400, neoispd->debugfs_entry, neoispd,
+ &neoisp_dump_drc_local_fops);
+}
+
+void neoisp_debugfs_exit(struct neoisp_dev_s *neoispd)
+{
+ debugfs_remove_recursive(neoispd->debugfs_entry);
+}
diff --git a/drivers/media/platform/nxp/neoisp/neoisp_main.c b/drivers/media/platform/nxp/neoisp/neoisp_main.c
index 9d92b52e5911..a54269082bf4 100644
--- a/drivers/media/platform/nxp/neoisp/neoisp_main.c
+++ b/drivers/media/platform/nxp/neoisp/neoisp_main.c
@@ -9,6 +9,7 @@
*/

#include <linux/clk.h>
+#include <linux/debugfs.h>
#include <linux/delay.h>
#include <linux/interrupt.h>
#include <linux/io.h>
@@ -41,6 +42,10 @@ static int standalone_mdev;
module_param_named(standalone_mdev, standalone_mdev, uint, 0644);
MODULE_PARM_DESC(standalone_mdev, " Create standalone neoisp media device, default is 0 (off)");

+static int enable_debugfs;
+module_param_named(enable_debugfs, enable_debugfs, uint, 0644);
+MODULE_PARM_DESC(enable_debugfs, " Turn on/off debugfs, default is 0 (off)");
+
static inline bool node_desc_is_output(const struct neoisp_node_desc_s *desc)
{
return desc->buf_type == V4L2_BUF_TYPE_META_OUTPUT ||
@@ -1744,9 +1749,16 @@ static int neoisp_probe(struct platform_device *pdev)
neoisp_init_hw(neoispd);
neoisp_set_default_context(neoispd);

+ if (enable_debugfs) {
+ neoisp_debugfs_init(neoispd);
+ /* Increase pm_runtime counter to prevent suspend */
+ pm_runtime_resume_and_get(dev);
+ }
+
pm_runtime_mark_last_busy(dev);
pm_runtime_put_autosuspend(dev);

+ dev_dbg(dev, "probe: done (%d) debugfs (%x)\n", ret, enable_debugfs);
return 0;

err_pm:
@@ -1761,6 +1773,9 @@ static void neoisp_remove(struct platform_device *pdev)
{
struct neoisp_dev_s *neoispd = platform_get_drvdata(pdev);

+ if (enable_debugfs)
+ neoisp_debugfs_exit(neoispd);
+
neoisp_destroy_devices(neoispd);

if (standalone_mdev)
--
2.51.0