aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/usbvideo/quickcam_messenger.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/video/usbvideo/quickcam_messenger.h')
-rw-r--r--drivers/media/video/usbvideo/quickcam_messenger.h126
1 files changed, 126 insertions, 0 deletions
diff --git a/drivers/media/video/usbvideo/quickcam_messenger.h b/drivers/media/video/usbvideo/quickcam_messenger.h
new file mode 100644
index 000000000000..baab9c081b52
--- /dev/null
+++ b/drivers/media/video/usbvideo/quickcam_messenger.h
@@ -0,0 +1,126 @@
1#ifndef quickcam_messenger_h
2#define quickcam_messenger_h
3
4#ifndef CONFIG_INPUT
5/* if we're not using input we dummy out these functions */
6#define qcm_register_input(...)
7#define qcm_unregister_input(...)
8#define qcm_report_buttonstat(...)
9#define qcm_setup_input_int(...) 0
10#define qcm_stop_int_data(...)
11#define qcm_alloc_int_urb(...) 0
12#define qcm_free_int(...)
13#endif
14
15
16#define CHECK_RET(ret, expr) \
17 if ((ret = expr) < 0) return ret
18
19/* Control Registers for the STVV6422 ASIC
20 * - this define is taken from the qc-usb-messenger code
21 */
22#define STV_ISO_ENABLE 0x1440
23#define ISOC_PACKET_SIZE 1023
24
25/* Chip identification number including revision indicator */
26#define CMOS_SENSOR_IDREV 0xE00A
27
28struct rgb {
29 u8 b;
30 u8 g;
31 u8 r;
32 u8 b2;
33 u8 g2;
34 u8 r2;
35};
36
37struct bayL0 {
38#ifdef __BIG_ENDIAN
39 u8 r;
40 u8 g;
41#elif __LITTLE_ENDIAN
42 u8 g;
43 u8 r;
44#else
45#error not byte order defined
46#endif
47};
48
49struct bayL1 {
50#ifdef __BIG_ENDIAN
51 u8 g;
52 u8 b;
53#elif __LITTLE_ENDIAN
54 u8 b;
55 u8 g;
56#else
57#error not byte order defined
58#endif
59};
60
61struct cam_size {
62 u16 width;
63 u16 height;
64 u8 cmd;
65};
66
67static const struct cam_size camera_sizes[] = {
68 { 160, 120, 0xf },
69 { 320, 240, 0x2 },
70};
71
72enum frame_sizes {
73 SIZE_160X120 = 0,
74 SIZE_320X240 = 1,
75};
76
77#define MAX_FRAME_SIZE SIZE_320X240
78
79struct qcm {
80 u16 colour;
81 u16 hue;
82 u16 brightness;
83 u16 contrast;
84 u16 whiteness;
85
86 u8 size;
87 int height;
88 int width;
89 u8 *scratch;
90 struct urb *button_urb;
91 u8 button_sts;
92 u8 button_sts_buf;
93
94#ifdef CONFIG_INPUT
95 struct input_dev *input;
96 char input_physname[64];
97#endif
98};
99
100struct regval {
101 u16 reg;
102 u8 val;
103};
104/* this table is derived from the
105qc-usb-messenger code */
106static const struct regval regval_table[] = {
107 { STV_ISO_ENABLE, 0x00 },
108 { 0x1436, 0x00 }, { 0x1432, 0x03 },
109 { 0x143a, 0xF9 }, { 0x0509, 0x38 },
110 { 0x050a, 0x38 }, { 0x050b, 0x38 },
111 { 0x050c, 0x2A }, { 0x050d, 0x01 },
112 { 0x1431, 0x00 }, { 0x1433, 0x34 },
113 { 0x1438, 0x18 }, { 0x1439, 0x00 },
114 { 0x143b, 0x05 }, { 0x143c, 0x00 },
115 { 0x143e, 0x01 }, { 0x143d, 0x00 },
116 { 0x1442, 0xe2 }, { 0x1500, 0xd0 },
117 { 0x1500, 0xd0 }, { 0x1500, 0x50 },
118 { 0x1501, 0xaf }, { 0x1502, 0xc2 },
119 { 0x1503, 0x45 }, { 0x1505, 0x02 },
120 { 0x150e, 0x8e }, { 0x150f, 0x37 },
121 { 0x15c0, 0x00 },
122};
123
124static const unsigned char marker[] = { 0x00, 0xff, 0x00, 0xFF };
125
126#endif /* quickcam_messenger_h */