| .. | .. |
|---|
| 8 | 8 | #include <linux/spinlock.h> |
|---|
| 9 | 9 | #include <linux/v4l2-mediabus.h> |
|---|
| 10 | 10 | |
|---|
| 11 | | -#include "hw.h" |
|---|
| 12 | 11 | #include "dev.h" |
|---|
| 13 | 12 | #include "procfs.h" |
|---|
| 14 | 13 | |
|---|
| .. | .. |
|---|
| 224 | 223 | dev->workmode == RKCIF_WORKMODE_ONEFRAME ? "one frame" : |
|---|
| 225 | 224 | dev->workmode == RKCIF_WORKMODE_PINGPONG ? "ping pong" : "line loop"); |
|---|
| 226 | 225 | |
|---|
| 227 | | - monitor_mode = dev->hw_dev->hw_timer.monitor_mode; |
|---|
| 226 | + monitor_mode = dev->reset_watchdog_timer.monitor_mode; |
|---|
| 228 | 227 | seq_printf(f, "Monitor Mode:%s\n", |
|---|
| 229 | 228 | rkcif_get_monitor_mode(monitor_mode)); |
|---|
| 230 | 229 | } |
|---|
| .. | .. |
|---|
| 272 | 271 | mbus_flags & V4L2_MBUS_VSYNC_ACTIVE_HIGH ? "high active" : "low active"); |
|---|
| 273 | 272 | } else { |
|---|
| 274 | 273 | seq_printf(f, "\tinterface:%s\n", |
|---|
| 275 | | - sensor->mbus.type == V4L2_MBUS_CSI2 ? "mipi csi2" : |
|---|
| 274 | + sensor->mbus.type == V4L2_MBUS_CSI2_DPHY ? "mipi csi2 dphy" : |
|---|
| 275 | + sensor->mbus.type == V4L2_MBUS_CSI2_CPHY ? "mipi csi2 cphy" : |
|---|
| 276 | 276 | sensor->mbus.type == V4L2_MBUS_CCP2 ? "lvds" : "unknown"); |
|---|
| 277 | 277 | seq_printf(f, "\tlanes:%d\n", sensor->lanes); |
|---|
| 278 | 278 | seq_puts(f, "\tvc channel:"); |
|---|
| .. | .. |
|---|
| 288 | 288 | } |
|---|
| 289 | 289 | |
|---|
| 290 | 290 | seq_printf(f, "\thdr mode: %s\n", |
|---|
| 291 | | - dev->hdr.mode == NO_HDR ? "normal" : |
|---|
| 292 | | - dev->hdr.mode == HDR_X2 ? "hdr_x2" : "hdr_x3"); |
|---|
| 291 | + dev->hdr.hdr_mode == NO_HDR ? "normal" : |
|---|
| 292 | + dev->hdr.hdr_mode == HDR_COMPR ? "hdr_compr" : |
|---|
| 293 | + dev->hdr.hdr_mode == HDR_X2 ? "hdr_x2" : "hdr_x3"); |
|---|
| 293 | 294 | |
|---|
| 294 | 295 | seq_printf(f, "\tformat:%s/%ux%u@%d\n", |
|---|
| 295 | 296 | rkcif_pixelcode_to_string(stream->cif_fmt_in->mbus_code), |
|---|
| .. | .. |
|---|
| 314 | 315 | dev->channels[0].width, dev->channels[0].height, |
|---|
| 315 | 316 | dev->channels[0].crop_st_x, dev->channels[0].crop_st_y); |
|---|
| 316 | 317 | seq_printf(f, "\tcompact:%s\n", stream->is_compact ? "enable" : "disabled"); |
|---|
| 317 | | - seq_printf(f, "\tframe amount:%d\n", stream->frame_idx); |
|---|
| 318 | + seq_printf(f, "\tframe amount:%d\n", stream->frame_idx - 1); |
|---|
| 318 | 319 | if (dev->inf_id == RKCIF_MIPI_LVDS) { |
|---|
| 319 | 320 | time_val = div_u64(stream->readout.early_time, 1000000); |
|---|
| 320 | 321 | seq_printf(f, "\tearly:%u ms\n", time_val); |
|---|
| 321 | | - if (dev->hdr.mode == NO_HDR) { |
|---|
| 322 | + if (dev->hdr.hdr_mode == NO_HDR || |
|---|
| 323 | + dev->hdr.hdr_mode == HDR_COMPR) { |
|---|
| 322 | 324 | time_val = div_u64(stream->readout.readout_time, 1000000); |
|---|
| 323 | 325 | seq_printf(f, "\treadout:%u ms\n", time_val); |
|---|
| 324 | 326 | } else { |
|---|
| .. | .. |
|---|
| 334 | 336 | seq_printf(f, "\tfps:%llu\n", fps); |
|---|
| 335 | 337 | seq_puts(f, "\tirq statistics:\n"); |
|---|
| 336 | 338 | seq_printf(f, "\t\t\ttotal:%llu\n", |
|---|
| 337 | | - dev->irq_stats.all_frm_end_cnt + dev->irq_stats.all_err_cnt); |
|---|
| 339 | + dev->irq_stats.frm_end_cnt[0] + |
|---|
| 340 | + dev->irq_stats.frm_end_cnt[1] + |
|---|
| 341 | + dev->irq_stats.frm_end_cnt[2] + |
|---|
| 342 | + dev->irq_stats.frm_end_cnt[3] + |
|---|
| 343 | + dev->irq_stats.all_err_cnt); |
|---|
| 338 | 344 | if (sensor->mbus.type == V4L2_MBUS_PARALLEL || |
|---|
| 339 | 345 | sensor->mbus.type == V4L2_MBUS_BT656) { |
|---|
| 340 | 346 | seq_printf(f, "\t\t\tdvp bus err:%llu\n", dev->irq_stats.dvp_bus_err_cnt); |
|---|
| 341 | 347 | seq_printf(f, "\t\t\tdvp pix err:%llu\n", dev->irq_stats.dvp_pix_err_cnt); |
|---|
| 342 | 348 | seq_printf(f, "\t\t\tdvp line err:%llu\n", dev->irq_stats.dvp_line_err_cnt); |
|---|
| 343 | 349 | seq_printf(f, "\t\t\tdvp over flow:%llu\n", dev->irq_stats.dvp_overflow_cnt); |
|---|
| 350 | + seq_printf(f, "\t\t\tdvp bandwidth lack:%llu\n", |
|---|
| 351 | + dev->irq_stats.dvp_bwidth_lack_cnt); |
|---|
| 352 | + seq_printf(f, "\t\t\tdvp size err:%llu\n", dev->irq_stats.dvp_size_err_cnt); |
|---|
| 344 | 353 | } else { |
|---|
| 345 | 354 | seq_printf(f, "\t\t\tcsi over flow:%llu\n", dev->irq_stats.csi_overflow_cnt); |
|---|
| 346 | | - seq_printf(f, "\t\t\tcsi bandwidth lack:%llu\n", dev->irq_stats.csi_bwidth_lack_cnt); |
|---|
| 347 | | - |
|---|
| 355 | + seq_printf(f, "\t\t\tcsi bandwidth lack:%llu\n", |
|---|
| 356 | + dev->irq_stats.csi_bwidth_lack_cnt); |
|---|
| 357 | + seq_printf(f, "\t\t\tcsi size err:%llu\n", dev->irq_stats.csi_size_err_cnt); |
|---|
| 348 | 358 | } |
|---|
| 359 | + seq_printf(f, "\t\t\tnot active buf cnt:%llu %llu %llu %llu\n", |
|---|
| 360 | + dev->irq_stats.not_active_buf_cnt[0], |
|---|
| 361 | + dev->irq_stats.not_active_buf_cnt[1], |
|---|
| 362 | + dev->irq_stats.not_active_buf_cnt[2], |
|---|
| 363 | + dev->irq_stats.not_active_buf_cnt[3]); |
|---|
| 349 | 364 | seq_printf(f, "\t\t\tall err count:%llu\n", dev->irq_stats.all_err_cnt); |
|---|
| 350 | | - seq_printf(f, "\t\t\tframe dma end:%llu\n", dev->irq_stats.all_frm_end_cnt); |
|---|
| 365 | + seq_printf(f, "\t\t\tframe dma end:%llu %llu %llu %llu\n", |
|---|
| 366 | + dev->irq_stats.frm_end_cnt[0], |
|---|
| 367 | + dev->irq_stats.frm_end_cnt[1], |
|---|
| 368 | + dev->irq_stats.frm_end_cnt[2], |
|---|
| 369 | + dev->irq_stats.frm_end_cnt[3]); |
|---|
| 370 | + seq_printf(f, "irq time: %llu ns\n", dev->hw_dev->irq_time); |
|---|
| 371 | + seq_printf(f, "dma enable: 0x%x 0x%x 0x%x 0x%x\n", |
|---|
| 372 | + dev->stream[0].dma_en, dev->stream[1].dma_en, |
|---|
| 373 | + dev->stream[2].dma_en, dev->stream[3].dma_en); |
|---|
| 374 | + seq_printf(f, "buf_cnt in drv: %d %d %d %d\n", |
|---|
| 375 | + atomic_read(&dev->stream[0].buf_cnt), |
|---|
| 376 | + atomic_read(&dev->stream[1].buf_cnt), |
|---|
| 377 | + atomic_read(&dev->stream[2].buf_cnt), |
|---|
| 378 | + atomic_read(&dev->stream[3].buf_cnt)); |
|---|
| 379 | + seq_printf(f, "total buf_cnt: %d %d %d %d\n", |
|---|
| 380 | + dev->stream[0].total_buf_num, |
|---|
| 381 | + dev->stream[1].total_buf_num, |
|---|
| 382 | + dev->stream[2].total_buf_num, |
|---|
| 383 | + dev->stream[3].total_buf_num); |
|---|
| 351 | 384 | } |
|---|
| 352 | 385 | } |
|---|
| 353 | 386 | |
|---|
| .. | .. |
|---|
| 373 | 406 | return single_open(file, rkcif_proc_show, data); |
|---|
| 374 | 407 | } |
|---|
| 375 | 408 | |
|---|
| 376 | | -static const struct file_operations rkcif_proc_fops = { |
|---|
| 377 | | - .owner = THIS_MODULE, |
|---|
| 378 | | - .open = rkcif_proc_open, |
|---|
| 379 | | - .release = single_release, |
|---|
| 380 | | - .read = seq_read, |
|---|
| 381 | | - .llseek = seq_lseek, |
|---|
| 409 | +static const struct proc_ops rkcif_proc_fops = { |
|---|
| 410 | + .proc_open = rkcif_proc_open, |
|---|
| 411 | + .proc_release = single_release, |
|---|
| 412 | + .proc_read = seq_read, |
|---|
| 413 | + .proc_lseek = seq_lseek, |
|---|
| 382 | 414 | }; |
|---|
| 383 | 415 | |
|---|
| 384 | 416 | int rkcif_proc_init(struct rkcif_device *dev) |
|---|