hc
2024-01-05 071106ecf68c401173c58808b1cf5f68cc50d390
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
/* SPDX-License-Identifier: GPL-2.0 */
/* Copyright (c) 2019 Fuzhou Rockchip Electronics Co., Ltd. */
 
#ifndef _RKISPP_STATS_H
#define _RKISPP_STATS_H
 
#include <linux/rk-ispp-config.h>
#include <linux/interrupt.h>
#include <linux/kfifo.h>
#include "common.h"
 
#define RKISPP_STATS_READOUT_WORK_SIZE    \
   (9 * sizeof(struct rkispp_stats_readout_work))
 
struct rkispp_stats_vdev;
 
enum rkispp_stats_readout_cmd {
   RKISPP_READOUT_STATS,
};
 
enum rkispp_statsvdev_id {
   STATS_VDEV_TNR = 0,
   STATS_VDEV_NR,
   STATS_VDEV_MAX
};
 
struct rkispp_stats_readout_work {
   enum rkispp_stats_readout_cmd readout;
   unsigned long long timestamp;
   unsigned int meas_type;
   unsigned int frame_id;
};
 
/*
 * struct rkispp_stats_vdev - ISPP Statistics device
 *
 * @irq_lock: buffer queue lock
 * @stat: stats buffer list
 * @readout_wq: workqueue for statistics information read
 */
struct rkispp_stats_vdev {
   struct rkispp_vdev_node vnode;
   struct rkispp_device *dev;
   enum rkispp_statsvdev_id vdev_id;
 
   spinlock_t irq_lock;
   struct list_head stat;
   struct rkispp_buffer *curr_buf;
   struct v4l2_format vdev_fmt;
   u32 frame_id;
   bool streamon;
};
 
void rkispp_stats_isr(struct rkispp_stats_vdev *stats_vdev);
 
int rkispp_register_stats_vdevs(struct rkispp_device *dev);
 
void rkispp_unregister_stats_vdevs(struct rkispp_device *dev);
 
#endif /* _RKISPP_STATS_H */