#include <asm/barrier.h>
#include <linux/bitops.h>
#include <linux/kernel.h>
#include <linux/list.h>
#include <linux/module.h>
#include <linux/slab.h>
#include <linux/uaccess.h>
#include <linux/usb.h>
#include <linux/usb/uvc.h>
#include <linux/videodev2.h>
#include <linux/vmalloc.h>
#include <linux/wait.h>
#include <linux/workqueue.h>
#include <linux/atomic.h>
#include <media/v4l2-ctrls.h>
#include "uvcvideo.h"
#define UVC_CTRL_DATA_CURRENT …
#define UVC_CTRL_DATA_BACKUP …
#define UVC_CTRL_DATA_MIN …
#define UVC_CTRL_DATA_MAX …
#define UVC_CTRL_DATA_RES …
#define UVC_CTRL_DATA_DEF …
#define UVC_CTRL_DATA_LAST …
static const struct uvc_control_info uvc_ctrls[] = …;
static const u32 uvc_control_classes[] = …;
static const int exposure_auto_mapping[] = …;
static int uvc_mapping_get_menu_value(const struct uvc_control_mapping *mapping,
u32 idx)
{ … }
static const char *
uvc_mapping_get_menu_name(const struct uvc_control_mapping *mapping, u32 idx)
{ … }
static s32 uvc_ctrl_get_zoom(struct uvc_control_mapping *mapping,
u8 query, const u8 *data)
{ … }
static void uvc_ctrl_set_zoom(struct uvc_control_mapping *mapping,
s32 value, u8 *data)
{ … }
static s32 uvc_ctrl_get_rel_speed(struct uvc_control_mapping *mapping,
u8 query, const u8 *data)
{ … }
static void uvc_ctrl_set_rel_speed(struct uvc_control_mapping *mapping,
s32 value, u8 *data)
{ … }
static const struct uvc_control_mapping uvc_ctrl_power_line_mapping_limited = …;
static const struct uvc_control_mapping uvc_ctrl_power_line_mapping_uvc11 = …;
static const struct uvc_control_mapping uvc_ctrl_power_line_mapping_uvc15 = …;
static const struct uvc_control_mapping *uvc_ctrl_filter_plf_mapping(
struct uvc_video_chain *chain, struct uvc_control *ctrl)
{ … }
static const struct uvc_control_mapping uvc_ctrl_mappings[] = …;
static inline u8 *uvc_ctrl_data(struct uvc_control *ctrl, int id)
{ … }
static inline int uvc_test_bit(const u8 *data, int bit)
{ … }
static inline void uvc_clear_bit(u8 *data, int bit)
{ … }
static s32 uvc_get_le_value(struct uvc_control_mapping *mapping,
u8 query, const u8 *data)
{ … }
static void uvc_set_le_value(struct uvc_control_mapping *mapping,
s32 value, u8 *data)
{ … }
static int uvc_entity_match_guid(const struct uvc_entity *entity,
const u8 guid[16])
{ … }
static void __uvc_find_control(struct uvc_entity *entity, u32 v4l2_id,
struct uvc_control_mapping **mapping, struct uvc_control **control,
int next)
{ … }
static struct uvc_control *uvc_find_control(struct uvc_video_chain *chain,
u32 v4l2_id, struct uvc_control_mapping **mapping)
{ … }
static int uvc_ctrl_populate_cache(struct uvc_video_chain *chain,
struct uvc_control *ctrl)
{ … }
static s32 __uvc_ctrl_get_value(struct uvc_control_mapping *mapping,
const u8 *data)
{ … }
static int __uvc_ctrl_load_cur(struct uvc_video_chain *chain,
struct uvc_control *ctrl)
{ … }
static int __uvc_ctrl_get(struct uvc_video_chain *chain,
struct uvc_control *ctrl,
struct uvc_control_mapping *mapping,
s32 *value)
{ … }
static int __uvc_query_v4l2_class(struct uvc_video_chain *chain, u32 req_id,
u32 found_id)
{ … }
static int uvc_query_v4l2_class(struct uvc_video_chain *chain, u32 req_id,
u32 found_id, struct v4l2_queryctrl *v4l2_ctrl)
{ … }
int uvc_ctrl_is_accessible(struct uvc_video_chain *chain, u32 v4l2_id,
const struct v4l2_ext_controls *ctrls,
unsigned long ioctl)
{ … }
static const char *uvc_map_get_name(const struct uvc_control_mapping *map)
{ … }
static u32 uvc_get_ctrl_bitmap(struct uvc_control *ctrl,
struct uvc_control_mapping *mapping)
{ … }
static int __uvc_query_v4l2_ctrl(struct uvc_video_chain *chain,
struct uvc_control *ctrl,
struct uvc_control_mapping *mapping,
struct v4l2_queryctrl *v4l2_ctrl)
{ … }
int uvc_query_v4l2_ctrl(struct uvc_video_chain *chain,
struct v4l2_queryctrl *v4l2_ctrl)
{ … }
int uvc_query_v4l2_menu(struct uvc_video_chain *chain,
struct v4l2_querymenu *query_menu)
{ … }
static void uvc_ctrl_fill_event(struct uvc_video_chain *chain,
struct v4l2_event *ev,
struct uvc_control *ctrl,
struct uvc_control_mapping *mapping,
s32 value, u32 changes)
{ … }
static void uvc_ctrl_send_event(struct uvc_video_chain *chain,
struct uvc_fh *handle, struct uvc_control *ctrl,
struct uvc_control_mapping *mapping, s32 value, u32 changes)
{ … }
static void uvc_ctrl_send_slave_event(struct uvc_video_chain *chain,
struct uvc_fh *handle, struct uvc_control *master, u32 slave_id)
{ … }
void uvc_ctrl_status_event(struct uvc_video_chain *chain,
struct uvc_control *ctrl, const u8 *data)
{ … }
static void uvc_ctrl_status_event_work(struct work_struct *work)
{ … }
bool uvc_ctrl_status_event_async(struct urb *urb, struct uvc_video_chain *chain,
struct uvc_control *ctrl, const u8 *data)
{ … }
static bool uvc_ctrl_xctrls_has_control(const struct v4l2_ext_control *xctrls,
unsigned int xctrls_count, u32 id)
{ … }
static void uvc_ctrl_send_events(struct uvc_fh *handle,
const struct v4l2_ext_control *xctrls, unsigned int xctrls_count)
{ … }
static int uvc_ctrl_add_event(struct v4l2_subscribed_event *sev, unsigned elems)
{ … }
static void uvc_ctrl_del_event(struct v4l2_subscribed_event *sev)
{ … }
const struct v4l2_subscribed_event_ops uvc_ctrl_sub_ev_ops = …;
int uvc_ctrl_begin(struct uvc_video_chain *chain)
{ … }
static int uvc_ctrl_commit_entity(struct uvc_device *dev,
struct uvc_entity *entity, int rollback, struct uvc_control **err_ctrl)
{ … }
static int uvc_ctrl_find_ctrl_idx(struct uvc_entity *entity,
struct v4l2_ext_controls *ctrls,
struct uvc_control *uvc_control)
{ … }
int __uvc_ctrl_commit(struct uvc_fh *handle, int rollback,
struct v4l2_ext_controls *ctrls)
{ … }
int uvc_ctrl_get(struct uvc_video_chain *chain,
struct v4l2_ext_control *xctrl)
{ … }
int uvc_ctrl_set(struct uvc_fh *handle,
struct v4l2_ext_control *xctrl)
{ … }
static int uvc_ctrl_get_flags(struct uvc_device *dev,
const struct uvc_control *ctrl,
struct uvc_control_info *info)
{ … }
static void uvc_ctrl_fixup_xu_info(struct uvc_device *dev,
const struct uvc_control *ctrl, struct uvc_control_info *info)
{ … }
static int uvc_ctrl_fill_xu_info(struct uvc_device *dev,
const struct uvc_control *ctrl, struct uvc_control_info *info)
{ … }
static int uvc_ctrl_add_info(struct uvc_device *dev, struct uvc_control *ctrl,
const struct uvc_control_info *info);
static int uvc_ctrl_init_xu_ctrl(struct uvc_device *dev,
struct uvc_control *ctrl)
{ … }
int uvc_xu_ctrl_query(struct uvc_video_chain *chain,
struct uvc_xu_control_query *xqry)
{ … }
int uvc_ctrl_restore_values(struct uvc_device *dev)
{ … }
static int uvc_ctrl_add_info(struct uvc_device *dev, struct uvc_control *ctrl,
const struct uvc_control_info *info)
{ … }
static int __uvc_ctrl_add_mapping(struct uvc_video_chain *chain,
struct uvc_control *ctrl, const struct uvc_control_mapping *mapping)
{ … }
int uvc_ctrl_add_mapping(struct uvc_video_chain *chain,
const struct uvc_control_mapping *mapping)
{ … }
static void uvc_ctrl_prune_entity(struct uvc_device *dev,
struct uvc_entity *entity)
{ … }
static void uvc_ctrl_init_ctrl(struct uvc_video_chain *chain,
struct uvc_control *ctrl)
{ … }
static int uvc_ctrl_init_chain(struct uvc_video_chain *chain)
{ … }
int uvc_ctrl_init_device(struct uvc_device *dev)
{ … }
static void uvc_ctrl_cleanup_mappings(struct uvc_device *dev,
struct uvc_control *ctrl)
{ … }
void uvc_ctrl_cleanup_device(struct uvc_device *dev)
{ … }