Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions | Variables
pwc.h File Reference
#include <linux/module.h>
#include <linux/usb.h>
#include <linux/spinlock.h>
#include <linux/wait.h>
#include <linux/mutex.h>
#include <linux/mm.h>
#include <linux/slab.h>
#include <asm/errno.h>
#include <linux/videodev2.h>
#include <media/v4l2-common.h>
#include <media/v4l2-device.h>
#include <media/v4l2-ioctl.h>
#include <media/v4l2-ctrls.h>
#include <media/v4l2-fh.h>
#include <media/v4l2-event.h>
#include <media/videobuf2-vmalloc.h>
#include "pwc-dec1.h"
#include "pwc-dec23.h"

Go to the source code of this file.

Data Structures

struct  pwc_raw_frame
 
struct  pwc_frame_buf
 
struct  pwc_device
 

Macros

#define PWC_VERSION   "10.0.15"
 
#define PWC_NAME   "pwc"
 
#define PFX   PWC_NAME ": "
 
#define PWC_DEBUG_LEVEL_MODULE   (1<<0)
 
#define PWC_DEBUG_LEVEL_PROBE   (1<<1)
 
#define PWC_DEBUG_LEVEL_OPEN   (1<<2)
 
#define PWC_DEBUG_LEVEL_READ   (1<<3)
 
#define PWC_DEBUG_LEVEL_MEMORY   (1<<4)
 
#define PWC_DEBUG_LEVEL_FLOW   (1<<5)
 
#define PWC_DEBUG_LEVEL_SIZE   (1<<6)
 
#define PWC_DEBUG_LEVEL_IOCTL   (1<<7)
 
#define PWC_DEBUG_LEVEL_TRACE   (1<<8)
 
#define PWC_DEBUG_MODULE(fmt, args...)   PWC_DEBUG(MODULE, fmt, ##args)
 
#define PWC_DEBUG_PROBE(fmt, args...)   PWC_DEBUG(PROBE, fmt, ##args)
 
#define PWC_DEBUG_OPEN(fmt, args...)   PWC_DEBUG(OPEN, fmt, ##args)
 
#define PWC_DEBUG_READ(fmt, args...)   PWC_DEBUG(READ, fmt, ##args)
 
#define PWC_DEBUG_MEMORY(fmt, args...)   PWC_DEBUG(MEMORY, fmt, ##args)
 
#define PWC_DEBUG_FLOW(fmt, args...)   PWC_DEBUG(FLOW, fmt, ##args)
 
#define PWC_DEBUG_SIZE(fmt, args...)   PWC_DEBUG(SIZE, fmt, ##args)
 
#define PWC_DEBUG_IOCTL(fmt, args...)   PWC_DEBUG(IOCTL, fmt, ##args)
 
#define PWC_DEBUG_TRACE(fmt, args...)   PWC_DEBUG(TRACE, fmt, ##args)
 
#define PWC_ERROR(fmt, args...)   printk(KERN_ERR PFX fmt, ##args)
 
#define PWC_WARNING(fmt, args...)   printk(KERN_WARNING PFX fmt, ##args)
 
#define PWC_INFO(fmt, args...)   printk(KERN_INFO PFX fmt, ##args)
 
#define PWC_TRACE(fmt, args...)   do { } while(0)
 
#define PWC_DEBUG(level, fmt, args...)   do { } while(0)
 
#define pwc_trace   0
 
#define TOUCAM_HEADER_SIZE   8
 
#define TOUCAM_TRAILER_SIZE   4
 
#define FEATURE_MOTOR_PANTILT   0x0001
 
#define FEATURE_CODEC1   0x0002
 
#define FEATURE_CODEC2   0x0004
 
#define MAX_WIDTH   640
 
#define MAX_HEIGHT   480
 
#define FRAME_LOWMARK   5
 
#define MAX_ISO_BUFS   3
 
#define ISO_FRAMES_PER_DESC   10
 
#define ISO_MAX_FRAME_SIZE   960
 
#define ISO_BUFFER_SIZE   (ISO_FRAMES_PER_DESC * ISO_MAX_FRAME_SIZE)
 
#define PWC_FRAME_SIZE   (460800 + TOUCAM_HEADER_SIZE + TOUCAM_TRAILER_SIZE)
 
#define MIN_FRAMES   2
 
#define MAX_FRAMES   16
 
#define DEVICE_USE_CODEC1(x)   ((x)<675)
 
#define DEVICE_USE_CODEC2(x)   ((x)>=675 && (x)<700)
 
#define DEVICE_USE_CODEC3(x)   ((x)>=700)
 
#define DEVICE_USE_CODEC23(x)   ((x)>=675)
 
#define SET_LUM_CTL   0x01
 
#define GET_LUM_CTL   0x02
 
#define SET_CHROM_CTL   0x03
 
#define GET_CHROM_CTL   0x04
 
#define SET_STATUS_CTL   0x05
 
#define GET_STATUS_CTL   0x06
 
#define SET_EP_STREAM_CTL   0x07
 
#define GET_EP_STREAM_CTL   0x08
 
#define GET_XX_CTL   0x09
 
#define SET_XX_CTL   0x0A
 
#define GET_XY_CTL   0x0B
 
#define SET_XY_CTL   0x0C
 
#define SET_MPT_CTL   0x0D
 
#define GET_MPT_CTL   0x0E
 
#define AGC_MODE_FORMATTER   0x2000
 
#define PRESET_AGC_FORMATTER   0x2100
 
#define SHUTTER_MODE_FORMATTER   0x2200
 
#define PRESET_SHUTTER_FORMATTER   0x2300
 
#define PRESET_CONTOUR_FORMATTER   0x2400
 
#define AUTO_CONTOUR_FORMATTER   0x2500
 
#define BACK_LIGHT_COMPENSATION_FORMATTER   0x2600
 
#define CONTRAST_FORMATTER   0x2700
 
#define DYNAMIC_NOISE_CONTROL_FORMATTER   0x2800
 
#define FLICKERLESS_MODE_FORMATTER   0x2900
 
#define AE_CONTROL_SPEED   0x2A00
 
#define BRIGHTNESS_FORMATTER   0x2B00
 
#define GAMMA_FORMATTER   0x2C00
 
#define WB_MODE_FORMATTER   0x1000
 
#define AWB_CONTROL_SPEED_FORMATTER   0x1100
 
#define AWB_CONTROL_DELAY_FORMATTER   0x1200
 
#define PRESET_MANUAL_RED_GAIN_FORMATTER   0x1300
 
#define PRESET_MANUAL_BLUE_GAIN_FORMATTER   0x1400
 
#define COLOUR_MODE_FORMATTER   0x1500
 
#define SATURATION_MODE_FORMATTER1   0x1600
 
#define SATURATION_MODE_FORMATTER2   0x1700
 
#define SAVE_USER_DEFAULTS_FORMATTER   0x0200
 
#define RESTORE_USER_DEFAULTS_FORMATTER   0x0300
 
#define RESTORE_FACTORY_DEFAULTS_FORMATTER   0x0400
 
#define READ_AGC_FORMATTER   0x0500
 
#define READ_SHUTTER_FORMATTER   0x0600
 
#define READ_RED_GAIN_FORMATTER   0x0700
 
#define READ_BLUE_GAIN_FORMATTER   0x0800
 
#define PT_RELATIVE_CONTROL_FORMATTER   0x01
 
#define PT_RESET_CONTROL_FORMATTER   0x02
 
#define PT_STATUS_FORMATTER   0x03
 
#define PSZ_SQCIF   0x00
 
#define PSZ_QSIF   0x01
 
#define PSZ_QCIF   0x02
 
#define PSZ_SIF   0x03
 
#define PSZ_CIF   0x04
 
#define PSZ_VGA   0x05
 
#define PSZ_MAX   6
 
#define pwc_set_s8_ctrl   pwc_set_u8_ctrl
 

Functions

int pwc_get_size (struct pwc_device *pdev, int width, int height)
 
void pwc_construct (struct pwc_device *pdev)
 
int pwc_set_video_mode (struct pwc_device *pdev, int width, int height, int pixfmt, int frames, int *compression, int send_to_cam)
 
unsigned int pwc_get_fps (struct pwc_device *pdev, unsigned int index, unsigned int size)
 
int pwc_set_leds (struct pwc_device *pdev, int on_value, int off_value)
 
int pwc_get_cmos_sensor (struct pwc_device *pdev, int *sensor)
 
int send_control_msg (struct pwc_device *pdev, u8 request, u16 value, void *buf, int buflen)
 
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 *dat)
 
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)
 
int pwc_init_controls (struct pwc_device *pdev)
 
void pwc_camera_power (struct pwc_device *pdev, int power)
 
int pwc_decompress (struct pwc_device *pdev, struct pwc_frame_buf *fbuf)
 

Variables

struct pwc_raw_frame __packed
 
const int pwc_image_sizes [PSZ_MAX][2]
 
struct v4l2_ioctl_ops pwc_ioctl_ops
 

Macro Definition Documentation

#define AE_CONTROL_SPEED   0x2A00

Definition at line 164 of file pwc.h.

#define AGC_MODE_FORMATTER   0x2000

Definition at line 154 of file pwc.h.

#define AUTO_CONTOUR_FORMATTER   0x2500

Definition at line 159 of file pwc.h.

#define AWB_CONTROL_DELAY_FORMATTER   0x1200

Definition at line 171 of file pwc.h.

#define AWB_CONTROL_SPEED_FORMATTER   0x1100

Definition at line 170 of file pwc.h.

#define BACK_LIGHT_COMPENSATION_FORMATTER   0x2600

Definition at line 160 of file pwc.h.

#define BRIGHTNESS_FORMATTER   0x2B00

Definition at line 165 of file pwc.h.

#define COLOUR_MODE_FORMATTER   0x1500

Definition at line 174 of file pwc.h.

#define CONTRAST_FORMATTER   0x2700

Definition at line 161 of file pwc.h.

#define DEVICE_USE_CODEC1 (   x)    ((x)<675)

Definition at line 132 of file pwc.h.

#define DEVICE_USE_CODEC2 (   x)    ((x)>=675 && (x)<700)

Definition at line 133 of file pwc.h.

#define DEVICE_USE_CODEC23 (   x)    ((x)>=675)

Definition at line 135 of file pwc.h.

#define DEVICE_USE_CODEC3 (   x)    ((x)>=700)

Definition at line 134 of file pwc.h.

#define DYNAMIC_NOISE_CONTROL_FORMATTER   0x2800

Definition at line 162 of file pwc.h.

#define FEATURE_CODEC1   0x0002

Definition at line 109 of file pwc.h.

#define FEATURE_CODEC2   0x0004

Definition at line 110 of file pwc.h.

#define FEATURE_MOTOR_PANTILT   0x0001

Definition at line 108 of file pwc.h.

#define FLICKERLESS_MODE_FORMATTER   0x2900

Definition at line 163 of file pwc.h.

#define FRAME_LOWMARK   5

Definition at line 116 of file pwc.h.

#define GAMMA_FORMATTER   0x2C00

Definition at line 166 of file pwc.h.

#define GET_CHROM_CTL   0x04

Definition at line 141 of file pwc.h.

#define GET_EP_STREAM_CTL   0x08

Definition at line 145 of file pwc.h.

#define GET_LUM_CTL   0x02

Definition at line 139 of file pwc.h.

#define GET_MPT_CTL   0x0E

Definition at line 151 of file pwc.h.

#define GET_STATUS_CTL   0x06

Definition at line 143 of file pwc.h.

#define GET_XX_CTL   0x09

Definition at line 146 of file pwc.h.

#define GET_XY_CTL   0x0B

Definition at line 148 of file pwc.h.

#define ISO_BUFFER_SIZE   (ISO_FRAMES_PER_DESC * ISO_MAX_FRAME_SIZE)

Definition at line 122 of file pwc.h.

#define ISO_FRAMES_PER_DESC   10

Definition at line 120 of file pwc.h.

#define ISO_MAX_FRAME_SIZE   960

Definition at line 121 of file pwc.h.

#define MAX_FRAMES   16

Definition at line 129 of file pwc.h.

#define MAX_HEIGHT   480

Definition at line 113 of file pwc.h.

#define MAX_ISO_BUFS   3

Definition at line 119 of file pwc.h.

#define MAX_WIDTH   640

Definition at line 112 of file pwc.h.

#define MIN_FRAMES   2

Definition at line 128 of file pwc.h.

#define PFX   PWC_NAME ": "

Definition at line 53 of file pwc.h.

#define PRESET_AGC_FORMATTER   0x2100

Definition at line 155 of file pwc.h.

#define PRESET_CONTOUR_FORMATTER   0x2400

Definition at line 158 of file pwc.h.

#define PRESET_MANUAL_BLUE_GAIN_FORMATTER   0x1400

Definition at line 173 of file pwc.h.

#define PRESET_MANUAL_RED_GAIN_FORMATTER   0x1300

Definition at line 172 of file pwc.h.

#define PRESET_SHUTTER_FORMATTER   0x2300

Definition at line 157 of file pwc.h.

#define PSZ_CIF   0x04

Definition at line 197 of file pwc.h.

#define PSZ_MAX   6

Definition at line 199 of file pwc.h.

#define PSZ_QCIF   0x02

Definition at line 195 of file pwc.h.

#define PSZ_QSIF   0x01

Definition at line 194 of file pwc.h.

#define PSZ_SIF   0x03

Definition at line 196 of file pwc.h.

#define PSZ_SQCIF   0x00

Definition at line 193 of file pwc.h.

#define PSZ_VGA   0x05

Definition at line 198 of file pwc.h.

#define PT_RELATIVE_CONTROL_FORMATTER   0x01

Definition at line 188 of file pwc.h.

#define PT_RESET_CONTROL_FORMATTER   0x02

Definition at line 189 of file pwc.h.

#define PT_STATUS_FORMATTER   0x03

Definition at line 190 of file pwc.h.

#define PWC_DEBUG (   level,
  fmt,
  args... 
)    do { } while(0)

Definition at line 98 of file pwc.h.

#define PWC_DEBUG_FLOW (   fmt,
  args... 
)    PWC_DEBUG(FLOW, fmt, ##args)

Definition at line 72 of file pwc.h.

#define PWC_DEBUG_IOCTL (   fmt,
  args... 
)    PWC_DEBUG(IOCTL, fmt, ##args)

Definition at line 74 of file pwc.h.

#define PWC_DEBUG_LEVEL_FLOW   (1<<5)

Definition at line 62 of file pwc.h.

#define PWC_DEBUG_LEVEL_IOCTL   (1<<7)

Definition at line 64 of file pwc.h.

#define PWC_DEBUG_LEVEL_MEMORY   (1<<4)

Definition at line 61 of file pwc.h.

#define PWC_DEBUG_LEVEL_MODULE   (1<<0)

Definition at line 57 of file pwc.h.

#define PWC_DEBUG_LEVEL_OPEN   (1<<2)

Definition at line 59 of file pwc.h.

#define PWC_DEBUG_LEVEL_PROBE   (1<<1)

Definition at line 58 of file pwc.h.

#define PWC_DEBUG_LEVEL_READ   (1<<3)

Definition at line 60 of file pwc.h.

#define PWC_DEBUG_LEVEL_SIZE   (1<<6)

Definition at line 63 of file pwc.h.

#define PWC_DEBUG_LEVEL_TRACE   (1<<8)

Definition at line 65 of file pwc.h.

#define PWC_DEBUG_MEMORY (   fmt,
  args... 
)    PWC_DEBUG(MEMORY, fmt, ##args)

Definition at line 71 of file pwc.h.

#define PWC_DEBUG_MODULE (   fmt,
  args... 
)    PWC_DEBUG(MODULE, fmt, ##args)

Definition at line 67 of file pwc.h.

#define PWC_DEBUG_OPEN (   fmt,
  args... 
)    PWC_DEBUG(OPEN, fmt, ##args)

Definition at line 69 of file pwc.h.

#define PWC_DEBUG_PROBE (   fmt,
  args... 
)    PWC_DEBUG(PROBE, fmt, ##args)

Definition at line 68 of file pwc.h.

#define PWC_DEBUG_READ (   fmt,
  args... 
)    PWC_DEBUG(READ, fmt, ##args)

Definition at line 70 of file pwc.h.

#define PWC_DEBUG_SIZE (   fmt,
  args... 
)    PWC_DEBUG(SIZE, fmt, ##args)

Definition at line 73 of file pwc.h.

#define PWC_DEBUG_TRACE (   fmt,
  args... 
)    PWC_DEBUG(TRACE, fmt, ##args)

Definition at line 75 of file pwc.h.

#define PWC_ERROR (   fmt,
  args... 
)    printk(KERN_ERR PFX fmt, ##args)

Definition at line 94 of file pwc.h.

#define PWC_FRAME_SIZE   (460800 + TOUCAM_HEADER_SIZE + TOUCAM_TRAILER_SIZE)

Definition at line 125 of file pwc.h.

#define PWC_INFO (   fmt,
  args... 
)    printk(KERN_INFO PFX fmt, ##args)

Definition at line 96 of file pwc.h.

#define PWC_NAME   "pwc"

Definition at line 52 of file pwc.h.

#define pwc_set_s8_ctrl   pwc_set_u8_ctrl

Definition at line 378 of file pwc.h.

#define PWC_TRACE (   fmt,
  args... 
)    do { } while(0)

Definition at line 97 of file pwc.h.

#define pwc_trace   0

Definition at line 100 of file pwc.h.

#define PWC_VERSION   "10.0.15"

Definition at line 51 of file pwc.h.

#define PWC_WARNING (   fmt,
  args... 
)    printk(KERN_WARNING PFX fmt, ##args)

Definition at line 95 of file pwc.h.

#define READ_AGC_FORMATTER   0x0500

Definition at line 182 of file pwc.h.

#define READ_BLUE_GAIN_FORMATTER   0x0800

Definition at line 185 of file pwc.h.

#define READ_RED_GAIN_FORMATTER   0x0700

Definition at line 184 of file pwc.h.

#define READ_SHUTTER_FORMATTER   0x0600

Definition at line 183 of file pwc.h.

#define RESTORE_FACTORY_DEFAULTS_FORMATTER   0x0400

Definition at line 181 of file pwc.h.

#define RESTORE_USER_DEFAULTS_FORMATTER   0x0300

Definition at line 180 of file pwc.h.

#define SATURATION_MODE_FORMATTER1   0x1600

Definition at line 175 of file pwc.h.

#define SATURATION_MODE_FORMATTER2   0x1700

Definition at line 176 of file pwc.h.

#define SAVE_USER_DEFAULTS_FORMATTER   0x0200

Definition at line 179 of file pwc.h.

#define SET_CHROM_CTL   0x03

Definition at line 140 of file pwc.h.

#define SET_EP_STREAM_CTL   0x07

Definition at line 144 of file pwc.h.

#define SET_LUM_CTL   0x01

Definition at line 138 of file pwc.h.

#define SET_MPT_CTL   0x0D

Definition at line 150 of file pwc.h.

#define SET_STATUS_CTL   0x05

Definition at line 142 of file pwc.h.

#define SET_XX_CTL   0x0A

Definition at line 147 of file pwc.h.

#define SET_XY_CTL   0x0C

Definition at line 149 of file pwc.h.

#define SHUTTER_MODE_FORMATTER   0x2200

Definition at line 156 of file pwc.h.

#define TOUCAM_HEADER_SIZE   8

Definition at line 105 of file pwc.h.

#define TOUCAM_TRAILER_SIZE   4

Definition at line 106 of file pwc.h.

#define WB_MODE_FORMATTER   0x1000

Definition at line 169 of file pwc.h.

Function Documentation

int pwc_button_ctrl ( struct pwc_device pdev,
u16  value 
)

Definition at line 471 of file pwc-ctrl.c.

void pwc_camera_power ( struct pwc_device pdev,
int  power 
)

Definition at line 483 of file pwc-ctrl.c.

void pwc_construct ( struct pwc_device pdev)

Definition at line 67 of file pwc-misc.c.

int pwc_decompress ( struct pwc_device pdev,
struct pwc_frame_buf fbuf 
)

pwc-uncompress.c

Definition at line 36 of file pwc-uncompress.c.

int pwc_get_cmos_sensor ( struct pwc_device pdev,
int sensor 
)
unsigned int pwc_get_fps ( struct pwc_device pdev,
unsigned int  index,
unsigned int  size 
)

Definition at line 393 of file pwc-ctrl.c.

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

Definition at line 434 of file pwc-ctrl.c.

int pwc_get_size ( struct pwc_device pdev,
int  width,
int  height 
)

Definition at line 41 of file pwc-misc.c.

int pwc_get_u16_ctrl ( struct pwc_device pdev,
u8  request,
u16  value,
int dat 
)

Definition at line 446 of file pwc-ctrl.c.

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

Definition at line 410 of file pwc-ctrl.c.

int pwc_init_controls ( struct pwc_device pdev)

Definition at line 162 of file pwc-v4l.c.

int pwc_set_leds ( struct pwc_device pdev,
int  on_value,
int  off_value 
)

Definition at line 504 of file pwc-ctrl.c.

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

Definition at line 458 of file pwc-ctrl.c.

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

Definition at line 422 of file pwc-ctrl.c.

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

Functions in pwc-ctrl.c

Definition at line 328 of file pwc-ctrl.c.

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

Definition at line 143 of file pwc-ctrl.c.

Variable Documentation

const int pwc_image_sizes[PSZ_MAX][2]

Functions in pwc-misc.c

Definition at line 30 of file pwc-misc.c.

struct v4l2_ioctl_ops pwc_ioctl_ops

Definition at line 1031 of file pwc-v4l.c.