diff options
Diffstat (limited to 'extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0040-mt9v113-Clean-Up-Remove-unneccessary-code-printf.patch')
-rw-r--r-- | extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0040-mt9v113-Clean-Up-Remove-unneccessary-code-printf.patch | 390 |
1 files changed, 390 insertions, 0 deletions
diff --git a/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0040-mt9v113-Clean-Up-Remove-unneccessary-code-printf.patch b/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0040-mt9v113-Clean-Up-Remove-unneccessary-code-printf.patch new file mode 100644 index 00000000..80121607 --- /dev/null +++ b/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0040-mt9v113-Clean-Up-Remove-unneccessary-code-printf.patch | |||
@@ -0,0 +1,390 @@ | |||
1 | From 9c9215eade28a09ac12888e9a02af107955009c5 Mon Sep 17 00:00:00 2001 | ||
2 | From: Vaibhav Hiremath <hvaibhav@ti.com> | ||
3 | Date: Tue, 13 Jul 2010 19:39:34 +0530 | ||
4 | Subject: [PATCH 40/75] mt9v113:Clean Up: Remove unneccessary code/printf | ||
5 | |||
6 | Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com> | ||
7 | --- | ||
8 | drivers/media/video/mt9v113.c | 105 ++++++++++++++++------------------------ | ||
9 | 1 files changed, 42 insertions(+), 63 deletions(-) | ||
10 | |||
11 | diff --git a/drivers/media/video/mt9v113.c b/drivers/media/video/mt9v113.c | ||
12 | index 8f8ba35..9a86cce 100644 | ||
13 | --- a/drivers/media/video/mt9v113.c | ||
14 | +++ b/drivers/media/video/mt9v113.c | ||
15 | @@ -22,10 +22,10 @@ | ||
16 | #include <linux/i2c.h> | ||
17 | #include <linux/delay.h> | ||
18 | #include <linux/videodev2.h> | ||
19 | +#include <linux/io.h> | ||
20 | + | ||
21 | #include <media/v4l2-int-device.h> | ||
22 | #include <media/mt9v113.h> | ||
23 | -#include <mach/hardware.h> | ||
24 | -#include <linux/io.h> | ||
25 | |||
26 | #include "mt9v113_regs.h" | ||
27 | |||
28 | @@ -34,21 +34,13 @@ | ||
29 | |||
30 | /* Private macros for TVP */ | ||
31 | #define I2C_RETRY_COUNT (5) | ||
32 | -#define LOCK_RETRY_COUNT (5) | ||
33 | -#define LOCK_RETRY_DELAY (200) | ||
34 | |||
35 | /* Debug functions */ | ||
36 | static int debug = 1; | ||
37 | module_param(debug, bool, 0644); | ||
38 | MODULE_PARM_DESC(debug, "Debug level (0-1)"); | ||
39 | |||
40 | -#define dump_reg(client, reg, val) \ | ||
41 | - do { \ | ||
42 | - val = mt9v113_read_reg(client, reg); \ | ||
43 | - v4l_info(client, "Reg(0x%.2X): 0x%.2X\n", reg, val); \ | ||
44 | - } while (0) | ||
45 | - | ||
46 | -/** | ||
47 | +/* | ||
48 | * enum mt9v113_std - enum for supported standards | ||
49 | */ | ||
50 | enum mt9v113_std { | ||
51 | @@ -57,7 +49,7 @@ enum mt9v113_std { | ||
52 | MT9V113_STD_INVALID | ||
53 | }; | ||
54 | |||
55 | -/** | ||
56 | +/* | ||
57 | * enum mt9v113_state - enum for different decoder states | ||
58 | */ | ||
59 | enum mt9v113_state { | ||
60 | @@ -65,7 +57,7 @@ enum mt9v113_state { | ||
61 | STATE_DETECTED | ||
62 | }; | ||
63 | |||
64 | -/** | ||
65 | +/* | ||
66 | * struct mt9v113_std_info - Structure to store standard informations | ||
67 | * @width: Line width in pixels | ||
68 | * @height:Number of active lines | ||
69 | @@ -79,7 +71,7 @@ struct mt9v113_std_info { | ||
70 | struct v4l2_standard standard; | ||
71 | }; | ||
72 | |||
73 | -/** | ||
74 | +/* | ||
75 | * struct mt9v113_decoded - decoder object | ||
76 | * @v4l2_int_device: Slave handle | ||
77 | * @pdata: Board specific | ||
78 | @@ -93,7 +85,6 @@ struct mt9v113_std_info { | ||
79 | * @current_std: Current standard | ||
80 | * @num_stds: Number of standards | ||
81 | * @std_list: Standards list | ||
82 | - * @route: input and output routing at chip level | ||
83 | */ | ||
84 | struct mt9v113_decoder { | ||
85 | struct v4l2_int_device *v4l2_int_device; | ||
86 | @@ -112,8 +103,6 @@ struct mt9v113_decoder { | ||
87 | enum mt9v113_std current_std; | ||
88 | int num_stds; | ||
89 | struct mt9v113_std_info *std_list; | ||
90 | - | ||
91 | - struct v4l2_routing route; | ||
92 | }; | ||
93 | |||
94 | /* MT9V113 register set for VGA mode */ | ||
95 | @@ -160,7 +149,7 @@ static struct mt9v113_reg mt9v113_reg_list[] = { | ||
96 | {TOK_WRITE, 0x0016, 0x42DF}, | ||
97 | {TOK_WRITE, 0x0014, 0x2145}, | ||
98 | {TOK_WRITE, 0x0014, 0x2145}, | ||
99 | - {TOK_WRITE, 0x0010, 0x0431}, | ||
100 | + {TOK_WRITE, 0x0010, 0x0231}, | ||
101 | {TOK_WRITE, 0x0012, 0x0000}, | ||
102 | {TOK_WRITE, 0x0014, 0x244B}, | ||
103 | {TOK_WRITE, 0x0014, 0x304B}, | ||
104 | @@ -378,6 +367,10 @@ static const struct v4l2_queryctrl mt9v113_autogain_ctrl = { | ||
105 | .default_value = 1, | ||
106 | }; | ||
107 | |||
108 | +const struct v4l2_fract mt9v113_frameintervals[] = { | ||
109 | + { .numerator = 1, .denominator = 10 } | ||
110 | +}; | ||
111 | + | ||
112 | static int mt9v113_read_reg(struct i2c_client *client, unsigned short reg) | ||
113 | { | ||
114 | int err = 0; | ||
115 | @@ -510,10 +503,6 @@ static int mt9v113_configure(struct mt9v113_decoder *decoder) | ||
116 | if (err) | ||
117 | return err; | ||
118 | |||
119 | -#if 0 | ||
120 | - if (debug) | ||
121 | - mt9v113_reg_dump(decoder); | ||
122 | -#endif | ||
123 | return 0; | ||
124 | } | ||
125 | |||
126 | @@ -534,13 +523,13 @@ static int mt9v113_vga_mode(struct mt9v113_decoder *decoder) | ||
127 | } | ||
128 | |||
129 | |||
130 | -/** | ||
131 | +/* | ||
132 | * ioctl_enum_framesizes - V4L2 sensor if handler for vidioc_int_enum_framesizes | ||
133 | * @s: pointer to standard V4L2 device structure | ||
134 | * @frms: pointer to standard V4L2 framesizes enumeration structure | ||
135 | * | ||
136 | * Returns possible framesizes depending on choosen pixel format | ||
137 | - **/ | ||
138 | + */ | ||
139 | static int ioctl_enum_framesizes(struct v4l2_int_device *s, | ||
140 | struct v4l2_frmsizeenum *frms) | ||
141 | { | ||
142 | @@ -584,9 +573,14 @@ static int ioctl_enum_frameintervals(struct v4l2_int_device *s, | ||
143 | if (ifmt == decoder->num_fmts) | ||
144 | return -EINVAL; | ||
145 | |||
146 | + if (frmi->index >= ARRAY_SIZE(mt9v113_frameintervals)) | ||
147 | + return -EINVAL; | ||
148 | + | ||
149 | frmi->type = V4L2_FRMSIZE_TYPE_DISCRETE; | ||
150 | - frmi->discrete.numerator = 1; | ||
151 | - frmi->discrete.denominator = 10; | ||
152 | + frmi->discrete.numerator = | ||
153 | + mt9v113_frameintervals[frmi->index].numerator; | ||
154 | + frmi->discrete.denominator = | ||
155 | + mt9v113_frameintervals[frmi->index].denominator; | ||
156 | return 0; | ||
157 | } | ||
158 | |||
159 | @@ -631,7 +625,7 @@ static int mt9v113_detect(struct mt9v113_decoder *decoder) | ||
160 | * mt9v113 decoder driver. | ||
161 | */ | ||
162 | |||
163 | -/** | ||
164 | +/* | ||
165 | * ioctl_querystd - V4L2 decoder interface handler for VIDIOC_QUERYSTD ioctl | ||
166 | * @s: pointer to standard V4L2 device structure | ||
167 | * @std_id: standard V4L2 std_id ioctl enum | ||
168 | @@ -660,7 +654,7 @@ static int ioctl_querystd(struct v4l2_int_device *s, v4l2_std_id *std_id) | ||
169 | return 0; | ||
170 | } | ||
171 | |||
172 | -/** | ||
173 | +/* | ||
174 | * ioctl_s_std - V4L2 decoder interface handler for VIDIOC_S_STD ioctl | ||
175 | * @s: pointer to standard V4L2 device structure | ||
176 | * @std_id: standard V4L2 v4l2_std_id ioctl enum | ||
177 | @@ -696,7 +690,7 @@ static int ioctl_s_std(struct v4l2_int_device *s, v4l2_std_id *std_id) | ||
178 | return 0; | ||
179 | } | ||
180 | |||
181 | -/** | ||
182 | +/* | ||
183 | * ioctl_s_routing - V4L2 decoder interface handler for VIDIOC_S_INPUT ioctl | ||
184 | * @s: pointer to standard V4L2 device structure | ||
185 | * @index: number of the input | ||
186 | @@ -711,7 +705,7 @@ static int ioctl_s_routing(struct v4l2_int_device *s, | ||
187 | return 0; | ||
188 | } | ||
189 | |||
190 | -/** | ||
191 | +/* | ||
192 | * ioctl_queryctrl - V4L2 decoder interface handler for VIDIOC_QUERYCTRL ioctl | ||
193 | * @s: pointer to standard V4L2 device structure | ||
194 | * @qctrl: standard V4L2 v4l2_queryctrl structure | ||
195 | @@ -771,7 +765,7 @@ ioctl_queryctrl(struct v4l2_int_device *s, struct v4l2_queryctrl *qctrl) | ||
196 | return err; | ||
197 | } | ||
198 | |||
199 | -/** | ||
200 | +/* | ||
201 | * ioctl_g_ctrl - V4L2 decoder interface handler for VIDIOC_G_CTRL ioctl | ||
202 | * @s: pointer to standard V4L2 device structure | ||
203 | * @ctrl: pointer to v4l2_control structure | ||
204 | @@ -828,7 +822,7 @@ ioctl_g_ctrl(struct v4l2_int_device *s, struct v4l2_control *ctrl) | ||
205 | return 0; | ||
206 | } | ||
207 | |||
208 | -/** | ||
209 | +/* | ||
210 | * ioctl_s_ctrl - V4L2 decoder interface handler for VIDIOC_S_CTRL ioctl | ||
211 | * @s: pointer to standard V4L2 device structure | ||
212 | * @ctrl: pointer to v4l2_control structure | ||
213 | @@ -936,7 +930,7 @@ ioctl_s_ctrl(struct v4l2_int_device *s, struct v4l2_control *ctrl) | ||
214 | return err; | ||
215 | } | ||
216 | |||
217 | -/** | ||
218 | +/* | ||
219 | * ioctl_enum_fmt_cap - Implement the CAPTURE buffer VIDIOC_ENUM_FMT ioctl | ||
220 | * @s: pointer to standard V4L2 device structure | ||
221 | * @fmt: standard V4L2 VIDIOC_ENUM_FMT ioctl structure | ||
222 | @@ -969,7 +963,7 @@ ioctl_enum_fmt_cap(struct v4l2_int_device *s, struct v4l2_fmtdesc *fmt) | ||
223 | return 0; | ||
224 | } | ||
225 | |||
226 | -/** | ||
227 | +/* | ||
228 | * ioctl_try_fmt_cap - Implement the CAPTURE buffer VIDIOC_TRY_FMT ioctl | ||
229 | * @s: pointer to standard V4L2 device structure | ||
230 | * @f: pointer to standard V4L2 VIDIOC_TRY_FMT ioctl structure | ||
231 | @@ -1026,7 +1020,7 @@ ioctl_try_fmt_cap(struct v4l2_int_device *s, struct v4l2_format *f) | ||
232 | return 0; | ||
233 | } | ||
234 | |||
235 | -/** | ||
236 | +/* | ||
237 | * ioctl_s_fmt_cap - V4L2 decoder interface handler for VIDIOC_S_FMT ioctl | ||
238 | * @s: pointer to standard V4L2 device structure | ||
239 | * @f: pointer to standard V4L2 VIDIOC_S_FMT ioctl structure | ||
240 | @@ -1058,7 +1052,7 @@ ioctl_s_fmt_cap(struct v4l2_int_device *s, struct v4l2_format *f) | ||
241 | return rval; | ||
242 | } | ||
243 | |||
244 | -/** | ||
245 | +/* | ||
246 | * ioctl_g_fmt_cap - V4L2 decoder interface handler for ioctl_g_fmt_cap | ||
247 | * @s: pointer to standard V4L2 device structure | ||
248 | * @f: pointer to standard V4L2 v4l2_format structure | ||
249 | @@ -1087,7 +1081,7 @@ ioctl_g_fmt_cap(struct v4l2_int_device *s, struct v4l2_format *f) | ||
250 | return 0; | ||
251 | } | ||
252 | |||
253 | -/** | ||
254 | +/* | ||
255 | * ioctl_g_parm - V4L2 decoder interface handler for VIDIOC_G_PARM ioctl | ||
256 | * @s: pointer to standard V4L2 device structure | ||
257 | * @a: pointer to standard V4L2 VIDIOC_G_PARM ioctl structure | ||
258 | @@ -1125,7 +1119,7 @@ ioctl_g_parm(struct v4l2_int_device *s, struct v4l2_streamparm *a) | ||
259 | return 0; | ||
260 | } | ||
261 | |||
262 | -/** | ||
263 | +/* | ||
264 | * ioctl_s_parm - V4L2 decoder interface handler for VIDIOC_S_PARM ioctl | ||
265 | * @s: pointer to standard V4L2 device structure | ||
266 | * @a: pointer to standard V4L2 VIDIOC_S_PARM ioctl structure | ||
267 | @@ -1161,7 +1155,7 @@ ioctl_s_parm(struct v4l2_int_device *s, struct v4l2_streamparm *a) | ||
268 | return 0; | ||
269 | } | ||
270 | |||
271 | -/** | ||
272 | +/* | ||
273 | * ioctl_g_ifparm - V4L2 decoder interface handler for vidioc_int_g_ifparm_num | ||
274 | * @s: pointer to standard V4L2 device structure | ||
275 | * @p: pointer to standard V4L2 vidioc_int_g_ifparm_num ioctl structure | ||
276 | @@ -1193,7 +1187,7 @@ static int ioctl_g_ifparm(struct v4l2_int_device *s, struct v4l2_ifparm *p) | ||
277 | return 0; | ||
278 | } | ||
279 | |||
280 | -/** | ||
281 | +/* | ||
282 | * ioctl_g_priv - V4L2 decoder interface handler for vidioc_int_g_priv_num | ||
283 | * @s: pointer to standard V4L2 device structure | ||
284 | * @p: void pointer to hold decoder's private data address | ||
285 | @@ -1210,7 +1204,7 @@ static int ioctl_g_priv(struct v4l2_int_device *s, void *p) | ||
286 | return decoder->pdata->priv_data_set(p); | ||
287 | } | ||
288 | |||
289 | -/** | ||
290 | +/* | ||
291 | * ioctl_s_power - V4L2 decoder interface handler for vidioc_int_s_power_num | ||
292 | * @s: pointer to standard V4L2 device structure | ||
293 | * @on: power state to which device is to be set | ||
294 | @@ -1272,7 +1266,7 @@ static int ioctl_s_power(struct v4l2_int_device *s, enum v4l2_power on) | ||
295 | return err; | ||
296 | } | ||
297 | |||
298 | -/** | ||
299 | +/* | ||
300 | * ioctl_init - V4L2 decoder interface handler for VIDIOC_INT_INIT | ||
301 | * @s: pointer to standard V4L2 device structure | ||
302 | * | ||
303 | @@ -1289,7 +1283,7 @@ static int ioctl_init(struct v4l2_int_device *s) | ||
304 | return err; | ||
305 | } | ||
306 | |||
307 | -/** | ||
308 | +/* | ||
309 | * ioctl_dev_exit - V4L2 decoder interface handler for vidioc_int_dev_exit_num | ||
310 | * @s: pointer to standard V4L2 device structure | ||
311 | * | ||
312 | @@ -1300,7 +1294,7 @@ static int ioctl_dev_exit(struct v4l2_int_device *s) | ||
313 | return 0; | ||
314 | } | ||
315 | |||
316 | -/** | ||
317 | +/* | ||
318 | * ioctl_dev_init - V4L2 decoder interface handler for vidioc_int_dev_init_num | ||
319 | * @s: pointer to standard V4L2 device structure | ||
320 | * | ||
321 | @@ -1397,7 +1391,7 @@ static struct v4l2_int_device mt9v113_int_device = { | ||
322 | }, | ||
323 | }; | ||
324 | |||
325 | -/** | ||
326 | +/* | ||
327 | * mt9v113_probe - decoder driver i2c probe handler | ||
328 | * @client: i2c driver client device structure | ||
329 | * | ||
330 | @@ -1410,30 +1404,15 @@ mt9v113_probe(struct i2c_client *client, const struct i2c_device_id *id) | ||
331 | struct mt9v113_decoder *decoder = &mt9v113_dev; | ||
332 | int err; | ||
333 | |||
334 | - printk("%s: %d\n", __func__, __LINE__); | ||
335 | /* Check if the adapter supports the needed features */ | ||
336 | if (!i2c_check_functionality(client->adapter, I2C_FUNC_SMBUS_BYTE_DATA)) | ||
337 | return -EIO; | ||
338 | |||
339 | - printk("%s: %d\n", __func__, __LINE__); | ||
340 | decoder->pdata = client->dev.platform_data; | ||
341 | if (!decoder->pdata) { | ||
342 | v4l_err(client, "No platform data!!\n"); | ||
343 | return -ENODEV; | ||
344 | } | ||
345 | - printk("%s: %d\n", __func__, __LINE__); | ||
346 | - /* | ||
347 | - * Fetch platform specific data, and configure the | ||
348 | - * mt9v113_reg_list[] accordingly. Since this is one | ||
349 | - * time configuration, no need to preserve. | ||
350 | - */ | ||
351 | - | ||
352 | - /*mt9v113_reg_list[REG_OUTPUT_FORMATTER2].val |= | ||
353 | - (decoder->pdata->clk_polarity << 1); | ||
354 | - mt9v113_reg_list[REG_SYNC_CONTROL].val |= | ||
355 | - ((decoder->pdata->hs_polarity << 2) | | ||
356 | - (decoder->pdata->vs_polarity << 3)); | ||
357 | - */ | ||
358 | /* | ||
359 | * Save the id data, required for power up sequence | ||
360 | */ | ||
361 | @@ -1458,7 +1437,7 @@ mt9v113_probe(struct i2c_client *client, const struct i2c_device_id *id) | ||
362 | return 0; | ||
363 | } | ||
364 | |||
365 | -/** | ||
366 | +/* | ||
367 | * mt9v113_remove - decoder driver i2c remove handler | ||
368 | * @client: i2c driver client device structure | ||
369 | * | ||
370 | @@ -1511,7 +1490,7 @@ static struct i2c_driver mt9v113_i2c_driver = { | ||
371 | .id_table = mt9v113_id, | ||
372 | }; | ||
373 | |||
374 | -/** | ||
375 | +/* | ||
376 | * mt9v113_init | ||
377 | * | ||
378 | * Module init function | ||
379 | @@ -1521,7 +1500,7 @@ static int __init mt9v113_init(void) | ||
380 | return i2c_add_driver(&mt9v113_i2c_driver); | ||
381 | } | ||
382 | |||
383 | -/** | ||
384 | +/* | ||
385 | * mt9v113_cleanup | ||
386 | * | ||
387 | * Module exit function | ||
388 | -- | ||
389 | 1.6.6.1 | ||
390 | |||