diff options
-rw-r--r-- | drivers/media/video/usbvision/usbvision-cards.c | 1728 | ||||
-rw-r--r-- | drivers/media/video/usbvision/usbvision-core.c | 984 | ||||
-rw-r--r-- | drivers/media/video/usbvision/usbvision-i2c.c | 14 | ||||
-rw-r--r-- | drivers/media/video/usbvision/usbvision-video.c | 242 | ||||
-rw-r--r-- | drivers/media/video/usbvision/usbvision.h | 194 |
5 files changed, 1581 insertions, 1581 deletions
diff --git a/drivers/media/video/usbvision/usbvision-cards.c b/drivers/media/video/usbvision/usbvision-cards.c index 503b13beb922..acfdb2bc7917 100644 --- a/drivers/media/video/usbvision/usbvision-cards.c +++ b/drivers/media/video/usbvision/usbvision-cards.c | |||
@@ -32,998 +32,998 @@ | |||
32 | /* Supported Devices: A table for usbvision.c*/ | 32 | /* Supported Devices: A table for usbvision.c*/ |
33 | struct usbvision_device_data_st usbvision_device_data[] = { | 33 | struct usbvision_device_data_st usbvision_device_data[] = { |
34 | [XANBOO] = { | 34 | [XANBOO] = { |
35 | .Interface = -1, | 35 | .interface = -1, |
36 | .Codec = CODEC_SAA7113, | 36 | .codec = CODEC_SAA7113, |
37 | .VideoChannels = 4, | 37 | .video_channels = 4, |
38 | .VideoNorm = V4L2_STD_NTSC, | 38 | .video_norm = V4L2_STD_NTSC, |
39 | .AudioChannels = 1, | 39 | .audio_channels = 1, |
40 | .Radio = 0, | 40 | .radio = 0, |
41 | .vbi = 1, | 41 | .vbi = 1, |
42 | .Tuner = 0, | 42 | .tuner = 0, |
43 | .TunerType = 0, | 43 | .tuner_type = 0, |
44 | .X_Offset = -1, | 44 | .x_offset = -1, |
45 | .Y_Offset = -1, | 45 | .y_offset = -1, |
46 | .ModelString = "Xanboo", | 46 | .model_string = "Xanboo", |
47 | }, | 47 | }, |
48 | [BELKIN_VIDEOBUS_II] = { | 48 | [BELKIN_VIDEOBUS_II] = { |
49 | .Interface = -1, | 49 | .interface = -1, |
50 | .Codec = CODEC_SAA7113, | 50 | .codec = CODEC_SAA7113, |
51 | .VideoChannels = 2, | 51 | .video_channels = 2, |
52 | .VideoNorm = V4L2_STD_PAL, | 52 | .video_norm = V4L2_STD_PAL, |
53 | .AudioChannels = 1, | 53 | .audio_channels = 1, |
54 | .Radio = 0, | 54 | .radio = 0, |
55 | .vbi = 1, | 55 | .vbi = 1, |
56 | .Tuner = 0, | 56 | .tuner = 0, |
57 | .TunerType = 0, | 57 | .tuner_type = 0, |
58 | .X_Offset = 0, | 58 | .x_offset = 0, |
59 | .Y_Offset = 3, | 59 | .y_offset = 3, |
60 | .Dvi_yuv_override = 1, | 60 | .dvi_yuv_override = 1, |
61 | .Dvi_yuv = 7, | 61 | .dvi_yuv = 7, |
62 | .ModelString = "Belkin USB VideoBus II Adapter", | 62 | .model_string = "Belkin USB VideoBus II Adapter", |
63 | }, | 63 | }, |
64 | [BELKIN_VIDEOBUS] = { | 64 | [BELKIN_VIDEOBUS] = { |
65 | .Interface = -1, | 65 | .interface = -1, |
66 | .Codec = CODEC_SAA7111, | 66 | .codec = CODEC_SAA7111, |
67 | .VideoChannels = 2, | 67 | .video_channels = 2, |
68 | .VideoNorm = V4L2_STD_NTSC, | 68 | .video_norm = V4L2_STD_NTSC, |
69 | .AudioChannels = 1, | 69 | .audio_channels = 1, |
70 | .Radio = 0, | 70 | .radio = 0, |
71 | .vbi = 1, | 71 | .vbi = 1, |
72 | .Tuner = 0, | 72 | .tuner = 0, |
73 | .TunerType = 0, | 73 | .tuner_type = 0, |
74 | .X_Offset = -1, | 74 | .x_offset = -1, |
75 | .Y_Offset = -1, | 75 | .y_offset = -1, |
76 | .ModelString = "Belkin Components USB VideoBus", | 76 | .model_string = "Belkin Components USB VideoBus", |
77 | }, | 77 | }, |
78 | [BELKIN_USB_VIDEOBUS_II] = { | 78 | [BELKIN_USB_VIDEOBUS_II] = { |
79 | .Interface = -1, | 79 | .interface = -1, |
80 | .Codec = CODEC_SAA7113, | 80 | .codec = CODEC_SAA7113, |
81 | .VideoChannels = 2, | 81 | .video_channels = 2, |
82 | .VideoNorm = V4L2_STD_NTSC, | 82 | .video_norm = V4L2_STD_NTSC, |
83 | .AudioChannels = 1, | 83 | .audio_channels = 1, |
84 | .Radio = 0, | 84 | .radio = 0, |
85 | .vbi = 1, | 85 | .vbi = 1, |
86 | .Tuner = 0, | 86 | .tuner = 0, |
87 | .TunerType = 0, | 87 | .tuner_type = 0, |
88 | .X_Offset = 0, | 88 | .x_offset = 0, |
89 | .Y_Offset = 3, | 89 | .y_offset = 3, |
90 | .Dvi_yuv_override = 1, | 90 | .dvi_yuv_override = 1, |
91 | .Dvi_yuv = 7, | 91 | .dvi_yuv = 7, |
92 | .ModelString = "Belkin USB VideoBus II", | 92 | .model_string = "Belkin USB VideoBus II", |
93 | }, | 93 | }, |
94 | [ECHOFX_INTERVIEW_LITE] = { | 94 | [ECHOFX_INTERVIEW_LITE] = { |
95 | .Interface = 0, | 95 | .interface = 0, |
96 | .Codec = CODEC_SAA7111, | 96 | .codec = CODEC_SAA7111, |
97 | .VideoChannels = 2, | 97 | .video_channels = 2, |
98 | .VideoNorm = V4L2_STD_PAL, | 98 | .video_norm = V4L2_STD_PAL, |
99 | .AudioChannels = 0, | 99 | .audio_channels = 0, |
100 | .Radio = 0, | 100 | .radio = 0, |
101 | .vbi = 1, | 101 | .vbi = 1, |
102 | .Tuner = 0, | 102 | .tuner = 0, |
103 | .TunerType = 0, | 103 | .tuner_type = 0, |
104 | .X_Offset = -1, | 104 | .x_offset = -1, |
105 | .Y_Offset = -1, | 105 | .y_offset = -1, |
106 | .Dvi_yuv_override = 1, | 106 | .dvi_yuv_override = 1, |
107 | .Dvi_yuv = 7, | 107 | .dvi_yuv = 7, |
108 | .ModelString = "echoFX InterView Lite", | 108 | .model_string = "echoFX InterView Lite", |
109 | }, | 109 | }, |
110 | [USBGEAR_USBG_V1] = { | 110 | [USBGEAR_USBG_V1] = { |
111 | .Interface = -1, | 111 | .interface = -1, |
112 | .Codec = CODEC_SAA7111, | 112 | .codec = CODEC_SAA7111, |
113 | .VideoChannels = 2, | 113 | .video_channels = 2, |
114 | .VideoNorm = V4L2_STD_NTSC, | 114 | .video_norm = V4L2_STD_NTSC, |
115 | .AudioChannels = 1, | 115 | .audio_channels = 1, |
116 | .Radio = 0, | 116 | .radio = 0, |
117 | .vbi = 1, | 117 | .vbi = 1, |
118 | .Tuner = 0, | 118 | .tuner = 0, |
119 | .TunerType = 0, | 119 | .tuner_type = 0, |
120 | .X_Offset = -1, | 120 | .x_offset = -1, |
121 | .Y_Offset = -1, | 121 | .y_offset = -1, |
122 | .ModelString = "USBGear USBG-V1 resp. HAMA USB", | 122 | .model_string = "USBGear USBG-V1 resp. HAMA USB", |
123 | }, | 123 | }, |
124 | [D_LINK_V100] = { | 124 | [D_LINK_V100] = { |
125 | .Interface = -1, | 125 | .interface = -1, |
126 | .Codec = CODEC_SAA7113, | 126 | .codec = CODEC_SAA7113, |
127 | .VideoChannels = 4, | 127 | .video_channels = 4, |
128 | .VideoNorm = V4L2_STD_NTSC, | 128 | .video_norm = V4L2_STD_NTSC, |
129 | .AudioChannels = 0, | 129 | .audio_channels = 0, |
130 | .Radio = 0, | 130 | .radio = 0, |
131 | .vbi = 1, | 131 | .vbi = 1, |
132 | .Tuner = 0, | 132 | .tuner = 0, |
133 | .TunerType = 0, | 133 | .tuner_type = 0, |
134 | .X_Offset = 0, | 134 | .x_offset = 0, |
135 | .Y_Offset = 3, | 135 | .y_offset = 3, |
136 | .Dvi_yuv_override = 1, | 136 | .dvi_yuv_override = 1, |
137 | .Dvi_yuv = 7, | 137 | .dvi_yuv = 7, |
138 | .ModelString = "D-Link V100", | 138 | .model_string = "D-Link V100", |
139 | }, | 139 | }, |
140 | [X10_USB_CAMERA] = { | 140 | [X10_USB_CAMERA] = { |
141 | .Interface = -1, | 141 | .interface = -1, |
142 | .Codec = CODEC_SAA7111, | 142 | .codec = CODEC_SAA7111, |
143 | .VideoChannels = 2, | 143 | .video_channels = 2, |
144 | .VideoNorm = V4L2_STD_NTSC, | 144 | .video_norm = V4L2_STD_NTSC, |
145 | .AudioChannels = 1, | 145 | .audio_channels = 1, |
146 | .Radio = 0, | 146 | .radio = 0, |
147 | .vbi = 1, | 147 | .vbi = 1, |
148 | .Tuner = 0, | 148 | .tuner = 0, |
149 | .TunerType = 0, | 149 | .tuner_type = 0, |
150 | .X_Offset = -1, | 150 | .x_offset = -1, |
151 | .Y_Offset = -1, | 151 | .y_offset = -1, |
152 | .ModelString = "X10 USB Camera", | 152 | .model_string = "X10 USB Camera", |
153 | }, | 153 | }, |
154 | [HPG_WINTV_LIVE_PAL_BG] = { | 154 | [HPG_WINTV_LIVE_PAL_BG] = { |
155 | .Interface = -1, | 155 | .interface = -1, |
156 | .Codec = CODEC_SAA7111, | 156 | .codec = CODEC_SAA7111, |
157 | .VideoChannels = 2, | 157 | .video_channels = 2, |
158 | .VideoNorm = V4L2_STD_PAL, | 158 | .video_norm = V4L2_STD_PAL, |
159 | .AudioChannels = 1, | 159 | .audio_channels = 1, |
160 | .Radio = 0, | 160 | .radio = 0, |
161 | .vbi = 1, | 161 | .vbi = 1, |
162 | .Tuner = 0, | 162 | .tuner = 0, |
163 | .TunerType = 0, | 163 | .tuner_type = 0, |
164 | .X_Offset = -1, | 164 | .x_offset = -1, |
165 | .Y_Offset = 3, | 165 | .y_offset = 3, |
166 | .Dvi_yuv_override = 1, | 166 | .dvi_yuv_override = 1, |
167 | .Dvi_yuv = 7, | 167 | .dvi_yuv = 7, |
168 | .ModelString = "Hauppauge WinTV USB Live (PAL B/G)", | 168 | .model_string = "Hauppauge WinTV USB Live (PAL B/G)", |
169 | }, | 169 | }, |
170 | [HPG_WINTV_LIVE_PRO_NTSC_MN] = { | 170 | [HPG_WINTV_LIVE_PRO_NTSC_MN] = { |
171 | .Interface = -1, | 171 | .interface = -1, |
172 | .Codec = CODEC_SAA7113, | 172 | .codec = CODEC_SAA7113, |
173 | .VideoChannels = 2, | 173 | .video_channels = 2, |
174 | .VideoNorm = V4L2_STD_NTSC, | 174 | .video_norm = V4L2_STD_NTSC, |
175 | .AudioChannels = 0, | 175 | .audio_channels = 0, |
176 | .Radio = 0, | 176 | .radio = 0, |
177 | .vbi = 1, | 177 | .vbi = 1, |
178 | .Tuner = 0, | 178 | .tuner = 0, |
179 | .TunerType = 0, | 179 | .tuner_type = 0, |
180 | .X_Offset = 0, | 180 | .x_offset = 0, |
181 | .Y_Offset = 3, | 181 | .y_offset = 3, |
182 | .Dvi_yuv_override = 1, | 182 | .dvi_yuv_override = 1, |
183 | .Dvi_yuv = 7, | 183 | .dvi_yuv = 7, |
184 | .ModelString = "Hauppauge WinTV USB Live Pro (NTSC M/N)", | 184 | .model_string = "Hauppauge WinTV USB Live Pro (NTSC M/N)", |
185 | }, | 185 | }, |
186 | [ZORAN_PMD_NOGATECH] = { | 186 | [ZORAN_PMD_NOGATECH] = { |
187 | .Interface = -1, | 187 | .interface = -1, |
188 | .Codec = CODEC_SAA7113, | 188 | .codec = CODEC_SAA7113, |
189 | .VideoChannels = 2, | 189 | .video_channels = 2, |
190 | .VideoNorm = V4L2_STD_PAL, | 190 | .video_norm = V4L2_STD_PAL, |
191 | .AudioChannels = 2, | 191 | .audio_channels = 2, |
192 | .Radio = 0, | 192 | .radio = 0, |
193 | .vbi = 1, | 193 | .vbi = 1, |
194 | .Tuner = 0, | 194 | .tuner = 0, |
195 | .TunerType = 0, | 195 | .tuner_type = 0, |
196 | .X_Offset = 0, | 196 | .x_offset = 0, |
197 | .Y_Offset = 3, | 197 | .y_offset = 3, |
198 | .Dvi_yuv_override = 1, | 198 | .dvi_yuv_override = 1, |
199 | .Dvi_yuv = 7, | 199 | .dvi_yuv = 7, |
200 | .ModelString = "Zoran Co. PMD (Nogatech) AV-grabber Manhattan", | 200 | .model_string = "Zoran Co. PMD (Nogatech) AV-grabber Manhattan", |
201 | }, | 201 | }, |
202 | [NOGATECH_USB_TV_NTSC_FM] = { | 202 | [NOGATECH_USB_TV_NTSC_FM] = { |
203 | .Interface = -1, | 203 | .interface = -1, |
204 | .Codec = CODEC_SAA7111, | 204 | .codec = CODEC_SAA7111, |
205 | .VideoChannels = 3, | 205 | .video_channels = 3, |
206 | .VideoNorm = V4L2_STD_NTSC, | 206 | .video_norm = V4L2_STD_NTSC, |
207 | .AudioChannels = 1, | 207 | .audio_channels = 1, |
208 | .Radio = 1, | 208 | .radio = 1, |
209 | .vbi = 1, | 209 | .vbi = 1, |
210 | .Tuner = 1, | 210 | .tuner = 1, |
211 | .TunerType = TUNER_PHILIPS_NTSC_M, | 211 | .tuner_type = TUNER_PHILIPS_NTSC_M, |
212 | .X_Offset = -1, | 212 | .x_offset = -1, |
213 | .Y_Offset = 20, | 213 | .y_offset = 20, |
214 | .ModelString = "Nogatech USB-TV (NTSC) FM", | 214 | .model_string = "Nogatech USB-TV (NTSC) FM", |
215 | }, | 215 | }, |
216 | [PNY_USB_TV_NTSC_FM] = { | 216 | [PNY_USB_TV_NTSC_FM] = { |
217 | .Interface = -1, | 217 | .interface = -1, |
218 | .Codec = CODEC_SAA7111, | 218 | .codec = CODEC_SAA7111, |
219 | .VideoChannels = 3, | 219 | .video_channels = 3, |
220 | .VideoNorm = V4L2_STD_NTSC, | 220 | .video_norm = V4L2_STD_NTSC, |
221 | .AudioChannels = 1, | 221 | .audio_channels = 1, |
222 | .Radio = 1, | 222 | .radio = 1, |
223 | .vbi = 1, | 223 | .vbi = 1, |
224 | .Tuner = 1, | 224 | .tuner = 1, |
225 | .TunerType = TUNER_PHILIPS_NTSC_M, | 225 | .tuner_type = TUNER_PHILIPS_NTSC_M, |
226 | .X_Offset = -1, | 226 | .x_offset = -1, |
227 | .Y_Offset = 20, | 227 | .y_offset = 20, |
228 | .ModelString = "PNY USB-TV (NTSC) FM", | 228 | .model_string = "PNY USB-TV (NTSC) FM", |
229 | }, | 229 | }, |
230 | [PV_PLAYTV_USB_PRO_PAL_FM] = { | 230 | [PV_PLAYTV_USB_PRO_PAL_FM] = { |
231 | .Interface = 0, | 231 | .interface = 0, |
232 | .Codec = CODEC_SAA7113, | 232 | .codec = CODEC_SAA7113, |
233 | .VideoChannels = 3, | 233 | .video_channels = 3, |
234 | .VideoNorm = V4L2_STD_PAL, | 234 | .video_norm = V4L2_STD_PAL, |
235 | .AudioChannels = 1, | 235 | .audio_channels = 1, |
236 | .Radio = 1, | 236 | .radio = 1, |
237 | .vbi = 1, | 237 | .vbi = 1, |
238 | .Tuner = 1, | 238 | .tuner = 1, |
239 | .TunerType = TUNER_PHILIPS_PAL, | 239 | .tuner_type = TUNER_PHILIPS_PAL, |
240 | .X_Offset = 0, | 240 | .x_offset = 0, |
241 | .Y_Offset = 3, | 241 | .y_offset = 3, |
242 | .Dvi_yuv_override = 1, | 242 | .dvi_yuv_override = 1, |
243 | .Dvi_yuv = 7, | 243 | .dvi_yuv = 7, |
244 | .ModelString = "PixelView PlayTv-USB PRO (PAL) FM", | 244 | .model_string = "PixelView PlayTv-USB PRO (PAL) FM", |
245 | }, | 245 | }, |
246 | [ZT_721] = { | 246 | [ZT_721] = { |
247 | .Interface = 0, | 247 | .interface = 0, |
248 | .Codec = CODEC_SAA7113, | 248 | .codec = CODEC_SAA7113, |
249 | .VideoChannels = 3, | 249 | .video_channels = 3, |
250 | .VideoNorm = V4L2_STD_PAL, | 250 | .video_norm = V4L2_STD_PAL, |
251 | .AudioChannels = 1, | 251 | .audio_channels = 1, |
252 | .Radio = 1, | 252 | .radio = 1, |
253 | .vbi = 1, | 253 | .vbi = 1, |
254 | .Tuner = 1, | 254 | .tuner = 1, |
255 | .TunerType = TUNER_PHILIPS_PAL, | 255 | .tuner_type = TUNER_PHILIPS_PAL, |
256 | .X_Offset = 0, | 256 | .x_offset = 0, |
257 | .Y_Offset = 3, | 257 | .y_offset = 3, |
258 | .Dvi_yuv_override = 1, | 258 | .dvi_yuv_override = 1, |
259 | .Dvi_yuv = 7, | 259 | .dvi_yuv = 7, |
260 | .ModelString = "ZTV ZT-721 2.4GHz USB A/V Receiver", | 260 | .model_string = "ZTV ZT-721 2.4GHz USB A/V Receiver", |
261 | }, | 261 | }, |
262 | [HPG_WINTV_NTSC_MN] = { | 262 | [HPG_WINTV_NTSC_MN] = { |
263 | .Interface = -1, | 263 | .interface = -1, |
264 | .Codec = CODEC_SAA7111, | 264 | .codec = CODEC_SAA7111, |
265 | .VideoChannels = 3, | 265 | .video_channels = 3, |
266 | .VideoNorm = V4L2_STD_NTSC, | 266 | .video_norm = V4L2_STD_NTSC, |
267 | .AudioChannels = 1, | 267 | .audio_channels = 1, |
268 | .Radio = 0, | 268 | .radio = 0, |
269 | .vbi = 1, | 269 | .vbi = 1, |
270 | .Tuner = 1, | 270 | .tuner = 1, |
271 | .TunerType = TUNER_PHILIPS_NTSC_M, | 271 | .tuner_type = TUNER_PHILIPS_NTSC_M, |
272 | .X_Offset = -1, | 272 | .x_offset = -1, |
273 | .Y_Offset = 20, | 273 | .y_offset = 20, |
274 | .ModelString = "Hauppauge WinTV USB (NTSC M/N)", | 274 | .model_string = "Hauppauge WinTV USB (NTSC M/N)", |
275 | }, | 275 | }, |
276 | [HPG_WINTV_PAL_BG] = { | 276 | [HPG_WINTV_PAL_BG] = { |
277 | .Interface = -1, | 277 | .interface = -1, |
278 | .Codec = CODEC_SAA7111, | 278 | .codec = CODEC_SAA7111, |
279 | .VideoChannels = 3, | 279 | .video_channels = 3, |
280 | .VideoNorm = V4L2_STD_PAL, | 280 | .video_norm = V4L2_STD_PAL, |
281 | .AudioChannels = 1, | 281 | .audio_channels = 1, |
282 | .Radio = 0, | 282 | .radio = 0, |
283 | .vbi = 1, | 283 | .vbi = 1, |
284 | .Tuner = 1, | 284 | .tuner = 1, |
285 | .TunerType = TUNER_PHILIPS_PAL, | 285 | .tuner_type = TUNER_PHILIPS_PAL, |
286 | .X_Offset = -1, | 286 | .x_offset = -1, |
287 | .Y_Offset = -1, | 287 | .y_offset = -1, |
288 | .ModelString = "Hauppauge WinTV USB (PAL B/G)", | 288 | .model_string = "Hauppauge WinTV USB (PAL B/G)", |
289 | }, | 289 | }, |
290 | [HPG_WINTV_PAL_I] = { | 290 | [HPG_WINTV_PAL_I] = { |
291 | .Interface = -1, | 291 | .interface = -1, |
292 | .Codec = CODEC_SAA7111, | 292 | .codec = CODEC_SAA7111, |
293 | .VideoChannels = 3, | 293 | .video_channels = 3, |
294 | .VideoNorm = V4L2_STD_PAL, | 294 | .video_norm = V4L2_STD_PAL, |
295 | .AudioChannels = 1, | 295 | .audio_channels = 1, |
296 | .Radio = 0, | 296 | .radio = 0, |
297 | .vbi = 1, | 297 | .vbi = 1, |
298 | .Tuner = 1, | 298 | .tuner = 1, |
299 | .TunerType = TUNER_PHILIPS_PAL, | 299 | .tuner_type = TUNER_PHILIPS_PAL, |
300 | .X_Offset = -1, | 300 | .x_offset = -1, |
301 | .Y_Offset = -1, | 301 | .y_offset = -1, |
302 | .ModelString = "Hauppauge WinTV USB (PAL I)", | 302 | .model_string = "Hauppauge WinTV USB (PAL I)", |
303 | }, | 303 | }, |
304 | [HPG_WINTV_PAL_SECAM_L] = { | 304 | [HPG_WINTV_PAL_SECAM_L] = { |
305 | .Interface = -1, | 305 | .interface = -1, |
306 | .Codec = CODEC_SAA7111, | 306 | .codec = CODEC_SAA7111, |
307 | .VideoChannels = 3, | 307 | .video_channels = 3, |
308 | .VideoNorm = V4L2_STD_SECAM, | 308 | .video_norm = V4L2_STD_SECAM, |
309 | .AudioChannels = 1, | 309 | .audio_channels = 1, |
310 | .Radio = 0, | 310 | .radio = 0, |
311 | .vbi = 1, | 311 | .vbi = 1, |
312 | .Tuner = 1, | 312 | .tuner = 1, |
313 | .TunerType = TUNER_PHILIPS_SECAM, | 313 | .tuner_type = TUNER_PHILIPS_SECAM, |
314 | .X_Offset = 0x80, | 314 | .x_offset = 0x80, |
315 | .Y_Offset = 0x16, | 315 | .y_offset = 0x16, |
316 | .ModelString = "Hauppauge WinTV USB (PAL/SECAM L)", | 316 | .model_string = "Hauppauge WinTV USB (PAL/SECAM L)", |
317 | }, | 317 | }, |
318 | [HPG_WINTV_PAL_D_K] = { | 318 | [HPG_WINTV_PAL_D_K] = { |
319 | .Interface = -1, | 319 | .interface = -1, |
320 | .Codec = CODEC_SAA7111, | 320 | .codec = CODEC_SAA7111, |
321 | .VideoChannels = 3, | 321 | .video_channels = 3, |
322 | .VideoNorm = V4L2_STD_PAL, | 322 | .video_norm = V4L2_STD_PAL, |
323 | .AudioChannels = 1, | 323 | .audio_channels = 1, |
324 | .Radio = 0, | 324 | .radio = 0, |
325 | .vbi = 1, | 325 | .vbi = 1, |
326 | .Tuner = 1, | 326 | .tuner = 1, |
327 | .TunerType = TUNER_PHILIPS_PAL, | 327 | .tuner_type = TUNER_PHILIPS_PAL, |
328 | .X_Offset = -1, | 328 | .x_offset = -1, |
329 | .Y_Offset = -1, | 329 | .y_offset = -1, |
330 | .ModelString = "Hauppauge WinTV USB (PAL D/K)", | 330 | .model_string = "Hauppauge WinTV USB (PAL D/K)", |
331 | }, | 331 | }, |
332 | [HPG_WINTV_NTSC_FM] = { | 332 | [HPG_WINTV_NTSC_FM] = { |
333 | .Interface = -1, | 333 | .interface = -1, |
334 | .Codec = CODEC_SAA7111, | 334 | .codec = CODEC_SAA7111, |
335 | .VideoChannels = 3, | 335 | .video_channels = 3, |
336 | .VideoNorm = V4L2_STD_NTSC, | 336 | .video_norm = V4L2_STD_NTSC, |
337 | .AudioChannels = 1, | 337 | .audio_channels = 1, |
338 | .Radio = 1, | 338 | .radio = 1, |
339 | .vbi = 1, | 339 | .vbi = 1, |
340 | .Tuner = 1, | 340 | .tuner = 1, |
341 | .TunerType = TUNER_PHILIPS_NTSC_M, | 341 | .tuner_type = TUNER_PHILIPS_NTSC_M, |
342 | .X_Offset = -1, | 342 | .x_offset = -1, |
343 | .Y_Offset = -1, | 343 | .y_offset = -1, |
344 | .ModelString = "Hauppauge WinTV USB (NTSC FM)", | 344 | .model_string = "Hauppauge WinTV USB (NTSC FM)", |
345 | }, | 345 | }, |
346 | [HPG_WINTV_PAL_BG_FM] = { | 346 | [HPG_WINTV_PAL_BG_FM] = { |
347 | .Interface = -1, | 347 | .interface = -1, |
348 | .Codec = CODEC_SAA7111, | 348 | .codec = CODEC_SAA7111, |
349 | .VideoChannels = 3, | 349 | .video_channels = 3, |
350 | .VideoNorm = V4L2_STD_PAL, | 350 | .video_norm = V4L2_STD_PAL, |
351 | .AudioChannels = 1, | 351 | .audio_channels = 1, |
352 | .Radio = 1, | 352 | .radio = 1, |
353 | .vbi = 1, | 353 | .vbi = 1, |
354 | .Tuner = 1, | 354 | .tuner = 1, |
355 | .TunerType = TUNER_PHILIPS_PAL, | 355 | .tuner_type = TUNER_PHILIPS_PAL, |
356 | .X_Offset = -1, | 356 | .x_offset = -1, |
357 | .Y_Offset = -1, | 357 | .y_offset = -1, |
358 | .ModelString = "Hauppauge WinTV USB (PAL B/G FM)", | 358 | .model_string = "Hauppauge WinTV USB (PAL B/G FM)", |
359 | }, | 359 | }, |
360 | [HPG_WINTV_PAL_I_FM] = { | 360 | [HPG_WINTV_PAL_I_FM] = { |
361 | .Interface = -1, | 361 | .interface = -1, |
362 | .Codec = CODEC_SAA7111, | 362 | .codec = CODEC_SAA7111, |
363 | .VideoChannels = 3, | 363 | .video_channels = 3, |
364 | .VideoNorm = V4L2_STD_PAL, | 364 | .video_norm = V4L2_STD_PAL, |
365 | .AudioChannels = 1, | 365 | .audio_channels = 1, |
366 | .Radio = 1, | 366 | .radio = 1, |
367 | .vbi = 1, | 367 | .vbi = 1, |
368 | .Tuner = 1, | 368 | .tuner = 1, |
369 | .TunerType = TUNER_PHILIPS_PAL, | 369 | .tuner_type = TUNER_PHILIPS_PAL, |
370 | .X_Offset = -1, | 370 | .x_offset = -1, |
371 | .Y_Offset = -1, | 371 | .y_offset = -1, |
372 | .ModelString = "Hauppauge WinTV USB (PAL I FM)", | 372 | .model_string = "Hauppauge WinTV USB (PAL I FM)", |
373 | }, | 373 | }, |
374 | [HPG_WINTV_PAL_D_K_FM] = { | 374 | [HPG_WINTV_PAL_D_K_FM] = { |
375 | .Interface = -1, | 375 | .interface = -1, |
376 | .Codec = CODEC_SAA7111, | 376 | .codec = CODEC_SAA7111, |
377 | .VideoChannels = 3, | 377 | .video_channels = 3, |
378 | .VideoNorm = V4L2_STD_PAL, | 378 | .video_norm = V4L2_STD_PAL, |
379 | .AudioChannels = 1, | 379 | .audio_channels = 1, |
380 | .Radio = 1, | 380 | .radio = 1, |
381 | .vbi = 1, | 381 | .vbi = 1, |
382 | .Tuner = 1, | 382 | .tuner = 1, |
383 | .TunerType = TUNER_PHILIPS_PAL, | 383 | .tuner_type = TUNER_PHILIPS_PAL, |
384 | .X_Offset = -1, | 384 | .x_offset = -1, |
385 | .Y_Offset = -1, | 385 | .y_offset = -1, |
386 | .ModelString = "Hauppauge WinTV USB (PAL D/K FM)", | 386 | .model_string = "Hauppauge WinTV USB (PAL D/K FM)", |
387 | }, | 387 | }, |
388 | [HPG_WINTV_PRO_NTSC_MN] = { | 388 | [HPG_WINTV_PRO_NTSC_MN] = { |
389 | .Interface = 0, | 389 | .interface = 0, |
390 | .Codec = CODEC_SAA7113, | 390 | .codec = CODEC_SAA7113, |
391 | .VideoChannels = 3, | 391 | .video_channels = 3, |
392 | .VideoNorm = V4L2_STD_NTSC, | 392 | .video_norm = V4L2_STD_NTSC, |
393 | .AudioChannels = 1, | 393 | .audio_channels = 1, |
394 | .Radio = 1, | 394 | .radio = 1, |
395 | .vbi = 1, | 395 | .vbi = 1, |
396 | .Tuner = 1, | 396 | .tuner = 1, |
397 | .TunerType = TUNER_MICROTUNE_4049FM5, | 397 | .tuner_type = TUNER_MICROTUNE_4049FM5, |
398 | .X_Offset = 0, | 398 | .x_offset = 0, |
399 | .Y_Offset = 3, | 399 | .y_offset = 3, |
400 | .Dvi_yuv_override = 1, | 400 | .dvi_yuv_override = 1, |
401 | .Dvi_yuv = 7, | 401 | .dvi_yuv = 7, |
402 | .ModelString = "Hauppauge WinTV USB Pro (NTSC M/N)", | 402 | .model_string = "Hauppauge WinTV USB Pro (NTSC M/N)", |
403 | }, | 403 | }, |
404 | [HPG_WINTV_PRO_NTSC_MN_V2] = { | 404 | [HPG_WINTV_PRO_NTSC_MN_V2] = { |
405 | .Interface = 0, | 405 | .interface = 0, |
406 | .Codec = CODEC_SAA7113, | 406 | .codec = CODEC_SAA7113, |
407 | .VideoChannels = 3, | 407 | .video_channels = 3, |
408 | .VideoNorm = V4L2_STD_NTSC, | 408 | .video_norm = V4L2_STD_NTSC, |
409 | .AudioChannels = 1, | 409 | .audio_channels = 1, |
410 | .Radio = 1, | 410 | .radio = 1, |
411 | .vbi = 1, | 411 | .vbi = 1, |
412 | .Tuner = 1, | 412 | .tuner = 1, |
413 | .TunerType = TUNER_MICROTUNE_4049FM5, | 413 | .tuner_type = TUNER_MICROTUNE_4049FM5, |
414 | .X_Offset = 0, | 414 | .x_offset = 0, |
415 | .Y_Offset = 3, | 415 | .y_offset = 3, |
416 | .Dvi_yuv_override = 1, | 416 | .dvi_yuv_override = 1, |
417 | .Dvi_yuv = 7, | 417 | .dvi_yuv = 7, |
418 | .ModelString = "Hauppauge WinTV USB Pro (NTSC M/N) V2", | 418 | .model_string = "Hauppauge WinTV USB Pro (NTSC M/N) V2", |
419 | }, | 419 | }, |
420 | [HPG_WINTV_PRO_PAL] = { | 420 | [HPG_WINTV_PRO_PAL] = { |
421 | .Interface = 0, | 421 | .interface = 0, |
422 | .Codec = CODEC_SAA7113, | 422 | .codec = CODEC_SAA7113, |
423 | .VideoChannels = 3, | 423 | .video_channels = 3, |
424 | .VideoNorm = V4L2_STD_PAL, | 424 | .video_norm = V4L2_STD_PAL, |
425 | .AudioChannels = 1, | 425 | .audio_channels = 1, |
426 | .Radio = 0, | 426 | .radio = 0, |
427 | .vbi = 1, | 427 | .vbi = 1, |
428 | .Tuner = 1, | 428 | .tuner = 1, |
429 | .TunerType = TUNER_PHILIPS_FM1216ME_MK3, | 429 | .tuner_type = TUNER_PHILIPS_FM1216ME_MK3, |
430 | .X_Offset = 0, | 430 | .x_offset = 0, |
431 | .Y_Offset = 3, | 431 | .y_offset = 3, |
432 | .Dvi_yuv_override = 1, | 432 | .dvi_yuv_override = 1, |
433 | .Dvi_yuv = 7, | 433 | .dvi_yuv = 7, |
434 | .ModelString = "Hauppauge WinTV USB Pro (PAL/SECAM B/G/I/D/K/L)", | 434 | .model_string = "Hauppauge WinTV USB Pro (PAL/SECAM B/G/I/D/K/L)", |
435 | }, | 435 | }, |
436 | [HPG_WINTV_PRO_NTSC_MN_V3] = { | 436 | [HPG_WINTV_PRO_NTSC_MN_V3] = { |
437 | .Interface = 0, | 437 | .interface = 0, |
438 | .Codec = CODEC_SAA7113, | 438 | .codec = CODEC_SAA7113, |
439 | .VideoChannels = 3, | 439 | .video_channels = 3, |
440 | .VideoNorm = V4L2_STD_NTSC, | 440 | .video_norm = V4L2_STD_NTSC, |
441 | .AudioChannels = 1, | 441 | .audio_channels = 1, |
442 | .Radio = 1, | 442 | .radio = 1, |
443 | .vbi = 1, | 443 | .vbi = 1, |
444 | .Tuner = 1, | 444 | .tuner = 1, |
445 | .TunerType = TUNER_PHILIPS_NTSC_M, | 445 | .tuner_type = TUNER_PHILIPS_NTSC_M, |
446 | .X_Offset = 0, | 446 | .x_offset = 0, |
447 | .Y_Offset = 3, | 447 | .y_offset = 3, |
448 | .Dvi_yuv_override = 1, | 448 | .dvi_yuv_override = 1, |
449 | .Dvi_yuv = 7, | 449 | .dvi_yuv = 7, |
450 | .ModelString = "Hauppauge WinTV USB Pro (NTSC M/N) V3", | 450 | .model_string = "Hauppauge WinTV USB Pro (NTSC M/N) V3", |
451 | }, | 451 | }, |
452 | [HPG_WINTV_PRO_PAL_BG] = { | 452 | [HPG_WINTV_PRO_PAL_BG] = { |
453 | .Interface = 0, | 453 | .interface = 0, |
454 | .Codec = CODEC_SAA7113, | 454 | .codec = CODEC_SAA7113, |
455 | .VideoChannels = 3, | 455 | .video_channels = 3, |
456 | .VideoNorm = V4L2_STD_PAL, | 456 | .video_norm = V4L2_STD_PAL, |
457 | .AudioChannels = 1, | 457 | .audio_channels = 1, |
458 | .Radio = 0, | 458 | .radio = 0, |
459 | .vbi = 1, | 459 | .vbi = 1, |
460 | .Tuner = 1, | 460 | .tuner = 1, |
461 | .TunerType = TUNER_PHILIPS_PAL, | 461 | .tuner_type = TUNER_PHILIPS_PAL, |
462 | .X_Offset = 0, | 462 | .x_offset = 0, |
463 | .Y_Offset = 3, | 463 | .y_offset = 3, |
464 | .Dvi_yuv_override = 1, | 464 | .dvi_yuv_override = 1, |
465 | .Dvi_yuv = 7, | 465 | .dvi_yuv = 7, |
466 | .ModelString = "Hauppauge WinTV USB Pro (PAL B/G)", | 466 | .model_string = "Hauppauge WinTV USB Pro (PAL B/G)", |
467 | }, | 467 | }, |
468 | [HPG_WINTV_PRO_PAL_I] = { | 468 | [HPG_WINTV_PRO_PAL_I] = { |
469 | .Interface = 0, | 469 | .interface = 0, |
470 | .Codec = CODEC_SAA7113, | 470 | .codec = CODEC_SAA7113, |
471 | .VideoChannels = 3, | 471 | .video_channels = 3, |
472 | .VideoNorm = V4L2_STD_PAL, | 472 | .video_norm = V4L2_STD_PAL, |
473 | .AudioChannels = 1, | 473 | .audio_channels = 1, |
474 | .Radio = 0, | 474 | .radio = 0, |
475 | .vbi = 1, | 475 | .vbi = 1, |
476 | .Tuner = 1, | 476 | .tuner = 1, |
477 | .TunerType = TUNER_PHILIPS_PAL, | 477 | .tuner_type = TUNER_PHILIPS_PAL, |
478 | .X_Offset = 0, | 478 | .x_offset = 0, |
479 | .Y_Offset = 3, | 479 | .y_offset = 3, |
480 | .Dvi_yuv_override = 1, | 480 | .dvi_yuv_override = 1, |
481 | .Dvi_yuv = 7, | 481 | .dvi_yuv = 7, |
482 | .ModelString = "Hauppauge WinTV USB Pro (PAL I)", | 482 | .model_string = "Hauppauge WinTV USB Pro (PAL I)", |
483 | }, | 483 | }, |
484 | [HPG_WINTV_PRO_PAL_SECAM_L] = { | 484 | [HPG_WINTV_PRO_PAL_SECAM_L] = { |
485 | .Interface = -1, | 485 | .interface = -1, |
486 | .Codec = CODEC_SAA7113, | 486 | .codec = CODEC_SAA7113, |
487 | .VideoChannels = 3, | 487 | .video_channels = 3, |
488 | .VideoNorm = V4L2_STD_SECAM, | 488 | .video_norm = V4L2_STD_SECAM, |
489 | .AudioChannels = 1, | 489 | .audio_channels = 1, |
490 | .Radio = 0, | 490 | .radio = 0, |
491 | .vbi = 1, | 491 | .vbi = 1, |
492 | .Tuner = 1, | 492 | .tuner = 1, |
493 | .TunerType = TUNER_PHILIPS_SECAM, | 493 | .tuner_type = TUNER_PHILIPS_SECAM, |
494 | .X_Offset = 0, | 494 | .x_offset = 0, |
495 | .Y_Offset = 3, | 495 | .y_offset = 3, |
496 | .Dvi_yuv_override = 1, | 496 | .dvi_yuv_override = 1, |
497 | .Dvi_yuv = 7, | 497 | .dvi_yuv = 7, |
498 | .ModelString = "Hauppauge WinTV USB Pro (PAL/SECAM L)", | 498 | .model_string = "Hauppauge WinTV USB Pro (PAL/SECAM L)", |
499 | }, | 499 | }, |
500 | [HPG_WINTV_PRO_PAL_D_K] = { | 500 | [HPG_WINTV_PRO_PAL_D_K] = { |
501 | .Interface = -1, | 501 | .interface = -1, |
502 | .Codec = CODEC_SAA7113, | 502 | .codec = CODEC_SAA7113, |
503 | .VideoChannels = 3, | 503 | .video_channels = 3, |
504 | .VideoNorm = V4L2_STD_PAL, | 504 | .video_norm = V4L2_STD_PAL, |
505 | .AudioChannels = 1, | 505 | .audio_channels = 1, |
506 | .Radio = 0, | 506 | .radio = 0, |
507 | .vbi = 1, | 507 | .vbi = 1, |
508 | .Tuner = 1, | 508 | .tuner = 1, |
509 | .TunerType = TUNER_PHILIPS_PAL, | 509 | .tuner_type = TUNER_PHILIPS_PAL, |
510 | .X_Offset = 0, | 510 | .x_offset = 0, |
511 | .Y_Offset = 3, | 511 | .y_offset = 3, |
512 | .Dvi_yuv_override = 1, | 512 | .dvi_yuv_override = 1, |
513 | .Dvi_yuv = 7, | 513 | .dvi_yuv = 7, |
514 | .ModelString = "Hauppauge WinTV USB Pro (PAL D/K)", | 514 | .model_string = "Hauppauge WinTV USB Pro (PAL D/K)", |
515 | }, | 515 | }, |
516 | [HPG_WINTV_PRO_PAL_SECAM] = { | 516 | [HPG_WINTV_PRO_PAL_SECAM] = { |
517 | .Interface = -1, | 517 | .interface = -1, |
518 | .Codec = CODEC_SAA7113, | 518 | .codec = CODEC_SAA7113, |
519 | .VideoChannels = 3, | 519 | .video_channels = 3, |
520 | .VideoNorm = V4L2_STD_SECAM, | 520 | .video_norm = V4L2_STD_SECAM, |
521 | .AudioChannels = 1, | 521 | .audio_channels = 1, |
522 | .Radio = 0, | 522 | .radio = 0, |
523 | .vbi = 1, | 523 | .vbi = 1, |
524 | .Tuner = 1, | 524 | .tuner = 1, |
525 | .TunerType = TUNER_PHILIPS_SECAM, | 525 | .tuner_type = TUNER_PHILIPS_SECAM, |
526 | .X_Offset = 0, | 526 | .x_offset = 0, |
527 | .Y_Offset = 3, | 527 | .y_offset = 3, |
528 | .Dvi_yuv_override = 1, | 528 | .dvi_yuv_override = 1, |
529 | .Dvi_yuv = 7, | 529 | .dvi_yuv = 7, |
530 | .ModelString = "Hauppauge WinTV USB Pro (PAL/SECAM BGDK/I/L)", | 530 | .model_string = "Hauppauge WinTV USB Pro (PAL/SECAM BGDK/I/L)", |
531 | }, | 531 | }, |
532 | [HPG_WINTV_PRO_PAL_SECAM_V2] = { | 532 | [HPG_WINTV_PRO_PAL_SECAM_V2] = { |
533 | .Interface = -1, | 533 | .interface = -1, |
534 | .Codec = CODEC_SAA7113, | 534 | .codec = CODEC_SAA7113, |
535 | .VideoChannels = 3, | 535 | .video_channels = 3, |
536 | .VideoNorm = V4L2_STD_SECAM, | 536 | .video_norm = V4L2_STD_SECAM, |
537 | .AudioChannels = 1, | 537 | .audio_channels = 1, |
538 | .Radio = 0, | 538 | .radio = 0, |
539 | .vbi = 1, | 539 | .vbi = 1, |
540 | .Tuner = 1, | 540 | .tuner = 1, |
541 | .TunerType = TUNER_PHILIPS_SECAM, | 541 | .tuner_type = TUNER_PHILIPS_SECAM, |
542 | .X_Offset = 0, | 542 | .x_offset = 0, |
543 | .Y_Offset = 3, | 543 | .y_offset = 3, |
544 | .Dvi_yuv_override = 1, | 544 | .dvi_yuv_override = 1, |
545 | .Dvi_yuv = 7, | 545 | .dvi_yuv = 7, |
546 | .ModelString = "Hauppauge WinTV USB Pro (PAL/SECAM BGDK/I/L) V2", | 546 | .model_string = "Hauppauge WinTV USB Pro (PAL/SECAM BGDK/I/L) V2", |
547 | }, | 547 | }, |
548 | [HPG_WINTV_PRO_PAL_BG_V2] = { | 548 | [HPG_WINTV_PRO_PAL_BG_V2] = { |
549 | .Interface = -1, | 549 | .interface = -1, |
550 | .Codec = CODEC_SAA7113, | 550 | .codec = CODEC_SAA7113, |
551 | .VideoChannels = 3, | 551 | .video_channels = 3, |
552 | .VideoNorm = V4L2_STD_PAL, | 552 | .video_norm = V4L2_STD_PAL, |
553 | .AudioChannels = 1, | 553 | .audio_channels = 1, |
554 | .Radio = 0, | 554 | .radio = 0, |
555 | .vbi = 1, | 555 | .vbi = 1, |
556 | .Tuner = 1, | 556 | .tuner = 1, |
557 | .TunerType = TUNER_ALPS_TSBE1_PAL, | 557 | .tuner_type = TUNER_ALPS_TSBE1_PAL, |
558 | .X_Offset = 0, | 558 | .x_offset = 0, |
559 | .Y_Offset = 3, | 559 | .y_offset = 3, |
560 | .Dvi_yuv_override = 1, | 560 | .dvi_yuv_override = 1, |
561 | .Dvi_yuv = 7, | 561 | .dvi_yuv = 7, |
562 | .ModelString = "Hauppauge WinTV USB Pro (PAL B/G) V2", | 562 | .model_string = "Hauppauge WinTV USB Pro (PAL B/G) V2", |
563 | }, | 563 | }, |
564 | [HPG_WINTV_PRO_PAL_BG_D_K] = { | 564 | [HPG_WINTV_PRO_PAL_BG_D_K] = { |
565 | .Interface = -1, | 565 | .interface = -1, |
566 | .Codec = CODEC_SAA7113, | 566 | .codec = CODEC_SAA7113, |
567 | .VideoChannels = 3, | 567 | .video_channels = 3, |
568 | .VideoNorm = V4L2_STD_PAL, | 568 | .video_norm = V4L2_STD_PAL, |
569 | .AudioChannels = 1, | 569 | .audio_channels = 1, |
570 | .Radio = 0, | 570 | .radio = 0, |
571 | .vbi = 1, | 571 | .vbi = 1, |
572 | .Tuner = 1, | 572 | .tuner = 1, |
573 | .TunerType = TUNER_ALPS_TSBE1_PAL, | 573 | .tuner_type = TUNER_ALPS_TSBE1_PAL, |
574 | .X_Offset = 0, | 574 | .x_offset = 0, |
575 | .Y_Offset = 3, | 575 | .y_offset = 3, |
576 | .Dvi_yuv_override = 1, | 576 | .dvi_yuv_override = 1, |
577 | .Dvi_yuv = 7, | 577 | .dvi_yuv = 7, |
578 | .ModelString = "Hauppauge WinTV USB Pro (PAL B/G,D/K)", | 578 | .model_string = "Hauppauge WinTV USB Pro (PAL B/G,D/K)", |
579 | }, | 579 | }, |
580 | [HPG_WINTV_PRO_PAL_I_D_K] = { | 580 | [HPG_WINTV_PRO_PAL_I_D_K] = { |
581 | .Interface = -1, | 581 | .interface = -1, |
582 | .Codec = CODEC_SAA7113, | 582 | .codec = CODEC_SAA7113, |
583 | .VideoChannels = 3, | 583 | .video_channels = 3, |
584 | .VideoNorm = V4L2_STD_PAL, | 584 | .video_norm = V4L2_STD_PAL, |
585 | .AudioChannels = 1, | 585 | .audio_channels = 1, |
586 | .Radio = 0, | 586 | .radio = 0, |
587 | .vbi = 1, | 587 | .vbi = 1, |
588 | .Tuner = 1, | 588 | .tuner = 1, |
589 | .TunerType = TUNER_LG_PAL_NEW_TAPC, | 589 | .tuner_type = TUNER_LG_PAL_NEW_TAPC, |
590 | .X_Offset = 0, | 590 | .x_offset = 0, |
591 | .Y_Offset = 3, | 591 | .y_offset = 3, |
592 | .Dvi_yuv_override = 1, | 592 | .dvi_yuv_override = 1, |
593 | .Dvi_yuv = 7, | 593 | .dvi_yuv = 7, |
594 | .ModelString = "Hauppauge WinTV USB Pro (PAL I,D/K)", | 594 | .model_string = "Hauppauge WinTV USB Pro (PAL I,D/K)", |
595 | }, | 595 | }, |
596 | [HPG_WINTV_PRO_NTSC_MN_FM] = { | 596 | [HPG_WINTV_PRO_NTSC_MN_FM] = { |
597 | .Interface = -1, | 597 | .interface = -1, |
598 | .Codec = CODEC_SAA7113, | 598 | .codec = CODEC_SAA7113, |
599 | .VideoChannels = 3, | 599 | .video_channels = 3, |
600 | .VideoNorm = V4L2_STD_NTSC, | 600 | .video_norm = V4L2_STD_NTSC, |
601 | .AudioChannels = 1, | 601 | .audio_channels = 1, |
602 | .Radio = 1, | 602 | .radio = 1, |
603 | .vbi = 1, | 603 | .vbi = 1, |
604 | .Tuner = 1, | 604 | .tuner = 1, |
605 | .TunerType = TUNER_PHILIPS_NTSC_M, | 605 | .tuner_type = TUNER_PHILIPS_NTSC_M, |
606 | .X_Offset = 0, | 606 | .x_offset = 0, |
607 | .Y_Offset = 3, | 607 | .y_offset = 3, |
608 | .Dvi_yuv_override = 1, | 608 | .dvi_yuv_override = 1, |
609 | .Dvi_yuv = 7, | 609 | .dvi_yuv = 7, |
610 | .ModelString = "Hauppauge WinTV USB Pro (NTSC M/N FM)", | 610 | .model_string = "Hauppauge WinTV USB Pro (NTSC M/N FM)", |
611 | }, | 611 | }, |
612 | [HPG_WINTV_PRO_PAL_BG_FM] = { | 612 | [HPG_WINTV_PRO_PAL_BG_FM] = { |
613 | .Interface = 0, | 613 | .interface = 0, |
614 | .Codec = CODEC_SAA7113, | 614 | .codec = CODEC_SAA7113, |
615 | .VideoChannels = 3, | 615 | .video_channels = 3, |
616 | .VideoNorm = V4L2_STD_PAL, | 616 | .video_norm = V4L2_STD_PAL, |
617 | .AudioChannels = 1, | 617 | .audio_channels = 1, |
618 | .Radio = 1, | 618 | .radio = 1, |
619 | .vbi = 1, | 619 | .vbi = 1, |
620 | .Tuner = 1, | 620 | .tuner = 1, |
621 | .TunerType = TUNER_PHILIPS_PAL, | 621 | .tuner_type = TUNER_PHILIPS_PAL, |
622 | .X_Offset = 0, | 622 | .x_offset = 0, |
623 | .Y_Offset = 3, | 623 | .y_offset = 3, |
624 | .Dvi_yuv_override = 1, | 624 | .dvi_yuv_override = 1, |
625 | .Dvi_yuv = 7, | 625 | .dvi_yuv = 7, |
626 | .ModelString = "Hauppauge WinTV USB Pro (PAL B/G FM)", | 626 | .model_string = "Hauppauge WinTV USB Pro (PAL B/G FM)", |
627 | }, | 627 | }, |
628 | [HPG_WINTV_PRO_PAL_I_FM] = { | 628 | [HPG_WINTV_PRO_PAL_I_FM] = { |
629 | .Interface = 0, | 629 | .interface = 0, |
630 | .Codec = CODEC_SAA7113, | 630 | .codec = CODEC_SAA7113, |
631 | .VideoChannels = 3, | 631 | .video_channels = 3, |
632 | .VideoNorm = V4L2_STD_PAL, | 632 | .video_norm = V4L2_STD_PAL, |
633 | .AudioChannels = 1, | 633 | .audio_channels = 1, |
634 | .Radio = 1, | 634 | .radio = 1, |
635 | .vbi = 1, | 635 | .vbi = 1, |
636 | .Tuner = 1, | 636 | .tuner = 1, |
637 | .TunerType = TUNER_PHILIPS_PAL, | 637 | .tuner_type = TUNER_PHILIPS_PAL, |
638 | .X_Offset = 0, | 638 | .x_offset = 0, |
639 | .Y_Offset = 3, | 639 | .y_offset = 3, |
640 | .Dvi_yuv_override = 1, | 640 | .dvi_yuv_override = 1, |
641 | .Dvi_yuv = 7, | 641 | .dvi_yuv = 7, |
642 | .ModelString = "Hauppauge WinTV USB Pro (PAL I FM)", | 642 | .model_string = "Hauppauge WinTV USB Pro (PAL I FM)", |
643 | }, | 643 | }, |
644 | [HPG_WINTV_PRO_PAL_D_K_FM] = { | 644 | [HPG_WINTV_PRO_PAL_D_K_FM] = { |
645 | .Interface = 0, | 645 | .interface = 0, |
646 | .Codec = CODEC_SAA7113, | 646 | .codec = CODEC_SAA7113, |
647 | .VideoChannels = 3, | 647 | .video_channels = 3, |
648 | .VideoNorm = V4L2_STD_PAL, | 648 | .video_norm = V4L2_STD_PAL, |
649 | .AudioChannels = 1, | 649 | .audio_channels = 1, |
650 | .Radio = 1, | 650 | .radio = 1, |
651 | .vbi = 1, | 651 | .vbi = 1, |
652 | .Tuner = 1, | 652 | .tuner = 1, |
653 | .TunerType = TUNER_PHILIPS_PAL, | 653 | .tuner_type = TUNER_PHILIPS_PAL, |
654 | .X_Offset = 0, | 654 | .x_offset = 0, |
655 | .Y_Offset = 3, | 655 | .y_offset = 3, |
656 | .Dvi_yuv_override = 1, | 656 | .dvi_yuv_override = 1, |
657 | .Dvi_yuv = 7, | 657 | .dvi_yuv = 7, |
658 | .ModelString = "Hauppauge WinTV USB Pro (PAL D/K FM)", | 658 | .model_string = "Hauppauge WinTV USB Pro (PAL D/K FM)", |
659 | }, | 659 | }, |
660 | [HPG_WINTV_PRO_TEMIC_PAL_FM] = { | 660 | [HPG_WINTV_PRO_TEMIC_PAL_FM] = { |
661 | .Interface = 0, | 661 | .interface = 0, |
662 | .Codec = CODEC_SAA7113, | 662 | .codec = CODEC_SAA7113, |
663 | .VideoChannels = 3, | 663 | .video_channels = 3, |
664 | .VideoNorm = V4L2_STD_PAL, | 664 | .video_norm = V4L2_STD_PAL, |
665 | .AudioChannels = 1, | 665 | .audio_channels = 1, |
666 | .Radio = 1, | 666 | .radio = 1, |
667 | .vbi = 1, | 667 | .vbi = 1, |
668 | .Tuner = 1, | 668 | .tuner = 1, |
669 | .TunerType = TUNER_MICROTUNE_4049FM5, | 669 | .tuner_type = TUNER_MICROTUNE_4049FM5, |
670 | .X_Offset = 0, | 670 | .x_offset = 0, |
671 | .Y_Offset = 3, | 671 | .y_offset = 3, |
672 | .Dvi_yuv_override = 1, | 672 | .dvi_yuv_override = 1, |
673 | .Dvi_yuv = 7, | 673 | .dvi_yuv = 7, |
674 | .ModelString = "Hauppauge WinTV USB Pro (Temic PAL/SECAM B/G/I/D/K/L FM)", | 674 | .model_string = "Hauppauge WinTV USB Pro (Temic PAL/SECAM B/G/I/D/K/L FM)", |
675 | }, | 675 | }, |
676 | [HPG_WINTV_PRO_TEMIC_PAL_BG_FM] = { | 676 | [HPG_WINTV_PRO_TEMIC_PAL_BG_FM] = { |
677 | .Interface = 0, | 677 | .interface = 0, |
678 | .Codec = CODEC_SAA7113, | 678 | .codec = CODEC_SAA7113, |
679 | .VideoChannels = 3, | 679 | .video_channels = 3, |
680 | .VideoNorm = V4L2_STD_PAL, | 680 | .video_norm = V4L2_STD_PAL, |
681 | .AudioChannels = 1, | 681 | .audio_channels = 1, |
682 | .Radio = 1, | 682 | .radio = 1, |
683 | .vbi = 1, | 683 | .vbi = 1, |
684 | .Tuner = 1, | 684 | .tuner = 1, |
685 | .TunerType = TUNER_MICROTUNE_4049FM5, | 685 | .tuner_type = TUNER_MICROTUNE_4049FM5, |
686 | .X_Offset = 0, | 686 | .x_offset = 0, |
687 | .Y_Offset = 3, | 687 | .y_offset = 3, |
688 | .Dvi_yuv_override = 1, | 688 | .dvi_yuv_override = 1, |
689 | .Dvi_yuv = 7, | 689 | .dvi_yuv = 7, |
690 | .ModelString = "Hauppauge WinTV USB Pro (Temic PAL B/G FM)", | 690 | .model_string = "Hauppauge WinTV USB Pro (Temic PAL B/G FM)", |
691 | }, | 691 | }, |
692 | [HPG_WINTV_PRO_PAL_FM] = { | 692 | [HPG_WINTV_PRO_PAL_FM] = { |
693 | .Interface = 0, | 693 | .interface = 0, |
694 | .Codec = CODEC_SAA7113, | 694 | .codec = CODEC_SAA7113, |
695 | .VideoChannels = 3, | 695 | .video_channels = 3, |
696 | .VideoNorm = V4L2_STD_PAL, | 696 | .video_norm = V4L2_STD_PAL, |
697 | .AudioChannels = 1, | 697 | .audio_channels = 1, |
698 | .Radio = 1, | 698 | .radio = 1, |
699 | .vbi = 1, | 699 | .vbi = 1, |
700 | .Tuner = 1, | 700 | .tuner = 1, |
701 | .TunerType = TUNER_PHILIPS_FM1216ME_MK3, | 701 | .tuner_type = TUNER_PHILIPS_FM1216ME_MK3, |
702 | .X_Offset = 0, | 702 | .x_offset = 0, |
703 | .Y_Offset = 3, | 703 | .y_offset = 3, |
704 | .Dvi_yuv_override = 1, | 704 | .dvi_yuv_override = 1, |
705 | .Dvi_yuv = 7, | 705 | .dvi_yuv = 7, |
706 | .ModelString = "Hauppauge WinTV USB Pro (PAL/SECAM B/G/I/D/K/L FM)", | 706 | .model_string = "Hauppauge WinTV USB Pro (PAL/SECAM B/G/I/D/K/L FM)", |
707 | }, | 707 | }, |
708 | [HPG_WINTV_PRO_NTSC_MN_FM_V2] = { | 708 | [HPG_WINTV_PRO_NTSC_MN_FM_V2] = { |
709 | .Interface = 0, | 709 | .interface = 0, |
710 | .Codec = CODEC_SAA7113, | 710 | .codec = CODEC_SAA7113, |
711 | .VideoChannels = 3, | 711 | .video_channels = 3, |
712 | .VideoNorm = V4L2_STD_NTSC, | 712 | .video_norm = V4L2_STD_NTSC, |
713 | .AudioChannels = 1, | 713 | .audio_channels = 1, |
714 | .Radio = 1, | 714 | .radio = 1, |
715 | .vbi = 1, | 715 | .vbi = 1, |
716 | .Tuner = 1, | 716 | .tuner = 1, |
717 | .TunerType = TUNER_PHILIPS_NTSC_M, | 717 | .tuner_type = TUNER_PHILIPS_NTSC_M, |
718 | .X_Offset = 0, | 718 | .x_offset = 0, |
719 | .Y_Offset = 3, | 719 | .y_offset = 3, |
720 | .Dvi_yuv_override = 1, | 720 | .dvi_yuv_override = 1, |
721 | .Dvi_yuv = 7, | 721 | .dvi_yuv = 7, |
722 | .ModelString = "Hauppauge WinTV USB Pro (NTSC M/N FM) V2", | 722 | .model_string = "Hauppauge WinTV USB Pro (NTSC M/N FM) V2", |
723 | }, | 723 | }, |
724 | [CAMTEL_TVB330] = { | 724 | [CAMTEL_TVB330] = { |
725 | .Interface = -1, | 725 | .interface = -1, |
726 | .Codec = CODEC_SAA7113, | 726 | .codec = CODEC_SAA7113, |
727 | .VideoChannels = 3, | 727 | .video_channels = 3, |
728 | .VideoNorm = V4L2_STD_NTSC, | 728 | .video_norm = V4L2_STD_NTSC, |
729 | .AudioChannels = 1, | 729 | .audio_channels = 1, |
730 | .Radio = 1, | 730 | .radio = 1, |
731 | .vbi = 1, | 731 | .vbi = 1, |
732 | .Tuner = 1, | 732 | .tuner = 1, |
733 | .TunerType = TUNER_PHILIPS_NTSC_M, | 733 | .tuner_type = TUNER_PHILIPS_NTSC_M, |
734 | .X_Offset = 5, | 734 | .x_offset = 5, |
735 | .Y_Offset = 5, | 735 | .y_offset = 5, |
736 | .ModelString = "Camtel Technology USB TV Genie Pro FM Model TVB330", | 736 | .model_string = "Camtel Technology USB TV Genie Pro FM Model TVB330", |
737 | }, | 737 | }, |
738 | [DIGITAL_VIDEO_CREATOR_I] = { | 738 | [DIGITAL_VIDEO_CREATOR_I] = { |
739 | .Interface = -1, | 739 | .interface = -1, |
740 | .Codec = CODEC_SAA7113, | 740 | .codec = CODEC_SAA7113, |
741 | .VideoChannels = 2, | 741 | .video_channels = 2, |
742 | .VideoNorm = V4L2_STD_PAL, | 742 | .video_norm = V4L2_STD_PAL, |
743 | .AudioChannels = 0, | 743 | .audio_channels = 0, |
744 | .Radio = 0, | 744 | .radio = 0, |
745 | .vbi = 1, | 745 | .vbi = 1, |
746 | .Tuner = 0, | 746 | .tuner = 0, |
747 | .TunerType = 0, | 747 | .tuner_type = 0, |
748 | .X_Offset = 0, | 748 | .x_offset = 0, |
749 | .Y_Offset = 3, | 749 | .y_offset = 3, |
750 | .Dvi_yuv_override = 1, | 750 | .dvi_yuv_override = 1, |
751 | .Dvi_yuv = 7, | 751 | .dvi_yuv = 7, |
752 | .ModelString = "Digital Video Creator I", | 752 | .model_string = "Digital Video Creator I", |
753 | }, | 753 | }, |
754 | [GLOBAL_VILLAGE_GV_007_NTSC] = { | 754 | [GLOBAL_VILLAGE_GV_007_NTSC] = { |
755 | .Interface = -1, | 755 | .interface = -1, |
756 | .Codec = CODEC_SAA7111, | 756 | .codec = CODEC_SAA7111, |
757 | .VideoChannels = 2, | 757 | .video_channels = 2, |
758 | .VideoNorm = V4L2_STD_NTSC, | 758 | .video_norm = V4L2_STD_NTSC, |
759 | .AudioChannels = 0, | 759 | .audio_channels = 0, |
760 | .Radio = 0, | 760 | .radio = 0, |
761 | .vbi = 1, | 761 | .vbi = 1, |
762 | .Tuner = 0, | 762 | .tuner = 0, |
763 | .TunerType = 0, | 763 | .tuner_type = 0, |
764 | .X_Offset = 82, | 764 | .x_offset = 82, |
765 | .Y_Offset = 20, | 765 | .y_offset = 20, |
766 | .Dvi_yuv_override = 1, | 766 | .dvi_yuv_override = 1, |
767 | .Dvi_yuv = 7, | 767 | .dvi_yuv = 7, |
768 | .ModelString = "Global Village GV-007 (NTSC)", | 768 | .model_string = "Global Village GV-007 (NTSC)", |
769 | }, | 769 | }, |
770 | [DAZZLE_DVC_50_REV_1_NTSC] = { | 770 | [DAZZLE_DVC_50_REV_1_NTSC] = { |
771 | .Interface = 0, | 771 | .interface = 0, |
772 | .Codec = CODEC_SAA7113, | 772 | .codec = CODEC_SAA7113, |
773 | .VideoChannels = 2, | 773 | .video_channels = 2, |
774 | .VideoNorm = V4L2_STD_NTSC, | 774 | .video_norm = V4L2_STD_NTSC, |
775 | .AudioChannels = 0, | 775 | .audio_channels = 0, |
776 | .Radio = 0, | 776 | .radio = 0, |
777 | .vbi = 1, | 777 | .vbi = 1, |
778 | .Tuner = 0, | 778 | .tuner = 0, |
779 | .TunerType = 0, | 779 | .tuner_type = 0, |
780 | .X_Offset = 0, | 780 | .x_offset = 0, |
781 | .Y_Offset = 3, | 781 | .y_offset = 3, |
782 | .Dvi_yuv_override = 1, | 782 | .dvi_yuv_override = 1, |
783 | .Dvi_yuv = 7, | 783 | .dvi_yuv = 7, |
784 | .ModelString = "Dazzle Fusion Model DVC-50 Rev 1 (NTSC)", | 784 | .model_string = "Dazzle Fusion Model DVC-50 Rev 1 (NTSC)", |
785 | }, | 785 | }, |
786 | [DAZZLE_DVC_80_REV_1_PAL] = { | 786 | [DAZZLE_DVC_80_REV_1_PAL] = { |
787 | .Interface = 0, | 787 | .interface = 0, |
788 | .Codec = CODEC_SAA7113, | 788 | .codec = CODEC_SAA7113, |
789 | .VideoChannels = 2, | 789 | .video_channels = 2, |
790 | .VideoNorm = V4L2_STD_PAL, | 790 | .video_norm = V4L2_STD_PAL, |
791 | .AudioChannels = 0, | 791 | .audio_channels = 0, |
792 | .Radio = 0, | 792 | .radio = 0, |
793 | .vbi = 1, | 793 | .vbi = 1, |
794 | .Tuner = 0, | 794 | .tuner = 0, |
795 | .TunerType = 0, | 795 | .tuner_type = 0, |
796 | .X_Offset = 0, | 796 | .x_offset = 0, |
797 | .Y_Offset = 3, | 797 | .y_offset = 3, |
798 | .Dvi_yuv_override = 1, | 798 | .dvi_yuv_override = 1, |
799 | .Dvi_yuv = 7, | 799 | .dvi_yuv = 7, |
800 | .ModelString = "Dazzle Fusion Model DVC-80 Rev 1 (PAL)", | 800 | .model_string = "Dazzle Fusion Model DVC-80 Rev 1 (PAL)", |
801 | }, | 801 | }, |
802 | [DAZZLE_DVC_90_REV_1_SECAM] = { | 802 | [DAZZLE_DVC_90_REV_1_SECAM] = { |
803 | .Interface = 0, | 803 | .interface = 0, |
804 | .Codec = CODEC_SAA7113, | 804 | .codec = CODEC_SAA7113, |
805 | .VideoChannels = 2, | 805 | .video_channels = 2, |
806 | .VideoNorm = V4L2_STD_SECAM, | 806 | .video_norm = V4L2_STD_SECAM, |
807 | .AudioChannels = 0, | 807 | .audio_channels = 0, |
808 | .Radio = 0, | 808 | .radio = 0, |
809 | .vbi = 1, | 809 | .vbi = 1, |
810 | .Tuner = 0, | 810 | .tuner = 0, |
811 | .TunerType = 0, | 811 | .tuner_type = 0, |
812 | .X_Offset = 0, | 812 | .x_offset = 0, |
813 | .Y_Offset = 3, | 813 | .y_offset = 3, |
814 | .Dvi_yuv_override = 1, | 814 | .dvi_yuv_override = 1, |
815 | .Dvi_yuv = 7, | 815 | .dvi_yuv = 7, |
816 | .ModelString = "Dazzle Fusion Model DVC-90 Rev 1 (SECAM)", | 816 | .model_string = "Dazzle Fusion Model DVC-90 Rev 1 (SECAM)", |
817 | }, | 817 | }, |
818 | [ESKAPE_LABS_MYTV2GO] = { | 818 | [ESKAPE_LABS_MYTV2GO] = { |
819 | .Interface = 0, | 819 | .interface = 0, |
820 | .Codec = CODEC_SAA7113, | 820 | .codec = CODEC_SAA7113, |
821 | .VideoChannels = 2, | 821 | .video_channels = 2, |
822 | .VideoNorm = V4L2_STD_PAL, | 822 | .video_norm = V4L2_STD_PAL, |
823 | .AudioChannels = 1, | 823 | .audio_channels = 1, |
824 | .Radio = 1, | 824 | .radio = 1, |
825 | .vbi = 1, | 825 | .vbi = 1, |
826 | .Tuner = 1, | 826 | .tuner = 1, |
827 | .TunerType = TUNER_PHILIPS_FM1216ME_MK3, | 827 | .tuner_type = TUNER_PHILIPS_FM1216ME_MK3, |
828 | .X_Offset = 0, | 828 | .x_offset = 0, |
829 | .Y_Offset = 3, | 829 | .y_offset = 3, |
830 | .Dvi_yuv_override = 1, | 830 | .dvi_yuv_override = 1, |
831 | .Dvi_yuv = 7, | 831 | .dvi_yuv = 7, |
832 | .ModelString = "Eskape Labs MyTV2Go", | 832 | .model_string = "Eskape Labs MyTV2Go", |
833 | }, | 833 | }, |
834 | [PINNA_PCTV_USB_PAL] = { | 834 | [PINNA_PCTV_USB_PAL] = { |
835 | .Interface = -1, | 835 | .interface = -1, |
836 | .Codec = CODEC_SAA7111, | 836 | .codec = CODEC_SAA7111, |
837 | .VideoChannels = 3, | 837 | .video_channels = 3, |
838 | .VideoNorm = V4L2_STD_PAL, | 838 | .video_norm = V4L2_STD_PAL, |
839 | .AudioChannels = 1, | 839 | .audio_channels = 1, |
840 | .Radio = 0, | 840 | .radio = 0, |
841 | .vbi = 0, | 841 | .vbi = 0, |
842 | .Tuner = 1, | 842 | .tuner = 1, |
843 | .TunerType = TUNER_TEMIC_4066FY5_PAL_I, | 843 | .tuner_type = TUNER_TEMIC_4066FY5_PAL_I, |
844 | .X_Offset = -1, | 844 | .x_offset = -1, |
845 | .Y_Offset = -1, | 845 | .y_offset = -1, |
846 | .ModelString = "Pinnacle Studio PCTV USB (PAL)", | 846 | .model_string = "Pinnacle Studio PCTV USB (PAL)", |
847 | }, | 847 | }, |
848 | [PINNA_PCTV_USB_SECAM] = { | 848 | [PINNA_PCTV_USB_SECAM] = { |
849 | .Interface = -1, | 849 | .interface = -1, |
850 | .Codec = CODEC_SAA7111, | 850 | .codec = CODEC_SAA7111, |
851 | .VideoChannels = 3, | 851 | .video_channels = 3, |
852 | .VideoNorm = V4L2_STD_SECAM, | 852 | .video_norm = V4L2_STD_SECAM, |
853 | .AudioChannels = 1, | 853 | .audio_channels = 1, |
854 | .Radio = 0, | 854 | .radio = 0, |
855 | .vbi = 1, | 855 | .vbi = 1, |
856 | .Tuner = 1, | 856 | .tuner = 1, |
857 | .TunerType = TUNER_PHILIPS_SECAM, | 857 | .tuner_type = TUNER_PHILIPS_SECAM, |
858 | .X_Offset = -1, | 858 | .x_offset = -1, |
859 | .Y_Offset = -1, | 859 | .y_offset = -1, |
860 | .ModelString = "Pinnacle Studio PCTV USB (SECAM)", | 860 | .model_string = "Pinnacle Studio PCTV USB (SECAM)", |
861 | }, | 861 | }, |
862 | [PINNA_PCTV_USB_PAL_FM] = { | 862 | [PINNA_PCTV_USB_PAL_FM] = { |
863 | .Interface = -1, | 863 | .interface = -1, |
864 | .Codec = CODEC_SAA7111, | 864 | .codec = CODEC_SAA7111, |
865 | .VideoChannels = 3, | 865 | .video_channels = 3, |
866 | .VideoNorm = V4L2_STD_PAL, | 866 | .video_norm = V4L2_STD_PAL, |
867 | .AudioChannels = 1, | 867 | .audio_channels = 1, |
868 | .Radio = 1, | 868 | .radio = 1, |
869 | .vbi = 1, | 869 | .vbi = 1, |
870 | .Tuner = 1, | 870 | .tuner = 1, |
871 | .TunerType = TUNER_PHILIPS_PAL, | 871 | .tuner_type = TUNER_PHILIPS_PAL, |
872 | .X_Offset = 128, | 872 | .x_offset = 128, |
873 | .Y_Offset = 23, | 873 | .y_offset = 23, |
874 | .ModelString = "Pinnacle Studio PCTV USB (PAL) FM", | 874 | .model_string = "Pinnacle Studio PCTV USB (PAL) FM", |
875 | }, | 875 | }, |
876 | [MIRO_PCTV_USB] = { | 876 | [MIRO_PCTV_USB] = { |
877 | .Interface = -1, | 877 | .interface = -1, |
878 | .Codec = CODEC_SAA7111, | 878 | .codec = CODEC_SAA7111, |
879 | .VideoChannels = 3, | 879 | .video_channels = 3, |
880 | .VideoNorm = V4L2_STD_PAL, | 880 | .video_norm = V4L2_STD_PAL, |
881 | .AudioChannels = 1, | 881 | .audio_channels = 1, |
882 | .Radio = 0, | 882 | .radio = 0, |
883 | .vbi = 1, | 883 | .vbi = 1, |
884 | .Tuner = 1, | 884 | .tuner = 1, |
885 | .TunerType = TUNER_PHILIPS_PAL, | 885 | .tuner_type = TUNER_PHILIPS_PAL, |
886 | .X_Offset = -1, | 886 | .x_offset = -1, |
887 | .Y_Offset = -1, | 887 | .y_offset = -1, |
888 | .ModelString = "Miro PCTV USB", | 888 | .model_string = "Miro PCTV USB", |
889 | }, | 889 | }, |
890 | [PINNA_PCTV_USB_NTSC_FM] = { | 890 | [PINNA_PCTV_USB_NTSC_FM] = { |
891 | .Interface = -1, | 891 | .interface = -1, |
892 | .Codec = CODEC_SAA7111, | 892 | .codec = CODEC_SAA7111, |
893 | .VideoChannels = 3, | 893 | .video_channels = 3, |
894 | .VideoNorm = V4L2_STD_NTSC, | 894 | .video_norm = V4L2_STD_NTSC, |
895 | .AudioChannels = 1, | 895 | .audio_channels = 1, |
896 | .Radio = 1, | 896 | .radio = 1, |
897 | .vbi = 1, | 897 | .vbi = 1, |
898 | .Tuner = 1, | 898 | .tuner = 1, |
899 | .TunerType = TUNER_PHILIPS_NTSC_M, | 899 | .tuner_type = TUNER_PHILIPS_NTSC_M, |
900 | .X_Offset = -1, | 900 | .x_offset = -1, |
901 | .Y_Offset = -1, | 901 | .y_offset = -1, |
902 | .ModelString = "Pinnacle Studio PCTV USB (NTSC) FM", | 902 | .model_string = "Pinnacle Studio PCTV USB (NTSC) FM", |
903 | }, | 903 | }, |
904 | [PINNA_PCTV_USB_NTSC_FM_V3] = { | 904 | [PINNA_PCTV_USB_NTSC_FM_V3] = { |
905 | .Interface = -1, | 905 | .interface = -1, |
906 | .Codec = CODEC_SAA7111, | 906 | .codec = CODEC_SAA7111, |
907 | .VideoChannels = 3, | 907 | .video_channels = 3, |
908 | .VideoNorm = V4L2_STD_NTSC, | 908 | .video_norm = V4L2_STD_NTSC, |
909 | .AudioChannels = 1, | 909 | .audio_channels = 1, |
910 | .Radio = 1, | 910 | .radio = 1, |
911 | .vbi = 1, | 911 | .vbi = 1, |
912 | .Tuner = 1, | 912 | .tuner = 1, |
913 | .TunerType = TUNER_PHILIPS_NTSC_M, | 913 | .tuner_type = TUNER_PHILIPS_NTSC_M, |
914 | .X_Offset = -1, | 914 | .x_offset = -1, |
915 | .Y_Offset = -1, | 915 | .y_offset = -1, |
916 | .ModelString = "Pinnacle Studio PCTV USB (NTSC) FM V3", | 916 | .model_string = "Pinnacle Studio PCTV USB (NTSC) FM V3", |
917 | }, | 917 | }, |
918 | [PINNA_PCTV_USB_PAL_FM_V2] = { | 918 | [PINNA_PCTV_USB_PAL_FM_V2] = { |
919 | .Interface = -1, | 919 | .interface = -1, |
920 | .Codec = CODEC_SAA7113, | 920 | .codec = CODEC_SAA7113, |
921 | .VideoChannels = 3, | 921 | .video_channels = 3, |
922 | .VideoNorm = V4L2_STD_PAL, | 922 | .video_norm = V4L2_STD_PAL, |
923 | .AudioChannels = 1, | 923 | .audio_channels = 1, |
924 | .Radio = 1, | 924 | .radio = 1, |
925 | .vbi = 1, | 925 | .vbi = 1, |
926 | .Tuner = 1, | 926 | .tuner = 1, |
927 | .TunerType = TUNER_TEMIC_4009FR5_PAL, | 927 | .tuner_type = TUNER_TEMIC_4009FR5_PAL, |
928 | .X_Offset = 0, | 928 | .x_offset = 0, |
929 | .Y_Offset = 3, | 929 | .y_offset = 3, |
930 | .Dvi_yuv_override = 1, | 930 | .dvi_yuv_override = 1, |
931 | .Dvi_yuv = 7, | 931 | .dvi_yuv = 7, |
932 | .ModelString = "Pinnacle Studio PCTV USB (PAL) FM V2", | 932 | .model_string = "Pinnacle Studio PCTV USB (PAL) FM V2", |
933 | }, | 933 | }, |
934 | [PINNA_PCTV_USB_NTSC_FM_V2] = { | 934 | [PINNA_PCTV_USB_NTSC_FM_V2] = { |
935 | .Interface = -1, | 935 | .interface = -1, |
936 | .Codec = CODEC_SAA7111, | 936 | .codec = CODEC_SAA7111, |
937 | .VideoChannels = 3, | 937 | .video_channels = 3, |
938 | .VideoNorm = V4L2_STD_NTSC, | 938 | .video_norm = V4L2_STD_NTSC, |
939 | .AudioChannels = 1, | 939 | .audio_channels = 1, |
940 | .Radio = 1, | 940 | .radio = 1, |
941 | .vbi = 1, | 941 | .vbi = 1, |
942 | .Tuner = 1, | 942 | .tuner = 1, |
943 | .TunerType = TUNER_TEMIC_4039FR5_NTSC, | 943 | .tuner_type = TUNER_TEMIC_4039FR5_NTSC, |
944 | .X_Offset = 0, | 944 | .x_offset = 0, |
945 | .Y_Offset = 3, | 945 | .y_offset = 3, |
946 | .Dvi_yuv_override = 1, | 946 | .dvi_yuv_override = 1, |
947 | .Dvi_yuv = 7, | 947 | .dvi_yuv = 7, |
948 | .ModelString = "Pinnacle Studio PCTV USB (NTSC) FM V2", | 948 | .model_string = "Pinnacle Studio PCTV USB (NTSC) FM V2", |
949 | }, | 949 | }, |
950 | [PINNA_PCTV_USB_PAL_FM_V3] = { | 950 | [PINNA_PCTV_USB_PAL_FM_V3] = { |
951 | .Interface = -1, | 951 | .interface = -1, |
952 | .Codec = CODEC_SAA7113, | 952 | .codec = CODEC_SAA7113, |
953 | .VideoChannels = 3, | 953 | .video_channels = 3, |
954 | .VideoNorm = V4L2_STD_PAL, | 954 | .video_norm = V4L2_STD_PAL, |
955 | .AudioChannels = 1, | 955 | .audio_channels = 1, |
956 | .Radio = 1, | 956 | .radio = 1, |
957 | .vbi = 1, | 957 | .vbi = 1, |
958 | .Tuner = 1, | 958 | .tuner = 1, |
959 | .TunerType = TUNER_TEMIC_4009FR5_PAL, | 959 | .tuner_type = TUNER_TEMIC_4009FR5_PAL, |
960 | .X_Offset = 0, | 960 | .x_offset = 0, |
961 | .Y_Offset = 3, | 961 | .y_offset = 3, |
962 | .Dvi_yuv_override = 1, | 962 | .dvi_yuv_override = 1, |
963 | .Dvi_yuv = 7, | 963 | .dvi_yuv = 7, |
964 | .ModelString = "Pinnacle Studio PCTV USB (PAL) FM V3", | 964 | .model_string = "Pinnacle Studio PCTV USB (PAL) FM V3", |
965 | }, | 965 | }, |
966 | [PINNA_LINX_VD_IN_CAB_NTSC] = { | 966 | [PINNA_LINX_VD_IN_CAB_NTSC] = { |
967 | .Interface = -1, | 967 | .interface = -1, |
968 | .Codec = CODEC_SAA7113, | 968 | .codec = CODEC_SAA7113, |
969 | .VideoChannels = 2, | 969 | .video_channels = 2, |
970 | .VideoNorm = V4L2_STD_NTSC, | 970 | .video_norm = V4L2_STD_NTSC, |
971 | .AudioChannels = 1, | 971 | .audio_channels = 1, |
972 | .Radio = 0, | 972 | .radio = 0, |
973 | .vbi = 1, | 973 | .vbi = 1, |
974 | .Tuner = 0, | 974 | .tuner = 0, |
975 | .TunerType = 0, | 975 | .tuner_type = 0, |
976 | .X_Offset = 0, | 976 | .x_offset = 0, |
977 | .Y_Offset = 3, | 977 | .y_offset = 3, |
978 | .Dvi_yuv_override = 1, | 978 | .dvi_yuv_override = 1, |
979 | .Dvi_yuv = 7, | 979 | .dvi_yuv = 7, |
980 | .ModelString = "Pinnacle Studio Linx Video input cable (NTSC)", | 980 | .model_string = "Pinnacle Studio Linx Video input cable (NTSC)", |
981 | }, | 981 | }, |
982 | [PINNA_LINX_VD_IN_CAB_PAL] = { | 982 | [PINNA_LINX_VD_IN_CAB_PAL] = { |
983 | .Interface = -1, | 983 | .interface = -1, |
984 | .Codec = CODEC_SAA7113, | 984 | .codec = CODEC_SAA7113, |
985 | .VideoChannels = 2, | 985 | .video_channels = 2, |
986 | .VideoNorm = V4L2_STD_PAL, | 986 | .video_norm = V4L2_STD_PAL, |
987 | .AudioChannels = 1, | 987 | .audio_channels = 1, |
988 | .Radio = 0, | 988 | .radio = 0, |
989 | .vbi = 1, | 989 | .vbi = 1, |
990 | .Tuner = 0, | 990 | .tuner = 0, |
991 | .TunerType = 0, | 991 | .tuner_type = 0, |
992 | .X_Offset = 0, | 992 | .x_offset = 0, |
993 | .Y_Offset = 3, | 993 | .y_offset = 3, |
994 | .Dvi_yuv_override = 1, | 994 | .dvi_yuv_override = 1, |
995 | .Dvi_yuv = 7, | 995 | .dvi_yuv = 7, |
996 | .ModelString = "Pinnacle Studio Linx Video input cable (PAL)", | 996 | .model_string = "Pinnacle Studio Linx Video input cable (PAL)", |
997 | }, | 997 | }, |
998 | [PINNA_PCTV_BUNGEE_PAL_FM] = { | 998 | [PINNA_PCTV_BUNGEE_PAL_FM] = { |
999 | .Interface = -1, | 999 | .interface = -1, |
1000 | .Codec = CODEC_SAA7113, | 1000 | .codec = CODEC_SAA7113, |
1001 | .VideoChannels = 3, | 1001 | .video_channels = 3, |
1002 | .VideoNorm = V4L2_STD_PAL, | 1002 | .video_norm = V4L2_STD_PAL, |
1003 | .AudioChannels = 1, | 1003 | .audio_channels = 1, |
1004 | .Radio = 1, | 1004 | .radio = 1, |
1005 | .vbi = 1, | 1005 | .vbi = 1, |
1006 | .Tuner = 1, | 1006 | .tuner = 1, |
1007 | .TunerType = TUNER_TEMIC_4009FR5_PAL, | 1007 | .tuner_type = TUNER_TEMIC_4009FR5_PAL, |
1008 | .X_Offset = 0, | 1008 | .x_offset = 0, |
1009 | .Y_Offset = 3, | 1009 | .y_offset = 3, |
1010 | .Dvi_yuv_override = 1, | 1010 | .dvi_yuv_override = 1, |
1011 | .Dvi_yuv = 7, | 1011 | .dvi_yuv = 7, |
1012 | .ModelString = "Pinnacle PCTV Bungee USB (PAL) FM", | 1012 | .model_string = "Pinnacle PCTV Bungee USB (PAL) FM", |
1013 | }, | 1013 | }, |
1014 | [HPG_WINTV] = { | 1014 | [HPG_WINTV] = { |
1015 | .Interface = -1, | 1015 | .interface = -1, |
1016 | .Codec = CODEC_SAA7111, | 1016 | .codec = CODEC_SAA7111, |
1017 | .VideoChannels = 3, | 1017 | .video_channels = 3, |
1018 | .VideoNorm = V4L2_STD_NTSC, | 1018 | .video_norm = V4L2_STD_NTSC, |
1019 | .AudioChannels = 1, | 1019 | .audio_channels = 1, |
1020 | .Radio = 0, | 1020 | .radio = 0, |
1021 | .vbi = 1, | 1021 | .vbi = 1, |
1022 | .Tuner = 1, | 1022 | .tuner = 1, |
1023 | .TunerType = TUNER_PHILIPS_NTSC_M, | 1023 | .tuner_type = TUNER_PHILIPS_NTSC_M, |
1024 | .X_Offset = -1, | 1024 | .x_offset = -1, |
1025 | .Y_Offset = -1, | 1025 | .y_offset = -1, |
1026 | .ModelString = "Hauppauge WinTv-USB", | 1026 | .model_string = "Hauppauge WinTv-USB", |
1027 | }, | 1027 | }, |
1028 | }; | 1028 | }; |
1029 | const int usbvision_device_data_size=ARRAY_SIZE(usbvision_device_data); | 1029 | const int usbvision_device_data_size=ARRAY_SIZE(usbvision_device_data); |
diff --git a/drivers/media/video/usbvision/usbvision-core.c b/drivers/media/video/usbvision/usbvision-core.c index de58aa7d9e1d..372e21b35ed3 100644 --- a/drivers/media/video/usbvision/usbvision-core.c +++ b/drivers/media/video/usbvision/usbvision-core.c | |||
@@ -53,23 +53,23 @@ static unsigned int force_testpattern; | |||
53 | module_param(force_testpattern,int,0644); | 53 | module_param(force_testpattern,int,0644); |
54 | MODULE_PARM_DESC(force_testpattern,"enable test pattern display [core]"); | 54 | MODULE_PARM_DESC(force_testpattern,"enable test pattern display [core]"); |
55 | 55 | ||
56 | static int adjustCompression = 1; /* Set the compression to be adaptive */ | 56 | static int adjust_compression = 1; /* Set the compression to be adaptive */ |
57 | module_param(adjustCompression, int, 0444); | 57 | module_param(adjust_compression, int, 0444); |
58 | MODULE_PARM_DESC(adjustCompression, " Set the ADPCM compression for the device. Default: 1 (On)"); | 58 | MODULE_PARM_DESC(adjust_compression, " Set the ADPCM compression for the device. Default: 1 (On)"); |
59 | 59 | ||
60 | /* To help people with Black and White output with using s-video input. | 60 | /* To help people with Black and White output with using s-video input. |
61 | * Some cables and input device are wired differently. */ | 61 | * Some cables and input device are wired differently. */ |
62 | static int SwitchSVideoInput; | 62 | static int switch_svideo_input; |
63 | module_param(SwitchSVideoInput, int, 0444); | 63 | module_param(switch_svideo_input, int, 0444); |
64 | MODULE_PARM_DESC(SwitchSVideoInput, " Set the S-Video input. Some cables and input device are wired differently. Default: 0 (Off)"); | 64 | MODULE_PARM_DESC(switch_svideo_input, " Set the S-Video input. Some cables and input device are wired differently. Default: 0 (Off)"); |
65 | 65 | ||
66 | static unsigned int adjust_X_Offset = -1; | 66 | static unsigned int adjust_x_offset = -1; |
67 | module_param(adjust_X_Offset, int, 0644); | 67 | module_param(adjust_x_offset, int, 0644); |
68 | MODULE_PARM_DESC(adjust_X_Offset, "adjust X offset display [core]"); | 68 | MODULE_PARM_DESC(adjust_x_offset, "adjust X offset display [core]"); |
69 | 69 | ||
70 | static unsigned int adjust_Y_Offset = -1; | 70 | static unsigned int adjust_y_offset = -1; |
71 | module_param(adjust_Y_Offset, int, 0644); | 71 | module_param(adjust_y_offset, int, 0644); |
72 | MODULE_PARM_DESC(adjust_Y_Offset, "adjust Y offset display [core]"); | 72 | MODULE_PARM_DESC(adjust_y_offset, "adjust Y offset display [core]"); |
73 | 73 | ||
74 | 74 | ||
75 | #define ENABLE_HEXDUMP 0 /* Enable if you need it */ | 75 | #define ENABLE_HEXDUMP 0 /* Enable if you need it */ |
@@ -327,7 +327,7 @@ static int scratch_get(struct usb_usbvision *usbvision, unsigned char *data, | |||
327 | static int scratch_get_header(struct usb_usbvision *usbvision, | 327 | static int scratch_get_header(struct usb_usbvision *usbvision, |
328 | struct usbvision_frame_header *header) | 328 | struct usbvision_frame_header *header) |
329 | { | 329 | { |
330 | int errCode = 0; | 330 | int err_code = 0; |
331 | 331 | ||
332 | PDEBUG(DBG_SCRATCH, "from read_ptr=%d", usbvision->scratch_headermarker_read_ptr); | 332 | PDEBUG(DBG_SCRATCH, "from read_ptr=%d", usbvision->scratch_headermarker_read_ptr); |
333 | 333 | ||
@@ -340,15 +340,15 @@ static int scratch_get_header(struct usb_usbvision *usbvision, | |||
340 | scratch_get(usbvision, (unsigned char *)header, USBVISION_HEADER_LENGTH); | 340 | scratch_get(usbvision, (unsigned char *)header, USBVISION_HEADER_LENGTH); |
341 | if ((header->magic_1 == USBVISION_MAGIC_1) | 341 | if ((header->magic_1 == USBVISION_MAGIC_1) |
342 | && (header->magic_2 == USBVISION_MAGIC_2) | 342 | && (header->magic_2 == USBVISION_MAGIC_2) |
343 | && (header->headerLength == USBVISION_HEADER_LENGTH)) { | 343 | && (header->header_length == USBVISION_HEADER_LENGTH)) { |
344 | errCode = USBVISION_HEADER_LENGTH; | 344 | err_code = USBVISION_HEADER_LENGTH; |
345 | header->frameWidth = header->frameWidthLo + (header->frameWidthHi << 8); | 345 | header->frame_width = header->frame_width_lo + (header->frame_width_hi << 8); |
346 | header->frameHeight = header->frameHeightLo + (header->frameHeightHi << 8); | 346 | header->frame_height = header->frame_height_lo + (header->frame_height_hi << 8); |
347 | break; | 347 | break; |
348 | } | 348 | } |
349 | } | 349 | } |
350 | 350 | ||
351 | return errCode; | 351 | return err_code; |
352 | } | 352 | } |
353 | 353 | ||
354 | 354 | ||
@@ -371,7 +371,7 @@ static void scratch_reset(struct usb_usbvision *usbvision) | |||
371 | usbvision->scratch_write_ptr = 0; | 371 | usbvision->scratch_write_ptr = 0; |
372 | usbvision->scratch_headermarker_read_ptr = 0; | 372 | usbvision->scratch_headermarker_read_ptr = 0; |
373 | usbvision->scratch_headermarker_write_ptr = 0; | 373 | usbvision->scratch_headermarker_write_ptr = 0; |
374 | usbvision->isocstate = IsocState_NoFrame; | 374 | usbvision->isocstate = isoc_state_no_frame; |
375 | } | 375 | } |
376 | 376 | ||
377 | int usbvision_scratch_alloc(struct usb_usbvision *usbvision) | 377 | int usbvision_scratch_alloc(struct usb_usbvision *usbvision) |
@@ -420,13 +420,13 @@ static void usbvision_testpattern(struct usb_usbvision *usbvision, | |||
420 | printk(KERN_ERR "%s: usbvision == NULL\n", proc); | 420 | printk(KERN_ERR "%s: usbvision == NULL\n", proc); |
421 | return; | 421 | return; |
422 | } | 422 | } |
423 | if (usbvision->curFrame == NULL) { | 423 | if (usbvision->cur_frame == NULL) { |
424 | printk(KERN_ERR "%s: usbvision->curFrame is NULL.\n", proc); | 424 | printk(KERN_ERR "%s: usbvision->cur_frame is NULL.\n", proc); |
425 | return; | 425 | return; |
426 | } | 426 | } |
427 | 427 | ||
428 | /* Grab the current frame */ | 428 | /* Grab the current frame */ |
429 | frame = usbvision->curFrame; | 429 | frame = usbvision->cur_frame; |
430 | 430 | ||
431 | /* Optionally start at the beginning */ | 431 | /* Optionally start at the beginning */ |
432 | if (fullframe) { | 432 | if (fullframe) { |
@@ -473,7 +473,7 @@ static void usbvision_testpattern(struct usb_usbvision *usbvision, | |||
473 | } | 473 | } |
474 | } | 474 | } |
475 | 475 | ||
476 | frame->grabstate = FrameState_Done; | 476 | frame->grabstate = frame_state_done; |
477 | frame->scanlength += scan_length; | 477 | frame->scanlength += scan_length; |
478 | ++num_pass; | 478 | ++num_pass; |
479 | 479 | ||
@@ -487,8 +487,8 @@ static void usbvision_testpattern(struct usb_usbvision *usbvision, | |||
487 | int usbvision_decompress_alloc(struct usb_usbvision *usbvision) | 487 | int usbvision_decompress_alloc(struct usb_usbvision *usbvision) |
488 | { | 488 | { |
489 | int IFB_size = MAX_FRAME_WIDTH * MAX_FRAME_HEIGHT * 3 / 2; | 489 | int IFB_size = MAX_FRAME_WIDTH * MAX_FRAME_HEIGHT * 3 / 2; |
490 | usbvision->IntraFrameBuffer = vmalloc_32(IFB_size); | 490 | usbvision->intra_frame_buffer = vmalloc_32(IFB_size); |
491 | if (usbvision->IntraFrameBuffer == NULL) { | 491 | if (usbvision->intra_frame_buffer == NULL) { |
492 | dev_err(&usbvision->dev->dev, | 492 | dev_err(&usbvision->dev->dev, |
493 | "%s: unable to allocate %d for compr. frame buffer\n", | 493 | "%s: unable to allocate %d for compr. frame buffer\n", |
494 | __func__, IFB_size); | 494 | __func__, IFB_size); |
@@ -504,8 +504,8 @@ int usbvision_decompress_alloc(struct usb_usbvision *usbvision) | |||
504 | */ | 504 | */ |
505 | void usbvision_decompress_free(struct usb_usbvision *usbvision) | 505 | void usbvision_decompress_free(struct usb_usbvision *usbvision) |
506 | { | 506 | { |
507 | vfree(usbvision->IntraFrameBuffer); | 507 | vfree(usbvision->intra_frame_buffer); |
508 | usbvision->IntraFrameBuffer = NULL; | 508 | usbvision->intra_frame_buffer = NULL; |
509 | 509 | ||
510 | } | 510 | } |
511 | 511 | ||
@@ -517,77 +517,77 @@ void usbvision_decompress_free(struct usb_usbvision *usbvision) | |||
517 | * | 517 | * |
518 | * Locate one of supported header markers in the scratch buffer. | 518 | * Locate one of supported header markers in the scratch buffer. |
519 | */ | 519 | */ |
520 | static enum ParseState usbvision_find_header(struct usb_usbvision *usbvision) | 520 | static enum parse_state usbvision_find_header(struct usb_usbvision *usbvision) |
521 | { | 521 | { |
522 | struct usbvision_frame *frame; | 522 | struct usbvision_frame *frame; |
523 | int foundHeader = 0; | 523 | int found_header = 0; |
524 | 524 | ||
525 | frame = usbvision->curFrame; | 525 | frame = usbvision->cur_frame; |
526 | 526 | ||
527 | while (scratch_get_header(usbvision, &frame->isocHeader) == USBVISION_HEADER_LENGTH) { | 527 | while (scratch_get_header(usbvision, &frame->isoc_header) == USBVISION_HEADER_LENGTH) { |
528 | // found header in scratch | 528 | // found header in scratch |
529 | PDEBUG(DBG_HEADER, "found header: 0x%02x%02x %d %d %d %d %#x 0x%02x %u %u", | 529 | PDEBUG(DBG_HEADER, "found header: 0x%02x%02x %d %d %d %d %#x 0x%02x %u %u", |
530 | frame->isocHeader.magic_2, | 530 | frame->isoc_header.magic_2, |
531 | frame->isocHeader.magic_1, | 531 | frame->isoc_header.magic_1, |
532 | frame->isocHeader.headerLength, | 532 | frame->isoc_header.header_length, |
533 | frame->isocHeader.frameNum, | 533 | frame->isoc_header.frame_num, |
534 | frame->isocHeader.framePhase, | 534 | frame->isoc_header.frame_phase, |
535 | frame->isocHeader.frameLatency, | 535 | frame->isoc_header.frame_latency, |
536 | frame->isocHeader.dataFormat, | 536 | frame->isoc_header.data_format, |
537 | frame->isocHeader.formatParam, | 537 | frame->isoc_header.format_param, |
538 | frame->isocHeader.frameWidth, | 538 | frame->isoc_header.frame_width, |
539 | frame->isocHeader.frameHeight); | 539 | frame->isoc_header.frame_height); |
540 | 540 | ||
541 | if (usbvision->requestIntra) { | 541 | if (usbvision->request_intra) { |
542 | if (frame->isocHeader.formatParam & 0x80) { | 542 | if (frame->isoc_header.format_param & 0x80) { |
543 | foundHeader = 1; | 543 | found_header = 1; |
544 | usbvision->lastIsocFrameNum = -1; // do not check for lost frames this time | 544 | usbvision->last_isoc_frame_num = -1; // do not check for lost frames this time |
545 | usbvision_unrequest_intra(usbvision); | 545 | usbvision_unrequest_intra(usbvision); |
546 | break; | 546 | break; |
547 | } | 547 | } |
548 | } | 548 | } |
549 | else { | 549 | else { |
550 | foundHeader = 1; | 550 | found_header = 1; |
551 | break; | 551 | break; |
552 | } | 552 | } |
553 | } | 553 | } |
554 | 554 | ||
555 | if (foundHeader) { | 555 | if (found_header) { |
556 | frame->frmwidth = frame->isocHeader.frameWidth * usbvision->stretch_width; | 556 | frame->frmwidth = frame->isoc_header.frame_width * usbvision->stretch_width; |
557 | frame->frmheight = frame->isocHeader.frameHeight * usbvision->stretch_height; | 557 | frame->frmheight = frame->isoc_header.frame_height * usbvision->stretch_height; |
558 | frame->v4l2_linesize = (frame->frmwidth * frame->v4l2_format.depth)>> 3; | 558 | frame->v4l2_linesize = (frame->frmwidth * frame->v4l2_format.depth)>> 3; |
559 | } | 559 | } |
560 | else { // no header found | 560 | else { // no header found |
561 | PDEBUG(DBG_HEADER, "skipping scratch data, no header"); | 561 | PDEBUG(DBG_HEADER, "skipping scratch data, no header"); |
562 | scratch_reset(usbvision); | 562 | scratch_reset(usbvision); |
563 | return ParseState_EndParse; | 563 | return parse_state_end_parse; |
564 | } | 564 | } |
565 | 565 | ||
566 | // found header | 566 | // found header |
567 | if (frame->isocHeader.dataFormat==ISOC_MODE_COMPRESS) { | 567 | if (frame->isoc_header.data_format==ISOC_MODE_COMPRESS) { |
568 | //check isocHeader.frameNum for lost frames | 568 | //check isoc_header.frame_num for lost frames |
569 | if (usbvision->lastIsocFrameNum >= 0) { | 569 | if (usbvision->last_isoc_frame_num >= 0) { |
570 | if (((usbvision->lastIsocFrameNum + 1) % 32) != frame->isocHeader.frameNum) { | 570 | if (((usbvision->last_isoc_frame_num + 1) % 32) != frame->isoc_header.frame_num) { |
571 | // unexpected frame drop: need to request new intra frame | 571 | // unexpected frame drop: need to request new intra frame |
572 | PDEBUG(DBG_HEADER, "Lost frame before %d on USB", frame->isocHeader.frameNum); | 572 | PDEBUG(DBG_HEADER, "Lost frame before %d on USB", frame->isoc_header.frame_num); |
573 | usbvision_request_intra(usbvision); | 573 | usbvision_request_intra(usbvision); |
574 | return ParseState_NextFrame; | 574 | return parse_state_next_frame; |
575 | } | 575 | } |
576 | } | 576 | } |
577 | usbvision->lastIsocFrameNum = frame->isocHeader.frameNum; | 577 | usbvision->last_isoc_frame_num = frame->isoc_header.frame_num; |
578 | } | 578 | } |
579 | usbvision->header_count++; | 579 | usbvision->header_count++; |
580 | frame->scanstate = ScanState_Lines; | 580 | frame->scanstate = scan_state_lines; |
581 | frame->curline = 0; | 581 | frame->curline = 0; |
582 | 582 | ||
583 | if (force_testpattern) { | 583 | if (force_testpattern) { |
584 | usbvision_testpattern(usbvision, 1, 1); | 584 | usbvision_testpattern(usbvision, 1, 1); |
585 | return ParseState_NextFrame; | 585 | return parse_state_next_frame; |
586 | } | 586 | } |
587 | return ParseState_Continue; | 587 | return parse_state_continue; |
588 | } | 588 | } |
589 | 589 | ||
590 | static enum ParseState usbvision_parse_lines_422(struct usb_usbvision *usbvision, | 590 | static enum parse_state usbvision_parse_lines_422(struct usb_usbvision *usbvision, |
591 | long *pcopylen) | 591 | long *pcopylen) |
592 | { | 592 | { |
593 | volatile struct usbvision_frame *frame; | 593 | volatile struct usbvision_frame *frame; |
@@ -599,18 +599,18 @@ static enum ParseState usbvision_parse_lines_422(struct usb_usbvision *usbvision | |||
599 | int clipmask_index, bytes_per_pixel; | 599 | int clipmask_index, bytes_per_pixel; |
600 | int stretch_bytes, clipmask_add; | 600 | int stretch_bytes, clipmask_add; |
601 | 601 | ||
602 | frame = usbvision->curFrame; | 602 | frame = usbvision->cur_frame; |
603 | f = frame->data + (frame->v4l2_linesize * frame->curline); | 603 | f = frame->data + (frame->v4l2_linesize * frame->curline); |
604 | 604 | ||
605 | /* Make sure there's enough data for the entire line */ | 605 | /* Make sure there's enough data for the entire line */ |
606 | len = (frame->isocHeader.frameWidth * 2)+5; | 606 | len = (frame->isoc_header.frame_width * 2)+5; |
607 | if (scratch_len(usbvision) < len) { | 607 | if (scratch_len(usbvision) < len) { |
608 | PDEBUG(DBG_PARSE, "out of data in line %d, need %u.\n", frame->curline, len); | 608 | PDEBUG(DBG_PARSE, "out of data in line %d, need %u.\n", frame->curline, len); |
609 | return ParseState_Out; | 609 | return parse_state_out; |
610 | } | 610 | } |
611 | 611 | ||
612 | if ((frame->curline + 1) >= frame->frmheight) { | 612 | if ((frame->curline + 1) >= frame->frmheight) { |
613 | return ParseState_NextFrame; | 613 | return parse_state_next_frame; |
614 | } | 614 | } |
615 | 615 | ||
616 | bytes_per_pixel = frame->v4l2_format.bytes_per_pixel; | 616 | bytes_per_pixel = frame->v4l2_format.bytes_per_pixel; |
@@ -699,99 +699,99 @@ static enum ParseState usbvision_parse_lines_422(struct usb_usbvision *usbvision | |||
699 | *pcopylen += frame->v4l2_linesize * usbvision->stretch_height; | 699 | *pcopylen += frame->v4l2_linesize * usbvision->stretch_height; |
700 | 700 | ||
701 | if (frame->curline >= frame->frmheight) { | 701 | if (frame->curline >= frame->frmheight) { |
702 | return ParseState_NextFrame; | 702 | return parse_state_next_frame; |
703 | } | 703 | } |
704 | else { | 704 | else { |
705 | return ParseState_Continue; | 705 | return parse_state_continue; |
706 | } | 706 | } |
707 | } | 707 | } |
708 | 708 | ||
709 | /* The decompression routine */ | 709 | /* The decompression routine */ |
710 | static int usbvision_decompress(struct usb_usbvision *usbvision,unsigned char *Compressed, | 710 | static int usbvision_decompress(struct usb_usbvision *usbvision,unsigned char *compressed, |
711 | unsigned char *Decompressed, int *StartPos, | 711 | unsigned char *decompressed, int *start_pos, |
712 | int *BlockTypeStartPos, int Len) | 712 | int *block_typestart_pos, int len) |
713 | { | 713 | { |
714 | int RestPixel, Idx, MaxPos, Pos, ExtraPos, BlockLen, BlockTypePos, BlockTypeLen; | 714 | int rest_pixel, idx, max_pos, pos, extra_pos, block_len, block_type_pos, block_type_len; |
715 | unsigned char BlockByte, BlockCode, BlockType, BlockTypeByte, Integrator; | 715 | unsigned char block_byte, block_code, block_type, block_type_byte, integrator; |
716 | 716 | ||
717 | Integrator = 0; | 717 | integrator = 0; |
718 | Pos = *StartPos; | 718 | pos = *start_pos; |
719 | BlockTypePos = *BlockTypeStartPos; | 719 | block_type_pos = *block_typestart_pos; |
720 | MaxPos = 396; //Pos + Len; | 720 | max_pos = 396; //pos + len; |
721 | ExtraPos = Pos; | 721 | extra_pos = pos; |
722 | BlockLen = 0; | 722 | block_len = 0; |
723 | BlockByte = 0; | 723 | block_byte = 0; |
724 | BlockCode = 0; | 724 | block_code = 0; |
725 | BlockType = 0; | 725 | block_type = 0; |
726 | BlockTypeByte = 0; | 726 | block_type_byte = 0; |
727 | BlockTypeLen = 0; | 727 | block_type_len = 0; |
728 | RestPixel = Len; | 728 | rest_pixel = len; |
729 | 729 | ||
730 | for (Idx = 0; Idx < Len; Idx++) { | 730 | for (idx = 0; idx < len; idx++) { |
731 | 731 | ||
732 | if (BlockLen == 0) { | 732 | if (block_len == 0) { |
733 | if (BlockTypeLen==0) { | 733 | if (block_type_len==0) { |
734 | BlockTypeByte = Compressed[BlockTypePos]; | 734 | block_type_byte = compressed[block_type_pos]; |
735 | BlockTypePos++; | 735 | block_type_pos++; |
736 | BlockTypeLen = 4; | 736 | block_type_len = 4; |
737 | } | 737 | } |
738 | BlockType = (BlockTypeByte & 0xC0) >> 6; | 738 | block_type = (block_type_byte & 0xC0) >> 6; |
739 | 739 | ||
740 | //statistic: | 740 | //statistic: |
741 | usbvision->ComprBlockTypes[BlockType]++; | 741 | usbvision->compr_block_types[block_type]++; |
742 | 742 | ||
743 | Pos = ExtraPos; | 743 | pos = extra_pos; |
744 | if (BlockType == 0) { | 744 | if (block_type == 0) { |
745 | if(RestPixel >= 24) { | 745 | if(rest_pixel >= 24) { |
746 | Idx += 23; | 746 | idx += 23; |
747 | RestPixel -= 24; | 747 | rest_pixel -= 24; |
748 | Integrator = Decompressed[Idx]; | 748 | integrator = decompressed[idx]; |
749 | } else { | 749 | } else { |
750 | Idx += RestPixel - 1; | 750 | idx += rest_pixel - 1; |
751 | RestPixel = 0; | 751 | rest_pixel = 0; |
752 | } | 752 | } |
753 | } else { | 753 | } else { |
754 | BlockCode = Compressed[Pos]; | 754 | block_code = compressed[pos]; |
755 | Pos++; | 755 | pos++; |
756 | if (RestPixel >= 24) { | 756 | if (rest_pixel >= 24) { |
757 | BlockLen = 24; | 757 | block_len = 24; |
758 | } else { | 758 | } else { |
759 | BlockLen = RestPixel; | 759 | block_len = rest_pixel; |
760 | } | 760 | } |
761 | RestPixel -= BlockLen; | 761 | rest_pixel -= block_len; |
762 | ExtraPos = Pos + (BlockLen / 4); | 762 | extra_pos = pos + (block_len / 4); |
763 | } | 763 | } |
764 | BlockTypeByte <<= 2; | 764 | block_type_byte <<= 2; |
765 | BlockTypeLen -= 1; | 765 | block_type_len -= 1; |
766 | } | 766 | } |
767 | if (BlockLen > 0) { | 767 | if (block_len > 0) { |
768 | if ((BlockLen%4) == 0) { | 768 | if ((block_len%4) == 0) { |
769 | BlockByte = Compressed[Pos]; | 769 | block_byte = compressed[pos]; |
770 | Pos++; | 770 | pos++; |
771 | } | 771 | } |
772 | if (BlockType == 1) { //inter Block | 772 | if (block_type == 1) { //inter Block |
773 | Integrator = Decompressed[Idx]; | 773 | integrator = decompressed[idx]; |
774 | } | 774 | } |
775 | switch (BlockByte & 0xC0) { | 775 | switch (block_byte & 0xC0) { |
776 | case 0x03<<6: | 776 | case 0x03<<6: |
777 | Integrator += Compressed[ExtraPos]; | 777 | integrator += compressed[extra_pos]; |
778 | ExtraPos++; | 778 | extra_pos++; |
779 | break; | 779 | break; |
780 | case 0x02<<6: | 780 | case 0x02<<6: |
781 | Integrator += BlockCode; | 781 | integrator += block_code; |
782 | break; | 782 | break; |
783 | case 0x00: | 783 | case 0x00: |
784 | Integrator -= BlockCode; | 784 | integrator -= block_code; |
785 | break; | 785 | break; |
786 | } | 786 | } |
787 | Decompressed[Idx] = Integrator; | 787 | decompressed[idx] = integrator; |
788 | BlockByte <<= 2; | 788 | block_byte <<= 2; |
789 | BlockLen -= 1; | 789 | block_len -= 1; |
790 | } | 790 | } |
791 | } | 791 | } |
792 | *StartPos = ExtraPos; | 792 | *start_pos = extra_pos; |
793 | *BlockTypeStartPos = BlockTypePos; | 793 | *block_typestart_pos = block_type_pos; |
794 | return Idx; | 794 | return idx; |
795 | } | 795 | } |
796 | 796 | ||
797 | 797 | ||
@@ -803,7 +803,7 @@ static int usbvision_decompress(struct usb_usbvision *usbvision,unsigned char *C | |||
803 | * number of bytes (RGB) to the *pcopylen. | 803 | * number of bytes (RGB) to the *pcopylen. |
804 | * | 804 | * |
805 | */ | 805 | */ |
806 | static enum ParseState usbvision_parse_compress(struct usb_usbvision *usbvision, | 806 | static enum parse_state usbvision_parse_compress(struct usb_usbvision *usbvision, |
807 | long *pcopylen) | 807 | long *pcopylen) |
808 | { | 808 | { |
809 | #define USBVISION_STRIP_MAGIC 0x5A | 809 | #define USBVISION_STRIP_MAGIC 0x5A |
@@ -812,16 +812,16 @@ static enum ParseState usbvision_parse_compress(struct usb_usbvision *usbvision, | |||
812 | 812 | ||
813 | struct usbvision_frame *frame; | 813 | struct usbvision_frame *frame; |
814 | unsigned char *f,*u = NULL ,*v = NULL; | 814 | unsigned char *f,*u = NULL ,*v = NULL; |
815 | unsigned char StripData[USBVISION_STRIP_LEN_MAX]; | 815 | unsigned char strip_data[USBVISION_STRIP_LEN_MAX]; |
816 | unsigned char StripHeader[USBVISION_STRIP_HEADER_LEN]; | 816 | unsigned char strip_header[USBVISION_STRIP_HEADER_LEN]; |
817 | int Idx, IdxEnd, StripLen, StripPtr, StartBlockPos, BlockPos, BlockTypePos; | 817 | int idx, idx_end, strip_len, strip_ptr, Startblock_pos, block_pos, block_type_pos; |
818 | int clipmask_index, bytes_per_pixel, rc; | 818 | int clipmask_index, bytes_per_pixel, rc; |
819 | int imageSize; | 819 | int image_size; |
820 | unsigned char rv, gv, bv; | 820 | unsigned char rv, gv, bv; |
821 | static unsigned char *Y, *U, *V; | 821 | static unsigned char *Y, *U, *V; |
822 | 822 | ||
823 | frame = usbvision->curFrame; | 823 | frame = usbvision->cur_frame; |
824 | imageSize = frame->frmwidth * frame->frmheight; | 824 | image_size = frame->frmwidth * frame->frmheight; |
825 | if ( (frame->v4l2_format.format == V4L2_PIX_FMT_YUV422P) || | 825 | if ( (frame->v4l2_format.format == V4L2_PIX_FMT_YUV422P) || |
826 | (frame->v4l2_format.format == V4L2_PIX_FMT_YVU420) ) { // this is a planar format | 826 | (frame->v4l2_format.format == V4L2_PIX_FMT_YVU420) ) { // this is a planar format |
827 | //... v4l2_linesize not used here. | 827 | //... v4l2_linesize not used here. |
@@ -833,14 +833,14 @@ static enum ParseState usbvision_parse_compress(struct usb_usbvision *usbvision, | |||
833 | // get base of u and b planes add halfoffset | 833 | // get base of u and b planes add halfoffset |
834 | 834 | ||
835 | u = frame->data | 835 | u = frame->data |
836 | + imageSize | 836 | + image_size |
837 | + (frame->frmwidth >>1) * frame->curline ; | 837 | + (frame->frmwidth >>1) * frame->curline ; |
838 | v = u + (imageSize >>1 ); | 838 | v = u + (image_size >>1 ); |
839 | 839 | ||
840 | } else if (frame->v4l2_format.format == V4L2_PIX_FMT_YVU420){ | 840 | } else if (frame->v4l2_format.format == V4L2_PIX_FMT_YVU420){ |
841 | 841 | ||
842 | v = frame->data + imageSize + ((frame->curline* (frame->width))>>2) ; | 842 | v = frame->data + image_size + ((frame->curline* (frame->width))>>2) ; |
843 | u = v + (imageSize >>2) ; | 843 | u = v + (image_size >>2) ; |
844 | } | 844 | } |
845 | 845 | ||
846 | if (frame->curline == 0) { | 846 | if (frame->curline == 0) { |
@@ -848,112 +848,112 @@ static enum ParseState usbvision_parse_compress(struct usb_usbvision *usbvision, | |||
848 | } | 848 | } |
849 | 849 | ||
850 | if (scratch_len(usbvision) < USBVISION_STRIP_HEADER_LEN) { | 850 | if (scratch_len(usbvision) < USBVISION_STRIP_HEADER_LEN) { |
851 | return ParseState_Out; | 851 | return parse_state_out; |
852 | } | 852 | } |
853 | 853 | ||
854 | //get strip header without changing the scratch_read_ptr | 854 | //get strip header without changing the scratch_read_ptr |
855 | scratch_set_extra_ptr(usbvision, &StripPtr, 0); | 855 | scratch_set_extra_ptr(usbvision, &strip_ptr, 0); |
856 | scratch_get_extra(usbvision, &StripHeader[0], &StripPtr, | 856 | scratch_get_extra(usbvision, &strip_header[0], &strip_ptr, |
857 | USBVISION_STRIP_HEADER_LEN); | 857 | USBVISION_STRIP_HEADER_LEN); |
858 | 858 | ||
859 | if (StripHeader[0] != USBVISION_STRIP_MAGIC) { | 859 | if (strip_header[0] != USBVISION_STRIP_MAGIC) { |
860 | // wrong strip magic | 860 | // wrong strip magic |
861 | usbvision->stripMagicErrors++; | 861 | usbvision->strip_magic_errors++; |
862 | return ParseState_NextFrame; | 862 | return parse_state_next_frame; |
863 | } | 863 | } |
864 | 864 | ||
865 | if (frame->curline != (int)StripHeader[2]) { | 865 | if (frame->curline != (int)strip_header[2]) { |
866 | //line number missmatch error | 866 | //line number missmatch error |
867 | usbvision->stripLineNumberErrors++; | 867 | usbvision->strip_line_number_errors++; |
868 | } | 868 | } |
869 | 869 | ||
870 | StripLen = 2 * (unsigned int)StripHeader[1]; | 870 | strip_len = 2 * (unsigned int)strip_header[1]; |
871 | if (StripLen > USBVISION_STRIP_LEN_MAX) { | 871 | if (strip_len > USBVISION_STRIP_LEN_MAX) { |
872 | // strip overrun | 872 | // strip overrun |
873 | // I think this never happens | 873 | // I think this never happens |
874 | usbvision_request_intra(usbvision); | 874 | usbvision_request_intra(usbvision); |
875 | } | 875 | } |
876 | 876 | ||
877 | if (scratch_len(usbvision) < StripLen) { | 877 | if (scratch_len(usbvision) < strip_len) { |
878 | //there is not enough data for the strip | 878 | //there is not enough data for the strip |
879 | return ParseState_Out; | 879 | return parse_state_out; |
880 | } | 880 | } |
881 | 881 | ||
882 | if (usbvision->IntraFrameBuffer) { | 882 | if (usbvision->intra_frame_buffer) { |
883 | Y = usbvision->IntraFrameBuffer + frame->frmwidth * frame->curline; | 883 | Y = usbvision->intra_frame_buffer + frame->frmwidth * frame->curline; |
884 | U = usbvision->IntraFrameBuffer + imageSize + (frame->frmwidth / 2) * (frame->curline / 2); | 884 | U = usbvision->intra_frame_buffer + image_size + (frame->frmwidth / 2) * (frame->curline / 2); |
885 | V = usbvision->IntraFrameBuffer + imageSize / 4 * 5 + (frame->frmwidth / 2) * (frame->curline / 2); | 885 | V = usbvision->intra_frame_buffer + image_size / 4 * 5 + (frame->frmwidth / 2) * (frame->curline / 2); |
886 | } | 886 | } |
887 | else { | 887 | else { |
888 | return ParseState_NextFrame; | 888 | return parse_state_next_frame; |
889 | } | 889 | } |
890 | 890 | ||
891 | bytes_per_pixel = frame->v4l2_format.bytes_per_pixel; | 891 | bytes_per_pixel = frame->v4l2_format.bytes_per_pixel; |
892 | clipmask_index = frame->curline * MAX_FRAME_WIDTH; | 892 | clipmask_index = frame->curline * MAX_FRAME_WIDTH; |
893 | 893 | ||
894 | scratch_get(usbvision, StripData, StripLen); | 894 | scratch_get(usbvision, strip_data, strip_len); |
895 | 895 | ||
896 | IdxEnd = frame->frmwidth; | 896 | idx_end = frame->frmwidth; |
897 | BlockTypePos = USBVISION_STRIP_HEADER_LEN; | 897 | block_type_pos = USBVISION_STRIP_HEADER_LEN; |
898 | StartBlockPos = BlockTypePos + (IdxEnd - 1) / 96 + (IdxEnd / 2 - 1) / 96 + 2; | 898 | Startblock_pos = block_type_pos + (idx_end - 1) / 96 + (idx_end / 2 - 1) / 96 + 2; |
899 | BlockPos = StartBlockPos; | 899 | block_pos = Startblock_pos; |
900 | 900 | ||
901 | usbvision->BlockPos = BlockPos; | 901 | usbvision->block_pos = block_pos; |
902 | 902 | ||
903 | if ((rc = usbvision_decompress(usbvision, StripData, Y, &BlockPos, &BlockTypePos, IdxEnd)) != IdxEnd) { | 903 | if ((rc = usbvision_decompress(usbvision, strip_data, Y, &block_pos, &block_type_pos, idx_end)) != idx_end) { |
904 | //return ParseState_Continue; | 904 | //return parse_state_continue; |
905 | } | 905 | } |
906 | if (StripLen > usbvision->maxStripLen) { | 906 | if (strip_len > usbvision->max_strip_len) { |
907 | usbvision->maxStripLen = StripLen; | 907 | usbvision->max_strip_len = strip_len; |
908 | } | 908 | } |
909 | 909 | ||
910 | if (frame->curline%2) { | 910 | if (frame->curline%2) { |
911 | if ((rc = usbvision_decompress(usbvision, StripData, V, &BlockPos, &BlockTypePos, IdxEnd/2)) != IdxEnd/2) { | 911 | if ((rc = usbvision_decompress(usbvision, strip_data, V, &block_pos, &block_type_pos, idx_end/2)) != idx_end/2) { |
912 | //return ParseState_Continue; | 912 | //return parse_state_continue; |
913 | } | 913 | } |
914 | } | 914 | } |
915 | else { | 915 | else { |
916 | if ((rc = usbvision_decompress(usbvision, StripData, U, &BlockPos, &BlockTypePos, IdxEnd/2)) != IdxEnd/2) { | 916 | if ((rc = usbvision_decompress(usbvision, strip_data, U, &block_pos, &block_type_pos, idx_end/2)) != idx_end/2) { |
917 | //return ParseState_Continue; | 917 | //return parse_state_continue; |
918 | } | 918 | } |
919 | } | 919 | } |
920 | 920 | ||
921 | if (BlockPos > usbvision->comprBlockPos) { | 921 | if (block_pos > usbvision->comprblock_pos) { |
922 | usbvision->comprBlockPos = BlockPos; | 922 | usbvision->comprblock_pos = block_pos; |
923 | } | 923 | } |
924 | if (BlockPos > StripLen) { | 924 | if (block_pos > strip_len) { |
925 | usbvision->stripLenErrors++; | 925 | usbvision->strip_len_errors++; |
926 | } | 926 | } |
927 | 927 | ||
928 | for (Idx = 0; Idx < IdxEnd; Idx++) { | 928 | for (idx = 0; idx < idx_end; idx++) { |
929 | if(frame->v4l2_format.format == V4L2_PIX_FMT_YUYV) { | 929 | if(frame->v4l2_format.format == V4L2_PIX_FMT_YUYV) { |
930 | *f++ = Y[Idx]; | 930 | *f++ = Y[idx]; |
931 | *f++ = Idx & 0x01 ? U[Idx/2] : V[Idx/2]; | 931 | *f++ = idx & 0x01 ? U[idx/2] : V[idx/2]; |
932 | } | 932 | } |
933 | else if(frame->v4l2_format.format == V4L2_PIX_FMT_YUV422P) { | 933 | else if(frame->v4l2_format.format == V4L2_PIX_FMT_YUV422P) { |
934 | *f++ = Y[Idx]; | 934 | *f++ = Y[idx]; |
935 | if ( Idx & 0x01) | 935 | if ( idx & 0x01) |
936 | *u++ = U[Idx>>1] ; | 936 | *u++ = U[idx>>1] ; |
937 | else | 937 | else |
938 | *v++ = V[Idx>>1]; | 938 | *v++ = V[idx>>1]; |
939 | } | 939 | } |
940 | else if (frame->v4l2_format.format == V4L2_PIX_FMT_YVU420) { | 940 | else if (frame->v4l2_format.format == V4L2_PIX_FMT_YVU420) { |
941 | *f++ = Y [Idx]; | 941 | *f++ = Y [idx]; |
942 | if ( !(( Idx & 0x01 ) | ( frame->curline & 0x01 )) ){ | 942 | if ( !(( idx & 0x01 ) | ( frame->curline & 0x01 )) ){ |
943 | 943 | ||
944 | /* only need do this for 1 in 4 pixels */ | 944 | /* only need do this for 1 in 4 pixels */ |
945 | /* intraframe buffer is YUV420 format */ | 945 | /* intraframe buffer is YUV420 format */ |
946 | 946 | ||
947 | *u++ = U[Idx >>1]; | 947 | *u++ = U[idx >>1]; |
948 | *v++ = V[Idx >>1]; | 948 | *v++ = V[idx >>1]; |
949 | } | 949 | } |
950 | 950 | ||
951 | } | 951 | } |
952 | else { | 952 | else { |
953 | YUV_TO_RGB_BY_THE_BOOK(Y[Idx], U[Idx/2], V[Idx/2], rv, gv, bv); | 953 | YUV_TO_RGB_BY_THE_BOOK(Y[idx], U[idx/2], V[idx/2], rv, gv, bv); |
954 | switch (frame->v4l2_format.format) { | 954 | switch (frame->v4l2_format.format) { |
955 | case V4L2_PIX_FMT_GREY: | 955 | case V4L2_PIX_FMT_GREY: |
956 | *f++ = Y[Idx]; | 956 | *f++ = Y[idx]; |
957 | break; | 957 | break; |
958 | case V4L2_PIX_FMT_RGB555: | 958 | case V4L2_PIX_FMT_RGB555: |
959 | *f++ = (0x1F & rv) | | 959 | *f++ = (0x1F & rv) | |
@@ -991,10 +991,10 @@ static enum ParseState usbvision_parse_compress(struct usb_usbvision *usbvision, | |||
991 | frame->curline += 1; | 991 | frame->curline += 1; |
992 | 992 | ||
993 | if (frame->curline >= frame->frmheight) { | 993 | if (frame->curline >= frame->frmheight) { |
994 | return ParseState_NextFrame; | 994 | return parse_state_next_frame; |
995 | } | 995 | } |
996 | else { | 996 | else { |
997 | return ParseState_Continue; | 997 | return parse_state_continue; |
998 | } | 998 | } |
999 | 999 | ||
1000 | } | 1000 | } |
@@ -1008,7 +1008,7 @@ static enum ParseState usbvision_parse_compress(struct usb_usbvision *usbvision, | |||
1008 | * number of bytes (RGB) to the *pcopylen. | 1008 | * number of bytes (RGB) to the *pcopylen. |
1009 | * | 1009 | * |
1010 | */ | 1010 | */ |
1011 | static enum ParseState usbvision_parse_lines_420(struct usb_usbvision *usbvision, | 1011 | static enum parse_state usbvision_parse_lines_420(struct usb_usbvision *usbvision, |
1012 | long *pcopylen) | 1012 | long *pcopylen) |
1013 | { | 1013 | { |
1014 | struct usbvision_frame *frame; | 1014 | struct usbvision_frame *frame; |
@@ -1028,7 +1028,7 @@ static enum ParseState usbvision_parse_lines_420(struct usb_usbvision *usbvision | |||
1028 | int clipmask_even_index, clipmask_odd_index, bytes_per_pixel; | 1028 | int clipmask_even_index, clipmask_odd_index, bytes_per_pixel; |
1029 | int clipmask_add, stretch_bytes; | 1029 | int clipmask_add, stretch_bytes; |
1030 | 1030 | ||
1031 | frame = usbvision->curFrame; | 1031 | frame = usbvision->cur_frame; |
1032 | f_even = frame->data + (frame->v4l2_linesize * frame->curline); | 1032 | f_even = frame->data + (frame->v4l2_linesize * frame->curline); |
1033 | f_odd = f_even + frame->v4l2_linesize * usbvision->stretch_height; | 1033 | f_odd = f_even + frame->v4l2_linesize * usbvision->stretch_height; |
1034 | 1034 | ||
@@ -1040,15 +1040,15 @@ static enum ParseState usbvision_parse_lines_420(struct usb_usbvision *usbvision | |||
1040 | clipmask_even_index = frame->curline * MAX_FRAME_WIDTH; | 1040 | clipmask_even_index = frame->curline * MAX_FRAME_WIDTH; |
1041 | clipmask_odd_index = clipmask_even_index + MAX_FRAME_WIDTH; | 1041 | clipmask_odd_index = clipmask_even_index + MAX_FRAME_WIDTH; |
1042 | clipmask_add = usbvision->stretch_width; | 1042 | clipmask_add = usbvision->stretch_width; |
1043 | pixel_per_line = frame->isocHeader.frameWidth; | 1043 | pixel_per_line = frame->isoc_header.frame_width; |
1044 | 1044 | ||
1045 | if (scratch_len(usbvision) < (int)pixel_per_line * 3) { | 1045 | if (scratch_len(usbvision) < (int)pixel_per_line * 3) { |
1046 | //printk(KERN_DEBUG "out of data, need %d\n", len); | 1046 | //printk(KERN_DEBUG "out of data, need %d\n", len); |
1047 | return ParseState_Out; | 1047 | return parse_state_out; |
1048 | } | 1048 | } |
1049 | 1049 | ||
1050 | if ((frame->curline + 1) >= frame->frmheight) { | 1050 | if ((frame->curline + 1) >= frame->frmheight) { |
1051 | return ParseState_NextFrame; | 1051 | return parse_state_next_frame; |
1052 | } | 1052 | } |
1053 | 1053 | ||
1054 | block_split = (pixel_per_line%y_block_size) ? 1 : 0; //are some blocks splitted into different lines? | 1054 | block_split = (pixel_per_line%y_block_size) ? 1 : 0; //are some blocks splitted into different lines? |
@@ -1272,9 +1272,9 @@ static enum ParseState usbvision_parse_lines_420(struct usb_usbvision *usbvision | |||
1272 | *pcopylen += frame->v4l2_linesize * 2 * usbvision->stretch_height; | 1272 | *pcopylen += frame->v4l2_linesize * 2 * usbvision->stretch_height; |
1273 | 1273 | ||
1274 | if (frame->curline >= frame->frmheight) | 1274 | if (frame->curline >= frame->frmheight) |
1275 | return ParseState_NextFrame; | 1275 | return parse_state_next_frame; |
1276 | else | 1276 | else |
1277 | return ParseState_Continue; | 1277 | return parse_state_continue; |
1278 | } | 1278 | } |
1279 | 1279 | ||
1280 | /* | 1280 | /* |
@@ -1288,53 +1288,53 @@ static enum ParseState usbvision_parse_lines_420(struct usb_usbvision *usbvision | |||
1288 | static void usbvision_parse_data(struct usb_usbvision *usbvision) | 1288 | static void usbvision_parse_data(struct usb_usbvision *usbvision) |
1289 | { | 1289 | { |
1290 | struct usbvision_frame *frame; | 1290 | struct usbvision_frame *frame; |
1291 | enum ParseState newstate; | 1291 | enum parse_state newstate; |
1292 | long copylen = 0; | 1292 | long copylen = 0; |
1293 | unsigned long lock_flags; | 1293 | unsigned long lock_flags; |
1294 | 1294 | ||
1295 | frame = usbvision->curFrame; | 1295 | frame = usbvision->cur_frame; |
1296 | 1296 | ||
1297 | PDEBUG(DBG_PARSE, "parsing len=%d\n", scratch_len(usbvision)); | 1297 | PDEBUG(DBG_PARSE, "parsing len=%d\n", scratch_len(usbvision)); |
1298 | 1298 | ||
1299 | while (1) { | 1299 | while (1) { |
1300 | 1300 | ||
1301 | newstate = ParseState_Out; | 1301 | newstate = parse_state_out; |
1302 | if (scratch_len(usbvision)) { | 1302 | if (scratch_len(usbvision)) { |
1303 | if (frame->scanstate == ScanState_Scanning) { | 1303 | if (frame->scanstate == scan_state_scanning) { |
1304 | newstate = usbvision_find_header(usbvision); | 1304 | newstate = usbvision_find_header(usbvision); |
1305 | } | 1305 | } |
1306 | else if (frame->scanstate == ScanState_Lines) { | 1306 | else if (frame->scanstate == scan_state_lines) { |
1307 | if (usbvision->isocMode == ISOC_MODE_YUV420) { | 1307 | if (usbvision->isoc_mode == ISOC_MODE_YUV420) { |
1308 | newstate = usbvision_parse_lines_420(usbvision, ©len); | 1308 | newstate = usbvision_parse_lines_420(usbvision, ©len); |
1309 | } | 1309 | } |
1310 | else if (usbvision->isocMode == ISOC_MODE_YUV422) { | 1310 | else if (usbvision->isoc_mode == ISOC_MODE_YUV422) { |
1311 | newstate = usbvision_parse_lines_422(usbvision, ©len); | 1311 | newstate = usbvision_parse_lines_422(usbvision, ©len); |
1312 | } | 1312 | } |
1313 | else if (usbvision->isocMode == ISOC_MODE_COMPRESS) { | 1313 | else if (usbvision->isoc_mode == ISOC_MODE_COMPRESS) { |
1314 | newstate = usbvision_parse_compress(usbvision, ©len); | 1314 | newstate = usbvision_parse_compress(usbvision, ©len); |
1315 | } | 1315 | } |
1316 | 1316 | ||
1317 | } | 1317 | } |
1318 | } | 1318 | } |
1319 | if (newstate == ParseState_Continue) { | 1319 | if (newstate == parse_state_continue) { |
1320 | continue; | 1320 | continue; |
1321 | } | 1321 | } |
1322 | else if ((newstate == ParseState_NextFrame) || (newstate == ParseState_Out)) { | 1322 | else if ((newstate == parse_state_next_frame) || (newstate == parse_state_out)) { |
1323 | break; | 1323 | break; |
1324 | } | 1324 | } |
1325 | else { | 1325 | else { |
1326 | return; /* ParseState_EndParse */ | 1326 | return; /* parse_state_end_parse */ |
1327 | } | 1327 | } |
1328 | } | 1328 | } |
1329 | 1329 | ||
1330 | if (newstate == ParseState_NextFrame) { | 1330 | if (newstate == parse_state_next_frame) { |
1331 | frame->grabstate = FrameState_Done; | 1331 | frame->grabstate = frame_state_done; |
1332 | do_gettimeofday(&(frame->timestamp)); | 1332 | do_gettimeofday(&(frame->timestamp)); |
1333 | frame->sequence = usbvision->frame_num; | 1333 | frame->sequence = usbvision->frame_num; |
1334 | 1334 | ||
1335 | spin_lock_irqsave(&usbvision->queue_lock, lock_flags); | 1335 | spin_lock_irqsave(&usbvision->queue_lock, lock_flags); |
1336 | list_move_tail(&(frame->frame), &usbvision->outqueue); | 1336 | list_move_tail(&(frame->frame), &usbvision->outqueue); |
1337 | usbvision->curFrame = NULL; | 1337 | usbvision->cur_frame = NULL; |
1338 | spin_unlock_irqrestore(&usbvision->queue_lock, lock_flags); | 1338 | spin_unlock_irqrestore(&usbvision->queue_lock, lock_flags); |
1339 | 1339 | ||
1340 | usbvision->frame_num++; | 1340 | usbvision->frame_num++; |
@@ -1346,7 +1346,7 @@ static void usbvision_parse_data(struct usb_usbvision *usbvision) | |||
1346 | } | 1346 | } |
1347 | } | 1347 | } |
1348 | else | 1348 | else |
1349 | frame->grabstate = FrameState_Grabbing; | 1349 | frame->grabstate = frame_state_grabbing; |
1350 | 1350 | ||
1351 | 1351 | ||
1352 | /* Update the frame's uncompressed length. */ | 1352 | /* Update the frame's uncompressed length. */ |
@@ -1372,32 +1372,32 @@ static int usbvision_compress_isochronous(struct usb_usbvision *usbvision, | |||
1372 | /* Detect and ignore errored packets */ | 1372 | /* Detect and ignore errored packets */ |
1373 | if (packet_stat) { // packet_stat != 0 ????????????? | 1373 | if (packet_stat) { // packet_stat != 0 ????????????? |
1374 | PDEBUG(DBG_ISOC, "data error: [%d] len=%d, status=%X", i, packet_len, packet_stat); | 1374 | PDEBUG(DBG_ISOC, "data error: [%d] len=%d, status=%X", i, packet_len, packet_stat); |
1375 | usbvision->isocErrCount++; | 1375 | usbvision->isoc_err_count++; |
1376 | continue; | 1376 | continue; |
1377 | } | 1377 | } |
1378 | 1378 | ||
1379 | /* Detect and ignore empty packets */ | 1379 | /* Detect and ignore empty packets */ |
1380 | if (packet_len < 0) { | 1380 | if (packet_len < 0) { |
1381 | PDEBUG(DBG_ISOC, "error packet [%d]", i); | 1381 | PDEBUG(DBG_ISOC, "error packet [%d]", i); |
1382 | usbvision->isocSkipCount++; | 1382 | usbvision->isoc_skip_count++; |
1383 | continue; | 1383 | continue; |
1384 | } | 1384 | } |
1385 | else if (packet_len == 0) { /* Frame end ????? */ | 1385 | else if (packet_len == 0) { /* Frame end ????? */ |
1386 | PDEBUG(DBG_ISOC, "null packet [%d]", i); | 1386 | PDEBUG(DBG_ISOC, "null packet [%d]", i); |
1387 | usbvision->isocstate=IsocState_NoFrame; | 1387 | usbvision->isocstate=isoc_state_no_frame; |
1388 | usbvision->isocSkipCount++; | 1388 | usbvision->isoc_skip_count++; |
1389 | continue; | 1389 | continue; |
1390 | } | 1390 | } |
1391 | else if (packet_len > usbvision->isocPacketSize) { | 1391 | else if (packet_len > usbvision->isoc_packet_size) { |
1392 | PDEBUG(DBG_ISOC, "packet[%d] > isocPacketSize", i); | 1392 | PDEBUG(DBG_ISOC, "packet[%d] > isoc_packet_size", i); |
1393 | usbvision->isocSkipCount++; | 1393 | usbvision->isoc_skip_count++; |
1394 | continue; | 1394 | continue; |
1395 | } | 1395 | } |
1396 | 1396 | ||
1397 | PDEBUG(DBG_ISOC, "packet ok [%d] len=%d", i, packet_len); | 1397 | PDEBUG(DBG_ISOC, "packet ok [%d] len=%d", i, packet_len); |
1398 | 1398 | ||
1399 | if (usbvision->isocstate==IsocState_NoFrame) { //new frame begins | 1399 | if (usbvision->isocstate==isoc_state_no_frame) { //new frame begins |
1400 | usbvision->isocstate=IsocState_InFrame; | 1400 | usbvision->isocstate=isoc_state_in_frame; |
1401 | scratch_mark_header(usbvision); | 1401 | scratch_mark_header(usbvision); |
1402 | usbvision_measure_bandwidth(usbvision); | 1402 | usbvision_measure_bandwidth(usbvision); |
1403 | PDEBUG(DBG_ISOC, "packet with header"); | 1403 | PDEBUG(DBG_ISOC, "packet with header"); |
@@ -1422,8 +1422,8 @@ static int usbvision_compress_isochronous(struct usb_usbvision *usbvision, | |||
1422 | /* Now we know that there is enough room in scratch buffer */ | 1422 | /* Now we know that there is enough room in scratch buffer */ |
1423 | scratch_put(usbvision, packet_data, packet_len); | 1423 | scratch_put(usbvision, packet_data, packet_len); |
1424 | totlen += packet_len; | 1424 | totlen += packet_len; |
1425 | usbvision->isocDataCount += packet_len; | 1425 | usbvision->isoc_data_count += packet_len; |
1426 | usbvision->isocPacketCount++; | 1426 | usbvision->isoc_packet_count++; |
1427 | } | 1427 | } |
1428 | #if ENABLE_HEXDUMP | 1428 | #if ENABLE_HEXDUMP |
1429 | if (totlen > 0) { | 1429 | if (totlen > 0) { |
@@ -1438,13 +1438,13 @@ static int usbvision_compress_isochronous(struct usb_usbvision *usbvision, | |||
1438 | return totlen; | 1438 | return totlen; |
1439 | } | 1439 | } |
1440 | 1440 | ||
1441 | static void usbvision_isocIrq(struct urb *urb) | 1441 | static void usbvision_isoc_irq(struct urb *urb) |
1442 | { | 1442 | { |
1443 | int errCode = 0; | 1443 | int err_code = 0; |
1444 | int len; | 1444 | int len; |
1445 | struct usb_usbvision *usbvision = urb->context; | 1445 | struct usb_usbvision *usbvision = urb->context; |
1446 | int i; | 1446 | int i; |
1447 | unsigned long startTime = jiffies; | 1447 | unsigned long start_time = jiffies; |
1448 | struct usbvision_frame **f; | 1448 | struct usbvision_frame **f; |
1449 | 1449 | ||
1450 | /* We don't want to do anything if we are about to be removed! */ | 1450 | /* We don't want to do anything if we are about to be removed! */ |
@@ -1456,14 +1456,14 @@ static void usbvision_isocIrq(struct urb *urb) | |||
1456 | return; | 1456 | return; |
1457 | } | 1457 | } |
1458 | 1458 | ||
1459 | f = &usbvision->curFrame; | 1459 | f = &usbvision->cur_frame; |
1460 | 1460 | ||
1461 | /* Manage streaming interruption */ | 1461 | /* Manage streaming interruption */ |
1462 | if (usbvision->streaming == Stream_Interrupt) { | 1462 | if (usbvision->streaming == stream_interrupt) { |
1463 | usbvision->streaming = Stream_Idle; | 1463 | usbvision->streaming = stream_idle; |
1464 | if ((*f)) { | 1464 | if ((*f)) { |
1465 | (*f)->grabstate = FrameState_Ready; | 1465 | (*f)->grabstate = frame_state_ready; |
1466 | (*f)->scanstate = ScanState_Scanning; | 1466 | (*f)->scanstate = scan_state_scanning; |
1467 | } | 1467 | } |
1468 | PDEBUG(DBG_IRQ, "stream interrupted"); | 1468 | PDEBUG(DBG_IRQ, "stream interrupted"); |
1469 | wake_up_interruptible(&usbvision->wait_stream); | 1469 | wake_up_interruptible(&usbvision->wait_stream); |
@@ -1472,10 +1472,10 @@ static void usbvision_isocIrq(struct urb *urb) | |||
1472 | /* Copy the data received into our scratch buffer */ | 1472 | /* Copy the data received into our scratch buffer */ |
1473 | len = usbvision_compress_isochronous(usbvision, urb); | 1473 | len = usbvision_compress_isochronous(usbvision, urb); |
1474 | 1474 | ||
1475 | usbvision->isocUrbCount++; | 1475 | usbvision->isoc_urb_count++; |
1476 | usbvision->urb_length = len; | 1476 | usbvision->urb_length = len; |
1477 | 1477 | ||
1478 | if (usbvision->streaming == Stream_On) { | 1478 | if (usbvision->streaming == stream_on) { |
1479 | 1479 | ||
1480 | /* If we collected enough data let's parse! */ | 1480 | /* If we collected enough data let's parse! */ |
1481 | if ((scratch_len(usbvision) > USBVISION_HEADER_LENGTH) && | 1481 | if ((scratch_len(usbvision) > USBVISION_HEADER_LENGTH) && |
@@ -1500,7 +1500,7 @@ static void usbvision_isocIrq(struct urb *urb) | |||
1500 | scratch_reset(usbvision); | 1500 | scratch_reset(usbvision); |
1501 | } | 1501 | } |
1502 | 1502 | ||
1503 | usbvision->timeInIrq += jiffies - startTime; | 1503 | usbvision->time_in_irq += jiffies - start_time; |
1504 | 1504 | ||
1505 | for (i = 0; i < USBVISION_URB_FRAMES; i++) { | 1505 | for (i = 0; i < USBVISION_URB_FRAMES; i++) { |
1506 | urb->iso_frame_desc[i].status = 0; | 1506 | urb->iso_frame_desc[i].status = 0; |
@@ -1509,12 +1509,12 @@ static void usbvision_isocIrq(struct urb *urb) | |||
1509 | 1509 | ||
1510 | urb->status = 0; | 1510 | urb->status = 0; |
1511 | urb->dev = usbvision->dev; | 1511 | urb->dev = usbvision->dev; |
1512 | errCode = usb_submit_urb (urb, GFP_ATOMIC); | 1512 | err_code = usb_submit_urb (urb, GFP_ATOMIC); |
1513 | 1513 | ||
1514 | if(errCode) { | 1514 | if(err_code) { |
1515 | dev_err(&usbvision->dev->dev, | 1515 | dev_err(&usbvision->dev->dev, |
1516 | "%s: usb_submit_urb failed: error %d\n", | 1516 | "%s: usb_submit_urb failed: error %d\n", |
1517 | __func__, errCode); | 1517 | __func__, err_code); |
1518 | } | 1518 | } |
1519 | 1519 | ||
1520 | return; | 1520 | return; |
@@ -1533,21 +1533,21 @@ static void usbvision_isocIrq(struct urb *urb) | |||
1533 | 1533 | ||
1534 | int usbvision_read_reg(struct usb_usbvision *usbvision, unsigned char reg) | 1534 | int usbvision_read_reg(struct usb_usbvision *usbvision, unsigned char reg) |
1535 | { | 1535 | { |
1536 | int errCode = 0; | 1536 | int err_code = 0; |
1537 | unsigned char buffer[1]; | 1537 | unsigned char buffer[1]; |
1538 | 1538 | ||
1539 | if (!USBVISION_IS_OPERATIONAL(usbvision)) | 1539 | if (!USBVISION_IS_OPERATIONAL(usbvision)) |
1540 | return -1; | 1540 | return -1; |
1541 | 1541 | ||
1542 | errCode = usb_control_msg(usbvision->dev, usb_rcvctrlpipe(usbvision->dev, 1), | 1542 | err_code = usb_control_msg(usbvision->dev, usb_rcvctrlpipe(usbvision->dev, 1), |
1543 | USBVISION_OP_CODE, | 1543 | USBVISION_OP_CODE, |
1544 | USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_ENDPOINT, | 1544 | USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_ENDPOINT, |
1545 | 0, (__u16) reg, buffer, 1, HZ); | 1545 | 0, (__u16) reg, buffer, 1, HZ); |
1546 | 1546 | ||
1547 | if (errCode < 0) { | 1547 | if (err_code < 0) { |
1548 | dev_err(&usbvision->dev->dev, | 1548 | dev_err(&usbvision->dev->dev, |
1549 | "%s: failed: error %d\n", __func__, errCode); | 1549 | "%s: failed: error %d\n", __func__, err_code); |
1550 | return errCode; | 1550 | return err_code; |
1551 | } | 1551 | } |
1552 | return buffer[0]; | 1552 | return buffer[0]; |
1553 | } | 1553 | } |
@@ -1563,32 +1563,32 @@ int usbvision_read_reg(struct usb_usbvision *usbvision, unsigned char reg) | |||
1563 | int usbvision_write_reg(struct usb_usbvision *usbvision, unsigned char reg, | 1563 | int usbvision_write_reg(struct usb_usbvision *usbvision, unsigned char reg, |
1564 | unsigned char value) | 1564 | unsigned char value) |
1565 | { | 1565 | { |
1566 | int errCode = 0; | 1566 | int err_code = 0; |
1567 | 1567 | ||
1568 | if (!USBVISION_IS_OPERATIONAL(usbvision)) | 1568 | if (!USBVISION_IS_OPERATIONAL(usbvision)) |
1569 | return 0; | 1569 | return 0; |
1570 | 1570 | ||
1571 | errCode = usb_control_msg(usbvision->dev, usb_sndctrlpipe(usbvision->dev, 1), | 1571 | err_code = usb_control_msg(usbvision->dev, usb_sndctrlpipe(usbvision->dev, 1), |
1572 | USBVISION_OP_CODE, | 1572 | USBVISION_OP_CODE, |
1573 | USB_DIR_OUT | USB_TYPE_VENDOR | | 1573 | USB_DIR_OUT | USB_TYPE_VENDOR | |
1574 | USB_RECIP_ENDPOINT, 0, (__u16) reg, &value, 1, HZ); | 1574 | USB_RECIP_ENDPOINT, 0, (__u16) reg, &value, 1, HZ); |
1575 | 1575 | ||
1576 | if (errCode < 0) { | 1576 | if (err_code < 0) { |
1577 | dev_err(&usbvision->dev->dev, | 1577 | dev_err(&usbvision->dev->dev, |
1578 | "%s: failed: error %d\n", __func__, errCode); | 1578 | "%s: failed: error %d\n", __func__, err_code); |
1579 | } | 1579 | } |
1580 | return errCode; | 1580 | return err_code; |
1581 | } | 1581 | } |
1582 | 1582 | ||
1583 | 1583 | ||
1584 | static void usbvision_ctrlUrb_complete(struct urb *urb) | 1584 | static void usbvision_ctrl_urb_complete(struct urb *urb) |
1585 | { | 1585 | { |
1586 | struct usb_usbvision *usbvision = (struct usb_usbvision *)urb->context; | 1586 | struct usb_usbvision *usbvision = (struct usb_usbvision *)urb->context; |
1587 | 1587 | ||
1588 | PDEBUG(DBG_IRQ, ""); | 1588 | PDEBUG(DBG_IRQ, ""); |
1589 | usbvision->ctrlUrbBusy = 0; | 1589 | usbvision->ctrl_urb_busy = 0; |
1590 | if (waitqueue_active(&usbvision->ctrlUrb_wq)) { | 1590 | if (waitqueue_active(&usbvision->ctrl_urb_wq)) { |
1591 | wake_up_interruptible(&usbvision->ctrlUrb_wq); | 1591 | wake_up_interruptible(&usbvision->ctrl_urb_wq); |
1592 | } | 1592 | } |
1593 | } | 1593 | } |
1594 | 1594 | ||
@@ -1596,146 +1596,146 @@ static void usbvision_ctrlUrb_complete(struct urb *urb) | |||
1596 | static int usbvision_write_reg_irq(struct usb_usbvision *usbvision,int address, | 1596 | static int usbvision_write_reg_irq(struct usb_usbvision *usbvision,int address, |
1597 | unsigned char *data, int len) | 1597 | unsigned char *data, int len) |
1598 | { | 1598 | { |
1599 | int errCode = 0; | 1599 | int err_code = 0; |
1600 | 1600 | ||
1601 | PDEBUG(DBG_IRQ, ""); | 1601 | PDEBUG(DBG_IRQ, ""); |
1602 | if (len > 8) { | 1602 | if (len > 8) { |
1603 | return -EFAULT; | 1603 | return -EFAULT; |
1604 | } | 1604 | } |
1605 | if (usbvision->ctrlUrbBusy) { | 1605 | if (usbvision->ctrl_urb_busy) { |
1606 | return -EBUSY; | 1606 | return -EBUSY; |
1607 | } | 1607 | } |
1608 | usbvision->ctrlUrbBusy = 1; | 1608 | usbvision->ctrl_urb_busy = 1; |
1609 | 1609 | ||
1610 | usbvision->ctrlUrbSetup.bRequestType = USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_ENDPOINT; | 1610 | usbvision->ctrl_urb_setup.bRequestType = USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_ENDPOINT; |
1611 | usbvision->ctrlUrbSetup.bRequest = USBVISION_OP_CODE; | 1611 | usbvision->ctrl_urb_setup.bRequest = USBVISION_OP_CODE; |
1612 | usbvision->ctrlUrbSetup.wValue = 0; | 1612 | usbvision->ctrl_urb_setup.wValue = 0; |
1613 | usbvision->ctrlUrbSetup.wIndex = cpu_to_le16(address); | 1613 | usbvision->ctrl_urb_setup.wIndex = cpu_to_le16(address); |
1614 | usbvision->ctrlUrbSetup.wLength = cpu_to_le16(len); | 1614 | usbvision->ctrl_urb_setup.wLength = cpu_to_le16(len); |
1615 | usb_fill_control_urb (usbvision->ctrlUrb, usbvision->dev, | 1615 | usb_fill_control_urb (usbvision->ctrl_urb, usbvision->dev, |
1616 | usb_sndctrlpipe(usbvision->dev, 1), | 1616 | usb_sndctrlpipe(usbvision->dev, 1), |
1617 | (unsigned char *)&usbvision->ctrlUrbSetup, | 1617 | (unsigned char *)&usbvision->ctrl_urb_setup, |
1618 | (void *)usbvision->ctrlUrbBuffer, len, | 1618 | (void *)usbvision->ctrl_urb_buffer, len, |
1619 | usbvision_ctrlUrb_complete, | 1619 | usbvision_ctrl_urb_complete, |
1620 | (void *)usbvision); | 1620 | (void *)usbvision); |
1621 | 1621 | ||
1622 | memcpy(usbvision->ctrlUrbBuffer, data, len); | 1622 | memcpy(usbvision->ctrl_urb_buffer, data, len); |
1623 | 1623 | ||
1624 | errCode = usb_submit_urb(usbvision->ctrlUrb, GFP_ATOMIC); | 1624 | err_code = usb_submit_urb(usbvision->ctrl_urb, GFP_ATOMIC); |
1625 | if (errCode < 0) { | 1625 | if (err_code < 0) { |
1626 | // error in usb_submit_urb() | 1626 | // error in usb_submit_urb() |
1627 | usbvision->ctrlUrbBusy = 0; | 1627 | usbvision->ctrl_urb_busy = 0; |
1628 | } | 1628 | } |
1629 | PDEBUG(DBG_IRQ, "submit %d byte: error %d", len, errCode); | 1629 | PDEBUG(DBG_IRQ, "submit %d byte: error %d", len, err_code); |
1630 | return errCode; | 1630 | return err_code; |
1631 | } | 1631 | } |
1632 | 1632 | ||
1633 | 1633 | ||
1634 | static int usbvision_init_compression(struct usb_usbvision *usbvision) | 1634 | static int usbvision_init_compression(struct usb_usbvision *usbvision) |
1635 | { | 1635 | { |
1636 | int errCode = 0; | 1636 | int err_code = 0; |
1637 | 1637 | ||
1638 | usbvision->lastIsocFrameNum = -1; | 1638 | usbvision->last_isoc_frame_num = -1; |
1639 | usbvision->isocDataCount = 0; | 1639 | usbvision->isoc_data_count = 0; |
1640 | usbvision->isocPacketCount = 0; | 1640 | usbvision->isoc_packet_count = 0; |
1641 | usbvision->isocSkipCount = 0; | 1641 | usbvision->isoc_skip_count = 0; |
1642 | usbvision->comprLevel = 50; | 1642 | usbvision->compr_level = 50; |
1643 | usbvision->lastComprLevel = -1; | 1643 | usbvision->last_compr_level = -1; |
1644 | usbvision->isocUrbCount = 0; | 1644 | usbvision->isoc_urb_count = 0; |
1645 | usbvision->requestIntra = 1; | 1645 | usbvision->request_intra = 1; |
1646 | usbvision->isocMeasureBandwidthCount = 0; | 1646 | usbvision->isoc_measure_bandwidth_count = 0; |
1647 | 1647 | ||
1648 | return errCode; | 1648 | return err_code; |
1649 | } | 1649 | } |
1650 | 1650 | ||
1651 | /* this function measures the used bandwidth since last call | 1651 | /* this function measures the used bandwidth since last call |
1652 | * return: 0 : no error | 1652 | * return: 0 : no error |
1653 | * sets usedBandwidth to 1-100 : 1-100% of full bandwidth resp. to isocPacketSize | 1653 | * sets used_bandwidth to 1-100 : 1-100% of full bandwidth resp. to isoc_packet_size |
1654 | */ | 1654 | */ |
1655 | static int usbvision_measure_bandwidth (struct usb_usbvision *usbvision) | 1655 | static int usbvision_measure_bandwidth (struct usb_usbvision *usbvision) |
1656 | { | 1656 | { |
1657 | int errCode = 0; | 1657 | int err_code = 0; |
1658 | 1658 | ||
1659 | if (usbvision->isocMeasureBandwidthCount < 2) { // this gives an average bandwidth of 3 frames | 1659 | if (usbvision->isoc_measure_bandwidth_count < 2) { // this gives an average bandwidth of 3 frames |
1660 | usbvision->isocMeasureBandwidthCount++; | 1660 | usbvision->isoc_measure_bandwidth_count++; |
1661 | return errCode; | 1661 | return err_code; |
1662 | } | 1662 | } |
1663 | if ((usbvision->isocPacketSize > 0) && (usbvision->isocPacketCount > 0)) { | 1663 | if ((usbvision->isoc_packet_size > 0) && (usbvision->isoc_packet_count > 0)) { |
1664 | usbvision->usedBandwidth = usbvision->isocDataCount / | 1664 | usbvision->used_bandwidth = usbvision->isoc_data_count / |
1665 | (usbvision->isocPacketCount + usbvision->isocSkipCount) * | 1665 | (usbvision->isoc_packet_count + usbvision->isoc_skip_count) * |
1666 | 100 / usbvision->isocPacketSize; | 1666 | 100 / usbvision->isoc_packet_size; |
1667 | } | 1667 | } |
1668 | usbvision->isocMeasureBandwidthCount = 0; | 1668 | usbvision->isoc_measure_bandwidth_count = 0; |
1669 | usbvision->isocDataCount = 0; | 1669 | usbvision->isoc_data_count = 0; |
1670 | usbvision->isocPacketCount = 0; | 1670 | usbvision->isoc_packet_count = 0; |
1671 | usbvision->isocSkipCount = 0; | 1671 | usbvision->isoc_skip_count = 0; |
1672 | return errCode; | 1672 | return err_code; |
1673 | } | 1673 | } |
1674 | 1674 | ||
1675 | static int usbvision_adjust_compression (struct usb_usbvision *usbvision) | 1675 | static int usbvision_adjust_compression (struct usb_usbvision *usbvision) |
1676 | { | 1676 | { |
1677 | int errCode = 0; | 1677 | int err_code = 0; |
1678 | unsigned char buffer[6]; | 1678 | unsigned char buffer[6]; |
1679 | 1679 | ||
1680 | PDEBUG(DBG_IRQ, ""); | 1680 | PDEBUG(DBG_IRQ, ""); |
1681 | if ((adjustCompression) && (usbvision->usedBandwidth > 0)) { | 1681 | if ((adjust_compression) && (usbvision->used_bandwidth > 0)) { |
1682 | usbvision->comprLevel += (usbvision->usedBandwidth - 90) / 2; | 1682 | usbvision->compr_level += (usbvision->used_bandwidth - 90) / 2; |
1683 | RESTRICT_TO_RANGE(usbvision->comprLevel, 0, 100); | 1683 | RESTRICT_TO_RANGE(usbvision->compr_level, 0, 100); |
1684 | if (usbvision->comprLevel != usbvision->lastComprLevel) { | 1684 | if (usbvision->compr_level != usbvision->last_compr_level) { |
1685 | int distorsion; | 1685 | int distorsion; |
1686 | if (usbvision->bridgeType == BRIDGE_NT1004 || usbvision->bridgeType == BRIDGE_NT1005) { | 1686 | if (usbvision->bridge_type == BRIDGE_NT1004 || usbvision->bridge_type == BRIDGE_NT1005) { |
1687 | buffer[0] = (unsigned char)(4 + 16 * usbvision->comprLevel / 100); // PCM Threshold 1 | 1687 | buffer[0] = (unsigned char)(4 + 16 * usbvision->compr_level / 100); // PCM Threshold 1 |
1688 | buffer[1] = (unsigned char)(4 + 8 * usbvision->comprLevel / 100); // PCM Threshold 2 | 1688 | buffer[1] = (unsigned char)(4 + 8 * usbvision->compr_level / 100); // PCM Threshold 2 |
1689 | distorsion = 7 + 248 * usbvision->comprLevel / 100; | 1689 | distorsion = 7 + 248 * usbvision->compr_level / 100; |
1690 | buffer[2] = (unsigned char)(distorsion & 0xFF); // Average distorsion Threshold (inter) | 1690 | buffer[2] = (unsigned char)(distorsion & 0xFF); // Average distorsion Threshold (inter) |
1691 | buffer[3] = (unsigned char)(distorsion & 0xFF); // Average distorsion Threshold (intra) | 1691 | buffer[3] = (unsigned char)(distorsion & 0xFF); // Average distorsion Threshold (intra) |
1692 | distorsion = 1 + 42 * usbvision->comprLevel / 100; | 1692 | distorsion = 1 + 42 * usbvision->compr_level / 100; |
1693 | buffer[4] = (unsigned char)(distorsion & 0xFF); // Maximum distorsion Threshold (inter) | 1693 | buffer[4] = (unsigned char)(distorsion & 0xFF); // Maximum distorsion Threshold (inter) |
1694 | buffer[5] = (unsigned char)(distorsion & 0xFF); // Maximum distorsion Threshold (intra) | 1694 | buffer[5] = (unsigned char)(distorsion & 0xFF); // Maximum distorsion Threshold (intra) |
1695 | } | 1695 | } |
1696 | else { //BRIDGE_NT1003 | 1696 | else { //BRIDGE_NT1003 |
1697 | buffer[0] = (unsigned char)(4 + 16 * usbvision->comprLevel / 100); // PCM threshold 1 | 1697 | buffer[0] = (unsigned char)(4 + 16 * usbvision->compr_level / 100); // PCM threshold 1 |
1698 | buffer[1] = (unsigned char)(4 + 8 * usbvision->comprLevel / 100); // PCM threshold 2 | 1698 | buffer[1] = (unsigned char)(4 + 8 * usbvision->compr_level / 100); // PCM threshold 2 |
1699 | distorsion = 2 + 253 * usbvision->comprLevel / 100; | 1699 | distorsion = 2 + 253 * usbvision->compr_level / 100; |
1700 | buffer[2] = (unsigned char)(distorsion & 0xFF); // distorsion threshold bit0-7 | 1700 | buffer[2] = (unsigned char)(distorsion & 0xFF); // distorsion threshold bit0-7 |
1701 | buffer[3] = 0; //(unsigned char)((distorsion >> 8) & 0x0F); // distorsion threshold bit 8-11 | 1701 | buffer[3] = 0; //(unsigned char)((distorsion >> 8) & 0x0F); // distorsion threshold bit 8-11 |
1702 | distorsion = 0 + 43 * usbvision->comprLevel / 100; | 1702 | distorsion = 0 + 43 * usbvision->compr_level / 100; |
1703 | buffer[4] = (unsigned char)(distorsion & 0xFF); // maximum distorsion bit0-7 | 1703 | buffer[4] = (unsigned char)(distorsion & 0xFF); // maximum distorsion bit0-7 |
1704 | buffer[5] = 0; //(unsigned char)((distorsion >> 8) & 0x01); // maximum distorsion bit 8 | 1704 | buffer[5] = 0; //(unsigned char)((distorsion >> 8) & 0x01); // maximum distorsion bit 8 |
1705 | } | 1705 | } |
1706 | errCode = usbvision_write_reg_irq(usbvision, USBVISION_PCM_THR1, buffer, 6); | 1706 | err_code = usbvision_write_reg_irq(usbvision, USBVISION_PCM_THR1, buffer, 6); |
1707 | if (errCode == 0){ | 1707 | if (err_code == 0){ |
1708 | PDEBUG(DBG_IRQ, "new compr params %#02x %#02x %#02x %#02x %#02x %#02x", buffer[0], | 1708 | PDEBUG(DBG_IRQ, "new compr params %#02x %#02x %#02x %#02x %#02x %#02x", buffer[0], |
1709 | buffer[1], buffer[2], buffer[3], buffer[4], buffer[5]); | 1709 | buffer[1], buffer[2], buffer[3], buffer[4], buffer[5]); |
1710 | usbvision->lastComprLevel = usbvision->comprLevel; | 1710 | usbvision->last_compr_level = usbvision->compr_level; |
1711 | } | 1711 | } |
1712 | } | 1712 | } |
1713 | } | 1713 | } |
1714 | return errCode; | 1714 | return err_code; |
1715 | } | 1715 | } |
1716 | 1716 | ||
1717 | static int usbvision_request_intra (struct usb_usbvision *usbvision) | 1717 | static int usbvision_request_intra (struct usb_usbvision *usbvision) |
1718 | { | 1718 | { |
1719 | int errCode = 0; | 1719 | int err_code = 0; |
1720 | unsigned char buffer[1]; | 1720 | unsigned char buffer[1]; |
1721 | 1721 | ||
1722 | PDEBUG(DBG_IRQ, ""); | 1722 | PDEBUG(DBG_IRQ, ""); |
1723 | usbvision->requestIntra = 1; | 1723 | usbvision->request_intra = 1; |
1724 | buffer[0] = 1; | 1724 | buffer[0] = 1; |
1725 | usbvision_write_reg_irq(usbvision, USBVISION_FORCE_INTRA, buffer, 1); | 1725 | usbvision_write_reg_irq(usbvision, USBVISION_FORCE_INTRA, buffer, 1); |
1726 | return errCode; | 1726 | return err_code; |
1727 | } | 1727 | } |
1728 | 1728 | ||
1729 | static int usbvision_unrequest_intra (struct usb_usbvision *usbvision) | 1729 | static int usbvision_unrequest_intra (struct usb_usbvision *usbvision) |
1730 | { | 1730 | { |
1731 | int errCode = 0; | 1731 | int err_code = 0; |
1732 | unsigned char buffer[1]; | 1732 | unsigned char buffer[1]; |
1733 | 1733 | ||
1734 | PDEBUG(DBG_IRQ, ""); | 1734 | PDEBUG(DBG_IRQ, ""); |
1735 | usbvision->requestIntra = 0; | 1735 | usbvision->request_intra = 0; |
1736 | buffer[0] = 0; | 1736 | buffer[0] = 0; |
1737 | usbvision_write_reg_irq(usbvision, USBVISION_FORCE_INTRA, buffer, 1); | 1737 | usbvision_write_reg_irq(usbvision, USBVISION_FORCE_INTRA, buffer, 1); |
1738 | return errCode; | 1738 | return err_code; |
1739 | } | 1739 | } |
1740 | 1740 | ||
1741 | /******************************* | 1741 | /******************************* |
@@ -1744,16 +1744,16 @@ static int usbvision_unrequest_intra (struct usb_usbvision *usbvision) | |||
1744 | 1744 | ||
1745 | int usbvision_power_off(struct usb_usbvision *usbvision) | 1745 | int usbvision_power_off(struct usb_usbvision *usbvision) |
1746 | { | 1746 | { |
1747 | int errCode = 0; | 1747 | int err_code = 0; |
1748 | 1748 | ||
1749 | PDEBUG(DBG_FUNC, ""); | 1749 | PDEBUG(DBG_FUNC, ""); |
1750 | 1750 | ||
1751 | errCode = usbvision_write_reg(usbvision, USBVISION_PWR_REG, USBVISION_SSPND_EN); | 1751 | err_code = usbvision_write_reg(usbvision, USBVISION_PWR_REG, USBVISION_SSPND_EN); |
1752 | if (errCode == 1) { | 1752 | if (err_code == 1) { |
1753 | usbvision->power = 0; | 1753 | usbvision->power = 0; |
1754 | } | 1754 | } |
1755 | PDEBUG(DBG_FUNC, "%s: errCode %d", (errCode!=1)?"ERROR":"power is off", errCode); | 1755 | PDEBUG(DBG_FUNC, "%s: err_code %d", (err_code!=1)?"ERROR":"power is off", err_code); |
1756 | return errCode; | 1756 | return err_code; |
1757 | } | 1757 | } |
1758 | 1758 | ||
1759 | /* | 1759 | /* |
@@ -1769,7 +1769,7 @@ static int usbvision_set_video_format(struct usb_usbvision *usbvision, int forma | |||
1769 | if (!USBVISION_IS_OPERATIONAL(usbvision)) | 1769 | if (!USBVISION_IS_OPERATIONAL(usbvision)) |
1770 | return 0; | 1770 | return 0; |
1771 | 1771 | ||
1772 | PDEBUG(DBG_FUNC, "isocMode %#02x", format); | 1772 | PDEBUG(DBG_FUNC, "isoc_mode %#02x", format); |
1773 | 1773 | ||
1774 | if ((format != ISOC_MODE_YUV422) | 1774 | if ((format != ISOC_MODE_YUV422) |
1775 | && (format != ISOC_MODE_YUV420) | 1775 | && (format != ISOC_MODE_YUV420) |
@@ -1790,7 +1790,7 @@ static int usbvision_set_video_format(struct usb_usbvision *usbvision, int forma | |||
1790 | printk(KERN_ERR "%s: ERROR=%d. USBVISION stopped - " | 1790 | printk(KERN_ERR "%s: ERROR=%d. USBVISION stopped - " |
1791 | "reconnect or reload driver.\n", proc, rc); | 1791 | "reconnect or reload driver.\n", proc, rc); |
1792 | } | 1792 | } |
1793 | usbvision->isocMode = format; | 1793 | usbvision->isoc_mode = format; |
1794 | return rc; | 1794 | return rc; |
1795 | } | 1795 | } |
1796 | 1796 | ||
@@ -1802,9 +1802,9 @@ static int usbvision_set_video_format(struct usb_usbvision *usbvision, int forma | |||
1802 | int usbvision_set_output(struct usb_usbvision *usbvision, int width, | 1802 | int usbvision_set_output(struct usb_usbvision *usbvision, int width, |
1803 | int height) | 1803 | int height) |
1804 | { | 1804 | { |
1805 | int errCode = 0; | 1805 | int err_code = 0; |
1806 | int UsbWidth, UsbHeight; | 1806 | int usb_width, usb_height; |
1807 | unsigned int frameRate=0, frameDrop=0; | 1807 | unsigned int frame_rate=0, frame_drop=0; |
1808 | unsigned char value[4]; | 1808 | unsigned char value[4]; |
1809 | 1809 | ||
1810 | if (!USBVISION_IS_OPERATIONAL(usbvision)) { | 1810 | if (!USBVISION_IS_OPERATIONAL(usbvision)) { |
@@ -1812,86 +1812,86 @@ int usbvision_set_output(struct usb_usbvision *usbvision, int width, | |||
1812 | } | 1812 | } |
1813 | 1813 | ||
1814 | if (width > MAX_USB_WIDTH) { | 1814 | if (width > MAX_USB_WIDTH) { |
1815 | UsbWidth = width / 2; | 1815 | usb_width = width / 2; |
1816 | usbvision->stretch_width = 2; | 1816 | usbvision->stretch_width = 2; |
1817 | } | 1817 | } |
1818 | else { | 1818 | else { |
1819 | UsbWidth = width; | 1819 | usb_width = width; |
1820 | usbvision->stretch_width = 1; | 1820 | usbvision->stretch_width = 1; |
1821 | } | 1821 | } |
1822 | 1822 | ||
1823 | if (height > MAX_USB_HEIGHT) { | 1823 | if (height > MAX_USB_HEIGHT) { |
1824 | UsbHeight = height / 2; | 1824 | usb_height = height / 2; |
1825 | usbvision->stretch_height = 2; | 1825 | usbvision->stretch_height = 2; |
1826 | } | 1826 | } |
1827 | else { | 1827 | else { |
1828 | UsbHeight = height; | 1828 | usb_height = height; |
1829 | usbvision->stretch_height = 1; | 1829 | usbvision->stretch_height = 1; |
1830 | } | 1830 | } |
1831 | 1831 | ||
1832 | RESTRICT_TO_RANGE(UsbWidth, MIN_FRAME_WIDTH, MAX_USB_WIDTH); | 1832 | RESTRICT_TO_RANGE(usb_width, MIN_FRAME_WIDTH, MAX_USB_WIDTH); |
1833 | UsbWidth &= ~(MIN_FRAME_WIDTH-1); | 1833 | usb_width &= ~(MIN_FRAME_WIDTH-1); |
1834 | RESTRICT_TO_RANGE(UsbHeight, MIN_FRAME_HEIGHT, MAX_USB_HEIGHT); | 1834 | RESTRICT_TO_RANGE(usb_height, MIN_FRAME_HEIGHT, MAX_USB_HEIGHT); |
1835 | UsbHeight &= ~(1); | 1835 | usb_height &= ~(1); |
1836 | 1836 | ||
1837 | PDEBUG(DBG_FUNC, "usb %dx%d; screen %dx%d; stretch %dx%d", | 1837 | PDEBUG(DBG_FUNC, "usb %dx%d; screen %dx%d; stretch %dx%d", |
1838 | UsbWidth, UsbHeight, width, height, | 1838 | usb_width, usb_height, width, height, |
1839 | usbvision->stretch_width, usbvision->stretch_height); | 1839 | usbvision->stretch_width, usbvision->stretch_height); |
1840 | 1840 | ||
1841 | /* I'll not rewrite the same values */ | 1841 | /* I'll not rewrite the same values */ |
1842 | if ((UsbWidth != usbvision->curwidth) || (UsbHeight != usbvision->curheight)) { | 1842 | if ((usb_width != usbvision->curwidth) || (usb_height != usbvision->curheight)) { |
1843 | value[0] = UsbWidth & 0xff; //LSB | 1843 | value[0] = usb_width & 0xff; //LSB |
1844 | value[1] = (UsbWidth >> 8) & 0x03; //MSB | 1844 | value[1] = (usb_width >> 8) & 0x03; //MSB |
1845 | value[2] = UsbHeight & 0xff; //LSB | 1845 | value[2] = usb_height & 0xff; //LSB |
1846 | value[3] = (UsbHeight >> 8) & 0x03; //MSB | 1846 | value[3] = (usb_height >> 8) & 0x03; //MSB |
1847 | 1847 | ||
1848 | errCode = usb_control_msg(usbvision->dev, usb_sndctrlpipe(usbvision->dev, 1), | 1848 | err_code = usb_control_msg(usbvision->dev, usb_sndctrlpipe(usbvision->dev, 1), |
1849 | USBVISION_OP_CODE, | 1849 | USBVISION_OP_CODE, |
1850 | USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_ENDPOINT, | 1850 | USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_ENDPOINT, |
1851 | 0, (__u16) USBVISION_LXSIZE_O, value, 4, HZ); | 1851 | 0, (__u16) USBVISION_LXSIZE_O, value, 4, HZ); |
1852 | 1852 | ||
1853 | if (errCode < 0) { | 1853 | if (err_code < 0) { |
1854 | dev_err(&usbvision->dev->dev, | 1854 | dev_err(&usbvision->dev->dev, |
1855 | "%s failed: error %d\n", __func__, errCode); | 1855 | "%s failed: error %d\n", __func__, err_code); |
1856 | return errCode; | 1856 | return err_code; |
1857 | } | 1857 | } |
1858 | usbvision->curwidth = usbvision->stretch_width * UsbWidth; | 1858 | usbvision->curwidth = usbvision->stretch_width * usb_width; |
1859 | usbvision->curheight = usbvision->stretch_height * UsbHeight; | 1859 | usbvision->curheight = usbvision->stretch_height * usb_height; |
1860 | } | 1860 | } |
1861 | 1861 | ||
1862 | if (usbvision->isocMode == ISOC_MODE_YUV422) { | 1862 | if (usbvision->isoc_mode == ISOC_MODE_YUV422) { |
1863 | frameRate = (usbvision->isocPacketSize * 1000) / (UsbWidth * UsbHeight * 2); | 1863 | frame_rate = (usbvision->isoc_packet_size * 1000) / (usb_width * usb_height * 2); |
1864 | } | 1864 | } |
1865 | else if (usbvision->isocMode == ISOC_MODE_YUV420) { | 1865 | else if (usbvision->isoc_mode == ISOC_MODE_YUV420) { |
1866 | frameRate = (usbvision->isocPacketSize * 1000) / ((UsbWidth * UsbHeight * 12) / 8); | 1866 | frame_rate = (usbvision->isoc_packet_size * 1000) / ((usb_width * usb_height * 12) / 8); |
1867 | } | 1867 | } |
1868 | else { | 1868 | else { |
1869 | frameRate = FRAMERATE_MAX; | 1869 | frame_rate = FRAMERATE_MAX; |
1870 | } | 1870 | } |
1871 | 1871 | ||
1872 | if (usbvision->tvnormId & V4L2_STD_625_50) { | 1872 | if (usbvision->tvnorm_id & V4L2_STD_625_50) { |
1873 | frameDrop = frameRate * 32 / 25 - 1; | 1873 | frame_drop = frame_rate * 32 / 25 - 1; |
1874 | } | 1874 | } |
1875 | else if (usbvision->tvnormId & V4L2_STD_525_60) { | 1875 | else if (usbvision->tvnorm_id & V4L2_STD_525_60) { |
1876 | frameDrop = frameRate * 32 / 30 - 1; | 1876 | frame_drop = frame_rate * 32 / 30 - 1; |
1877 | } | 1877 | } |
1878 | 1878 | ||
1879 | RESTRICT_TO_RANGE(frameDrop, FRAMERATE_MIN, FRAMERATE_MAX); | 1879 | RESTRICT_TO_RANGE(frame_drop, FRAMERATE_MIN, FRAMERATE_MAX); |
1880 | 1880 | ||
1881 | PDEBUG(DBG_FUNC, "frameRate %d fps, frameDrop %d", frameRate, frameDrop); | 1881 | PDEBUG(DBG_FUNC, "frame_rate %d fps, frame_drop %d", frame_rate, frame_drop); |
1882 | 1882 | ||
1883 | frameDrop = FRAMERATE_MAX; // We can allow the maximum here, because dropping is controlled | 1883 | frame_drop = FRAMERATE_MAX; // We can allow the maximum here, because dropping is controlled |
1884 | 1884 | ||
1885 | /* frameDrop = 7; => framePhase = 1, 5, 9, 13, 17, 21, 25, 0, 4, 8, ... | 1885 | /* frame_drop = 7; => frame_phase = 1, 5, 9, 13, 17, 21, 25, 0, 4, 8, ... |
1886 | => frameSkip = 4; | 1886 | => frame_skip = 4; |
1887 | => frameRate = (7 + 1) * 25 / 32 = 200 / 32 = 6.25; | 1887 | => frame_rate = (7 + 1) * 25 / 32 = 200 / 32 = 6.25; |
1888 | 1888 | ||
1889 | frameDrop = 9; => framePhase = 1, 5, 8, 11, 14, 17, 21, 24, 27, 1, 4, 8, ... | 1889 | frame_drop = 9; => frame_phase = 1, 5, 8, 11, 14, 17, 21, 24, 27, 1, 4, 8, ... |
1890 | => frameSkip = 4, 3, 3, 3, 3, 4, 3, 3, 3, 3, 4, ... | 1890 | => frame_skip = 4, 3, 3, 3, 3, 4, 3, 3, 3, 3, 4, ... |
1891 | => frameRate = (9 + 1) * 25 / 32 = 250 / 32 = 7.8125; | 1891 | => frame_rate = (9 + 1) * 25 / 32 = 250 / 32 = 7.8125; |
1892 | */ | 1892 | */ |
1893 | errCode = usbvision_write_reg(usbvision, USBVISION_FRM_RATE, frameDrop); | 1893 | err_code = usbvision_write_reg(usbvision, USBVISION_FRM_RATE, frame_drop); |
1894 | return errCode; | 1894 | return err_code; |
1895 | } | 1895 | } |
1896 | 1896 | ||
1897 | 1897 | ||
@@ -1925,7 +1925,7 @@ int usbvision_frames_alloc(struct usb_usbvision *usbvision, int number_of_frames | |||
1925 | /* Allocate all buffers */ | 1925 | /* Allocate all buffers */ |
1926 | for (i = 0; i < usbvision->num_frames; i++) { | 1926 | for (i = 0; i < usbvision->num_frames; i++) { |
1927 | usbvision->frame[i].index = i; | 1927 | usbvision->frame[i].index = i; |
1928 | usbvision->frame[i].grabstate = FrameState_Unused; | 1928 | usbvision->frame[i].grabstate = frame_state_unused; |
1929 | usbvision->frame[i].data = usbvision->fbuf + | 1929 | usbvision->frame[i].data = usbvision->fbuf + |
1930 | i * usbvision->max_frame_size; | 1930 | i * usbvision->max_frame_size; |
1931 | /* | 1931 | /* |
@@ -1969,7 +1969,7 @@ void usbvision_empty_framequeues(struct usb_usbvision *usbvision) | |||
1969 | INIT_LIST_HEAD(&(usbvision->outqueue)); | 1969 | INIT_LIST_HEAD(&(usbvision->outqueue)); |
1970 | 1970 | ||
1971 | for (i = 0; i < USBVISION_NUMFRAMES; i++) { | 1971 | for (i = 0; i < USBVISION_NUMFRAMES; i++) { |
1972 | usbvision->frame[i].grabstate = FrameState_Unused; | 1972 | usbvision->frame[i].grabstate = frame_state_unused; |
1973 | usbvision->frame[i].bytes_read = 0; | 1973 | usbvision->frame[i].bytes_read = 0; |
1974 | } | 1974 | } |
1975 | } | 1975 | } |
@@ -1984,9 +1984,9 @@ int usbvision_stream_interrupt(struct usb_usbvision *usbvision) | |||
1984 | 1984 | ||
1985 | /* stop reading from the device */ | 1985 | /* stop reading from the device */ |
1986 | 1986 | ||
1987 | usbvision->streaming = Stream_Interrupt; | 1987 | usbvision->streaming = stream_interrupt; |
1988 | ret = wait_event_timeout(usbvision->wait_stream, | 1988 | ret = wait_event_timeout(usbvision->wait_stream, |
1989 | (usbvision->streaming == Stream_Idle), | 1989 | (usbvision->streaming == stream_idle), |
1990 | msecs_to_jiffies(USBVISION_NUMSBUF*USBVISION_URB_FRAMES)); | 1990 | msecs_to_jiffies(USBVISION_NUMSBUF*USBVISION_URB_FRAMES)); |
1991 | return ret; | 1991 | return ret; |
1992 | } | 1992 | } |
@@ -2030,7 +2030,7 @@ static int usbvision_set_compress_params(struct usb_usbvision *usbvision) | |||
2030 | return rc; | 2030 | return rc; |
2031 | } | 2031 | } |
2032 | 2032 | ||
2033 | if (usbvision->bridgeType == BRIDGE_NT1004) { | 2033 | if (usbvision->bridge_type == BRIDGE_NT1004) { |
2034 | value[0] = 20; // PCM Threshold 1 | 2034 | value[0] = 20; // PCM Threshold 1 |
2035 | value[1] = 12; // PCM Threshold 2 | 2035 | value[1] = 12; // PCM Threshold 2 |
2036 | value[2] = 255; // Distorsion Threshold inter | 2036 | value[2] = 255; // Distorsion Threshold inter |
@@ -2085,9 +2085,9 @@ int usbvision_set_input(struct usb_usbvision *usbvision) | |||
2085 | return 0; | 2085 | return 0; |
2086 | 2086 | ||
2087 | /* Set input format expected from decoder*/ | 2087 | /* Set input format expected from decoder*/ |
2088 | if (usbvision_device_data[usbvision->DevModel].Vin_Reg1_override) { | 2088 | if (usbvision_device_data[usbvision->dev_model].vin_reg1_override) { |
2089 | value[0] = usbvision_device_data[usbvision->DevModel].Vin_Reg1; | 2089 | value[0] = usbvision_device_data[usbvision->dev_model].vin_reg1; |
2090 | } else if(usbvision_device_data[usbvision->DevModel].Codec == CODEC_SAA7113) { | 2090 | } else if(usbvision_device_data[usbvision->dev_model].codec == CODEC_SAA7113) { |
2091 | /* SAA7113 uses 8 bit output */ | 2091 | /* SAA7113 uses 8 bit output */ |
2092 | value[0] = USBVISION_8_422_SYNC; | 2092 | value[0] = USBVISION_8_422_SYNC; |
2093 | } else { | 2093 | } else { |
@@ -2105,7 +2105,7 @@ int usbvision_set_input(struct usb_usbvision *usbvision) | |||
2105 | } | 2105 | } |
2106 | 2106 | ||
2107 | 2107 | ||
2108 | if (usbvision->tvnormId & V4L2_STD_PAL) { | 2108 | if (usbvision->tvnorm_id & V4L2_STD_PAL) { |
2109 | value[0] = 0xC0; | 2109 | value[0] = 0xC0; |
2110 | value[1] = 0x02; //0x02C0 -> 704 Input video line length | 2110 | value[1] = 0x02; //0x02C0 -> 704 Input video line length |
2111 | value[2] = 0x20; | 2111 | value[2] = 0x20; |
@@ -2114,7 +2114,7 @@ int usbvision_set_input(struct usb_usbvision *usbvision) | |||
2114 | value[5] = 0x00; //0x0060 -> 96 Input video h offset | 2114 | value[5] = 0x00; //0x0060 -> 96 Input video h offset |
2115 | value[6] = 0x16; | 2115 | value[6] = 0x16; |
2116 | value[7] = 0x00; //0x0016 -> 22 Input video v offset | 2116 | value[7] = 0x00; //0x0016 -> 22 Input video v offset |
2117 | } else if (usbvision->tvnormId & V4L2_STD_SECAM) { | 2117 | } else if (usbvision->tvnorm_id & V4L2_STD_SECAM) { |
2118 | value[0] = 0xC0; | 2118 | value[0] = 0xC0; |
2119 | value[1] = 0x02; //0x02C0 -> 704 Input video line length | 2119 | value[1] = 0x02; //0x02C0 -> 704 Input video line length |
2120 | value[2] = 0x20; | 2120 | value[2] = 0x20; |
@@ -2134,24 +2134,24 @@ int usbvision_set_input(struct usb_usbvision *usbvision) | |||
2134 | value[7] = 0x00; //0x0010 -> 16 Input video v offset | 2134 | value[7] = 0x00; //0x0010 -> 16 Input video v offset |
2135 | } | 2135 | } |
2136 | 2136 | ||
2137 | if (usbvision_device_data[usbvision->DevModel].X_Offset >= 0) { | 2137 | if (usbvision_device_data[usbvision->dev_model].x_offset >= 0) { |
2138 | value[4]=usbvision_device_data[usbvision->DevModel].X_Offset & 0xff; | 2138 | value[4]=usbvision_device_data[usbvision->dev_model].x_offset & 0xff; |
2139 | value[5]=(usbvision_device_data[usbvision->DevModel].X_Offset & 0x0300) >> 8; | 2139 | value[5]=(usbvision_device_data[usbvision->dev_model].x_offset & 0x0300) >> 8; |
2140 | } | 2140 | } |
2141 | 2141 | ||
2142 | if (adjust_X_Offset != -1) { | 2142 | if (adjust_x_offset != -1) { |
2143 | value[4] = adjust_X_Offset & 0xff; | 2143 | value[4] = adjust_x_offset & 0xff; |
2144 | value[5] = (adjust_X_Offset & 0x0300) >> 8; | 2144 | value[5] = (adjust_x_offset & 0x0300) >> 8; |
2145 | } | 2145 | } |
2146 | 2146 | ||
2147 | if (usbvision_device_data[usbvision->DevModel].Y_Offset >= 0) { | 2147 | if (usbvision_device_data[usbvision->dev_model].y_offset >= 0) { |
2148 | value[6]=usbvision_device_data[usbvision->DevModel].Y_Offset & 0xff; | 2148 | value[6]=usbvision_device_data[usbvision->dev_model].y_offset & 0xff; |
2149 | value[7]=(usbvision_device_data[usbvision->DevModel].Y_Offset & 0x0300) >> 8; | 2149 | value[7]=(usbvision_device_data[usbvision->dev_model].y_offset & 0x0300) >> 8; |
2150 | } | 2150 | } |
2151 | 2151 | ||
2152 | if (adjust_Y_Offset != -1) { | 2152 | if (adjust_y_offset != -1) { |
2153 | value[6] = adjust_Y_Offset & 0xff; | 2153 | value[6] = adjust_y_offset & 0xff; |
2154 | value[7] = (adjust_Y_Offset & 0x0300) >> 8; | 2154 | value[7] = (adjust_y_offset & 0x0300) >> 8; |
2155 | } | 2155 | } |
2156 | 2156 | ||
2157 | rc = usb_control_msg(usbvision->dev, usb_sndctrlpipe(usbvision->dev, 1), | 2157 | rc = usb_control_msg(usbvision->dev, usb_sndctrlpipe(usbvision->dev, 1), |
@@ -2167,10 +2167,10 @@ int usbvision_set_input(struct usb_usbvision *usbvision) | |||
2167 | 2167 | ||
2168 | dvi_yuv_value = 0x00; /* U comes after V, Ya comes after U/V, Yb comes after Yb */ | 2168 | dvi_yuv_value = 0x00; /* U comes after V, Ya comes after U/V, Yb comes after Yb */ |
2169 | 2169 | ||
2170 | if(usbvision_device_data[usbvision->DevModel].Dvi_yuv_override){ | 2170 | if(usbvision_device_data[usbvision->dev_model].dvi_yuv_override){ |
2171 | dvi_yuv_value = usbvision_device_data[usbvision->DevModel].Dvi_yuv; | 2171 | dvi_yuv_value = usbvision_device_data[usbvision->dev_model].dvi_yuv; |
2172 | } | 2172 | } |
2173 | else if(usbvision_device_data[usbvision->DevModel].Codec == CODEC_SAA7113) { | 2173 | else if(usbvision_device_data[usbvision->dev_model].codec == CODEC_SAA7113) { |
2174 | /* This changes as the fine sync control changes. Further investigation necessary */ | 2174 | /* This changes as the fine sync control changes. Further investigation necessary */ |
2175 | dvi_yuv_value = 0x06; | 2175 | dvi_yuv_value = 0x06; |
2176 | } | 2176 | } |
@@ -2192,7 +2192,7 @@ static int usbvision_set_dram_settings(struct usb_usbvision *usbvision) | |||
2192 | int rc; | 2192 | int rc; |
2193 | unsigned char value[8]; | 2193 | unsigned char value[8]; |
2194 | 2194 | ||
2195 | if (usbvision->isocMode == ISOC_MODE_COMPRESS) { | 2195 | if (usbvision->isoc_mode == ISOC_MODE_COMPRESS) { |
2196 | value[0] = 0x42; | 2196 | value[0] = 0x42; |
2197 | value[1] = 0x71; | 2197 | value[1] = 0x71; |
2198 | value[2] = 0xff; | 2198 | value[2] = 0xff; |
@@ -2261,7 +2261,7 @@ static int usbvision_set_dram_settings(struct usb_usbvision *usbvision) | |||
2261 | 2261 | ||
2262 | int usbvision_power_on(struct usb_usbvision *usbvision) | 2262 | int usbvision_power_on(struct usb_usbvision *usbvision) |
2263 | { | 2263 | { |
2264 | int errCode = 0; | 2264 | int err_code = 0; |
2265 | 2265 | ||
2266 | PDEBUG(DBG_FUNC, ""); | 2266 | PDEBUG(DBG_FUNC, ""); |
2267 | 2267 | ||
@@ -2271,13 +2271,13 @@ int usbvision_power_on(struct usb_usbvision *usbvision) | |||
2271 | 2271 | ||
2272 | usbvision_write_reg(usbvision, USBVISION_PWR_REG, | 2272 | usbvision_write_reg(usbvision, USBVISION_PWR_REG, |
2273 | USBVISION_SSPND_EN | USBVISION_PWR_VID); | 2273 | USBVISION_SSPND_EN | USBVISION_PWR_VID); |
2274 | errCode = usbvision_write_reg(usbvision, USBVISION_PWR_REG, | 2274 | err_code = usbvision_write_reg(usbvision, USBVISION_PWR_REG, |
2275 | USBVISION_SSPND_EN | USBVISION_PWR_VID | USBVISION_RES2); | 2275 | USBVISION_SSPND_EN | USBVISION_PWR_VID | USBVISION_RES2); |
2276 | if (errCode == 1) { | 2276 | if (err_code == 1) { |
2277 | usbvision->power = 1; | 2277 | usbvision->power = 1; |
2278 | } | 2278 | } |
2279 | PDEBUG(DBG_FUNC, "%s: errCode %d", (errCode<0)?"ERROR":"power is on", errCode); | 2279 | PDEBUG(DBG_FUNC, "%s: err_code %d", (err_code<0)?"ERROR":"power is on", err_code); |
2280 | return errCode; | 2280 | return err_code; |
2281 | } | 2281 | } |
2282 | 2282 | ||
2283 | 2283 | ||
@@ -2288,7 +2288,7 @@ int usbvision_power_on(struct usb_usbvision *usbvision) | |||
2288 | // to call usbvision_power_off from task queue | 2288 | // to call usbvision_power_off from task queue |
2289 | static void call_usbvision_power_off(struct work_struct *work) | 2289 | static void call_usbvision_power_off(struct work_struct *work) |
2290 | { | 2290 | { |
2291 | struct usb_usbvision *usbvision = container_of(work, struct usb_usbvision, powerOffWork); | 2291 | struct usb_usbvision *usbvision = container_of(work, struct usb_usbvision, power_off_work); |
2292 | 2292 | ||
2293 | PDEBUG(DBG_FUNC, ""); | 2293 | PDEBUG(DBG_FUNC, ""); |
2294 | if (mutex_lock_interruptible(&usbvision->v4l2_lock)) | 2294 | if (mutex_lock_interruptible(&usbvision->v4l2_lock)) |
@@ -2303,32 +2303,32 @@ static void call_usbvision_power_off(struct work_struct *work) | |||
2303 | mutex_unlock(&usbvision->v4l2_lock); | 2303 | mutex_unlock(&usbvision->v4l2_lock); |
2304 | } | 2304 | } |
2305 | 2305 | ||
2306 | static void usbvision_powerOffTimer(unsigned long data) | 2306 | static void usbvision_power_off_timer(unsigned long data) |
2307 | { | 2307 | { |
2308 | struct usb_usbvision *usbvision = (void *) data; | 2308 | struct usb_usbvision *usbvision = (void *) data; |
2309 | 2309 | ||
2310 | PDEBUG(DBG_FUNC, ""); | 2310 | PDEBUG(DBG_FUNC, ""); |
2311 | del_timer(&usbvision->powerOffTimer); | 2311 | del_timer(&usbvision->power_off_timer); |
2312 | INIT_WORK(&usbvision->powerOffWork, call_usbvision_power_off); | 2312 | INIT_WORK(&usbvision->power_off_work, call_usbvision_power_off); |
2313 | (void) schedule_work(&usbvision->powerOffWork); | 2313 | (void) schedule_work(&usbvision->power_off_work); |
2314 | } | 2314 | } |
2315 | 2315 | ||
2316 | void usbvision_init_powerOffTimer(struct usb_usbvision *usbvision) | 2316 | void usbvision_init_power_off_timer(struct usb_usbvision *usbvision) |
2317 | { | 2317 | { |
2318 | init_timer(&usbvision->powerOffTimer); | 2318 | init_timer(&usbvision->power_off_timer); |
2319 | usbvision->powerOffTimer.data = (long) usbvision; | 2319 | usbvision->power_off_timer.data = (long) usbvision; |
2320 | usbvision->powerOffTimer.function = usbvision_powerOffTimer; | 2320 | usbvision->power_off_timer.function = usbvision_power_off_timer; |
2321 | } | 2321 | } |
2322 | 2322 | ||
2323 | void usbvision_set_powerOffTimer(struct usb_usbvision *usbvision) | 2323 | void usbvision_set_power_off_timer(struct usb_usbvision *usbvision) |
2324 | { | 2324 | { |
2325 | mod_timer(&usbvision->powerOffTimer, jiffies + USBVISION_POWEROFF_TIME); | 2325 | mod_timer(&usbvision->power_off_timer, jiffies + USBVISION_POWEROFF_TIME); |
2326 | } | 2326 | } |
2327 | 2327 | ||
2328 | void usbvision_reset_powerOffTimer(struct usb_usbvision *usbvision) | 2328 | void usbvision_reset_power_off_timer(struct usb_usbvision *usbvision) |
2329 | { | 2329 | { |
2330 | if (timer_pending(&usbvision->powerOffTimer)) { | 2330 | if (timer_pending(&usbvision->power_off_timer)) { |
2331 | del_timer(&usbvision->powerOffTimer); | 2331 | del_timer(&usbvision->power_off_timer); |
2332 | } | 2332 | } |
2333 | } | 2333 | } |
2334 | 2334 | ||
@@ -2339,14 +2339,14 @@ void usbvision_reset_powerOffTimer(struct usb_usbvision *usbvision) | |||
2339 | */ | 2339 | */ |
2340 | int usbvision_begin_streaming(struct usb_usbvision *usbvision) | 2340 | int usbvision_begin_streaming(struct usb_usbvision *usbvision) |
2341 | { | 2341 | { |
2342 | int errCode = 0; | 2342 | int err_code = 0; |
2343 | 2343 | ||
2344 | if (usbvision->isocMode == ISOC_MODE_COMPRESS) { | 2344 | if (usbvision->isoc_mode == ISOC_MODE_COMPRESS) { |
2345 | usbvision_init_compression(usbvision); | 2345 | usbvision_init_compression(usbvision); |
2346 | } | 2346 | } |
2347 | errCode = usbvision_write_reg(usbvision, USBVISION_VIN_REG2, USBVISION_NOHVALID | | 2347 | err_code = usbvision_write_reg(usbvision, USBVISION_VIN_REG2, USBVISION_NOHVALID | |
2348 | usbvision->Vin_Reg2_Preset); | 2348 | usbvision->vin_reg2_preset); |
2349 | return errCode; | 2349 | return err_code; |
2350 | } | 2350 | } |
2351 | 2351 | ||
2352 | /* | 2352 | /* |
@@ -2373,7 +2373,7 @@ int usbvision_restart_isoc(struct usb_usbvision *usbvision) | |||
2373 | (ret = | 2373 | (ret = |
2374 | usbvision_write_reg(usbvision, USBVISION_VIN_REG2, | 2374 | usbvision_write_reg(usbvision, USBVISION_VIN_REG2, |
2375 | USBVISION_KEEP_BLANK | USBVISION_NOHVALID | | 2375 | USBVISION_KEEP_BLANK | USBVISION_NOHVALID | |
2376 | usbvision->Vin_Reg2_Preset)) < 0) return ret; | 2376 | usbvision->vin_reg2_preset)) < 0) return ret; |
2377 | 2377 | ||
2378 | /* TODO: schedule timeout */ | 2378 | /* TODO: schedule timeout */ |
2379 | while ((usbvision_read_reg(usbvision, USBVISION_STATUS_REG) & 0x01) != 1); | 2379 | while ((usbvision_read_reg(usbvision, USBVISION_STATUS_REG) & 0x01) != 1); |
@@ -2387,20 +2387,20 @@ int usbvision_audio_off(struct usb_usbvision *usbvision) | |||
2387 | printk(KERN_ERR "usbvision_audio_off: can't wirte reg\n"); | 2387 | printk(KERN_ERR "usbvision_audio_off: can't wirte reg\n"); |
2388 | return -1; | 2388 | return -1; |
2389 | } | 2389 | } |
2390 | usbvision->AudioMute = 0; | 2390 | usbvision->audio_mute = 0; |
2391 | usbvision->AudioChannel = USBVISION_AUDIO_MUTE; | 2391 | usbvision->audio_channel = USBVISION_AUDIO_MUTE; |
2392 | return 0; | 2392 | return 0; |
2393 | } | 2393 | } |
2394 | 2394 | ||
2395 | int usbvision_set_audio(struct usb_usbvision *usbvision, int AudioChannel) | 2395 | int usbvision_set_audio(struct usb_usbvision *usbvision, int audio_channel) |
2396 | { | 2396 | { |
2397 | if (!usbvision->AudioMute) { | 2397 | if (!usbvision->audio_mute) { |
2398 | if (usbvision_write_reg(usbvision, USBVISION_IOPIN_REG, AudioChannel) < 0) { | 2398 | if (usbvision_write_reg(usbvision, USBVISION_IOPIN_REG, audio_channel) < 0) { |
2399 | printk(KERN_ERR "usbvision_set_audio: can't write iopin register for audio switching\n"); | 2399 | printk(KERN_ERR "usbvision_set_audio: can't write iopin register for audio switching\n"); |
2400 | return -1; | 2400 | return -1; |
2401 | } | 2401 | } |
2402 | } | 2402 | } |
2403 | usbvision->AudioChannel = AudioChannel; | 2403 | usbvision->audio_channel = audio_channel; |
2404 | return 0; | 2404 | return 0; |
2405 | } | 2405 | } |
2406 | 2406 | ||
@@ -2419,27 +2419,27 @@ int usbvision_setup(struct usb_usbvision *usbvision,int format) | |||
2419 | 2419 | ||
2420 | int usbvision_set_alternate(struct usb_usbvision *dev) | 2420 | int usbvision_set_alternate(struct usb_usbvision *dev) |
2421 | { | 2421 | { |
2422 | int errCode, prev_alt = dev->ifaceAlt; | 2422 | int err_code, prev_alt = dev->iface_alt; |
2423 | int i; | 2423 | int i; |
2424 | 2424 | ||
2425 | dev->ifaceAlt=0; | 2425 | dev->iface_alt=0; |
2426 | for(i=0;i< dev->num_alt; i++) | 2426 | for(i=0;i< dev->num_alt; i++) |
2427 | if(dev->alt_max_pkt_size[i]>dev->alt_max_pkt_size[dev->ifaceAlt]) | 2427 | if(dev->alt_max_pkt_size[i]>dev->alt_max_pkt_size[dev->iface_alt]) |
2428 | dev->ifaceAlt=i; | 2428 | dev->iface_alt=i; |
2429 | 2429 | ||
2430 | if (dev->ifaceAlt != prev_alt) { | 2430 | if (dev->iface_alt != prev_alt) { |
2431 | dev->isocPacketSize = dev->alt_max_pkt_size[dev->ifaceAlt]; | 2431 | dev->isoc_packet_size = dev->alt_max_pkt_size[dev->iface_alt]; |
2432 | PDEBUG(DBG_FUNC,"setting alternate %d with wMaxPacketSize=%u", dev->ifaceAlt,dev->isocPacketSize); | 2432 | PDEBUG(DBG_FUNC,"setting alternate %d with max_packet_size=%u", dev->iface_alt,dev->isoc_packet_size); |
2433 | errCode = usb_set_interface(dev->dev, dev->iface, dev->ifaceAlt); | 2433 | err_code = usb_set_interface(dev->dev, dev->iface, dev->iface_alt); |
2434 | if (errCode < 0) { | 2434 | if (err_code < 0) { |
2435 | dev_err(&dev->dev->dev, | 2435 | dev_err(&dev->dev->dev, |
2436 | "cannot change alternate number to %d (error=%i)\n", | 2436 | "cannot change alternate number to %d (error=%i)\n", |
2437 | dev->ifaceAlt, errCode); | 2437 | dev->iface_alt, err_code); |
2438 | return errCode; | 2438 | return err_code; |
2439 | } | 2439 | } |
2440 | } | 2440 | } |
2441 | 2441 | ||
2442 | PDEBUG(DBG_ISOC, "ISO Packet Length:%d", dev->isocPacketSize); | 2442 | PDEBUG(DBG_ISOC, "ISO Packet Length:%d", dev->isoc_packet_size); |
2443 | 2443 | ||
2444 | return 0; | 2444 | return 0; |
2445 | } | 2445 | } |
@@ -2451,27 +2451,27 @@ int usbvision_set_alternate(struct usb_usbvision *dev) | |||
2451 | int usbvision_init_isoc(struct usb_usbvision *usbvision) | 2451 | int usbvision_init_isoc(struct usb_usbvision *usbvision) |
2452 | { | 2452 | { |
2453 | struct usb_device *dev = usbvision->dev; | 2453 | struct usb_device *dev = usbvision->dev; |
2454 | int bufIdx, errCode, regValue; | 2454 | int buf_idx, err_code, reg_value; |
2455 | int sb_size; | 2455 | int sb_size; |
2456 | 2456 | ||
2457 | if (!USBVISION_IS_OPERATIONAL(usbvision)) | 2457 | if (!USBVISION_IS_OPERATIONAL(usbvision)) |
2458 | return -EFAULT; | 2458 | return -EFAULT; |
2459 | 2459 | ||
2460 | usbvision->curFrame = NULL; | 2460 | usbvision->cur_frame = NULL; |
2461 | scratch_reset(usbvision); | 2461 | scratch_reset(usbvision); |
2462 | 2462 | ||
2463 | /* Alternate interface 1 is is the biggest frame size */ | 2463 | /* Alternate interface 1 is is the biggest frame size */ |
2464 | errCode = usbvision_set_alternate(usbvision); | 2464 | err_code = usbvision_set_alternate(usbvision); |
2465 | if (errCode < 0) { | 2465 | if (err_code < 0) { |
2466 | usbvision->last_error = errCode; | 2466 | usbvision->last_error = err_code; |
2467 | return -EBUSY; | 2467 | return -EBUSY; |
2468 | } | 2468 | } |
2469 | sb_size = USBVISION_URB_FRAMES * usbvision->isocPacketSize; | 2469 | sb_size = USBVISION_URB_FRAMES * usbvision->isoc_packet_size; |
2470 | 2470 | ||
2471 | regValue = (16 - usbvision_read_reg(usbvision, | 2471 | reg_value = (16 - usbvision_read_reg(usbvision, |
2472 | USBVISION_ALTER_REG)) & 0x0F; | 2472 | USBVISION_ALTER_REG)) & 0x0F; |
2473 | 2473 | ||
2474 | usbvision->usb_bandwidth = regValue >> 1; | 2474 | usbvision->usb_bandwidth = reg_value >> 1; |
2475 | PDEBUG(DBG_ISOC, "USB Bandwidth Usage: %dMbit/Sec", | 2475 | PDEBUG(DBG_ISOC, "USB Bandwidth Usage: %dMbit/Sec", |
2476 | usbvision->usb_bandwidth); | 2476 | usbvision->usb_bandwidth); |
2477 | 2477 | ||
@@ -2479,7 +2479,7 @@ int usbvision_init_isoc(struct usb_usbvision *usbvision) | |||
2479 | 2479 | ||
2480 | /* We double buffer the Iso lists */ | 2480 | /* We double buffer the Iso lists */ |
2481 | 2481 | ||
2482 | for (bufIdx = 0; bufIdx < USBVISION_NUMSBUF; bufIdx++) { | 2482 | for (buf_idx = 0; buf_idx < USBVISION_NUMSBUF; buf_idx++) { |
2483 | int j, k; | 2483 | int j, k; |
2484 | struct urb *urb; | 2484 | struct urb *urb; |
2485 | 2485 | ||
@@ -2489,8 +2489,8 @@ int usbvision_init_isoc(struct usb_usbvision *usbvision) | |||
2489 | "%s: usb_alloc_urb() failed\n", __func__); | 2489 | "%s: usb_alloc_urb() failed\n", __func__); |
2490 | return -ENOMEM; | 2490 | return -ENOMEM; |
2491 | } | 2491 | } |
2492 | usbvision->sbuf[bufIdx].urb = urb; | 2492 | usbvision->sbuf[buf_idx].urb = urb; |
2493 | usbvision->sbuf[bufIdx].data = | 2493 | usbvision->sbuf[buf_idx].data = |
2494 | usb_alloc_coherent(usbvision->dev, | 2494 | usb_alloc_coherent(usbvision->dev, |
2495 | sb_size, | 2495 | sb_size, |
2496 | GFP_KERNEL, | 2496 | GFP_KERNEL, |
@@ -2500,31 +2500,31 @@ int usbvision_init_isoc(struct usb_usbvision *usbvision) | |||
2500 | urb->pipe = usb_rcvisocpipe(dev, usbvision->video_endp); | 2500 | urb->pipe = usb_rcvisocpipe(dev, usbvision->video_endp); |
2501 | urb->transfer_flags = URB_ISO_ASAP | URB_NO_TRANSFER_DMA_MAP; | 2501 | urb->transfer_flags = URB_ISO_ASAP | URB_NO_TRANSFER_DMA_MAP; |
2502 | urb->interval = 1; | 2502 | urb->interval = 1; |
2503 | urb->transfer_buffer = usbvision->sbuf[bufIdx].data; | 2503 | urb->transfer_buffer = usbvision->sbuf[buf_idx].data; |
2504 | urb->complete = usbvision_isocIrq; | 2504 | urb->complete = usbvision_isoc_irq; |
2505 | urb->number_of_packets = USBVISION_URB_FRAMES; | 2505 | urb->number_of_packets = USBVISION_URB_FRAMES; |
2506 | urb->transfer_buffer_length = | 2506 | urb->transfer_buffer_length = |
2507 | usbvision->isocPacketSize * USBVISION_URB_FRAMES; | 2507 | usbvision->isoc_packet_size * USBVISION_URB_FRAMES; |
2508 | for (j = k = 0; j < USBVISION_URB_FRAMES; j++, | 2508 | for (j = k = 0; j < USBVISION_URB_FRAMES; j++, |
2509 | k += usbvision->isocPacketSize) { | 2509 | k += usbvision->isoc_packet_size) { |
2510 | urb->iso_frame_desc[j].offset = k; | 2510 | urb->iso_frame_desc[j].offset = k; |
2511 | urb->iso_frame_desc[j].length = | 2511 | urb->iso_frame_desc[j].length = |
2512 | usbvision->isocPacketSize; | 2512 | usbvision->isoc_packet_size; |
2513 | } | 2513 | } |
2514 | } | 2514 | } |
2515 | 2515 | ||
2516 | /* Submit all URBs */ | 2516 | /* Submit all URBs */ |
2517 | for (bufIdx = 0; bufIdx < USBVISION_NUMSBUF; bufIdx++) { | 2517 | for (buf_idx = 0; buf_idx < USBVISION_NUMSBUF; buf_idx++) { |
2518 | errCode = usb_submit_urb(usbvision->sbuf[bufIdx].urb, | 2518 | err_code = usb_submit_urb(usbvision->sbuf[buf_idx].urb, |
2519 | GFP_KERNEL); | 2519 | GFP_KERNEL); |
2520 | if (errCode) { | 2520 | if (err_code) { |
2521 | dev_err(&usbvision->dev->dev, | 2521 | dev_err(&usbvision->dev->dev, |
2522 | "%s: usb_submit_urb(%d) failed: error %d\n", | 2522 | "%s: usb_submit_urb(%d) failed: error %d\n", |
2523 | __func__, bufIdx, errCode); | 2523 | __func__, buf_idx, err_code); |
2524 | } | 2524 | } |
2525 | } | 2525 | } |
2526 | 2526 | ||
2527 | usbvision->streaming = Stream_Idle; | 2527 | usbvision->streaming = stream_idle; |
2528 | PDEBUG(DBG_ISOC, "%s: streaming=1 usbvision->video_endp=$%02x", | 2528 | PDEBUG(DBG_ISOC, "%s: streaming=1 usbvision->video_endp=$%02x", |
2529 | __func__, | 2529 | __func__, |
2530 | usbvision->video_endp); | 2530 | usbvision->video_endp); |
@@ -2540,47 +2540,47 @@ int usbvision_init_isoc(struct usb_usbvision *usbvision) | |||
2540 | */ | 2540 | */ |
2541 | void usbvision_stop_isoc(struct usb_usbvision *usbvision) | 2541 | void usbvision_stop_isoc(struct usb_usbvision *usbvision) |
2542 | { | 2542 | { |
2543 | int bufIdx, errCode, regValue; | 2543 | int buf_idx, err_code, reg_value; |
2544 | int sb_size = USBVISION_URB_FRAMES * usbvision->isocPacketSize; | 2544 | int sb_size = USBVISION_URB_FRAMES * usbvision->isoc_packet_size; |
2545 | 2545 | ||
2546 | if ((usbvision->streaming == Stream_Off) || (usbvision->dev == NULL)) | 2546 | if ((usbvision->streaming == stream_off) || (usbvision->dev == NULL)) |
2547 | return; | 2547 | return; |
2548 | 2548 | ||
2549 | /* Unschedule all of the iso td's */ | 2549 | /* Unschedule all of the iso td's */ |
2550 | for (bufIdx = 0; bufIdx < USBVISION_NUMSBUF; bufIdx++) { | 2550 | for (buf_idx = 0; buf_idx < USBVISION_NUMSBUF; buf_idx++) { |
2551 | usb_kill_urb(usbvision->sbuf[bufIdx].urb); | 2551 | usb_kill_urb(usbvision->sbuf[buf_idx].urb); |
2552 | if (usbvision->sbuf[bufIdx].data){ | 2552 | if (usbvision->sbuf[buf_idx].data){ |
2553 | usb_free_coherent(usbvision->dev, | 2553 | usb_free_coherent(usbvision->dev, |
2554 | sb_size, | 2554 | sb_size, |
2555 | usbvision->sbuf[bufIdx].data, | 2555 | usbvision->sbuf[buf_idx].data, |
2556 | usbvision->sbuf[bufIdx].urb->transfer_dma); | 2556 | usbvision->sbuf[buf_idx].urb->transfer_dma); |
2557 | } | 2557 | } |
2558 | usb_free_urb(usbvision->sbuf[bufIdx].urb); | 2558 | usb_free_urb(usbvision->sbuf[buf_idx].urb); |
2559 | usbvision->sbuf[bufIdx].urb = NULL; | 2559 | usbvision->sbuf[buf_idx].urb = NULL; |
2560 | } | 2560 | } |
2561 | 2561 | ||
2562 | PDEBUG(DBG_ISOC, "%s: streaming=Stream_Off\n", __func__); | 2562 | PDEBUG(DBG_ISOC, "%s: streaming=stream_off\n", __func__); |
2563 | usbvision->streaming = Stream_Off; | 2563 | usbvision->streaming = stream_off; |
2564 | 2564 | ||
2565 | if (!usbvision->remove_pending) { | 2565 | if (!usbvision->remove_pending) { |
2566 | 2566 | ||
2567 | /* Set packet size to 0 */ | 2567 | /* Set packet size to 0 */ |
2568 | usbvision->ifaceAlt=0; | 2568 | usbvision->iface_alt=0; |
2569 | errCode = usb_set_interface(usbvision->dev, usbvision->iface, | 2569 | err_code = usb_set_interface(usbvision->dev, usbvision->iface, |
2570 | usbvision->ifaceAlt); | 2570 | usbvision->iface_alt); |
2571 | if (errCode < 0) { | 2571 | if (err_code < 0) { |
2572 | dev_err(&usbvision->dev->dev, | 2572 | dev_err(&usbvision->dev->dev, |
2573 | "%s: usb_set_interface() failed: error %d\n", | 2573 | "%s: usb_set_interface() failed: error %d\n", |
2574 | __func__, errCode); | 2574 | __func__, err_code); |
2575 | usbvision->last_error = errCode; | 2575 | usbvision->last_error = err_code; |
2576 | } | 2576 | } |
2577 | regValue = (16-usbvision_read_reg(usbvision, USBVISION_ALTER_REG)) & 0x0F; | 2577 | reg_value = (16-usbvision_read_reg(usbvision, USBVISION_ALTER_REG)) & 0x0F; |
2578 | usbvision->isocPacketSize = | 2578 | usbvision->isoc_packet_size = |
2579 | (regValue == 0) ? 0 : (regValue * 64) - 1; | 2579 | (reg_value == 0) ? 0 : (reg_value * 64) - 1; |
2580 | PDEBUG(DBG_ISOC, "ISO Packet Length:%d", | 2580 | PDEBUG(DBG_ISOC, "ISO Packet Length:%d", |
2581 | usbvision->isocPacketSize); | 2581 | usbvision->isoc_packet_size); |
2582 | 2582 | ||
2583 | usbvision->usb_bandwidth = regValue >> 1; | 2583 | usbvision->usb_bandwidth = reg_value >> 1; |
2584 | PDEBUG(DBG_ISOC, "USB Bandwidth Usage: %dMbit/Sec", | 2584 | PDEBUG(DBG_ISOC, "USB Bandwidth Usage: %dMbit/Sec", |
2585 | usbvision->usb_bandwidth); | 2585 | usbvision->usb_bandwidth); |
2586 | } | 2586 | } |
@@ -2604,12 +2604,12 @@ int usbvision_muxsel(struct usb_usbvision *usbvision, int channel) | |||
2604 | // Regular USB TV Tuners -> channel: 0 = Television, 1 = Composite, 2 = S-Video | 2604 | // Regular USB TV Tuners -> channel: 0 = Television, 1 = Composite, 2 = S-Video |
2605 | // Four video input devices -> channel: 0 = Chan White, 1 = Chan Green, 2 = Chan Yellow, 3 = Chan Red | 2605 | // Four video input devices -> channel: 0 = Chan White, 1 = Chan Green, 2 = Chan Yellow, 3 = Chan Red |
2606 | 2606 | ||
2607 | switch (usbvision_device_data[usbvision->DevModel].Codec) { | 2607 | switch (usbvision_device_data[usbvision->dev_model].codec) { |
2608 | case CODEC_SAA7113: | 2608 | case CODEC_SAA7113: |
2609 | mode[1] = SAA7115_COMPOSITE2; | 2609 | mode[1] = SAA7115_COMPOSITE2; |
2610 | if (SwitchSVideoInput) { | 2610 | if (switch_svideo_input) { |
2611 | /* To handle problems with S-Video Input for | 2611 | /* To handle problems with S-Video Input for |
2612 | * some devices. Use SwitchSVideoInput | 2612 | * some devices. Use switch_svideo_input |
2613 | * parameter when loading the module.*/ | 2613 | * parameter when loading the module.*/ |
2614 | mode[2] = SAA7115_COMPOSITE1; | 2614 | mode[2] = SAA7115_COMPOSITE1; |
2615 | } | 2615 | } |
diff --git a/drivers/media/video/usbvision/usbvision-i2c.c b/drivers/media/video/usbvision/usbvision-i2c.c index 81dd53bb5267..7b2cd00bf004 100644 --- a/drivers/media/video/usbvision/usbvision-i2c.c +++ b/drivers/media/video/usbvision/usbvision-i2c.c | |||
@@ -244,7 +244,7 @@ int usbvision_i2c_register(struct usb_usbvision *usbvision) | |||
244 | PDEBUG(DBG_I2C, "i2c bus for %s registered", usbvision->i2c_adap.name); | 244 | PDEBUG(DBG_I2C, "i2c bus for %s registered", usbvision->i2c_adap.name); |
245 | 245 | ||
246 | /* Request the load of the i2c modules we need */ | 246 | /* Request the load of the i2c modules we need */ |
247 | switch (usbvision_device_data[usbvision->DevModel].Codec) { | 247 | switch (usbvision_device_data[usbvision->dev_model].codec) { |
248 | case CODEC_SAA7113: | 248 | case CODEC_SAA7113: |
249 | case CODEC_SAA7111: | 249 | case CODEC_SAA7111: |
250 | /* Without this delay the detection of the saa711x is | 250 | /* Without this delay the detection of the saa711x is |
@@ -255,7 +255,7 @@ int usbvision_i2c_register(struct usb_usbvision *usbvision) | |||
255 | "saa7115_auto", 0, saa711x_addrs); | 255 | "saa7115_auto", 0, saa711x_addrs); |
256 | break; | 256 | break; |
257 | } | 257 | } |
258 | if (usbvision_device_data[usbvision->DevModel].Tuner == 1) { | 258 | if (usbvision_device_data[usbvision->dev_model].tuner == 1) { |
259 | struct v4l2_subdev *sd; | 259 | struct v4l2_subdev *sd; |
260 | enum v4l2_i2c_tuner_type type; | 260 | enum v4l2_i2c_tuner_type type; |
261 | struct tuner_setup tun_setup; | 261 | struct tuner_setup tun_setup; |
@@ -426,18 +426,18 @@ static int usbvision_i2c_write_max4(struct usb_usbvision *usbvision, | |||
426 | static int usbvision_i2c_write(struct usb_usbvision *usbvision, unsigned char addr, char *buf, | 426 | static int usbvision_i2c_write(struct usb_usbvision *usbvision, unsigned char addr, char *buf, |
427 | short len) | 427 | short len) |
428 | { | 428 | { |
429 | char *bufPtr = buf; | 429 | char *buf_ptr = buf; |
430 | int retval; | 430 | int retval; |
431 | int wrcount = 0; | 431 | int wrcount = 0; |
432 | int count; | 432 | int count; |
433 | int maxLen = 4; | 433 | int max_len = 4; |
434 | 434 | ||
435 | while (len > 0) { | 435 | while (len > 0) { |
436 | count = (len > maxLen) ? maxLen : len; | 436 | count = (len > max_len) ? max_len : len; |
437 | retval = usbvision_i2c_write_max4(usbvision, addr, bufPtr, count); | 437 | retval = usbvision_i2c_write_max4(usbvision, addr, buf_ptr, count); |
438 | if (retval > 0) { | 438 | if (retval > 0) { |
439 | len -= count; | 439 | len -= count; |
440 | bufPtr += count; | 440 | buf_ptr += count; |
441 | wrcount += count; | 441 | wrcount += count; |
442 | } else | 442 | } else |
443 | return (retval < 0) ? retval : -EFAULT; | 443 | return (retval < 0) ? retval : -EFAULT; |
diff --git a/drivers/media/video/usbvision/usbvision-video.c b/drivers/media/video/usbvision/usbvision-video.c index a5709a576772..4882ea087b92 100644 --- a/drivers/media/video/usbvision/usbvision-video.c +++ b/drivers/media/video/usbvision/usbvision-video.c | |||
@@ -127,11 +127,11 @@ static void usbvision_release(struct usb_usbvision *usbvision); | |||
127 | 127 | ||
128 | /* Default initialization of device driver parameters */ | 128 | /* Default initialization of device driver parameters */ |
129 | /* Set the default format for ISOC endpoint */ | 129 | /* Set the default format for ISOC endpoint */ |
130 | static int isocMode = ISOC_MODE_COMPRESS; | 130 | static int isoc_mode = ISOC_MODE_COMPRESS; |
131 | /* Set the default Debug Mode of the device driver */ | 131 | /* Set the default Debug Mode of the device driver */ |
132 | static int video_debug; | 132 | static int video_debug; |
133 | /* Set the default device to power on at startup */ | 133 | /* Set the default device to power on at startup */ |
134 | static int PowerOnAtOpen = 1; | 134 | static int power_on_at_open = 1; |
135 | /* Sequential Number of Video Device */ | 135 | /* Sequential Number of Video Device */ |
136 | static int video_nr = -1; | 136 | static int video_nr = -1; |
137 | /* Sequential Number of Radio Device */ | 137 | /* Sequential Number of Radio Device */ |
@@ -140,15 +140,15 @@ static int radio_nr = -1; | |||
140 | /* Grab parameters for the device driver */ | 140 | /* Grab parameters for the device driver */ |
141 | 141 | ||
142 | /* Showing parameters under SYSFS */ | 142 | /* Showing parameters under SYSFS */ |
143 | module_param(isocMode, int, 0444); | 143 | module_param(isoc_mode, int, 0444); |
144 | module_param(video_debug, int, 0444); | 144 | module_param(video_debug, int, 0444); |
145 | module_param(PowerOnAtOpen, int, 0444); | 145 | module_param(power_on_at_open, int, 0444); |
146 | module_param(video_nr, int, 0444); | 146 | module_param(video_nr, int, 0444); |
147 | module_param(radio_nr, int, 0444); | 147 | module_param(radio_nr, int, 0444); |
148 | 148 | ||
149 | MODULE_PARM_DESC(isocMode, " Set the default format for ISOC endpoint. Default: 0x60 (Compression On)"); | 149 | MODULE_PARM_DESC(isoc_mode, " Set the default format for ISOC endpoint. Default: 0x60 (Compression On)"); |
150 | MODULE_PARM_DESC(video_debug, " Set the default Debug Mode of the device driver. Default: 0 (Off)"); | 150 | MODULE_PARM_DESC(video_debug, " Set the default Debug Mode of the device driver. Default: 0 (Off)"); |
151 | MODULE_PARM_DESC(PowerOnAtOpen, " Set the default device to power on when device is opened. Default: 1 (On)"); | 151 | MODULE_PARM_DESC(power_on_at_open, " Set the default device to power on when device is opened. Default: 1 (On)"); |
152 | MODULE_PARM_DESC(video_nr, "Set video device number (/dev/videoX). Default: -1 (autodetect)"); | 152 | MODULE_PARM_DESC(video_nr, "Set video device number (/dev/videoX). Default: -1 (autodetect)"); |
153 | MODULE_PARM_DESC(radio_nr, "Set radio device number (/dev/radioX). Default: -1 (autodetect)"); | 153 | MODULE_PARM_DESC(radio_nr, "Set radio device number (/dev/radioX). Default: -1 (autodetect)"); |
154 | 154 | ||
@@ -192,7 +192,7 @@ static ssize_t show_model(struct device *cd, | |||
192 | container_of(cd, struct video_device, dev); | 192 | container_of(cd, struct video_device, dev); |
193 | struct usb_usbvision *usbvision = video_get_drvdata(vdev); | 193 | struct usb_usbvision *usbvision = video_get_drvdata(vdev); |
194 | return sprintf(buf, "%s\n", | 194 | return sprintf(buf, "%s\n", |
195 | usbvision_device_data[usbvision->DevModel].ModelString); | 195 | usbvision_device_data[usbvision->dev_model].model_string); |
196 | } | 196 | } |
197 | static DEVICE_ATTR(model, S_IRUGO, show_model, NULL); | 197 | static DEVICE_ATTR(model, S_IRUGO, show_model, NULL); |
198 | 198 | ||
@@ -263,7 +263,7 @@ static ssize_t show_streaming(struct device *cd, | |||
263 | container_of(cd, struct video_device, dev); | 263 | container_of(cd, struct video_device, dev); |
264 | struct usb_usbvision *usbvision = video_get_drvdata(vdev); | 264 | struct usb_usbvision *usbvision = video_get_drvdata(vdev); |
265 | return sprintf(buf, "%s\n", | 265 | return sprintf(buf, "%s\n", |
266 | YES_NO(usbvision->streaming==Stream_On?1:0)); | 266 | YES_NO(usbvision->streaming==stream_on?1:0)); |
267 | } | 267 | } |
268 | static DEVICE_ATTR(streaming, S_IRUGO, show_streaming, NULL); | 268 | static DEVICE_ATTR(streaming, S_IRUGO, show_streaming, NULL); |
269 | 269 | ||
@@ -274,7 +274,7 @@ static ssize_t show_compression(struct device *cd, | |||
274 | container_of(cd, struct video_device, dev); | 274 | container_of(cd, struct video_device, dev); |
275 | struct usb_usbvision *usbvision = video_get_drvdata(vdev); | 275 | struct usb_usbvision *usbvision = video_get_drvdata(vdev); |
276 | return sprintf(buf, "%s\n", | 276 | return sprintf(buf, "%s\n", |
277 | YES_NO(usbvision->isocMode==ISOC_MODE_COMPRESS)); | 277 | YES_NO(usbvision->isoc_mode==ISOC_MODE_COMPRESS)); |
278 | } | 278 | } |
279 | static DEVICE_ATTR(compression, S_IRUGO, show_compression, NULL); | 279 | static DEVICE_ATTR(compression, S_IRUGO, show_compression, NULL); |
280 | 280 | ||
@@ -284,7 +284,7 @@ static ssize_t show_device_bridge(struct device *cd, | |||
284 | struct video_device *vdev = | 284 | struct video_device *vdev = |
285 | container_of(cd, struct video_device, dev); | 285 | container_of(cd, struct video_device, dev); |
286 | struct usb_usbvision *usbvision = video_get_drvdata(vdev); | 286 | struct usb_usbvision *usbvision = video_get_drvdata(vdev); |
287 | return sprintf(buf, "%d\n", usbvision->bridgeType); | 287 | return sprintf(buf, "%d\n", usbvision->bridge_type); |
288 | } | 288 | } |
289 | static DEVICE_ATTR(bridge, S_IRUGO, show_device_bridge, NULL); | 289 | static DEVICE_ATTR(bridge, S_IRUGO, show_device_bridge, NULL); |
290 | 290 | ||
@@ -352,23 +352,23 @@ static void usbvision_remove_sysfs(struct video_device *vdev) | |||
352 | static int usbvision_v4l2_open(struct file *file) | 352 | static int usbvision_v4l2_open(struct file *file) |
353 | { | 353 | { |
354 | struct usb_usbvision *usbvision = video_drvdata(file); | 354 | struct usb_usbvision *usbvision = video_drvdata(file); |
355 | int errCode = 0; | 355 | int err_code = 0; |
356 | 356 | ||
357 | PDEBUG(DBG_IO, "open"); | 357 | PDEBUG(DBG_IO, "open"); |
358 | 358 | ||
359 | usbvision_reset_powerOffTimer(usbvision); | 359 | usbvision_reset_power_off_timer(usbvision); |
360 | 360 | ||
361 | if (usbvision->user) | 361 | if (usbvision->user) |
362 | errCode = -EBUSY; | 362 | err_code = -EBUSY; |
363 | else { | 363 | else { |
364 | /* Allocate memory for the scratch ring buffer */ | 364 | /* Allocate memory for the scratch ring buffer */ |
365 | errCode = usbvision_scratch_alloc(usbvision); | 365 | err_code = usbvision_scratch_alloc(usbvision); |
366 | if (isocMode==ISOC_MODE_COMPRESS) { | 366 | if (isoc_mode==ISOC_MODE_COMPRESS) { |
367 | /* Allocate intermediate decompression buffers | 367 | /* Allocate intermediate decompression buffers |
368 | only if needed */ | 368 | only if needed */ |
369 | errCode = usbvision_decompress_alloc(usbvision); | 369 | err_code = usbvision_decompress_alloc(usbvision); |
370 | } | 370 | } |
371 | if (errCode) { | 371 | if (err_code) { |
372 | /* Deallocate all buffers if trouble */ | 372 | /* Deallocate all buffers if trouble */ |
373 | usbvision_scratch_free(usbvision); | 373 | usbvision_scratch_free(usbvision); |
374 | usbvision_decompress_free(usbvision); | 374 | usbvision_decompress_free(usbvision); |
@@ -376,7 +376,7 @@ static int usbvision_v4l2_open(struct file *file) | |||
376 | } | 376 | } |
377 | 377 | ||
378 | /* If so far no errors then we shall start the camera */ | 378 | /* If so far no errors then we shall start the camera */ |
379 | if (!errCode) { | 379 | if (!err_code) { |
380 | if (usbvision->power == 0) { | 380 | if (usbvision->power == 0) { |
381 | usbvision_power_on(usbvision); | 381 | usbvision_power_on(usbvision); |
382 | usbvision_i2c_register(usbvision); | 382 | usbvision_i2c_register(usbvision); |
@@ -385,21 +385,21 @@ static int usbvision_v4l2_open(struct file *file) | |||
385 | /* Send init sequence only once, it's large! */ | 385 | /* Send init sequence only once, it's large! */ |
386 | if (!usbvision->initialized) { | 386 | if (!usbvision->initialized) { |
387 | int setup_ok = 0; | 387 | int setup_ok = 0; |
388 | setup_ok = usbvision_setup(usbvision,isocMode); | 388 | setup_ok = usbvision_setup(usbvision,isoc_mode); |
389 | if (setup_ok) | 389 | if (setup_ok) |
390 | usbvision->initialized = 1; | 390 | usbvision->initialized = 1; |
391 | else | 391 | else |
392 | errCode = -EBUSY; | 392 | err_code = -EBUSY; |
393 | } | 393 | } |
394 | 394 | ||
395 | if (!errCode) { | 395 | if (!err_code) { |
396 | usbvision_begin_streaming(usbvision); | 396 | usbvision_begin_streaming(usbvision); |
397 | errCode = usbvision_init_isoc(usbvision); | 397 | err_code = usbvision_init_isoc(usbvision); |
398 | /* device must be initialized before isoc transfer */ | 398 | /* device must be initialized before isoc transfer */ |
399 | usbvision_muxsel(usbvision,0); | 399 | usbvision_muxsel(usbvision,0); |
400 | usbvision->user++; | 400 | usbvision->user++; |
401 | } else { | 401 | } else { |
402 | if (PowerOnAtOpen) { | 402 | if (power_on_at_open) { |
403 | usbvision_i2c_unregister(usbvision); | 403 | usbvision_i2c_unregister(usbvision); |
404 | usbvision_power_off(usbvision); | 404 | usbvision_power_off(usbvision); |
405 | usbvision->initialized = 0; | 405 | usbvision->initialized = 0; |
@@ -411,7 +411,7 @@ static int usbvision_v4l2_open(struct file *file) | |||
411 | usbvision_empty_framequeues(usbvision); | 411 | usbvision_empty_framequeues(usbvision); |
412 | 412 | ||
413 | PDEBUG(DBG_IO, "success"); | 413 | PDEBUG(DBG_IO, "success"); |
414 | return errCode; | 414 | return err_code; |
415 | } | 415 | } |
416 | 416 | ||
417 | /* | 417 | /* |
@@ -439,10 +439,10 @@ static int usbvision_v4l2_close(struct file *file) | |||
439 | 439 | ||
440 | usbvision->user--; | 440 | usbvision->user--; |
441 | 441 | ||
442 | if (PowerOnAtOpen) { | 442 | if (power_on_at_open) { |
443 | /* power off in a little while | 443 | /* power off in a little while |
444 | to avoid off/on every close/open short sequences */ | 444 | to avoid off/on every close/open short sequences */ |
445 | usbvision_set_powerOffTimer(usbvision); | 445 | usbvision_set_power_off_timer(usbvision); |
446 | usbvision->initialized = 0; | 446 | usbvision->initialized = 0; |
447 | } | 447 | } |
448 | 448 | ||
@@ -467,19 +467,19 @@ static int vidioc_g_register (struct file *file, void *priv, | |||
467 | struct v4l2_dbg_register *reg) | 467 | struct v4l2_dbg_register *reg) |
468 | { | 468 | { |
469 | struct usb_usbvision *usbvision = video_drvdata(file); | 469 | struct usb_usbvision *usbvision = video_drvdata(file); |
470 | int errCode; | 470 | int err_code; |
471 | 471 | ||
472 | if (!v4l2_chip_match_host(®->match)) | 472 | if (!v4l2_chip_match_host(®->match)) |
473 | return -EINVAL; | 473 | return -EINVAL; |
474 | /* NT100x has a 8-bit register space */ | 474 | /* NT100x has a 8-bit register space */ |
475 | errCode = usbvision_read_reg(usbvision, reg->reg&0xff); | 475 | err_code = usbvision_read_reg(usbvision, reg->reg&0xff); |
476 | if (errCode < 0) { | 476 | if (err_code < 0) { |
477 | dev_err(&usbvision->vdev->dev, | 477 | dev_err(&usbvision->vdev->dev, |
478 | "%s: VIDIOC_DBG_G_REGISTER failed: error %d\n", | 478 | "%s: VIDIOC_DBG_G_REGISTER failed: error %d\n", |
479 | __func__, errCode); | 479 | __func__, err_code); |
480 | return errCode; | 480 | return err_code; |
481 | } | 481 | } |
482 | reg->val = errCode; | 482 | reg->val = err_code; |
483 | reg->size = 1; | 483 | reg->size = 1; |
484 | return 0; | 484 | return 0; |
485 | } | 485 | } |
@@ -488,17 +488,17 @@ static int vidioc_s_register (struct file *file, void *priv, | |||
488 | struct v4l2_dbg_register *reg) | 488 | struct v4l2_dbg_register *reg) |
489 | { | 489 | { |
490 | struct usb_usbvision *usbvision = video_drvdata(file); | 490 | struct usb_usbvision *usbvision = video_drvdata(file); |
491 | int errCode; | 491 | int err_code; |
492 | 492 | ||
493 | if (!v4l2_chip_match_host(®->match)) | 493 | if (!v4l2_chip_match_host(®->match)) |
494 | return -EINVAL; | 494 | return -EINVAL; |
495 | /* NT100x has a 8-bit register space */ | 495 | /* NT100x has a 8-bit register space */ |
496 | errCode = usbvision_write_reg(usbvision, reg->reg&0xff, reg->val); | 496 | err_code = usbvision_write_reg(usbvision, reg->reg&0xff, reg->val); |
497 | if (errCode < 0) { | 497 | if (err_code < 0) { |
498 | dev_err(&usbvision->vdev->dev, | 498 | dev_err(&usbvision->vdev->dev, |
499 | "%s: VIDIOC_DBG_S_REGISTER failed: error %d\n", | 499 | "%s: VIDIOC_DBG_S_REGISTER failed: error %d\n", |
500 | __func__, errCode); | 500 | __func__, err_code); |
501 | return errCode; | 501 | return err_code; |
502 | } | 502 | } |
503 | return 0; | 503 | return 0; |
504 | } | 504 | } |
@@ -511,7 +511,7 @@ static int vidioc_querycap (struct file *file, void *priv, | |||
511 | 511 | ||
512 | strlcpy(vc->driver, "USBVision", sizeof(vc->driver)); | 512 | strlcpy(vc->driver, "USBVision", sizeof(vc->driver)); |
513 | strlcpy(vc->card, | 513 | strlcpy(vc->card, |
514 | usbvision_device_data[usbvision->DevModel].ModelString, | 514 | usbvision_device_data[usbvision->dev_model].model_string, |
515 | sizeof(vc->card)); | 515 | sizeof(vc->card)); |
516 | usb_make_path(usbvision->dev, vc->bus_info, sizeof(vc->bus_info)); | 516 | usb_make_path(usbvision->dev, vc->bus_info, sizeof(vc->bus_info)); |
517 | vc->version = USBVISION_DRIVER_VERSION; | 517 | vc->version = USBVISION_DRIVER_VERSION; |
@@ -540,7 +540,7 @@ static int vidioc_enum_input (struct file *file, void *priv, | |||
540 | specific for each usbvision card model */ | 540 | specific for each usbvision card model */ |
541 | switch(chan) { | 541 | switch(chan) { |
542 | case 0: | 542 | case 0: |
543 | if (usbvision_device_data[usbvision->DevModel].VideoChannels == 4) { | 543 | if (usbvision_device_data[usbvision->dev_model].video_channels == 4) { |
544 | strcpy(vi->name, "White Video Input"); | 544 | strcpy(vi->name, "White Video Input"); |
545 | } else { | 545 | } else { |
546 | strcpy(vi->name, "Television"); | 546 | strcpy(vi->name, "Television"); |
@@ -552,7 +552,7 @@ static int vidioc_enum_input (struct file *file, void *priv, | |||
552 | break; | 552 | break; |
553 | case 1: | 553 | case 1: |
554 | vi->type = V4L2_INPUT_TYPE_CAMERA; | 554 | vi->type = V4L2_INPUT_TYPE_CAMERA; |
555 | if (usbvision_device_data[usbvision->DevModel].VideoChannels == 4) { | 555 | if (usbvision_device_data[usbvision->dev_model].video_channels == 4) { |
556 | strcpy(vi->name, "Green Video Input"); | 556 | strcpy(vi->name, "Green Video Input"); |
557 | } else { | 557 | } else { |
558 | strcpy(vi->name, "Composite Video Input"); | 558 | strcpy(vi->name, "Composite Video Input"); |
@@ -561,7 +561,7 @@ static int vidioc_enum_input (struct file *file, void *priv, | |||
561 | break; | 561 | break; |
562 | case 2: | 562 | case 2: |
563 | vi->type = V4L2_INPUT_TYPE_CAMERA; | 563 | vi->type = V4L2_INPUT_TYPE_CAMERA; |
564 | if (usbvision_device_data[usbvision->DevModel].VideoChannels == 4) { | 564 | if (usbvision_device_data[usbvision->dev_model].video_channels == 4) { |
565 | strcpy(vi->name, "Yellow Video Input"); | 565 | strcpy(vi->name, "Yellow Video Input"); |
566 | } else { | 566 | } else { |
567 | strcpy(vi->name, "S-Video Input"); | 567 | strcpy(vi->name, "S-Video Input"); |
@@ -604,9 +604,9 @@ static int vidioc_s_std (struct file *file, void *priv, v4l2_std_id *id) | |||
604 | { | 604 | { |
605 | struct usb_usbvision *usbvision = video_drvdata(file); | 605 | struct usb_usbvision *usbvision = video_drvdata(file); |
606 | 606 | ||
607 | usbvision->tvnormId=*id; | 607 | usbvision->tvnorm_id=*id; |
608 | 608 | ||
609 | call_all(usbvision, core, s_std, usbvision->tvnormId); | 609 | call_all(usbvision, core, s_std, usbvision->tvnorm_id); |
610 | /* propagate the change to the decoder */ | 610 | /* propagate the change to the decoder */ |
611 | usbvision_muxsel(usbvision, usbvision->ctl_input); | 611 | usbvision_muxsel(usbvision, usbvision->ctl_input); |
612 | 612 | ||
@@ -744,7 +744,7 @@ static int vidioc_reqbufs (struct file *file, | |||
744 | if (vr->memory != V4L2_MEMORY_MMAP) | 744 | if (vr->memory != V4L2_MEMORY_MMAP) |
745 | return -EINVAL; | 745 | return -EINVAL; |
746 | 746 | ||
747 | if(usbvision->streaming == Stream_On) { | 747 | if(usbvision->streaming == stream_on) { |
748 | if ((ret = usbvision_stream_interrupt(usbvision))) | 748 | if ((ret = usbvision_stream_interrupt(usbvision))) |
749 | return ret; | 749 | return ret; |
750 | } | 750 | } |
@@ -753,7 +753,7 @@ static int vidioc_reqbufs (struct file *file, | |||
753 | usbvision_empty_framequeues(usbvision); | 753 | usbvision_empty_framequeues(usbvision); |
754 | vr->count = usbvision_frames_alloc(usbvision,vr->count); | 754 | vr->count = usbvision_frames_alloc(usbvision,vr->count); |
755 | 755 | ||
756 | usbvision->curFrame = NULL; | 756 | usbvision->cur_frame = NULL; |
757 | 757 | ||
758 | return 0; | 758 | return 0; |
759 | } | 759 | } |
@@ -772,11 +772,11 @@ static int vidioc_querybuf (struct file *file, | |||
772 | /* Updating the corresponding frame state */ | 772 | /* Updating the corresponding frame state */ |
773 | vb->flags = 0; | 773 | vb->flags = 0; |
774 | frame = &usbvision->frame[vb->index]; | 774 | frame = &usbvision->frame[vb->index]; |
775 | if(frame->grabstate >= FrameState_Ready) | 775 | if(frame->grabstate >= frame_state_ready) |
776 | vb->flags |= V4L2_BUF_FLAG_QUEUED; | 776 | vb->flags |= V4L2_BUF_FLAG_QUEUED; |
777 | if(frame->grabstate >= FrameState_Done) | 777 | if(frame->grabstate >= frame_state_done) |
778 | vb->flags |= V4L2_BUF_FLAG_DONE; | 778 | vb->flags |= V4L2_BUF_FLAG_DONE; |
779 | if(frame->grabstate == FrameState_Unused) | 779 | if(frame->grabstate == frame_state_unused) |
780 | vb->flags |= V4L2_BUF_FLAG_MAPPED; | 780 | vb->flags |= V4L2_BUF_FLAG_MAPPED; |
781 | vb->memory = V4L2_MEMORY_MMAP; | 781 | vb->memory = V4L2_MEMORY_MMAP; |
782 | 782 | ||
@@ -805,13 +805,13 @@ static int vidioc_qbuf (struct file *file, void *priv, struct v4l2_buffer *vb) | |||
805 | 805 | ||
806 | frame = &usbvision->frame[vb->index]; | 806 | frame = &usbvision->frame[vb->index]; |
807 | 807 | ||
808 | if (frame->grabstate != FrameState_Unused) { | 808 | if (frame->grabstate != frame_state_unused) { |
809 | return -EAGAIN; | 809 | return -EAGAIN; |
810 | } | 810 | } |
811 | 811 | ||
812 | /* Mark it as ready and enqueue frame */ | 812 | /* Mark it as ready and enqueue frame */ |
813 | frame->grabstate = FrameState_Ready; | 813 | frame->grabstate = frame_state_ready; |
814 | frame->scanstate = ScanState_Scanning; | 814 | frame->scanstate = scan_state_scanning; |
815 | frame->scanlength = 0; /* Accumulated in usbvision_parse_data() */ | 815 | frame->scanlength = 0; /* Accumulated in usbvision_parse_data() */ |
816 | 816 | ||
817 | vb->flags &= ~V4L2_BUF_FLAG_DONE; | 817 | vb->flags &= ~V4L2_BUF_FLAG_DONE; |
@@ -834,7 +834,7 @@ static int vidioc_dqbuf (struct file *file, void *priv, struct v4l2_buffer *vb) | |||
834 | unsigned long lock_flags; | 834 | unsigned long lock_flags; |
835 | 835 | ||
836 | if (list_empty(&(usbvision->outqueue))) { | 836 | if (list_empty(&(usbvision->outqueue))) { |
837 | if (usbvision->streaming == Stream_Idle) | 837 | if (usbvision->streaming == stream_idle) |
838 | return -EINVAL; | 838 | return -EINVAL; |
839 | ret = wait_event_interruptible | 839 | ret = wait_event_interruptible |
840 | (usbvision->wait_frame, | 840 | (usbvision->wait_frame, |
@@ -849,7 +849,7 @@ static int vidioc_dqbuf (struct file *file, void *priv, struct v4l2_buffer *vb) | |||
849 | list_del(usbvision->outqueue.next); | 849 | list_del(usbvision->outqueue.next); |
850 | spin_unlock_irqrestore(&usbvision->queue_lock, lock_flags); | 850 | spin_unlock_irqrestore(&usbvision->queue_lock, lock_flags); |
851 | 851 | ||
852 | f->grabstate = FrameState_Unused; | 852 | f->grabstate = frame_state_unused; |
853 | 853 | ||
854 | vb->memory = V4L2_MEMORY_MMAP; | 854 | vb->memory = V4L2_MEMORY_MMAP; |
855 | vb->flags = V4L2_BUF_FLAG_MAPPED | | 855 | vb->flags = V4L2_BUF_FLAG_MAPPED | |
@@ -868,7 +868,7 @@ static int vidioc_streamon(struct file *file, void *priv, enum v4l2_buf_type i) | |||
868 | { | 868 | { |
869 | struct usb_usbvision *usbvision = video_drvdata(file); | 869 | struct usb_usbvision *usbvision = video_drvdata(file); |
870 | 870 | ||
871 | usbvision->streaming = Stream_On; | 871 | usbvision->streaming = stream_on; |
872 | call_all(usbvision, video, s_stream, 1); | 872 | call_all(usbvision, video, s_stream, 1); |
873 | 873 | ||
874 | return 0; | 874 | return 0; |
@@ -882,7 +882,7 @@ static int vidioc_streamoff(struct file *file, | |||
882 | if (type != V4L2_BUF_TYPE_VIDEO_CAPTURE) | 882 | if (type != V4L2_BUF_TYPE_VIDEO_CAPTURE) |
883 | return -EINVAL; | 883 | return -EINVAL; |
884 | 884 | ||
885 | if(usbvision->streaming == Stream_On) { | 885 | if(usbvision->streaming == stream_on) { |
886 | usbvision_stream_interrupt(usbvision); | 886 | usbvision_stream_interrupt(usbvision); |
887 | /* Stop all video streamings */ | 887 | /* Stop all video streamings */ |
888 | call_all(usbvision, video, s_stream, 0); | 888 | call_all(usbvision, video, s_stream, 0); |
@@ -923,18 +923,18 @@ static int vidioc_try_fmt_vid_cap (struct file *file, void *priv, | |||
923 | struct v4l2_format *vf) | 923 | struct v4l2_format *vf) |
924 | { | 924 | { |
925 | struct usb_usbvision *usbvision = video_drvdata(file); | 925 | struct usb_usbvision *usbvision = video_drvdata(file); |
926 | int formatIdx; | 926 | int format_idx; |
927 | 927 | ||
928 | /* Find requested format in available ones */ | 928 | /* Find requested format in available ones */ |
929 | for(formatIdx=0;formatIdx<USBVISION_SUPPORTED_PALETTES;formatIdx++) { | 929 | for(format_idx=0;format_idx<USBVISION_SUPPORTED_PALETTES;format_idx++) { |
930 | if(vf->fmt.pix.pixelformat == | 930 | if(vf->fmt.pix.pixelformat == |
931 | usbvision_v4l2_format[formatIdx].format) { | 931 | usbvision_v4l2_format[format_idx].format) { |
932 | usbvision->palette = usbvision_v4l2_format[formatIdx]; | 932 | usbvision->palette = usbvision_v4l2_format[format_idx]; |
933 | break; | 933 | break; |
934 | } | 934 | } |
935 | } | 935 | } |
936 | /* robustness */ | 936 | /* robustness */ |
937 | if(formatIdx == USBVISION_SUPPORTED_PALETTES) { | 937 | if(format_idx == USBVISION_SUPPORTED_PALETTES) { |
938 | return -EINVAL; | 938 | return -EINVAL; |
939 | } | 939 | } |
940 | RESTRICT_TO_RANGE(vf->fmt.pix.width, MIN_FRAME_WIDTH, MAX_FRAME_WIDTH); | 940 | RESTRICT_TO_RANGE(vf->fmt.pix.width, MIN_FRAME_WIDTH, MAX_FRAME_WIDTH); |
@@ -958,14 +958,14 @@ static int vidioc_s_fmt_vid_cap(struct file *file, void *priv, | |||
958 | } | 958 | } |
959 | 959 | ||
960 | /* stop io in case it is already in progress */ | 960 | /* stop io in case it is already in progress */ |
961 | if(usbvision->streaming == Stream_On) { | 961 | if(usbvision->streaming == stream_on) { |
962 | if ((ret = usbvision_stream_interrupt(usbvision))) | 962 | if ((ret = usbvision_stream_interrupt(usbvision))) |
963 | return ret; | 963 | return ret; |
964 | } | 964 | } |
965 | usbvision_frames_free(usbvision); | 965 | usbvision_frames_free(usbvision); |
966 | usbvision_empty_framequeues(usbvision); | 966 | usbvision_empty_framequeues(usbvision); |
967 | 967 | ||
968 | usbvision->curFrame = NULL; | 968 | usbvision->cur_frame = NULL; |
969 | 969 | ||
970 | /* by now we are committed to the new data... */ | 970 | /* by now we are committed to the new data... */ |
971 | usbvision_set_output(usbvision, vf->fmt.pix.width, vf->fmt.pix.height); | 971 | usbvision_set_output(usbvision, vf->fmt.pix.width, vf->fmt.pix.height); |
@@ -1000,9 +1000,9 @@ static ssize_t usbvision_v4l2_read(struct file *file, char __user *buf, | |||
1000 | usbvision_frames_alloc(usbvision,USBVISION_NUMFRAMES); | 1000 | usbvision_frames_alloc(usbvision,USBVISION_NUMFRAMES); |
1001 | } | 1001 | } |
1002 | 1002 | ||
1003 | if(usbvision->streaming != Stream_On) { | 1003 | if(usbvision->streaming != stream_on) { |
1004 | /* no stream is running, make it running ! */ | 1004 | /* no stream is running, make it running ! */ |
1005 | usbvision->streaming = Stream_On; | 1005 | usbvision->streaming = stream_on; |
1006 | call_all(usbvision, video, s_stream, 1); | 1006 | call_all(usbvision, video, s_stream, 1); |
1007 | } | 1007 | } |
1008 | 1008 | ||
@@ -1010,10 +1010,10 @@ static ssize_t usbvision_v4l2_read(struct file *file, char __user *buf, | |||
1010 | (like a user of VIDIOC_QBUF would do) */ | 1010 | (like a user of VIDIOC_QBUF would do) */ |
1011 | for(i=0;i<usbvision->num_frames;i++) { | 1011 | for(i=0;i<usbvision->num_frames;i++) { |
1012 | frame = &usbvision->frame[i]; | 1012 | frame = &usbvision->frame[i]; |
1013 | if(frame->grabstate == FrameState_Unused) { | 1013 | if(frame->grabstate == frame_state_unused) { |
1014 | /* Mark it as ready and enqueue frame */ | 1014 | /* Mark it as ready and enqueue frame */ |
1015 | frame->grabstate = FrameState_Ready; | 1015 | frame->grabstate = frame_state_ready; |
1016 | frame->scanstate = ScanState_Scanning; | 1016 | frame->scanstate = scan_state_scanning; |
1017 | /* Accumulated in usbvision_parse_data() */ | 1017 | /* Accumulated in usbvision_parse_data() */ |
1018 | frame->scanlength = 0; | 1018 | frame->scanlength = 0; |
1019 | 1019 | ||
@@ -1046,7 +1046,7 @@ static ssize_t usbvision_v4l2_read(struct file *file, char __user *buf, | |||
1046 | spin_unlock_irqrestore(&usbvision->queue_lock, lock_flags); | 1046 | spin_unlock_irqrestore(&usbvision->queue_lock, lock_flags); |
1047 | 1047 | ||
1048 | /* An error returns an empty frame */ | 1048 | /* An error returns an empty frame */ |
1049 | if (frame->grabstate == FrameState_Error) { | 1049 | if (frame->grabstate == frame_state_error) { |
1050 | frame->bytes_read = 0; | 1050 | frame->bytes_read = 0; |
1051 | return 0; | 1051 | return 0; |
1052 | } | 1052 | } |
@@ -1073,7 +1073,7 @@ static ssize_t usbvision_v4l2_read(struct file *file, char __user *buf, | |||
1073 | frame->bytes_read = 0; | 1073 | frame->bytes_read = 0; |
1074 | 1074 | ||
1075 | /* Mark it as available to be used again. */ | 1075 | /* Mark it as available to be used again. */ |
1076 | frame->grabstate = FrameState_Unused; | 1076 | frame->grabstate = frame_state_unused; |
1077 | /* } */ | 1077 | /* } */ |
1078 | 1078 | ||
1079 | return count; | 1079 | return count; |
@@ -1136,7 +1136,7 @@ static int usbvision_v4l2_mmap(struct file *file, struct vm_area_struct *vma) | |||
1136 | static int usbvision_radio_open(struct file *file) | 1136 | static int usbvision_radio_open(struct file *file) |
1137 | { | 1137 | { |
1138 | struct usb_usbvision *usbvision = video_drvdata(file); | 1138 | struct usb_usbvision *usbvision = video_drvdata(file); |
1139 | int errCode = 0; | 1139 | int err_code = 0; |
1140 | 1140 | ||
1141 | PDEBUG(DBG_IO, "%s:", __func__); | 1141 | PDEBUG(DBG_IO, "%s:", __func__); |
1142 | 1142 | ||
@@ -1144,11 +1144,11 @@ static int usbvision_radio_open(struct file *file) | |||
1144 | dev_err(&usbvision->rdev->dev, | 1144 | dev_err(&usbvision->rdev->dev, |
1145 | "%s: Someone tried to open an already opened USBVision Radio!\n", | 1145 | "%s: Someone tried to open an already opened USBVision Radio!\n", |
1146 | __func__); | 1146 | __func__); |
1147 | errCode = -EBUSY; | 1147 | err_code = -EBUSY; |
1148 | } | 1148 | } |
1149 | else { | 1149 | else { |
1150 | if(PowerOnAtOpen) { | 1150 | if(power_on_at_open) { |
1151 | usbvision_reset_powerOffTimer(usbvision); | 1151 | usbvision_reset_power_off_timer(usbvision); |
1152 | if (usbvision->power == 0) { | 1152 | if (usbvision->power == 0) { |
1153 | usbvision_power_on(usbvision); | 1153 | usbvision_power_on(usbvision); |
1154 | usbvision_i2c_register(usbvision); | 1154 | usbvision_i2c_register(usbvision); |
@@ -1156,10 +1156,10 @@ static int usbvision_radio_open(struct file *file) | |||
1156 | } | 1156 | } |
1157 | 1157 | ||
1158 | /* Alternate interface 1 is is the biggest frame size */ | 1158 | /* Alternate interface 1 is is the biggest frame size */ |
1159 | errCode = usbvision_set_alternate(usbvision); | 1159 | err_code = usbvision_set_alternate(usbvision); |
1160 | if (errCode < 0) { | 1160 | if (err_code < 0) { |
1161 | usbvision->last_error = errCode; | 1161 | usbvision->last_error = err_code; |
1162 | errCode = -EBUSY; | 1162 | err_code = -EBUSY; |
1163 | goto out; | 1163 | goto out; |
1164 | } | 1164 | } |
1165 | 1165 | ||
@@ -1170,36 +1170,36 @@ static int usbvision_radio_open(struct file *file) | |||
1170 | usbvision->user++; | 1170 | usbvision->user++; |
1171 | } | 1171 | } |
1172 | 1172 | ||
1173 | if (errCode) { | 1173 | if (err_code) { |
1174 | if (PowerOnAtOpen) { | 1174 | if (power_on_at_open) { |
1175 | usbvision_i2c_unregister(usbvision); | 1175 | usbvision_i2c_unregister(usbvision); |
1176 | usbvision_power_off(usbvision); | 1176 | usbvision_power_off(usbvision); |
1177 | usbvision->initialized = 0; | 1177 | usbvision->initialized = 0; |
1178 | } | 1178 | } |
1179 | } | 1179 | } |
1180 | out: | 1180 | out: |
1181 | return errCode; | 1181 | return err_code; |
1182 | } | 1182 | } |
1183 | 1183 | ||
1184 | 1184 | ||
1185 | static int usbvision_radio_close(struct file *file) | 1185 | static int usbvision_radio_close(struct file *file) |
1186 | { | 1186 | { |
1187 | struct usb_usbvision *usbvision = video_drvdata(file); | 1187 | struct usb_usbvision *usbvision = video_drvdata(file); |
1188 | int errCode = 0; | 1188 | int err_code = 0; |
1189 | 1189 | ||
1190 | PDEBUG(DBG_IO, ""); | 1190 | PDEBUG(DBG_IO, ""); |
1191 | 1191 | ||
1192 | /* Set packet size to 0 */ | 1192 | /* Set packet size to 0 */ |
1193 | usbvision->ifaceAlt=0; | 1193 | usbvision->iface_alt=0; |
1194 | errCode = usb_set_interface(usbvision->dev, usbvision->iface, | 1194 | err_code = usb_set_interface(usbvision->dev, usbvision->iface, |
1195 | usbvision->ifaceAlt); | 1195 | usbvision->iface_alt); |
1196 | 1196 | ||
1197 | usbvision_audio_off(usbvision); | 1197 | usbvision_audio_off(usbvision); |
1198 | usbvision->radio=0; | 1198 | usbvision->radio=0; |
1199 | usbvision->user--; | 1199 | usbvision->user--; |
1200 | 1200 | ||
1201 | if (PowerOnAtOpen) { | 1201 | if (power_on_at_open) { |
1202 | usbvision_set_powerOffTimer(usbvision); | 1202 | usbvision_set_power_off_timer(usbvision); |
1203 | usbvision->initialized = 0; | 1203 | usbvision->initialized = 0; |
1204 | } | 1204 | } |
1205 | 1205 | ||
@@ -1209,7 +1209,7 @@ static int usbvision_radio_close(struct file *file) | |||
1209 | } | 1209 | } |
1210 | 1210 | ||
1211 | PDEBUG(DBG_IO, "success"); | 1211 | PDEBUG(DBG_IO, "success"); |
1212 | return errCode; | 1212 | return err_code; |
1213 | } | 1213 | } |
1214 | 1214 | ||
1215 | // | 1215 | // |
@@ -1375,7 +1375,7 @@ static int __devinit usbvision_register_video(struct usb_usbvision *usbvision) | |||
1375 | usbvision->nr, video_device_node_name(usbvision->vdev)); | 1375 | usbvision->nr, video_device_node_name(usbvision->vdev)); |
1376 | 1376 | ||
1377 | // Radio Device: | 1377 | // Radio Device: |
1378 | if (usbvision_device_data[usbvision->DevModel].Radio) { | 1378 | if (usbvision_device_data[usbvision->dev_model].radio) { |
1379 | // usbvision has radio | 1379 | // usbvision has radio |
1380 | usbvision->rdev = usbvision_vdev_init(usbvision, | 1380 | usbvision->rdev = usbvision_vdev_init(usbvision, |
1381 | &usbvision_radio_template, | 1381 | &usbvision_radio_template, |
@@ -1427,12 +1427,12 @@ static struct usb_usbvision *usbvision_alloc(struct usb_device *dev, | |||
1427 | mutex_init(&usbvision->v4l2_lock); | 1427 | mutex_init(&usbvision->v4l2_lock); |
1428 | 1428 | ||
1429 | // prepare control urb for control messages during interrupts | 1429 | // prepare control urb for control messages during interrupts |
1430 | usbvision->ctrlUrb = usb_alloc_urb(USBVISION_URB_FRAMES, GFP_KERNEL); | 1430 | usbvision->ctrl_urb = usb_alloc_urb(USBVISION_URB_FRAMES, GFP_KERNEL); |
1431 | if (usbvision->ctrlUrb == NULL) | 1431 | if (usbvision->ctrl_urb == NULL) |
1432 | goto err_unreg; | 1432 | goto err_unreg; |
1433 | init_waitqueue_head(&usbvision->ctrlUrb_wq); | 1433 | init_waitqueue_head(&usbvision->ctrl_urb_wq); |
1434 | 1434 | ||
1435 | usbvision_init_powerOffTimer(usbvision); | 1435 | usbvision_init_power_off_timer(usbvision); |
1436 | 1436 | ||
1437 | return usbvision; | 1437 | return usbvision; |
1438 | 1438 | ||
@@ -1454,15 +1454,15 @@ static void usbvision_release(struct usb_usbvision *usbvision) | |||
1454 | { | 1454 | { |
1455 | PDEBUG(DBG_PROBE, ""); | 1455 | PDEBUG(DBG_PROBE, ""); |
1456 | 1456 | ||
1457 | usbvision_reset_powerOffTimer(usbvision); | 1457 | usbvision_reset_power_off_timer(usbvision); |
1458 | 1458 | ||
1459 | usbvision->initialized = 0; | 1459 | usbvision->initialized = 0; |
1460 | 1460 | ||
1461 | usbvision_remove_sysfs(usbvision->vdev); | 1461 | usbvision_remove_sysfs(usbvision->vdev); |
1462 | usbvision_unregister_video(usbvision); | 1462 | usbvision_unregister_video(usbvision); |
1463 | 1463 | ||
1464 | if (usbvision->ctrlUrb) { | 1464 | if (usbvision->ctrl_urb) { |
1465 | usb_free_urb(usbvision->ctrlUrb); | 1465 | usb_free_urb(usbvision->ctrl_urb); |
1466 | } | 1466 | } |
1467 | 1467 | ||
1468 | v4l2_device_unregister(&usbvision->v4l2_dev); | 1468 | v4l2_device_unregister(&usbvision->v4l2_dev); |
@@ -1481,25 +1481,25 @@ static void usbvision_configure_video(struct usb_usbvision *usbvision) | |||
1481 | if (usbvision == NULL) | 1481 | if (usbvision == NULL) |
1482 | return; | 1482 | return; |
1483 | 1483 | ||
1484 | model = usbvision->DevModel; | 1484 | model = usbvision->dev_model; |
1485 | usbvision->palette = usbvision_v4l2_format[2]; // V4L2_PIX_FMT_RGB24; | 1485 | usbvision->palette = usbvision_v4l2_format[2]; // V4L2_PIX_FMT_RGB24; |
1486 | 1486 | ||
1487 | if (usbvision_device_data[usbvision->DevModel].Vin_Reg2_override) { | 1487 | if (usbvision_device_data[usbvision->dev_model].vin_reg2_override) { |
1488 | usbvision->Vin_Reg2_Preset = | 1488 | usbvision->vin_reg2_preset = |
1489 | usbvision_device_data[usbvision->DevModel].Vin_Reg2; | 1489 | usbvision_device_data[usbvision->dev_model].vin_reg2; |
1490 | } else { | 1490 | } else { |
1491 | usbvision->Vin_Reg2_Preset = 0; | 1491 | usbvision->vin_reg2_preset = 0; |
1492 | } | 1492 | } |
1493 | 1493 | ||
1494 | usbvision->tvnormId = usbvision_device_data[model].VideoNorm; | 1494 | usbvision->tvnorm_id = usbvision_device_data[model].video_norm; |
1495 | 1495 | ||
1496 | usbvision->video_inputs = usbvision_device_data[model].VideoChannels; | 1496 | usbvision->video_inputs = usbvision_device_data[model].video_channels; |
1497 | usbvision->ctl_input = 0; | 1497 | usbvision->ctl_input = 0; |
1498 | 1498 | ||
1499 | /* This should be here to make i2c clients to be able to register */ | 1499 | /* This should be here to make i2c clients to be able to register */ |
1500 | /* first switch off audio */ | 1500 | /* first switch off audio */ |
1501 | usbvision_audio_off(usbvision); | 1501 | usbvision_audio_off(usbvision); |
1502 | if (!PowerOnAtOpen) { | 1502 | if (!power_on_at_open) { |
1503 | /* and then power up the noisy tuner */ | 1503 | /* and then power up the noisy tuner */ |
1504 | usbvision_power_on(usbvision); | 1504 | usbvision_power_on(usbvision); |
1505 | usbvision_i2c_register(usbvision); | 1505 | usbvision_i2c_register(usbvision); |
@@ -1534,10 +1534,10 @@ static int __devinit usbvision_probe(struct usb_interface *intf, | |||
1534 | return -ENODEV; | 1534 | return -ENODEV; |
1535 | } | 1535 | } |
1536 | printk(KERN_INFO "%s: %s found\n", __func__, | 1536 | printk(KERN_INFO "%s: %s found\n", __func__, |
1537 | usbvision_device_data[model].ModelString); | 1537 | usbvision_device_data[model].model_string); |
1538 | 1538 | ||
1539 | if (usbvision_device_data[model].Interface >= 0) { | 1539 | if (usbvision_device_data[model].interface >= 0) { |
1540 | interface = &dev->actconfig->interface[usbvision_device_data[model].Interface]->altsetting[0]; | 1540 | interface = &dev->actconfig->interface[usbvision_device_data[model].interface]->altsetting[0]; |
1541 | } else { | 1541 | } else { |
1542 | interface = &dev->actconfig->interface[ifnum]->altsetting[0]; | 1542 | interface = &dev->actconfig->interface[ifnum]->altsetting[0]; |
1543 | } | 1543 | } |
@@ -1562,13 +1562,13 @@ static int __devinit usbvision_probe(struct usb_interface *intf, | |||
1562 | } | 1562 | } |
1563 | 1563 | ||
1564 | if (dev->descriptor.bNumConfigurations > 1) { | 1564 | if (dev->descriptor.bNumConfigurations > 1) { |
1565 | usbvision->bridgeType = BRIDGE_NT1004; | 1565 | usbvision->bridge_type = BRIDGE_NT1004; |
1566 | } else if (model == DAZZLE_DVC_90_REV_1_SECAM) { | 1566 | } else if (model == DAZZLE_DVC_90_REV_1_SECAM) { |
1567 | usbvision->bridgeType = BRIDGE_NT1005; | 1567 | usbvision->bridge_type = BRIDGE_NT1005; |
1568 | } else { | 1568 | } else { |
1569 | usbvision->bridgeType = BRIDGE_NT1003; | 1569 | usbvision->bridge_type = BRIDGE_NT1003; |
1570 | } | 1570 | } |
1571 | PDEBUG(DBG_PROBE, "bridgeType %d", usbvision->bridgeType); | 1571 | PDEBUG(DBG_PROBE, "bridge_type %d", usbvision->bridge_type); |
1572 | 1572 | ||
1573 | /* compute alternate max packet sizes */ | 1573 | /* compute alternate max packet sizes */ |
1574 | uif = dev->actconfig->interface[0]; | 1574 | uif = dev->actconfig->interface[0]; |
@@ -1594,20 +1594,20 @@ static int __devinit usbvision_probe(struct usb_interface *intf, | |||
1594 | 1594 | ||
1595 | usbvision->nr = usbvision_nr++; | 1595 | usbvision->nr = usbvision_nr++; |
1596 | 1596 | ||
1597 | usbvision->have_tuner = usbvision_device_data[model].Tuner; | 1597 | usbvision->have_tuner = usbvision_device_data[model].tuner; |
1598 | if (usbvision->have_tuner) { | 1598 | if (usbvision->have_tuner) { |
1599 | usbvision->tuner_type = usbvision_device_data[model].TunerType; | 1599 | usbvision->tuner_type = usbvision_device_data[model].tuner_type; |
1600 | } | 1600 | } |
1601 | 1601 | ||
1602 | usbvision->DevModel = model; | 1602 | usbvision->dev_model = model; |
1603 | usbvision->remove_pending = 0; | 1603 | usbvision->remove_pending = 0; |
1604 | usbvision->iface = ifnum; | 1604 | usbvision->iface = ifnum; |
1605 | usbvision->ifaceAlt = 0; | 1605 | usbvision->iface_alt = 0; |
1606 | usbvision->video_endp = endpoint->bEndpointAddress; | 1606 | usbvision->video_endp = endpoint->bEndpointAddress; |
1607 | usbvision->isocPacketSize = 0; | 1607 | usbvision->isoc_packet_size = 0; |
1608 | usbvision->usb_bandwidth = 0; | 1608 | usbvision->usb_bandwidth = 0; |
1609 | usbvision->user = 0; | 1609 | usbvision->user = 0; |
1610 | usbvision->streaming = Stream_Off; | 1610 | usbvision->streaming = stream_off; |
1611 | usbvision_configure_video(usbvision); | 1611 | usbvision_configure_video(usbvision); |
1612 | usbvision_register_video(usbvision); | 1612 | usbvision_register_video(usbvision); |
1613 | 1613 | ||
@@ -1682,7 +1682,7 @@ static struct usb_driver usbvision_driver = { | |||
1682 | */ | 1682 | */ |
1683 | static int __init usbvision_init(void) | 1683 | static int __init usbvision_init(void) |
1684 | { | 1684 | { |
1685 | int errCode; | 1685 | int err_code; |
1686 | 1686 | ||
1687 | PDEBUG(DBG_PROBE, ""); | 1687 | PDEBUG(DBG_PROBE, ""); |
1688 | 1688 | ||
@@ -1691,19 +1691,19 @@ static int __init usbvision_init(void) | |||
1691 | PDEBUG(DBG_MMAP, "MMAP debugging is enabled [video]"); | 1691 | PDEBUG(DBG_MMAP, "MMAP debugging is enabled [video]"); |
1692 | 1692 | ||
1693 | /* disable planar mode support unless compression enabled */ | 1693 | /* disable planar mode support unless compression enabled */ |
1694 | if (isocMode != ISOC_MODE_COMPRESS ) { | 1694 | if (isoc_mode != ISOC_MODE_COMPRESS ) { |
1695 | // FIXME : not the right way to set supported flag | 1695 | // FIXME : not the right way to set supported flag |
1696 | usbvision_v4l2_format[6].supported = 0; // V4L2_PIX_FMT_YVU420 | 1696 | usbvision_v4l2_format[6].supported = 0; // V4L2_PIX_FMT_YVU420 |
1697 | usbvision_v4l2_format[7].supported = 0; // V4L2_PIX_FMT_YUV422P | 1697 | usbvision_v4l2_format[7].supported = 0; // V4L2_PIX_FMT_YUV422P |
1698 | } | 1698 | } |
1699 | 1699 | ||
1700 | errCode = usb_register(&usbvision_driver); | 1700 | err_code = usb_register(&usbvision_driver); |
1701 | 1701 | ||
1702 | if (errCode == 0) { | 1702 | if (err_code == 0) { |
1703 | printk(KERN_INFO DRIVER_DESC " : " USBVISION_VERSION_STRING "\n"); | 1703 | printk(KERN_INFO DRIVER_DESC " : " USBVISION_VERSION_STRING "\n"); |
1704 | PDEBUG(DBG_PROBE, "success"); | 1704 | PDEBUG(DBG_PROBE, "success"); |
1705 | } | 1705 | } |
1706 | return errCode; | 1706 | return err_code; |
1707 | } | 1707 | } |
1708 | 1708 | ||
1709 | static void __exit usbvision_exit(void) | 1709 | static void __exit usbvision_exit(void) |
diff --git a/drivers/media/video/usbvision/usbvision.h b/drivers/media/video/usbvision/usbvision.h index 2271ede78ddf..42189e500143 100644 --- a/drivers/media/video/usbvision/usbvision.h +++ b/drivers/media/video/usbvision/usbvision.h | |||
@@ -223,39 +223,39 @@ enum { | |||
223 | /* ----------------------------------------------------------------- */ | 223 | /* ----------------------------------------------------------------- */ |
224 | /* usbvision video structures */ | 224 | /* usbvision video structures */ |
225 | /* ----------------------------------------------------------------- */ | 225 | /* ----------------------------------------------------------------- */ |
226 | enum ScanState { | 226 | enum scan_state { |
227 | ScanState_Scanning, /* Scanning for header */ | 227 | scan_state_scanning, /* Scanning for header */ |
228 | ScanState_Lines /* Parsing lines */ | 228 | scan_state_lines /* Parsing lines */ |
229 | }; | 229 | }; |
230 | 230 | ||
231 | /* Completion states of the data parser */ | 231 | /* Completion states of the data parser */ |
232 | enum ParseState { | 232 | enum parse_state { |
233 | ParseState_Continue, /* Just parse next item */ | 233 | parse_state_continue, /* Just parse next item */ |
234 | ParseState_NextFrame, /* Frame done, send it to V4L */ | 234 | parse_state_next_frame, /* Frame done, send it to V4L */ |
235 | ParseState_Out, /* Not enough data for frame */ | 235 | parse_state_out, /* Not enough data for frame */ |
236 | ParseState_EndParse /* End parsing */ | 236 | parse_state_end_parse /* End parsing */ |
237 | }; | 237 | }; |
238 | 238 | ||
239 | enum FrameState { | 239 | enum frame_state { |
240 | FrameState_Unused, /* Unused (no MCAPTURE) */ | 240 | frame_state_unused, /* Unused (no MCAPTURE) */ |
241 | FrameState_Ready, /* Ready to start grabbing */ | 241 | frame_state_ready, /* Ready to start grabbing */ |
242 | FrameState_Grabbing, /* In the process of being grabbed into */ | 242 | frame_state_grabbing, /* In the process of being grabbed into */ |
243 | FrameState_Done, /* Finished grabbing, but not been synced yet */ | 243 | frame_state_done, /* Finished grabbing, but not been synced yet */ |
244 | FrameState_DoneHold, /* Are syncing or reading */ | 244 | frame_state_done_hold, /* Are syncing or reading */ |
245 | FrameState_Error, /* Something bad happened while processing */ | 245 | frame_state_error, /* Something bad happened while processing */ |
246 | }; | 246 | }; |
247 | 247 | ||
248 | /* stream states */ | 248 | /* stream states */ |
249 | enum StreamState { | 249 | enum stream_state { |
250 | Stream_Off, /* Driver streaming is completely OFF */ | 250 | stream_off, /* Driver streaming is completely OFF */ |
251 | Stream_Idle, /* Driver streaming is ready to be put ON by the application */ | 251 | stream_idle, /* Driver streaming is ready to be put ON by the application */ |
252 | Stream_Interrupt, /* Driver streaming must be interrupted */ | 252 | stream_interrupt, /* Driver streaming must be interrupted */ |
253 | Stream_On, /* Driver streaming is put ON by the application */ | 253 | stream_on, /* Driver streaming is put ON by the application */ |
254 | }; | 254 | }; |
255 | 255 | ||
256 | enum IsocState { | 256 | enum isoc_state { |
257 | IsocState_InFrame, /* Isoc packet is member of frame */ | 257 | isoc_state_in_frame, /* Isoc packet is member of frame */ |
258 | IsocState_NoFrame, /* Isoc packet is not member of any frame */ | 258 | isoc_state_no_frame, /* Isoc packet is not member of any frame */ |
259 | }; | 259 | }; |
260 | 260 | ||
261 | struct usb_device; | 261 | struct usb_device; |
@@ -286,23 +286,23 @@ struct usbvision_v4l2_format_st { | |||
286 | struct usbvision_frame_header { | 286 | struct usbvision_frame_header { |
287 | unsigned char magic_1; /* 0 magic */ | 287 | unsigned char magic_1; /* 0 magic */ |
288 | unsigned char magic_2; /* 1 magic */ | 288 | unsigned char magic_2; /* 1 magic */ |
289 | unsigned char headerLength; /* 2 */ | 289 | unsigned char header_length; /* 2 */ |
290 | unsigned char frameNum; /* 3 */ | 290 | unsigned char frame_num; /* 3 */ |
291 | unsigned char framePhase; /* 4 */ | 291 | unsigned char frame_phase; /* 4 */ |
292 | unsigned char frameLatency; /* 5 */ | 292 | unsigned char frame_latency; /* 5 */ |
293 | unsigned char dataFormat; /* 6 */ | 293 | unsigned char data_format; /* 6 */ |
294 | unsigned char formatParam; /* 7 */ | 294 | unsigned char format_param; /* 7 */ |
295 | unsigned char frameWidthLo; /* 8 */ | 295 | unsigned char frame_width_lo; /* 8 */ |
296 | unsigned char frameWidthHi; /* 9 */ | 296 | unsigned char frame_width_hi; /* 9 */ |
297 | unsigned char frameHeightLo; /* 10 */ | 297 | unsigned char frame_height_lo; /* 10 */ |
298 | unsigned char frameHeightHi; /* 11 */ | 298 | unsigned char frame_height_hi; /* 11 */ |
299 | __u16 frameWidth; /* 8 - 9 after endian correction*/ | 299 | __u16 frame_width; /* 8 - 9 after endian correction*/ |
300 | __u16 frameHeight; /* 10 - 11 after endian correction*/ | 300 | __u16 frame_height; /* 10 - 11 after endian correction*/ |
301 | }; | 301 | }; |
302 | 302 | ||
303 | struct usbvision_frame { | 303 | struct usbvision_frame { |
304 | char *data; /* Frame buffer */ | 304 | char *data; /* Frame buffer */ |
305 | struct usbvision_frame_header isocHeader; /* Header from stream */ | 305 | struct usbvision_frame_header isoc_header; /* Header from stream */ |
306 | 306 | ||
307 | int width; /* Width application is expecting */ | 307 | int width; /* Width application is expecting */ |
308 | int height; /* Height */ | 308 | int height; /* Height */ |
@@ -332,24 +332,24 @@ struct usbvision_frame { | |||
332 | #define BRIDGE_NT1005 1005 | 332 | #define BRIDGE_NT1005 1005 |
333 | 333 | ||
334 | struct usbvision_device_data_st { | 334 | struct usbvision_device_data_st { |
335 | __u64 VideoNorm; | 335 | __u64 video_norm; |
336 | const char *ModelString; | 336 | const char *model_string; |
337 | int Interface; /* to handle special interface number like BELKIN and Hauppauge WinTV-USB II */ | 337 | int interface; /* to handle special interface number like BELKIN and Hauppauge WinTV-USB II */ |
338 | __u16 Codec; | 338 | __u16 codec; |
339 | unsigned VideoChannels:3; | 339 | unsigned video_channels:3; |
340 | unsigned AudioChannels:2; | 340 | unsigned audio_channels:2; |
341 | unsigned Radio:1; | 341 | unsigned radio:1; |
342 | unsigned vbi:1; | 342 | unsigned vbi:1; |
343 | unsigned Tuner:1; | 343 | unsigned tuner:1; |
344 | unsigned Vin_Reg1_override:1; /* Override default value with */ | 344 | unsigned vin_reg1_override:1; /* Override default value with */ |
345 | unsigned Vin_Reg2_override:1; /* Vin_Reg1, Vin_Reg2, etc. */ | 345 | unsigned vin_reg2_override:1; /* vin_reg1, vin_reg2, etc. */ |
346 | unsigned Dvi_yuv_override:1; | 346 | unsigned dvi_yuv_override:1; |
347 | __u8 Vin_Reg1; | 347 | __u8 vin_reg1; |
348 | __u8 Vin_Reg2; | 348 | __u8 vin_reg2; |
349 | __u8 Dvi_yuv; | 349 | __u8 dvi_yuv; |
350 | __u8 TunerType; | 350 | __u8 tuner_type; |
351 | __s16 X_Offset; | 351 | __s16 x_offset; |
352 | __s16 Y_Offset; | 352 | __s16 y_offset; |
353 | }; | 353 | }; |
354 | 354 | ||
355 | /* Declared on usbvision-cards.c */ | 355 | /* Declared on usbvision-cards.c */ |
@@ -365,40 +365,40 @@ struct usb_usbvision { | |||
365 | struct i2c_adapter i2c_adap; | 365 | struct i2c_adapter i2c_adap; |
366 | int registered_i2c; | 366 | int registered_i2c; |
367 | 367 | ||
368 | struct urb *ctrlUrb; | 368 | struct urb *ctrl_urb; |
369 | unsigned char ctrlUrbBuffer[8]; | 369 | unsigned char ctrl_urb_buffer[8]; |
370 | int ctrlUrbBusy; | 370 | int ctrl_urb_busy; |
371 | struct usb_ctrlrequest ctrlUrbSetup; | 371 | struct usb_ctrlrequest ctrl_urb_setup; |
372 | wait_queue_head_t ctrlUrb_wq; // Processes waiting | 372 | wait_queue_head_t ctrl_urb_wq; // Processes waiting |
373 | 373 | ||
374 | /* configuration part */ | 374 | /* configuration part */ |
375 | int have_tuner; | 375 | int have_tuner; |
376 | int tuner_type; | 376 | int tuner_type; |
377 | int bridgeType; // NT1003, NT1004, NT1005 | 377 | int bridge_type; // NT1003, NT1004, NT1005 |
378 | int radio; | 378 | int radio; |
379 | int video_inputs; // # of inputs | 379 | int video_inputs; // # of inputs |
380 | unsigned long freq; | 380 | unsigned long freq; |
381 | int AudioMute; | 381 | int audio_mute; |
382 | int AudioChannel; | 382 | int audio_channel; |
383 | int isocMode; // format of video data for the usb isoc-transfer | 383 | int isoc_mode; // format of video data for the usb isoc-transfer |
384 | unsigned int nr; // Number of the device | 384 | unsigned int nr; // Number of the device |
385 | 385 | ||
386 | /* Device structure */ | 386 | /* Device structure */ |
387 | struct usb_device *dev; | 387 | struct usb_device *dev; |
388 | /* usb transfer */ | 388 | /* usb transfer */ |
389 | int num_alt; /* Number of alternative settings */ | 389 | int num_alt; /* Number of alternative settings */ |
390 | unsigned int *alt_max_pkt_size; /* array of wMaxPacketSize */ | 390 | unsigned int *alt_max_pkt_size; /* array of max_packet_size */ |
391 | unsigned char iface; /* Video interface number */ | 391 | unsigned char iface; /* Video interface number */ |
392 | unsigned char ifaceAlt; /* Alt settings */ | 392 | unsigned char iface_alt; /* Alt settings */ |
393 | unsigned char Vin_Reg2_Preset; | 393 | unsigned char vin_reg2_preset; |
394 | struct mutex v4l2_lock; | 394 | struct mutex v4l2_lock; |
395 | struct timer_list powerOffTimer; | 395 | struct timer_list power_off_timer; |
396 | struct work_struct powerOffWork; | 396 | struct work_struct power_off_work; |
397 | int power; /* is the device powered on? */ | 397 | int power; /* is the device powered on? */ |
398 | int user; /* user count for exclusive use */ | 398 | int user; /* user count for exclusive use */ |
399 | int initialized; /* Had we already sent init sequence? */ | 399 | int initialized; /* Had we already sent init sequence? */ |
400 | int DevModel; /* What type of USBVISION device we got? */ | 400 | int dev_model; /* What type of USBVISION device we got? */ |
401 | enum StreamState streaming; /* Are we streaming Isochronous? */ | 401 | enum stream_state streaming; /* Are we streaming Isochronous? */ |
402 | int last_error; /* What calamity struck us? */ | 402 | int last_error; /* What calamity struck us? */ |
403 | int curwidth; /* width of the frame the device is currently set to*/ | 403 | int curwidth; /* width of the frame the device is currently set to*/ |
404 | int curheight; /* height of the frame the device is currently set to*/ | 404 | int curheight; /* height of the frame the device is currently set to*/ |
@@ -411,7 +411,7 @@ struct usb_usbvision { | |||
411 | struct list_head inqueue, outqueue; /* queued frame list and ready to dequeue frame list */ | 411 | struct list_head inqueue, outqueue; /* queued frame list and ready to dequeue frame list */ |
412 | wait_queue_head_t wait_frame; /* Processes waiting */ | 412 | wait_queue_head_t wait_frame; /* Processes waiting */ |
413 | wait_queue_head_t wait_stream; /* Processes waiting */ | 413 | wait_queue_head_t wait_stream; /* Processes waiting */ |
414 | struct usbvision_frame *curFrame; // pointer to current frame, set by usbvision_find_header | 414 | struct usbvision_frame *cur_frame; // pointer to current frame, set by usbvision_find_header |
415 | struct usbvision_frame frame[USBVISION_NUMFRAMES]; // frame buffer | 415 | struct usbvision_frame frame[USBVISION_NUMFRAMES]; // frame buffer |
416 | int num_frames; // number of frames allocated | 416 | int num_frames; // number of frames allocated |
417 | struct usbvision_sbuf sbuf[USBVISION_NUMSBUF]; // S buffering | 417 | struct usbvision_sbuf sbuf[USBVISION_NUMSBUF]; // S buffering |
@@ -424,43 +424,43 @@ struct usb_usbvision { | |||
424 | int scratch_headermarker[USBVISION_NUM_HEADERMARKER]; | 424 | int scratch_headermarker[USBVISION_NUM_HEADERMARKER]; |
425 | int scratch_headermarker_read_ptr; | 425 | int scratch_headermarker_read_ptr; |
426 | int scratch_headermarker_write_ptr; | 426 | int scratch_headermarker_write_ptr; |
427 | enum IsocState isocstate; | 427 | enum isoc_state isocstate; |
428 | struct usbvision_v4l2_format_st palette; | 428 | struct usbvision_v4l2_format_st palette; |
429 | 429 | ||
430 | struct v4l2_capability vcap; /* Video capabilities */ | 430 | struct v4l2_capability vcap; /* Video capabilities */ |
431 | unsigned int ctl_input; /* selected input */ | 431 | unsigned int ctl_input; /* selected input */ |
432 | v4l2_std_id tvnormId; /* selected tv norm */ | 432 | v4l2_std_id tvnorm_id; /* selected tv norm */ |
433 | unsigned char video_endp; /* 0x82 for USBVISION devices based */ | 433 | unsigned char video_endp; /* 0x82 for USBVISION devices based */ |
434 | 434 | ||
435 | // Decompression stuff: | 435 | // Decompression stuff: |
436 | unsigned char *IntraFrameBuffer; /* Buffer for reference frame */ | 436 | unsigned char *intra_frame_buffer; /* Buffer for reference frame */ |
437 | int BlockPos; //for test only | 437 | int block_pos; //for test only |
438 | int requestIntra; // 0 = normal; 1 = intra frame is requested; | 438 | int request_intra; // 0 = normal; 1 = intra frame is requested; |
439 | int lastIsocFrameNum; // check for lost isoc frames | 439 | int last_isoc_frame_num; // check for lost isoc frames |
440 | int isocPacketSize; // need to calculate usedBandwidth | 440 | int isoc_packet_size; // need to calculate used_bandwidth |
441 | int usedBandwidth; // used bandwidth 0-100%, need to set comprLevel | 441 | int used_bandwidth; // used bandwidth 0-100%, need to set compr_level |
442 | int comprLevel; // How strong (100) or weak (0) is compression | 442 | int compr_level; // How strong (100) or weak (0) is compression |
443 | int lastComprLevel; // How strong (100) or weak (0) was compression | 443 | int last_compr_level; // How strong (100) or weak (0) was compression |
444 | int usb_bandwidth; /* Mbit/s */ | 444 | int usb_bandwidth; /* Mbit/s */ |
445 | 445 | ||
446 | /* Statistics that can be overlayed on the screen */ | 446 | /* Statistics that can be overlayed on the screen */ |
447 | unsigned long isocUrbCount; // How many URBs we received so far | 447 | unsigned long isoc_urb_count; // How many URBs we received so far |
448 | unsigned long urb_length; /* Length of last URB */ | 448 | unsigned long urb_length; /* Length of last URB */ |
449 | unsigned long isocDataCount; /* How many bytes we received */ | 449 | unsigned long isoc_data_count; /* How many bytes we received */ |
450 | unsigned long header_count; /* How many frame headers we found */ | 450 | unsigned long header_count; /* How many frame headers we found */ |
451 | unsigned long scratch_ovf_count; /* How many times we overflowed scratch */ | 451 | unsigned long scratch_ovf_count; /* How many times we overflowed scratch */ |
452 | unsigned long isocSkipCount; /* How many empty ISO packets received */ | 452 | unsigned long isoc_skip_count; /* How many empty ISO packets received */ |
453 | unsigned long isocErrCount; /* How many bad ISO packets received */ | 453 | unsigned long isoc_err_count; /* How many bad ISO packets received */ |
454 | unsigned long isocPacketCount; // How many packets we totally got | 454 | unsigned long isoc_packet_count; // How many packets we totally got |
455 | unsigned long timeInIrq; // How long do we need for interrupt | 455 | unsigned long time_in_irq; // How long do we need for interrupt |
456 | int isocMeasureBandwidthCount; | 456 | int isoc_measure_bandwidth_count; |
457 | int frame_num; // How many video frames we send to user | 457 | int frame_num; // How many video frames we send to user |
458 | int maxStripLen; // How big is the biggest strip | 458 | int max_strip_len; // How big is the biggest strip |
459 | int comprBlockPos; | 459 | int comprblock_pos; |
460 | int stripLenErrors; // How many times was BlockPos greater than StripLen | 460 | int strip_len_errors; // How many times was block_pos greater than strip_len |
461 | int stripMagicErrors; | 461 | int strip_magic_errors; |
462 | int stripLineNumberErrors; | 462 | int strip_line_number_errors; |
463 | int ComprBlockTypes[4]; | 463 | int compr_block_types[4]; |
464 | }; | 464 | }; |
465 | 465 | ||
466 | static inline struct usb_usbvision *to_usbvision(struct v4l2_device *v4l2_dev) | 466 | static inline struct usb_usbvision *to_usbvision(struct v4l2_device *v4l2_dev) |
@@ -500,7 +500,7 @@ int usbvision_restart_isoc(struct usb_usbvision *usbvision); | |||
500 | void usbvision_stop_isoc(struct usb_usbvision *usbvision); | 500 | void usbvision_stop_isoc(struct usb_usbvision *usbvision); |
501 | int usbvision_set_alternate(struct usb_usbvision *dev); | 501 | int usbvision_set_alternate(struct usb_usbvision *dev); |
502 | 502 | ||
503 | int usbvision_set_audio(struct usb_usbvision *usbvision, int AudioChannel); | 503 | int usbvision_set_audio(struct usb_usbvision *usbvision, int audio_channel); |
504 | int usbvision_audio_off(struct usb_usbvision *usbvision); | 504 | int usbvision_audio_off(struct usb_usbvision *usbvision); |
505 | 505 | ||
506 | int usbvision_begin_streaming(struct usb_usbvision *usbvision); | 506 | int usbvision_begin_streaming(struct usb_usbvision *usbvision); |
@@ -511,9 +511,9 @@ int usbvision_muxsel(struct usb_usbvision *usbvision, int channel); | |||
511 | int usbvision_set_input(struct usb_usbvision *usbvision); | 511 | int usbvision_set_input(struct usb_usbvision *usbvision); |
512 | int usbvision_set_output(struct usb_usbvision *usbvision, int width, int height); | 512 | int usbvision_set_output(struct usb_usbvision *usbvision, int width, int height); |
513 | 513 | ||
514 | void usbvision_init_powerOffTimer(struct usb_usbvision *usbvision); | 514 | void usbvision_init_power_off_timer(struct usb_usbvision *usbvision); |
515 | void usbvision_set_powerOffTimer(struct usb_usbvision *usbvision); | 515 | void usbvision_set_power_off_timer(struct usb_usbvision *usbvision); |
516 | void usbvision_reset_powerOffTimer(struct usb_usbvision *usbvision); | 516 | void usbvision_reset_power_off_timer(struct usb_usbvision *usbvision); |
517 | int usbvision_power_off(struct usb_usbvision *usbvision); | 517 | int usbvision_power_off(struct usb_usbvision *usbvision); |
518 | int usbvision_power_on(struct usb_usbvision *usbvision); | 518 | int usbvision_power_on(struct usb_usbvision *usbvision); |
519 | 519 | ||