aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2011-07-03 15:26:52 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2011-07-27 16:55:37 -0400
commite3aec98c1d3beaba9b96a7f00046bc06e59d6ab9 (patch)
treee8c39c143249dc20c02a7c5fe988a5f4d4e5f870
parent51886df0ca8bcc42e13cad7bcfc3487268229cea (diff)
[media] pwc: clean-up header files
Remove unused pwc-ioctl.h (the copy in include/media is used everywhere) Remove almost empty pwc-uncompress.h, move single define to pwc.h Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
-rw-r--r--drivers/media/video/pwc/pwc-ctrl.c1
-rw-r--r--drivers/media/video/pwc/pwc-if.c1
-rw-r--r--drivers/media/video/pwc/pwc-ioctl.h322
-rw-r--r--drivers/media/video/pwc/pwc-kiara.c1
-rw-r--r--drivers/media/video/pwc/pwc-uncompress.c1
-rw-r--r--drivers/media/video/pwc/pwc-uncompress.h40
-rw-r--r--drivers/media/video/pwc/pwc.h4
7 files changed, 3 insertions, 367 deletions
diff --git a/drivers/media/video/pwc/pwc-ctrl.c b/drivers/media/video/pwc/pwc-ctrl.c
index d09413c44c8..3977addf3ba 100644
--- a/drivers/media/video/pwc/pwc-ctrl.c
+++ b/drivers/media/video/pwc/pwc-ctrl.c
@@ -44,7 +44,6 @@
44#include <asm/errno.h> 44#include <asm/errno.h>
45 45
46#include "pwc.h" 46#include "pwc.h"
47#include "pwc-uncompress.h"
48#include "pwc-kiara.h" 47#include "pwc-kiara.h"
49#include "pwc-timon.h" 48#include "pwc-timon.h"
50#include "pwc-dec1.h" 49#include "pwc-dec1.h"
diff --git a/drivers/media/video/pwc/pwc-if.c b/drivers/media/video/pwc/pwc-if.c
index a5fe4a1532a..51ca3589b1b 100644
--- a/drivers/media/video/pwc/pwc-if.c
+++ b/drivers/media/video/pwc/pwc-if.c
@@ -75,7 +75,6 @@
75#include "pwc-timon.h" 75#include "pwc-timon.h"
76#include "pwc-dec23.h" 76#include "pwc-dec23.h"
77#include "pwc-dec1.h" 77#include "pwc-dec1.h"
78#include "pwc-uncompress.h"
79 78
80/* Function prototypes and driver templates */ 79/* Function prototypes and driver templates */
81 80
diff --git a/drivers/media/video/pwc/pwc-ioctl.h b/drivers/media/video/pwc/pwc-ioctl.h
deleted file mode 100644
index b74fea0a8d3..00000000000
--- a/drivers/media/video/pwc/pwc-ioctl.h
+++ /dev/null
@@ -1,322 +0,0 @@
1#ifndef PWC_IOCTL_H
2#define PWC_IOCTL_H
3
4/* (C) 2001-2004 Nemosoft Unv.
5 (C) 2004-2006 Luc Saillard (luc@saillard.org)
6
7 NOTE: this version of pwc is an unofficial (modified) release of pwc & pcwx
8 driver and thus may have bugs that are not present in the original version.
9 Please send bug reports and support requests to <luc@saillard.org>.
10 The decompression routines have been implemented by reverse-engineering the
11 Nemosoft binary pwcx module. Caveat emptor.
12
13 This program is free software; you can redistribute it and/or modify
14 it under the terms of the GNU General Public License as published by
15 the Free Software Foundation; either version 2 of the License, or
16 (at your option) any later version.
17
18 This program is distributed in the hope that it will be useful,
19 but WITHOUT ANY WARRANTY; without even the implied warranty of
20 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 GNU General Public License for more details.
22
23 You should have received a copy of the GNU General Public License
24 along with this program; if not, write to the Free Software
25 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
26*/
27
28/* This is pwc-ioctl.h belonging to PWC 10.0.10
29 It contains structures and defines to communicate from user space
30 directly to the driver.
31 */
32
33/*
34 Changes
35 2001/08/03 Alvarado Added ioctl constants to access methods for
36 changing white balance and red/blue gains
37 2002/12/15 G. H. Fernandez-Toribio VIDIOCGREALSIZE
38 2003/12/13 Nemosft Unv. Some modifications to make interfacing to
39 PWCX easier
40 */
41
42/* These are private ioctl() commands, specific for the Philips webcams.
43 They contain functions not found in other webcams, and settings not
44 specified in the Video4Linux API.
45
46 The #define names are built up like follows:
47 VIDIOC VIDeo IOCtl prefix
48 PWC Philps WebCam
49 G optional: Get
50 S optional: Set
51 ... the function
52 */
53
54#include <linux/types.h>
55
56 /* Enumeration of image sizes */
57#define PSZ_SQCIF 0x00
58#define PSZ_QSIF 0x01
59#define PSZ_QCIF 0x02
60#define PSZ_SIF 0x03
61#define PSZ_CIF 0x04
62#define PSZ_VGA 0x05
63#define PSZ_MAX 6
64
65
66/* The frame rate is encoded in the video_window.flags parameter using
67 the upper 16 bits, since some flags are defined nowadays. The following
68 defines provide a mask and shift to filter out this value.
69 This value can also be passing using the private flag when using v4l2 and
70 VIDIOC_S_FMT ioctl.
71
72 In 'Snapshot' mode the camera freezes its automatic exposure and colour
73 balance controls.
74 */
75#define PWC_FPS_SHIFT 16
76#define PWC_FPS_MASK 0x00FF0000
77#define PWC_FPS_FRMASK 0x003F0000
78#define PWC_FPS_SNAPSHOT 0x00400000
79#define PWC_QLT_MASK 0x03000000
80#define PWC_QLT_SHIFT 24
81
82
83/* structure for transferring x & y coordinates */
84struct pwc_coord
85{
86 int x, y; /* guess what */
87 int size; /* size, or offset */
88};
89
90
91/* Used with VIDIOCPWCPROBE */
92struct pwc_probe
93{
94 char name[32];
95 int type;
96};
97
98struct pwc_serial
99{
100 char serial[30]; /* String with serial number. Contains terminating 0 */
101};
102
103/* pwc_whitebalance.mode values */
104#define PWC_WB_INDOOR 0
105#define PWC_WB_OUTDOOR 1
106#define PWC_WB_FL 2
107#define PWC_WB_MANUAL 3
108#define PWC_WB_AUTO 4
109
110/* Used with VIDIOCPWC[SG]AWB (Auto White Balance).
111 Set mode to one of the PWC_WB_* values above.
112 *red and *blue are the respective gains of these colour components inside
113 the camera; range 0..65535
114 When 'mode' == PWC_WB_MANUAL, 'manual_red' and 'manual_blue' are set or read;
115 otherwise undefined.
116 'read_red' and 'read_blue' are read-only.
117*/
118struct pwc_whitebalance
119{
120 int mode;
121 int manual_red, manual_blue; /* R/W */
122 int read_red, read_blue; /* R/O */
123};
124
125/*
126 'control_speed' and 'control_delay' are used in automatic whitebalance mode,
127 and tell the camera how fast it should react to changes in lighting, and
128 with how much delay. Valid values are 0..65535.
129*/
130struct pwc_wb_speed
131{
132 int control_speed;
133 int control_delay;
134
135};
136
137/* Used with VIDIOCPWC[SG]LED */
138struct pwc_leds
139{
140 int led_on; /* Led on-time; range = 0..25000 */
141 int led_off; /* Led off-time; range = 0..25000 */
142};
143
144/* Image size (used with GREALSIZE) */
145struct pwc_imagesize
146{
147 int width;
148 int height;
149};
150
151/* Defines and structures for Motorized Pan & Tilt */
152#define PWC_MPT_PAN 0x01
153#define PWC_MPT_TILT 0x02
154#define PWC_MPT_TIMEOUT 0x04 /* for status */
155
156/* Set angles; when absolute != 0, the angle is absolute and the
157 driver calculates the relative offset for you. This can only
158 be used with VIDIOCPWCSANGLE; VIDIOCPWCGANGLE always returns
159 absolute angles.
160 */
161struct pwc_mpt_angles
162{
163 int absolute; /* write-only */
164 int pan; /* degrees * 100 */
165 int tilt; /* degress * 100 */
166};
167
168/* Range of angles of the camera, both horizontally and vertically.
169 */
170struct pwc_mpt_range
171{
172 int pan_min, pan_max; /* degrees * 100 */
173 int tilt_min, tilt_max;
174};
175
176struct pwc_mpt_status
177{
178 int status;
179 int time_pan;
180 int time_tilt;
181};
182
183
184/* This is used for out-of-kernel decompression. With it, you can get
185 all the necessary information to initialize and use the decompressor
186 routines in standalone applications.
187 */
188struct pwc_video_command
189{
190 int type; /* camera type (645, 675, 730, etc.) */
191 int release; /* release number */
192
193 int size; /* one of PSZ_* */
194 int alternate;
195 int command_len; /* length of USB video command */
196 unsigned char command_buf[13]; /* Actual USB video command */
197 int bandlength; /* >0 = compressed */
198 int frame_size; /* Size of one (un)compressed frame */
199};
200
201/* Flags for PWCX subroutines. Not all modules honour all flags. */
202#define PWCX_FLAG_PLANAR 0x0001
203#define PWCX_FLAG_BAYER 0x0008
204
205
206/* IOCTL definitions */
207
208 /* Restore user settings */
209#define VIDIOCPWCRUSER _IO('v', 192)
210 /* Save user settings */
211#define VIDIOCPWCSUSER _IO('v', 193)
212 /* Restore factory settings */
213#define VIDIOCPWCFACTORY _IO('v', 194)
214
215 /* You can manipulate the compression factor. A compression preference of 0
216 means use uncompressed modes when available; 1 is low compression, 2 is
217 medium and 3 is high compression preferred. Of course, the higher the
218 compression, the lower the bandwidth used but more chance of artefacts
219 in the image. The driver automatically chooses a higher compression when
220 the preferred mode is not available.
221 */
222 /* Set preferred compression quality (0 = uncompressed, 3 = highest compression) */
223#define VIDIOCPWCSCQUAL _IOW('v', 195, int)
224 /* Get preferred compression quality */
225#define VIDIOCPWCGCQUAL _IOR('v', 195, int)
226
227
228/* Retrieve serial number of camera */
229#define VIDIOCPWCGSERIAL _IOR('v', 198, struct pwc_serial)
230
231 /* This is a probe function; since so many devices are supported, it
232 becomes difficult to include all the names in programs that want to
233 check for the enhanced Philips stuff. So in stead, try this PROBE;
234 it returns a structure with the original name, and the corresponding
235 Philips type.
236 To use, fill the structure with zeroes, call PROBE and if that succeeds,
237 compare the name with that returned from VIDIOCGCAP; they should be the
238 same. If so, you can be assured it is a Philips (OEM) cam and the type
239 is valid.
240 */
241#define VIDIOCPWCPROBE _IOR('v', 199, struct pwc_probe)
242
243 /* Set AGC (Automatic Gain Control); int < 0 = auto, 0..65535 = fixed */
244#define VIDIOCPWCSAGC _IOW('v', 200, int)
245 /* Get AGC; int < 0 = auto; >= 0 = fixed, range 0..65535 */
246#define VIDIOCPWCGAGC _IOR('v', 200, int)
247 /* Set shutter speed; int < 0 = auto; >= 0 = fixed, range 0..65535 */
248#define VIDIOCPWCSSHUTTER _IOW('v', 201, int)
249
250 /* Color compensation (Auto White Balance) */
251#define VIDIOCPWCSAWB _IOW('v', 202, struct pwc_whitebalance)
252#define VIDIOCPWCGAWB _IOR('v', 202, struct pwc_whitebalance)
253
254 /* Auto WB speed */
255#define VIDIOCPWCSAWBSPEED _IOW('v', 203, struct pwc_wb_speed)
256#define VIDIOCPWCGAWBSPEED _IOR('v', 203, struct pwc_wb_speed)
257
258 /* LEDs on/off/blink; int range 0..65535 */
259#define VIDIOCPWCSLED _IOW('v', 205, struct pwc_leds)
260#define VIDIOCPWCGLED _IOR('v', 205, struct pwc_leds)
261
262 /* Contour (sharpness); int < 0 = auto, 0..65536 = fixed */
263#define VIDIOCPWCSCONTOUR _IOW('v', 206, int)
264#define VIDIOCPWCGCONTOUR _IOR('v', 206, int)
265
266 /* Backlight compensation; 0 = off, otherwise on */
267#define VIDIOCPWCSBACKLIGHT _IOW('v', 207, int)
268#define VIDIOCPWCGBACKLIGHT _IOR('v', 207, int)
269
270 /* Flickerless mode; = 0 off, otherwise on */
271#define VIDIOCPWCSFLICKER _IOW('v', 208, int)
272#define VIDIOCPWCGFLICKER _IOR('v', 208, int)
273
274 /* Dynamic noise reduction; 0 off, 3 = high noise reduction */
275#define VIDIOCPWCSDYNNOISE _IOW('v', 209, int)
276#define VIDIOCPWCGDYNNOISE _IOR('v', 209, int)
277
278 /* Real image size as used by the camera; tells you whether or not there's a gray border around the image */
279#define VIDIOCPWCGREALSIZE _IOR('v', 210, struct pwc_imagesize)
280
281 /* Motorized pan & tilt functions */
282#define VIDIOCPWCMPTRESET _IOW('v', 211, int)
283#define VIDIOCPWCMPTGRANGE _IOR('v', 211, struct pwc_mpt_range)
284#define VIDIOCPWCMPTSANGLE _IOW('v', 212, struct pwc_mpt_angles)
285#define VIDIOCPWCMPTGANGLE _IOR('v', 212, struct pwc_mpt_angles)
286#define VIDIOCPWCMPTSTATUS _IOR('v', 213, struct pwc_mpt_status)
287
288 /* Get the USB set-video command; needed for initializing libpwcx */
289#define VIDIOCPWCGVIDCMD _IOR('v', 215, struct pwc_video_command)
290struct pwc_table_init_buffer {
291 int len;
292 char *buffer;
293
294};
295#define VIDIOCPWCGVIDTABLE _IOR('v', 216, struct pwc_table_init_buffer)
296
297/*
298 * This is private command used when communicating with v4l2.
299 * In the future all private ioctl will be remove/replace to
300 * use interface offer by v4l2.
301 */
302
303#define V4L2_CID_PRIVATE_SAVE_USER (V4L2_CID_PRIVATE_BASE + 0)
304#define V4L2_CID_PRIVATE_RESTORE_USER (V4L2_CID_PRIVATE_BASE + 1)
305#define V4L2_CID_PRIVATE_RESTORE_FACTORY (V4L2_CID_PRIVATE_BASE + 2)
306#define V4L2_CID_PRIVATE_COLOUR_MODE (V4L2_CID_PRIVATE_BASE + 3)
307#define V4L2_CID_PRIVATE_AUTOCONTOUR (V4L2_CID_PRIVATE_BASE + 4)
308#define V4L2_CID_PRIVATE_CONTOUR (V4L2_CID_PRIVATE_BASE + 5)
309#define V4L2_CID_PRIVATE_BACKLIGHT (V4L2_CID_PRIVATE_BASE + 6)
310#define V4L2_CID_PRIVATE_FLICKERLESS (V4L2_CID_PRIVATE_BASE + 7)
311#define V4L2_CID_PRIVATE_NOISE_REDUCTION (V4L2_CID_PRIVATE_BASE + 8)
312
313struct pwc_raw_frame {
314 __le16 type; /* type of the webcam */
315 __le16 vbandlength; /* Size of 4lines compressed (used by the decompressor) */
316 __u8 cmd[4]; /* the four byte of the command (in case of nala,
317 only the first 3 bytes is filled) */
318 __u8 rawframe[0]; /* frame_size = H/4*vbandlength */
319} __attribute__ ((packed));
320
321
322#endif
diff --git a/drivers/media/video/pwc/pwc-kiara.c b/drivers/media/video/pwc/pwc-kiara.c
index f4ae83c0cf2..e5f4fd81712 100644
--- a/drivers/media/video/pwc/pwc-kiara.c
+++ b/drivers/media/video/pwc/pwc-kiara.c
@@ -40,7 +40,6 @@
40 40
41 41
42#include "pwc-kiara.h" 42#include "pwc-kiara.h"
43#include "pwc-uncompress.h"
44 43
45const unsigned int Kiara_fps_vector[PWC_FPS_MAX_KIARA] = { 5, 10, 15, 20, 25, 30 }; 44const unsigned int Kiara_fps_vector[PWC_FPS_MAX_KIARA] = { 5, 10, 15, 20, 25, 30 };
46 45
diff --git a/drivers/media/video/pwc/pwc-uncompress.c b/drivers/media/video/pwc/pwc-uncompress.c
index d110e38c4de..51265092bd3 100644
--- a/drivers/media/video/pwc/pwc-uncompress.c
+++ b/drivers/media/video/pwc/pwc-uncompress.c
@@ -30,7 +30,6 @@
30#include <asm/types.h> 30#include <asm/types.h>
31 31
32#include "pwc.h" 32#include "pwc.h"
33#include "pwc-uncompress.h"
34#include "pwc-dec1.h" 33#include "pwc-dec1.h"
35#include "pwc-dec23.h" 34#include "pwc-dec23.h"
36 35
diff --git a/drivers/media/video/pwc/pwc-uncompress.h b/drivers/media/video/pwc/pwc-uncompress.h
deleted file mode 100644
index 43028e74e9e..00000000000
--- a/drivers/media/video/pwc/pwc-uncompress.h
+++ /dev/null
@@ -1,40 +0,0 @@
1/* (C) 1999-2003 Nemosoft Unv.
2 (C) 2004-2006 Luc Saillard (luc@saillard.org)
3
4 NOTE: this version of pwc is an unofficial (modified) release of pwc & pcwx
5 driver and thus may have bugs that are not present in the original version.
6 Please send bug reports and support requests to <luc@saillard.org>.
7 The decompression routines have been implemented by reverse-engineering the
8 Nemosoft binary pwcx module. Caveat emptor.
9
10 This program is free software; you can redistribute it and/or modify
11 it under the terms of the GNU General Public License as published by
12 the Free Software Foundation; either version 2 of the License, or
13 (at your option) any later version.
14
15 This program is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 GNU General Public License for more details.
19
20 You should have received a copy of the GNU General Public License
21 along with this program; if not, write to the Free Software
22 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23*/
24
25/* This file is the bridge between the kernel module and the plugin; it
26 describes the structures and datatypes used in both modules. Any
27 significant change should be reflected by increasing the
28 pwc_decompressor_version major number.
29 */
30#ifndef PWC_UNCOMPRESS_H
31#define PWC_UNCOMPRESS_H
32
33
34#include <media/pwc-ioctl.h>
35
36/* from pwc-dec.h */
37#define PWCX_FLAG_PLANAR 0x0001
38/* */
39
40#endif
diff --git a/drivers/media/video/pwc/pwc.h b/drivers/media/video/pwc/pwc.h
index 8f3607be5a7..0e4e2d7b787 100644
--- a/drivers/media/video/pwc/pwc.h
+++ b/drivers/media/video/pwc/pwc.h
@@ -42,7 +42,6 @@
42#include <linux/input.h> 42#include <linux/input.h>
43#endif 43#endif
44 44
45#include "pwc-uncompress.h"
46#include <media/pwc-ioctl.h> 45#include <media/pwc-ioctl.h>
47 46
48/* Version block */ 47/* Version block */
@@ -129,6 +128,9 @@
129#define DEVICE_USE_CODEC3(x) ((x)>=700) 128#define DEVICE_USE_CODEC3(x) ((x)>=700)
130#define DEVICE_USE_CODEC23(x) ((x)>=675) 129#define DEVICE_USE_CODEC23(x) ((x)>=675)
131 130
131/* from pwc-dec.h */
132#define PWCX_FLAG_PLANAR 0x0001
133
132/* Request types: video */ 134/* Request types: video */
133#define SET_LUM_CTL 0x01 135#define SET_LUM_CTL 0x01
134#define GET_LUM_CTL 0x02 136#define GET_LUM_CTL 0x02