linux/drivers/media/usb/pwc/pwc-ctrl.c

// SPDX-License-Identifier: GPL-2.0-or-later
/* Driver for Philips webcam
   Functions that send various control messages to the webcam, including
   video modes.
   (C) 1999-2003 Nemosoft Unv.
   (C) 2004-2006 Luc Saillard ([email protected])
   (C) 2011 Hans de Goede <[email protected]>

   NOTE: this version of pwc is an unofficial (modified) release of pwc & pcwx
   driver and thus may have bugs that are not present in the original version.
   Please send bug reports and support requests to <[email protected]>.

   NOTE: this version of pwc is an unofficial (modified) release of pwc & pcwx
   driver and thus may have bugs that are not present in the original version.
   Please send bug reports and support requests to <[email protected]>.
   The decompression routines have been implemented by reverse-engineering the
   Nemosoft binary pwcx module. Caveat emptor.

*/

/*
   Changes
   2001/08/03  Alvarado   Added methods for changing white balance and
			  red/green gains
 */

/* Control functions for the cam; brightness, contrast, video mode, etc. */

#ifdef __KERNEL__
#include <linux/uaccess.h>
#endif
#include <asm/errno.h>

#include "pwc.h"
#include "pwc-kiara.h"
#include "pwc-timon.h"
#include "pwc-dec1.h"
#include "pwc-dec23.h"

/* Selectors for status controls used only in this file */
#define GET_STATUS_B00
#define SENSOR_TYPE_FORMATTER1
#define GET_STATUS_3000
#define READ_RAW_Y_MEAN_FORMATTER
#define SET_POWER_SAVE_MODE_FORMATTER
#define MIRROR_IMAGE_FORMATTER
#define LED_FORMATTER
#define LOWLIGHT
#define GET_STATUS_3600
#define SENSOR_TYPE_FORMATTER2
#define GET_STATUS_3800
#define GET_STATUS_4000
#define GET_STATUS_4100
#define CTL_STATUS_4200

/* Formatters for the Video Endpoint controls [GS]ET_EP_STREAM_CTL */
#define VIDEO_OUTPUT_CONTROL_FORMATTER

static const char *size2name[PSZ_MAX] =;

/********/

/* Entries for the Nala (645/646) camera; the Nala doesn't have compression
   preferences, so you either get compressed or non-compressed streams.

   An alternate value of 0 means this mode is not available at all.
 */

#define PWC_FPS_MAX_NALA

struct Nala_table_entry {};

static unsigned int Nala_fps_vector[PWC_FPS_MAX_NALA] =;

static struct Nala_table_entry Nala_table[PSZ_MAX][PWC_FPS_MAX_NALA] =;

/****************************************************************************/

static int recv_control_msg(struct pwc_device *pdev,
	u8 request, u16 value, int recv_count)
{}

static inline int send_video_command(struct pwc_device *pdev,
	int index, const unsigned char *buf, int buflen)
{}

int send_control_msg(struct pwc_device *pdev,
	u8 request, u16 value, void *buf, int buflen)
{}

static int set_video_mode_Nala(struct pwc_device *pdev, int size, int pixfmt,
			       int frames, int *compression, int send_to_cam)
{}


static int set_video_mode_Timon(struct pwc_device *pdev, int size, int pixfmt,
				int frames, int *compression, int send_to_cam)
{}


static int set_video_mode_Kiara(struct pwc_device *pdev, int size, int pixfmt,
				int frames, int *compression, int send_to_cam)
{}

int pwc_set_video_mode(struct pwc_device *pdev, int width, int height,
	int pixfmt, int frames, int *compression, int send_to_cam)
{}

static unsigned int pwc_get_fps_Nala(struct pwc_device *pdev, unsigned int index, unsigned int size)
{}

static unsigned int pwc_get_fps_Kiara(struct pwc_device *pdev, unsigned int index, unsigned int size)
{}

static unsigned int pwc_get_fps_Timon(struct pwc_device *pdev, unsigned int index, unsigned int size)
{}

unsigned int pwc_get_fps(struct pwc_device *pdev, unsigned int index, unsigned int size)
{}

int pwc_get_u8_ctrl(struct pwc_device *pdev, u8 request, u16 value, int *data)
{}

int pwc_set_u8_ctrl(struct pwc_device *pdev, u8 request, u16 value, u8 data)
{}

int pwc_get_s8_ctrl(struct pwc_device *pdev, u8 request, u16 value, int *data)
{}

int pwc_get_u16_ctrl(struct pwc_device *pdev, u8 request, u16 value, int *data)
{}

int pwc_set_u16_ctrl(struct pwc_device *pdev, u8 request, u16 value, u16 data)
{}

int pwc_button_ctrl(struct pwc_device *pdev, u16 value)
{}

/* POWER */
void pwc_camera_power(struct pwc_device *pdev, int power)
{}

int pwc_set_leds(struct pwc_device *pdev, int on_value, int off_value)
{}

#ifdef CONFIG_USB_PWC_DEBUG
int pwc_get_cmos_sensor(struct pwc_device *pdev, int *sensor)
{}
#endif