aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHans Verkuil <hverkuil-cisco@xs4all.nl>2019-11-19 15:42:59 +0100
committerHans Verkuil <hverkuil-cisco@xs4all.nl>2019-11-19 15:42:59 +0100
commit4a9fbf55e63ae59105e9637c3a567b421973223d (patch)
treeb8dba6980047031450f869c68dd16d6911b6d7cc
parent3191325493e2fcf720bd72644b69b80ef8544287 (diff)
vivid: add fraction test control.fract-ctrl
Valid range: 0.1-10. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
-rw-r--r--drivers/media/platform/vivid/vivid-ctrls.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/drivers/media/platform/vivid/vivid-ctrls.c b/drivers/media/platform/vivid/vivid-ctrls.c
index 68e8124c7973..f9327661d88b 100644
--- a/drivers/media/platform/vivid/vivid-ctrls.c
+++ b/drivers/media/platform/vivid/vivid-ctrls.c
@@ -33,6 +33,7 @@
#define VIVID_CID_U16_MATRIX (VIVID_CID_CUSTOM_BASE + 9)
#define VIVID_CID_U8_4D_ARRAY (VIVID_CID_CUSTOM_BASE + 10)
#define VIVID_CID_AREA (VIVID_CID_CUSTOM_BASE + 11)
+#define VIVID_CID_FRACT (VIVID_CID_CUSTOM_BASE + 12)
#define VIVID_CID_VIVID_BASE (0x00f00000 | 0xf000)
#define VIVID_CID_VIVID_CLASS (0x00f00000 | 1)
@@ -280,6 +281,31 @@ static const struct v4l2_ctrl_config vivid_ctrl_area = {
.p_def.p_const = &area,
};
+static const struct v4l2_fract def_fract = {
+ .numerator = 1,
+ .denominator = 1,
+};
+
+static const struct v4l2_fract min_fract = {
+ .numerator = 1,
+ .denominator = 10,
+};
+
+static const struct v4l2_fract max_fract = {
+ .numerator = 10,
+ .denominator = 1,
+};
+
+static const struct v4l2_ctrl_config vivid_ctrl_fract = {
+ .ops = &vivid_user_gen_ctrl_ops,
+ .id = VIVID_CID_FRACT,
+ .name = "Fraction",
+ .type = V4L2_CTRL_TYPE_FRACT,
+ .p_def.p_const = &def_fract,
+ .p_min.p_const = &min_fract,
+ .p_max.p_const = &max_fract,
+};
+
/* Framebuffer Controls */
static int vivid_fb_s_ctrl(struct v4l2_ctrl *ctrl)
@@ -1588,6 +1614,7 @@ int vivid_create_controls(struct vivid_dev *dev, bool show_ccs_cap,
dev->bitmask = v4l2_ctrl_new_custom(hdl_user_gen, &vivid_ctrl_bitmask, NULL);
dev->int_menu = v4l2_ctrl_new_custom(hdl_user_gen, &vivid_ctrl_int_menu, NULL);
v4l2_ctrl_new_custom(hdl_user_gen, &vivid_ctrl_area, NULL);
+ v4l2_ctrl_new_custom(hdl_user_gen, &vivid_ctrl_fract, NULL);
v4l2_ctrl_new_custom(hdl_user_gen, &vivid_ctrl_u32_array, NULL);
v4l2_ctrl_new_custom(hdl_user_gen, &vivid_ctrl_u16_matrix, NULL);
v4l2_ctrl_new_custom(hdl_user_gen, &vivid_ctrl_u8_4d_array, NULL);

Privacy Policy