How to modify VI registers in TX2

For debugging purposes, I am interested in modifying the VI_CH_LINE_TIMER_0 register specified in the TX2 TRM. Actually, I want to count the number of lines per frame, so I’ve seen in this post that it is possible by modifying the aforementioned register, so I will receive events every X specified line numbers. How can I do it?

Have a check the …/kernel/nvidia/drivers/media/platform/tegra/camera/vi/vi4_fops.c

But how are the TRIPLINE, PERIODIC and ENABLE values modified? I cannot see them in the file


It’s define in the vi4_registers.h you need to make code to write it by vi4_channel_write()

#define LINE_TIMER 0x044
#define LINE_TIMER_EN (0x1 << 25)
#define PERIODIC (0x1 << 24)
#define TRIPLINE (0xffff << 0)

So I guess than could be done in the same driver right? So in the camera_open() function for example, I can modify those values and therefore get more messages in the trace.

Yes, it can be done in the same driver. And should be get the log from the trace.