Skip to content
Snippets Groups Projects
Commit 9b9c5ddc authored by Dafna Hirschfeld's avatar Dafna Hirschfeld
Browse files

add trace_printk to debug the MIS of interrupts

parent ef94db65
No related branches found
No related tags found
No related merge requests found
# SPDX-License-Identifier: GPL-2.0
ccflags-y += -DDEBUG
obj-$(CONFIG_VIDEO_ROCKCHIP_ISP1) += rockchip-isp1.o
rockchip-isp1-objs += rkisp1-capture.o \
rkisp1-common.o \
......
......@@ -648,10 +648,13 @@ void rkisp1_capture_isr(struct rkisp1_device *rkisp1)
{
unsigned int i;
u32 status;
struct rkisp1_isp *isp = &rkisp1->isp;
status = rkisp1_read(rkisp1, RKISP1_CIF_MI_MIS);
rkisp1_write(rkisp1, status, RKISP1_CIF_MI_ICR);
trace_printk("cap mis 0x%08x sp=%ld mp=%ld frame seq=%u\n", status, status & BIT(1), status & BIT(0),
atomic_read(&isp->frame_sequence));
for (i = 0; i < ARRAY_SIZE(rkisp1->capture_devs); ++i) {
struct rkisp1_capture *cap = &rkisp1->capture_devs[i];
......
......@@ -101,6 +101,8 @@
* +-----------+ +-----------+
*/
u64 mytime;
struct rkisp1_match_data {
const char * const *clks;
unsigned int size;
......@@ -391,6 +393,7 @@ static irqreturn_t rkisp1_isr(int irq, void *ctx)
{
struct device *dev = ctx;
struct rkisp1_device *rkisp1 = dev_get_drvdata(dev);
u64 t = ktime_get_ns();
/*
* Call rkisp1_capture_isr() first to handle the frame that
......@@ -398,9 +401,12 @@ static irqreturn_t rkisp1_isr(int irq, void *ctx)
* it is potentially incremented by rkisp1_isp_isr() in the vertical
* sync.
*/
trace_printk("START %llu\n", t - mytime);
mytime = t;
rkisp1_capture_isr(rkisp1);
rkisp1_isp_isr(rkisp1);
rkisp1_mipi_isr(rkisp1);
trace_printk("END\n");
return IRQ_HANDLED;
}
......
......@@ -23,6 +23,7 @@
#define RKISP1_ISP_DEV_NAME RKISP1_DRIVER_NAME "_isp"
extern u64 mytime;
/*
* NOTE: MIPI controller and input MUX are also configured in this file.
* This is because ISP Subdev describes not only ISP submodule (input size,
......@@ -534,6 +535,7 @@ static void rkisp1_isp_start(struct rkisp1_device *rkisp1)
struct rkisp1_sensor_async *sensor = rkisp1->active_sensor;
u32 val;
mytime = 0;
rkisp1_config_clk(rkisp1);
/* Activate MIPI */
......@@ -925,6 +927,7 @@ static int rkisp1_isp_s_stream(struct v4l2_subdev *sd, int enable)
if (!enable) {
rkisp1_isp_stop(rkisp1);
rkisp1_mipi_csi2_stop(rkisp1->active_sensor);
mytime = 0;
return 0;
}
......@@ -1050,6 +1053,7 @@ void rkisp1_mipi_isr(struct rkisp1_device *rkisp1)
u32 val, status;
status = rkisp1_read(rkisp1, RKISP1_CIF_MIPI_MIS);
trace_printk("mipi mis 0x%08x %ld\n", status, status & RKISP1_CIF_MIPI_FRAME_END);
if (!status)
return;
......@@ -1110,6 +1114,8 @@ void rkisp1_isp_isr(struct rkisp1_device *rkisp1)
u32 status, isp_err;
status = rkisp1_read(rkisp1, RKISP1_CIF_ISP_MIS);
trace_printk("isp mis 0x%08x v-start=%ld isp-frame=%ld\n", status, status & RKISP1_CIF_ISP_V_START,
status & RKISP1_CIF_ISP_FRAME);
if (!status)
return;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment