linux/drivers/media/test-drivers/vivid/vivid-ctrls.c

// SPDX-License-Identifier: GPL-2.0-only
/*
 * vivid-ctrls.c - control support functions.
 *
 * Copyright 2014 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
 */

#include <linux/errno.h>
#include <linux/kernel.h>
#include <linux/videodev2.h>
#include <media/v4l2-event.h>
#include <media/v4l2-common.h>

#include "vivid-core.h"
#include "vivid-vid-cap.h"
#include "vivid-vid-out.h"
#include "vivid-vid-common.h"
#include "vivid-radio-common.h"
#include "vivid-osd.h"
#include "vivid-ctrls.h"

#define VIVID_CID_CUSTOM_BASE
#define VIVID_CID_BUTTON
#define VIVID_CID_BOOLEAN
#define VIVID_CID_INTEGER
#define VIVID_CID_INTEGER64
#define VIVID_CID_MENU
#define VIVID_CID_STRING
#define VIVID_CID_BITMASK
#define VIVID_CID_INTMENU
#define VIVID_CID_U32_ARRAY
#define VIVID_CID_U16_MATRIX
#define VIVID_CID_U8_4D_ARRAY
#define VIVID_CID_AREA
#define VIVID_CID_RO_INTEGER
#define VIVID_CID_U32_DYN_ARRAY
#define VIVID_CID_U8_PIXEL_ARRAY
#define VIVID_CID_S32_ARRAY
#define VIVID_CID_S64_ARRAY

#define VIVID_CID_VIVID_BASE
#define VIVID_CID_VIVID_CLASS
#define VIVID_CID_TEST_PATTERN
#define VIVID_CID_OSD_TEXT_MODE
#define VIVID_CID_HOR_MOVEMENT
#define VIVID_CID_VERT_MOVEMENT
#define VIVID_CID_SHOW_BORDER
#define VIVID_CID_SHOW_SQUARE
#define VIVID_CID_INSERT_SAV
#define VIVID_CID_INSERT_EAV
#define VIVID_CID_VBI_CAP_INTERLACED
#define VIVID_CID_INSERT_HDMI_VIDEO_GUARD_BAND

#define VIVID_CID_HFLIP
#define VIVID_CID_VFLIP
#define VIVID_CID_STD_ASPECT_RATIO
#define VIVID_CID_DV_TIMINGS_ASPECT_RATIO
#define VIVID_CID_TSTAMP_SRC
#define VIVID_CID_COLORSPACE
#define VIVID_CID_XFER_FUNC
#define VIVID_CID_YCBCR_ENC
#define VIVID_CID_QUANTIZATION
#define VIVID_CID_LIMITED_RGB_RANGE
#define VIVID_CID_ALPHA_MODE
#define VIVID_CID_HAS_CROP_CAP
#define VIVID_CID_HAS_COMPOSE_CAP
#define VIVID_CID_HAS_SCALER_CAP
#define VIVID_CID_HAS_CROP_OUT
#define VIVID_CID_HAS_COMPOSE_OUT
#define VIVID_CID_HAS_SCALER_OUT
#define VIVID_CID_SEQ_WRAP
#define VIVID_CID_TIME_WRAP
#define VIVID_CID_MAX_EDID_BLOCKS
#define VIVID_CID_PERCENTAGE_FILL
#define VIVID_CID_REDUCED_FPS
#define VIVID_CID_HSV_ENC

#define VIVID_CID_STD_SIGNAL_MODE
#define VIVID_CID_STANDARD
#define VIVID_CID_DV_TIMINGS_SIGNAL_MODE
#define VIVID_CID_DV_TIMINGS
#define VIVID_CID_PERC_DROPPED
#define VIVID_CID_DISCONNECT
#define VIVID_CID_DQBUF_ERROR
#define VIVID_CID_QUEUE_SETUP_ERROR
#define VIVID_CID_BUF_PREPARE_ERROR
#define VIVID_CID_START_STR_ERROR
#define VIVID_CID_QUEUE_ERROR
#define VIVID_CID_CLEAR_FB
#define VIVID_CID_REQ_VALIDATE_ERROR

#define VIVID_CID_RADIO_SEEK_MODE
#define VIVID_CID_RADIO_SEEK_PROG_LIM
#define VIVID_CID_RADIO_RX_RDS_RBDS
#define VIVID_CID_RADIO_RX_RDS_BLOCKIO

#define VIVID_CID_RADIO_TX_RDS_BLOCKIO

#define VIVID_CID_SDR_CAP_FM_DEVIATION

#define VIVID_CID_META_CAP_GENERATE_PTS
#define VIVID_CID_META_CAP_GENERATE_SCR

/* HDMI inputs are in the range 0-14. The next available CID is VIVID_CID_VIVID_BASE + 128 */
#define VIVID_CID_HDMI_IS_CONNECTED_TO_OUTPUT(input)

/* S-Video inputs are in the range 0-15. The next available CID is VIVID_CID_VIVID_BASE + 144 */
#define VIVID_CID_SVID_IS_CONNECTED_TO_OUTPUT(input)

/* General User Controls */

static void vivid_unregister_dev(bool valid, struct video_device *vdev)
{}

static int vivid_user_gen_s_ctrl(struct v4l2_ctrl *ctrl)
{}

static const struct v4l2_ctrl_ops vivid_user_gen_ctrl_ops =;

static const struct v4l2_ctrl_config vivid_ctrl_button =;

static const struct v4l2_ctrl_config vivid_ctrl_boolean =;

static const struct v4l2_ctrl_config vivid_ctrl_int32 =;

static const struct v4l2_ctrl_config vivid_ctrl_int64 =;

static const struct v4l2_ctrl_config vivid_ctrl_u32_array =;

static const struct v4l2_ctrl_config vivid_ctrl_u32_dyn_array =;

static const struct v4l2_ctrl_config vivid_ctrl_u16_matrix =;

static const struct v4l2_ctrl_config vivid_ctrl_u8_4d_array =;

static const struct v4l2_ctrl_config vivid_ctrl_u8_pixel_array =;

static const struct v4l2_ctrl_config vivid_ctrl_s32_array =;

static const struct v4l2_ctrl_config vivid_ctrl_s64_array =;

static const char * const vivid_ctrl_menu_strings[] =;

static const struct v4l2_ctrl_config vivid_ctrl_menu =;

static const struct v4l2_ctrl_config vivid_ctrl_string =;

static const struct v4l2_ctrl_config vivid_ctrl_bitmask =;

static const s64 vivid_ctrl_int_menu_values[] =;

static const struct v4l2_ctrl_config vivid_ctrl_int_menu =;

static const struct v4l2_ctrl_config vivid_ctrl_disconnect =;

static const struct v4l2_area area =;

static const struct v4l2_ctrl_config vivid_ctrl_area =;

static const struct v4l2_ctrl_config vivid_ctrl_ro_int32 =;

/* Framebuffer Controls */

static int vivid_fb_s_ctrl(struct v4l2_ctrl *ctrl)
{}

static const struct v4l2_ctrl_ops vivid_fb_ctrl_ops =;

static const struct v4l2_ctrl_config vivid_ctrl_clear_fb =;


/* Video User Controls */

static int vivid_user_vid_g_volatile_ctrl(struct v4l2_ctrl *ctrl)
{}

static int vivid_user_vid_s_ctrl(struct v4l2_ctrl *ctrl)
{}

static const struct v4l2_ctrl_ops vivid_user_vid_ctrl_ops =;


/* Video Capture Controls */

static void vivid_update_power_present(struct vivid_dev *dev)
{}

static int vivid_vid_cap_s_ctrl(struct v4l2_ctrl *ctrl)
{}

static const struct v4l2_ctrl_ops vivid_vid_cap_ctrl_ops =;

static const char * const vivid_ctrl_hor_movement_strings[] =;

static const struct v4l2_ctrl_config vivid_ctrl_hor_movement =;

static const char * const vivid_ctrl_vert_movement_strings[] =;

static const struct v4l2_ctrl_config vivid_ctrl_vert_movement =;

static const struct v4l2_ctrl_config vivid_ctrl_show_border =;

static const struct v4l2_ctrl_config vivid_ctrl_show_square =;

static const char * const vivid_ctrl_osd_mode_strings[] =;

static const struct v4l2_ctrl_config vivid_ctrl_osd_mode =;

static const struct v4l2_ctrl_config vivid_ctrl_perc_fill =;

static const struct v4l2_ctrl_config vivid_ctrl_insert_sav =;

static const struct v4l2_ctrl_config vivid_ctrl_insert_eav =;

static const struct v4l2_ctrl_config vivid_ctrl_insert_hdmi_video_guard_band =;

static const struct v4l2_ctrl_config vivid_ctrl_hflip =;

static const struct v4l2_ctrl_config vivid_ctrl_vflip =;

static const struct v4l2_ctrl_config vivid_ctrl_reduced_fps =;

static const struct v4l2_ctrl_config vivid_ctrl_has_crop_cap =;

static const struct v4l2_ctrl_config vivid_ctrl_has_compose_cap =;

static const struct v4l2_ctrl_config vivid_ctrl_has_scaler_cap =;

static const char * const vivid_ctrl_tstamp_src_strings[] =;

static const struct v4l2_ctrl_config vivid_ctrl_tstamp_src =;

static const struct v4l2_ctrl_config vivid_ctrl_std_aspect_ratio =;

static const char * const vivid_ctrl_dv_timings_signal_mode_strings[] =;

static const struct v4l2_ctrl_config vivid_ctrl_dv_timings_signal_mode =;

static const struct v4l2_ctrl_config vivid_ctrl_dv_timings_aspect_ratio =;

static const struct v4l2_ctrl_config vivid_ctrl_max_edid_blocks =;

static const char * const vivid_ctrl_colorspace_strings[] =;

static const struct v4l2_ctrl_config vivid_ctrl_colorspace =;

static const char * const vivid_ctrl_xfer_func_strings[] =;

static const struct v4l2_ctrl_config vivid_ctrl_xfer_func =;

static const char * const vivid_ctrl_ycbcr_enc_strings[] =;

static const struct v4l2_ctrl_config vivid_ctrl_ycbcr_enc =;

static const char * const vivid_ctrl_hsv_enc_strings[] =;

static const struct v4l2_ctrl_config vivid_ctrl_hsv_enc =;

static const char * const vivid_ctrl_quantization_strings[] =;

static const struct v4l2_ctrl_config vivid_ctrl_quantization =;

static const struct v4l2_ctrl_config vivid_ctrl_alpha_mode =;

static const struct v4l2_ctrl_config vivid_ctrl_limited_rgb_range =;


/* VBI Capture Control */

static int vivid_vbi_cap_s_ctrl(struct v4l2_ctrl *ctrl)
{}

static const struct v4l2_ctrl_ops vivid_vbi_cap_ctrl_ops =;

static const struct v4l2_ctrl_config vivid_ctrl_vbi_cap_interlaced =;


/* Video Output Controls */

static int vivid_vid_out_s_ctrl(struct v4l2_ctrl *ctrl)
{}

static const struct v4l2_ctrl_ops vivid_vid_out_ctrl_ops =;

static const struct v4l2_ctrl_config vivid_ctrl_has_crop_out =;

static const struct v4l2_ctrl_config vivid_ctrl_has_compose_out =;

static const struct v4l2_ctrl_config vivid_ctrl_has_scaler_out =;

/* Streaming Controls */

static int vivid_streaming_s_ctrl(struct v4l2_ctrl *ctrl)
{}

static const struct v4l2_ctrl_ops vivid_streaming_ctrl_ops =;

static const struct v4l2_ctrl_config vivid_ctrl_dqbuf_error =;

static const struct v4l2_ctrl_config vivid_ctrl_perc_dropped =;

static const struct v4l2_ctrl_config vivid_ctrl_queue_setup_error =;

static const struct v4l2_ctrl_config vivid_ctrl_buf_prepare_error =;

static const struct v4l2_ctrl_config vivid_ctrl_start_streaming_error =;

static const struct v4l2_ctrl_config vivid_ctrl_queue_error =;

#ifdef CONFIG_MEDIA_CONTROLLER
static const struct v4l2_ctrl_config vivid_ctrl_req_validate_error =;
#endif

static const struct v4l2_ctrl_config vivid_ctrl_seq_wrap =;

static const char * const vivid_ctrl_time_wrap_strings[] =;

static const struct v4l2_ctrl_config vivid_ctrl_time_wrap =;


/* SDTV Capture Controls */

static int vivid_sdtv_cap_s_ctrl(struct v4l2_ctrl *ctrl)
{}

static const struct v4l2_ctrl_ops vivid_sdtv_cap_ctrl_ops =;

static const char * const vivid_ctrl_std_signal_mode_strings[] =;

static const struct v4l2_ctrl_config vivid_ctrl_std_signal_mode =;

static const struct v4l2_ctrl_config vivid_ctrl_standard =;



/* Radio Receiver Controls */

static int vivid_radio_rx_s_ctrl(struct v4l2_ctrl *ctrl)
{}

static const struct v4l2_ctrl_ops vivid_radio_rx_ctrl_ops =;

static const char * const vivid_ctrl_radio_rds_mode_strings[] =;

static const struct v4l2_ctrl_config vivid_ctrl_radio_rx_rds_blockio =;

static const struct v4l2_ctrl_config vivid_ctrl_radio_rx_rds_rbds =;

static const char * const vivid_ctrl_radio_hw_seek_mode_strings[] =;

static const struct v4l2_ctrl_config vivid_ctrl_radio_hw_seek_mode =;

static const struct v4l2_ctrl_config vivid_ctrl_radio_hw_seek_prog_lim =;


/* Radio Transmitter Controls */

static int vivid_radio_tx_s_ctrl(struct v4l2_ctrl *ctrl)
{}

static const struct v4l2_ctrl_ops vivid_radio_tx_ctrl_ops =;

static const struct v4l2_ctrl_config vivid_ctrl_radio_tx_rds_blockio =;


/* SDR Capture Controls */

static int vivid_sdr_cap_s_ctrl(struct v4l2_ctrl *ctrl)
{}

static const struct v4l2_ctrl_ops vivid_sdr_cap_ctrl_ops =;

static const struct v4l2_ctrl_config vivid_ctrl_sdr_cap_fm_deviation =;

/* Metadata Capture Control */

static int vivid_meta_cap_s_ctrl(struct v4l2_ctrl *ctrl)
{}

static const struct v4l2_ctrl_ops vivid_meta_cap_ctrl_ops =;

static const struct v4l2_ctrl_config vivid_ctrl_meta_has_pts =;

static const struct v4l2_ctrl_config vivid_ctrl_meta_has_src_clk =;

static const struct v4l2_ctrl_config vivid_ctrl_class =;

int vivid_create_controls(struct vivid_dev *dev, bool show_ccs_cap,
		bool show_ccs_out, bool no_error_inj,
		bool has_sdtv, bool has_hdmi)
{}

void vivid_free_controls(struct vivid_dev *dev)
{}