#define pr_fmt(fmt) …
#define MODULE_NAME …
#include <linux/input.h>
#include <linux/sched/signal.h>
#include <linux/bitops.h>
#include "gspca.h"
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;
#define MAGIC_0 …
#define MAGIC_1 …
#define DATA_IN …
#define DATA_OUT …
#define VIDEOSIZE_QCIF …
#define VIDEOSIZE_CIF …
#define SUBSAMPLE_420 …
#define SUBSAMPLE_422 …
#define YUVORDER_YUYV …
#define YUVORDER_UYVY …
#define NOT_COMPRESSED …
#define COMPRESSED …
#define NO_DECIMATION …
#define DECIMATION_ENAB …
#define EOI …
#define EOL …
#define FRAME_HEADER_SIZE …
#define CPIA_GRAB_SINGLE …
#define CPIA_GRAB_CONTINEOUS …
#define CPIA_COMPRESSION_NONE …
#define CPIA_COMPRESSION_AUTO …
#define CPIA_COMPRESSION_MANUAL …
#define CPIA_COMPRESSION_TARGET_QUALITY …
#define CPIA_COMPRESSION_TARGET_FRAMERATE …
#define SYSTEMSTATE …
#define GRABSTATE …
#define STREAMSTATE …
#define FATALERROR …
#define CMDERROR …
#define DEBUGFLAGS …
#define VPSTATUS …
#define ERRORCODE …
#define UNINITIALISED_STATE …
#define PASS_THROUGH_STATE …
#define LO_POWER_STATE …
#define HI_POWER_STATE …
#define WARM_BOOT_STATE …
#define GRAB_IDLE …
#define GRAB_ACTIVE …
#define GRAB_DONE …
#define STREAM_NOT_READY …
#define STREAM_READY …
#define STREAM_OPEN …
#define STREAM_PAUSED …
#define STREAM_FINISHED …
#define CPIA_FLAG …
#define SYSTEM_FLAG …
#define INT_CTRL_FLAG …
#define PROCESS_FLAG …
#define COM_FLAG …
#define VP_CTRL_FLAG …
#define CAPTURE_FLAG …
#define DEBUG_FLAG …
#define VP_STATE_OK …
#define VP_STATE_FAILED_VIDEOINIT …
#define VP_STATE_FAILED_AECACBINIT …
#define VP_STATE_AEC_MAX …
#define VP_STATE_ACB_BMAX …
#define VP_STATE_ACB_RMIN …
#define VP_STATE_ACB_GMIN …
#define VP_STATE_ACB_RMAX …
#define VP_STATE_ACB_GMAX …
#define COMP_RED …
#define COMP_GREEN1 …
#define COMP_GREEN2 …
#define COMP_BLUE …
#define EXPOSURE_VERY_LIGHT …
#define EXPOSURE_LIGHT …
#define EXPOSURE_NORMAL …
#define EXPOSURE_DARK …
#define EXPOSURE_VERY_DARK …
#define CPIA_MODULE_CPIA …
#define CPIA_MODULE_SYSTEM …
#define CPIA_MODULE_VP_CTRL …
#define CPIA_MODULE_CAPTURE …
#define CPIA_MODULE_DEBUG …
#define INPUT …
#define OUTPUT …
#define CPIA_COMMAND_GetCPIAVersion …
#define CPIA_COMMAND_GetPnPID …
#define CPIA_COMMAND_GetCameraStatus …
#define CPIA_COMMAND_GotoHiPower …
#define CPIA_COMMAND_GotoLoPower …
#define CPIA_COMMAND_GotoSuspend …
#define CPIA_COMMAND_GotoPassThrough …
#define CPIA_COMMAND_ModifyCameraStatus …
#define CPIA_COMMAND_ReadVCRegs …
#define CPIA_COMMAND_WriteVCReg …
#define CPIA_COMMAND_ReadMCPorts …
#define CPIA_COMMAND_WriteMCPort …
#define CPIA_COMMAND_SetBaudRate …
#define CPIA_COMMAND_SetECPTiming …
#define CPIA_COMMAND_ReadIDATA …
#define CPIA_COMMAND_WriteIDATA …
#define CPIA_COMMAND_GenericCall …
#define CPIA_COMMAND_I2CStart …
#define CPIA_COMMAND_I2CStop …
#define CPIA_COMMAND_I2CWrite …
#define CPIA_COMMAND_I2CRead …
#define CPIA_COMMAND_GetVPVersion …
#define CPIA_COMMAND_ResetFrameCounter …
#define CPIA_COMMAND_SetColourParams …
#define CPIA_COMMAND_SetExposure …
#define CPIA_COMMAND_SetColourBalance …
#define CPIA_COMMAND_SetSensorFPS …
#define CPIA_COMMAND_SetVPDefaults …
#define CPIA_COMMAND_SetApcor …
#define CPIA_COMMAND_SetFlickerCtrl …
#define CPIA_COMMAND_SetVLOffset …
#define CPIA_COMMAND_GetColourParams …
#define CPIA_COMMAND_GetColourBalance …
#define CPIA_COMMAND_GetExposure …
#define CPIA_COMMAND_SetSensorMatrix …
#define CPIA_COMMAND_ColourBars …
#define CPIA_COMMAND_ReadVPRegs …
#define CPIA_COMMAND_WriteVPReg …
#define CPIA_COMMAND_GrabFrame …
#define CPIA_COMMAND_UploadFrame …
#define CPIA_COMMAND_SetGrabMode …
#define CPIA_COMMAND_InitStreamCap …
#define CPIA_COMMAND_FiniStreamCap …
#define CPIA_COMMAND_StartStreamCap …
#define CPIA_COMMAND_EndStreamCap …
#define CPIA_COMMAND_SetFormat …
#define CPIA_COMMAND_SetROI …
#define CPIA_COMMAND_SetCompression …
#define CPIA_COMMAND_SetCompressionTarget …
#define CPIA_COMMAND_SetYUVThresh …
#define CPIA_COMMAND_SetCompressionParams …
#define CPIA_COMMAND_DiscardFrame …
#define CPIA_COMMAND_GrabReset …
#define CPIA_COMMAND_OutputRS232 …
#define CPIA_COMMAND_AbortProcess …
#define CPIA_COMMAND_SetDramPage …
#define CPIA_COMMAND_StartDramUpload …
#define CPIA_COMMAND_StartDummyDtream …
#define CPIA_COMMAND_AbortStream …
#define CPIA_COMMAND_DownloadDRAM …
#define CPIA_COMMAND_Null …
#define ROUND_UP_EXP_FOR_FLICKER …
#define MAX_EXP …
#define MAX_EXP_102 …
#define LOW_EXP …
#define VERY_LOW_EXP …
#define TC …
#define EXP_ACC_DARK …
#define EXP_ACC_LIGHT …
#define HIGH_COMP_102 …
#define MAX_COMP …
#define DARK_TIME …
#define LIGHT_TIME …
#define FIRMWARE_VERSION(x, y) …
#define CPIA1_CID_COMP_TARGET …
#define BRIGHTNESS_DEF …
#define CONTRAST_DEF …
#define SATURATION_DEF …
#define FREQ_DEF …
#define ILLUMINATORS_1_DEF …
#define ILLUMINATORS_2_DEF …
#define COMP_TARGET_DEF …
static u8 flicker_jumps[2][2][4] = …;
struct cam_params { … };
struct sd { … };
static const struct v4l2_pix_format mode[] = …;
static int cpia_usb_transferCmd(struct gspca_dev *gspca_dev, u8 *command)
{ … }
static int do_command(struct gspca_dev *gspca_dev, u16 command,
u8 a, u8 b, u8 c, u8 d)
{ … }
static int do_command_extended(struct gspca_dev *gspca_dev, u16 command,
u8 a, u8 b, u8 c, u8 d,
u8 e, u8 f, u8 g, u8 h,
u8 i, u8 j, u8 k, u8 l)
{ … }
#define FLICKER_MAX_EXPOSURE …
#define FLICKER_ALLOWABLE_OVER_EXPOSURE …
#define FLICKER_BRIGHTNESS_CONSTANT …
static int find_over_exposure(int brightness)
{ … }
#undef FLICKER_MAX_EXPOSURE
#undef FLICKER_ALLOWABLE_OVER_EXPOSURE
#undef FLICKER_BRIGHTNESS_CONSTANT
static void reset_camera_params(struct gspca_dev *gspca_dev)
{ … }
static void printstatus(struct gspca_dev *gspca_dev, struct cam_params *params)
{ … }
static int goto_low_power(struct gspca_dev *gspca_dev)
{ … }
static int goto_high_power(struct gspca_dev *gspca_dev)
{ … }
static int get_version_information(struct gspca_dev *gspca_dev)
{ … }
static int save_camera_state(struct gspca_dev *gspca_dev)
{ … }
static int command_setformat(struct gspca_dev *gspca_dev)
{ … }
static int command_setcolourparams(struct gspca_dev *gspca_dev)
{ … }
static int command_setapcor(struct gspca_dev *gspca_dev)
{ … }
static int command_setvloffset(struct gspca_dev *gspca_dev)
{ … }
static int command_setexposure(struct gspca_dev *gspca_dev)
{ … }
static int command_setcolourbalance(struct gspca_dev *gspca_dev)
{ … }
static int command_setcompressiontarget(struct gspca_dev *gspca_dev)
{ … }
static int command_setyuvtresh(struct gspca_dev *gspca_dev)
{ … }
static int command_setcompressionparams(struct gspca_dev *gspca_dev)
{ … }
static int command_setcompression(struct gspca_dev *gspca_dev)
{ … }
static int command_setsensorfps(struct gspca_dev *gspca_dev)
{ … }
static int command_setflickerctrl(struct gspca_dev *gspca_dev)
{ … }
static int command_setecptiming(struct gspca_dev *gspca_dev)
{ … }
static int command_pause(struct gspca_dev *gspca_dev)
{ … }
static int command_resume(struct gspca_dev *gspca_dev)
{ … }
static int command_setlights(struct gspca_dev *gspca_dev)
{ … }
static int set_flicker(struct gspca_dev *gspca_dev, int on, int apply)
{ … }
static void monitor_exposure(struct gspca_dev *gspca_dev)
{ … }
static void restart_flicker(struct gspca_dev *gspca_dev)
{ … }
static int sd_config(struct gspca_dev *gspca_dev,
const struct usb_device_id *id)
{ … }
static int sd_start(struct gspca_dev *gspca_dev)
{ … }
static void sd_stopN(struct gspca_dev *gspca_dev)
{ … }
static int sd_init(struct gspca_dev *gspca_dev)
{ … }
static void sd_pkt_scan(struct gspca_dev *gspca_dev,
u8 *data,
int len)
{ … }
static void sd_dq_callback(struct gspca_dev *gspca_dev)
{ … }
static int sd_s_ctrl(struct v4l2_ctrl *ctrl)
{ … }
static const struct v4l2_ctrl_ops sd_ctrl_ops = …;
static int sd_init_controls(struct gspca_dev *gspca_dev)
{ … }
static const struct sd_desc sd_desc = …;
static const struct usb_device_id device_table[] = …;
MODULE_DEVICE_TABLE(usb, device_table);
static int sd_probe(struct usb_interface *intf,
const struct usb_device_id *id)
{ … }
static struct usb_driver sd_driver = …;
module_usb_driver(…) …;