-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathgenx320_controls.c
80 lines (69 loc) · 2.25 KB
/
genx320_controls.c
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
// SPDX-License-Identifier: GPL-2.0-only
#include <media/v4l2-ctrls.h>
#include "genx320_controls.h"
#include "genx320.h"
#include "psee_controls.h"
#include "drivers/genx320/genx320_roi.h"
#include "drivers/genx320/genx320_roi_pixel.h"
#include "drivers/genx320/genx320_erc.h"
#include "drivers/genx320/genx320_bias.h"
#include "drivers/genx320/genx320_mipi.h"
#include "drivers/genx320/genx320.h"
static struct psee_roi_master_ops genx320_roi_window_ops = {
.init = genx320_roi_window_init,
.append = genx320_roi_window_append,
.update = genx320_roi_window_update,
.set = genx320_roi_window_set,
.reset = genx320_roi_window_reset,
.enable_roni = genx320_roi_window_enable_roni,
};
static struct psee_roi_pixel_ops genx320_roi_pixel_ops = {
.init = genx320_roi_pixel_init,
.set_pixel = genx320_roi_pixel_set_pixel,
.get_pixel = genx320_roi_pixel_get_pixel,
.set_array = genx320_roi_pixel_set_array,
.get_array = genx320_roi_pixel_get_array,
.reset = genx320_roi_pixel_reset,
};
static struct psee_erc_ops genx320_erc_ops = {
.init = genx320_erc_init,
.enable = genx320_erc_enable,
.s_rate = genx320_erc_set_event_rate,
};
static const struct psee_bias_ops genx320_bias_ops = {
.init = genx320_bias_init,
.set = genx320_bias_set,
.get = genx320_bias_get,
.get_min = genx320_bias_get_min,
.get_max = genx320_bias_get_max,
.get_default = genx320_bias_get_default,
.get_name = genx320_bias_get_name,
};
static struct psee_esp_ops genx320_esp_ops = {
.erc = &genx320_erc_ops,
.bias = &genx320_bias_ops,
.roi_window = &genx320_roi_window_ops,
.roi_pixel = &genx320_roi_pixel_ops,
};
static struct psee_mipi_ops genx320_mipi_ops = {
.configure = genx320_mipi_configure,
};
static struct psee_core_ops genx320_core_ops = {
.start = genx320_start_streaming,
.stop = genx320_stop_streaming,
.s_format = genx320_set_event_format,
.get_width = genx320_get_width,
.get_height = genx320_get_height,
};
static struct psee_ops genx320_ops = {
.esp = &genx320_esp_ops,
.mipi = &genx320_mipi_ops,
.core = &genx320_core_ops,
};
int genx320_init_controls(struct genx320 *genx320, const struct psee_ctrl_ops *ctrl_ops)
{
struct v4l2_ctrl_handler *hdl = &genx320->pcw.hdl;
psee_init_controls(&genx320->pcw, ctrl_ops, &genx320_ops);
hdl->lock = &genx320->mutex;
return 0;
}