diff options
author | Mauro Carvalho Chehab <mchehab@infradead.org> | 2007-11-15 07:44:30 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2008-01-25 16:02:11 -0500 |
commit | 83fb340b3184875a63564ea174350b1d1b081874 (patch) | |
tree | 8bf75a3317e774f5ff36a65a22ddc80318d438b1 | |
parent | 98883cdcb5884bd0f7a89ac36b7170404127b3ea (diff) |
V4L/DVB (6595): Corrects printk lines
Make the driver less verbose by default. It adds a debug parameter to make the
driver more verbose.
Also, error messages were using KERN_ERR level, instead of KERN_INFO.
A few printk messages were reviewed to make them more clear.
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
-rw-r--r-- | drivers/media/video/tuner-xc2028.c | 127 |
1 files changed, 68 insertions, 59 deletions
diff --git a/drivers/media/video/tuner-xc2028.c b/drivers/media/video/tuner-xc2028.c index e046c21be0b9..492181d8de87 100644 --- a/drivers/media/video/tuner-xc2028.c +++ b/drivers/media/video/tuner-xc2028.c | |||
@@ -24,6 +24,10 @@ | |||
24 | 24 | ||
25 | #define PREFIX "xc2028" | 25 | #define PREFIX "xc2028" |
26 | 26 | ||
27 | static int debug; | ||
28 | module_param(debug, int, 0644); | ||
29 | MODULE_PARM_DESC(debug, "enable verbose debug messages"); | ||
30 | |||
27 | static LIST_HEAD(xc2028_list); | 31 | static LIST_HEAD(xc2028_list); |
28 | /* struct for storing firmware table */ | 32 | /* struct for storing firmware table */ |
29 | struct firmware_description { | 33 | struct firmware_description { |
@@ -68,14 +72,14 @@ struct xc2028_data { | |||
68 | #define i2c_send(rc, priv, buf, size) do { \ | 72 | #define i2c_send(rc, priv, buf, size) do { \ |
69 | rc = tuner_i2c_xfer_send(&priv->i2c_props, buf, size); \ | 73 | rc = tuner_i2c_xfer_send(&priv->i2c_props, buf, size); \ |
70 | if (size != rc) \ | 74 | if (size != rc) \ |
71 | tuner_info("i2c output error: rc = %d (should be %d)\n",\ | 75 | tuner_err("i2c output error: rc = %d (should be %d)\n", \ |
72 | rc, (int)size); \ | 76 | rc, (int)size); \ |
73 | } while (0) | 77 | } while (0) |
74 | 78 | ||
75 | #define i2c_rcv(rc, priv, buf, size) do { \ | 79 | #define i2c_rcv(rc, priv, buf, size) do { \ |
76 | rc = tuner_i2c_xfer_recv(&priv->i2c_props, buf, size); \ | 80 | rc = tuner_i2c_xfer_recv(&priv->i2c_props, buf, size); \ |
77 | if (size != rc) \ | 81 | if (size != rc) \ |
78 | tuner_info("i2c input error: rc = %d (should be %d)\n", \ | 82 | tuner_err("i2c input error: rc = %d (should be %d)\n", \ |
79 | rc, (int)size); \ | 83 | rc, (int)size); \ |
80 | } while (0) | 84 | } while (0) |
81 | 85 | ||
@@ -85,7 +89,7 @@ struct xc2028_data { | |||
85 | if (sizeof(_val) != \ | 89 | if (sizeof(_val) != \ |
86 | (rc = tuner_i2c_xfer_send(&priv->i2c_props, \ | 90 | (rc = tuner_i2c_xfer_send(&priv->i2c_props, \ |
87 | _val, sizeof(_val)))) { \ | 91 | _val, sizeof(_val)))) { \ |
88 | tuner_info("Error on line %d: %d\n", __LINE__, rc); \ | 92 | tuner_err("Error on line %d: %d\n", __LINE__, rc); \ |
89 | return -EINVAL; \ | 93 | return -EINVAL; \ |
90 | } \ | 94 | } \ |
91 | msleep(10); \ | 95 | msleep(10); \ |
@@ -96,7 +100,7 @@ static unsigned int xc2028_get_reg(struct xc2028_data *priv, u16 reg) | |||
96 | int rc; | 100 | int rc; |
97 | unsigned char buf[2]; | 101 | unsigned char buf[2]; |
98 | 102 | ||
99 | tuner_info("%s called\n", __FUNCTION__); | 103 | tuner_dbg("%s called\n", __FUNCTION__); |
100 | 104 | ||
101 | buf[0] = reg>>8; | 105 | buf[0] = reg>>8; |
102 | buf[1] = (unsigned char) reg; | 106 | buf[1] = (unsigned char) reg; |
@@ -201,16 +205,16 @@ static int load_all_firmwares(struct dvb_frontend *fe) | |||
201 | int n, n_array; | 205 | int n, n_array; |
202 | char name[33]; | 206 | char name[33]; |
203 | 207 | ||
204 | tuner_info("%s called\n", __FUNCTION__); | 208 | tuner_dbg("%s called\n", __FUNCTION__); |
205 | 209 | ||
206 | tuner_info("Reading firmware %s\n", priv->ctrl.fname); | 210 | tuner_info("Reading firmware %s\n", priv->ctrl.fname); |
207 | rc = request_firmware(&fw, priv->ctrl.fname, priv->dev); | 211 | rc = request_firmware(&fw, priv->ctrl.fname, priv->dev); |
208 | if (rc < 0) { | 212 | if (rc < 0) { |
209 | if (rc == -ENOENT) | 213 | if (rc == -ENOENT) |
210 | tuner_info("Error: firmware %s not found.\n", | 214 | tuner_err("Error: firmware %s not found.\n", |
211 | priv->ctrl.fname); | 215 | priv->ctrl.fname); |
212 | else | 216 | else |
213 | tuner_info("Error %d while requesting firmware %s \n", | 217 | tuner_err("Error %d while requesting firmware %s \n", |
214 | rc, priv->ctrl.fname); | 218 | rc, priv->ctrl.fname); |
215 | 219 | ||
216 | return rc; | 220 | return rc; |
@@ -219,7 +223,7 @@ static int load_all_firmwares(struct dvb_frontend *fe) | |||
219 | endp = p + fw->size; | 223 | endp = p + fw->size; |
220 | 224 | ||
221 | if (fw->size < sizeof(name) - 1 + 2) { | 225 | if (fw->size < sizeof(name) - 1 + 2) { |
222 | tuner_info("Error: firmware size is zero!\n"); | 226 | tuner_err("Error: firmware size is zero!\n"); |
223 | rc = -EINVAL; | 227 | rc = -EINVAL; |
224 | goto done; | 228 | goto done; |
225 | } | 229 | } |
@@ -231,7 +235,7 @@ static int load_all_firmwares(struct dvb_frontend *fe) | |||
231 | priv->version = le16_to_cpu(*(__u16 *) p); | 235 | priv->version = le16_to_cpu(*(__u16 *) p); |
232 | p += 2; | 236 | p += 2; |
233 | 237 | ||
234 | tuner_info("firmware: %s, ver %d.%d\n", name, | 238 | tuner_info("Firmware: %s, ver %d.%d\n", name, |
235 | priv->version >> 8, priv->version & 0xff); | 239 | priv->version >> 8, priv->version & 0xff); |
236 | 240 | ||
237 | if (p + 2 > endp) | 241 | if (p + 2 > endp) |
@@ -240,12 +244,13 @@ static int load_all_firmwares(struct dvb_frontend *fe) | |||
240 | n_array = le16_to_cpu(*(__u16 *) p); | 244 | n_array = le16_to_cpu(*(__u16 *) p); |
241 | p += 2; | 245 | p += 2; |
242 | 246 | ||
243 | tuner_info("there are %d firmwares at %s\n", n_array, priv->ctrl.fname); | 247 | tuner_info("There are %d firmwares at %s\n", |
248 | n_array, priv->ctrl.fname); | ||
244 | 249 | ||
245 | priv->firm = kzalloc(sizeof(*priv->firm) * n_array, GFP_KERNEL); | 250 | priv->firm = kzalloc(sizeof(*priv->firm) * n_array, GFP_KERNEL); |
246 | 251 | ||
247 | if (!fw) { | 252 | if (!fw) { |
248 | tuner_info("Not enough memory for loading firmware.\n"); | 253 | tuner_err("Not enough memory for reading firmware.\n"); |
249 | rc = -ENOMEM; | 254 | rc = -ENOMEM; |
250 | goto done; | 255 | goto done; |
251 | } | 256 | } |
@@ -258,13 +263,13 @@ static int load_all_firmwares(struct dvb_frontend *fe) | |||
258 | 263 | ||
259 | n++; | 264 | n++; |
260 | if (n >= n_array) { | 265 | if (n >= n_array) { |
261 | tuner_info("Too much firmwares at the file\n"); | 266 | tuner_err("Too much firmwares at the file\n"); |
262 | goto corrupt; | 267 | goto corrupt; |
263 | } | 268 | } |
264 | 269 | ||
265 | /* Checks if there's enough bytes to read */ | 270 | /* Checks if there's enough bytes to read */ |
266 | if (p + sizeof(type) + sizeof(id) + sizeof(size) > endp) { | 271 | if (p + sizeof(type) + sizeof(id) + sizeof(size) > endp) { |
267 | tuner_info("Lost firmware!\n"); | 272 | tuner_err("Firmware header is incomplete!\n"); |
268 | goto corrupt; | 273 | goto corrupt; |
269 | } | 274 | } |
270 | 275 | ||
@@ -278,20 +283,21 @@ static int load_all_firmwares(struct dvb_frontend *fe) | |||
278 | p += sizeof(size); | 283 | p += sizeof(size); |
279 | 284 | ||
280 | if ((!size) || (size + p > endp)) { | 285 | if ((!size) || (size + p > endp)) { |
281 | tuner_info("Firmware type "); | 286 | tuner_err("Firmware type "); |
282 | dump_firm_type(type); | 287 | dump_firm_type(type); |
283 | printk("(%x), id %lx corrupt (size=%ld, expected %d)\n", | 288 | printk("(%x), id %lx is corrupted " |
284 | type, (unsigned long)id, endp - p, size); | 289 | "(size=%ld, expected %d)\n", |
290 | type, (unsigned long)id, endp - p, size); | ||
285 | goto corrupt; | 291 | goto corrupt; |
286 | } | 292 | } |
287 | 293 | ||
288 | priv->firm[n].ptr = kzalloc(size, GFP_KERNEL); | 294 | priv->firm[n].ptr = kzalloc(size, GFP_KERNEL); |
289 | if (!priv->firm[n].ptr) { | 295 | if (!priv->firm[n].ptr) { |
290 | tuner_info("Not enough memory.\n"); | 296 | tuner_err("Not enough memory.\n"); |
291 | rc = -ENOMEM; | 297 | rc = -ENOMEM; |
292 | goto err; | 298 | goto err; |
293 | } | 299 | } |
294 | tuner_info("Loading firmware type "); | 300 | tuner_info("Reading firmware type "); |
295 | dump_firm_type(type); | 301 | dump_firm_type(type); |
296 | printk("(%x), id %lx, size=%d.\n", | 302 | printk("(%x), id %lx, size=%d.\n", |
297 | type, (unsigned long)id, size); | 303 | type, (unsigned long)id, size); |
@@ -305,7 +311,7 @@ static int load_all_firmwares(struct dvb_frontend *fe) | |||
305 | } | 311 | } |
306 | 312 | ||
307 | if (n + 1 != priv->firm_size) { | 313 | if (n + 1 != priv->firm_size) { |
308 | tuner_info("Firmware file is incomplete!\n"); | 314 | tuner_err("Firmware file is incomplete!\n"); |
309 | goto corrupt; | 315 | goto corrupt; |
310 | } | 316 | } |
311 | 317 | ||
@@ -313,7 +319,7 @@ static int load_all_firmwares(struct dvb_frontend *fe) | |||
313 | 319 | ||
314 | corrupt: | 320 | corrupt: |
315 | rc = -EINVAL; | 321 | rc = -EINVAL; |
316 | tuner_info("Error: firmware file is corrupted!\n"); | 322 | tuner_err("Error: firmware file is corrupted!\n"); |
317 | 323 | ||
318 | err: | 324 | err: |
319 | tuner_info("Releasing loaded firmware file.\n"); | 325 | tuner_info("Releasing loaded firmware file.\n"); |
@@ -322,7 +328,7 @@ err: | |||
322 | 328 | ||
323 | done: | 329 | done: |
324 | release_firmware(fw); | 330 | release_firmware(fw); |
325 | tuner_info("Firmware files loaded.\n"); | 331 | tuner_dbg("Firmware files loaded.\n"); |
326 | 332 | ||
327 | return rc; | 333 | return rc; |
328 | } | 334 | } |
@@ -333,10 +339,10 @@ static int seek_firmware(struct dvb_frontend *fe, unsigned int type, | |||
333 | struct xc2028_data *priv = fe->tuner_priv; | 339 | struct xc2028_data *priv = fe->tuner_priv; |
334 | int i; | 340 | int i; |
335 | 341 | ||
336 | tuner_info("%s called\n", __FUNCTION__); | 342 | tuner_dbg("%s called\n", __FUNCTION__); |
337 | 343 | ||
338 | if (!priv->firm) { | 344 | if (!priv->firm) { |
339 | printk(KERN_ERR PREFIX "Error! firmware not loaded\n"); | 345 | tuner_err("Error! firmware not loaded\n"); |
340 | return -EINVAL; | 346 | return -EINVAL; |
341 | } | 347 | } |
342 | 348 | ||
@@ -364,10 +370,11 @@ found: | |||
364 | *id = priv->firm[i].id; | 370 | *id = priv->firm[i].id; |
365 | 371 | ||
366 | ret: | 372 | ret: |
367 | tuner_info("%s firmware for type=", (i < 0)? "Can't find": "Found"); | 373 | tuner_dbg("%s firmware for type=", (i < 0)? "Can't find": "Found"); |
368 | dump_firm_type(type); | 374 | if (debug) { |
369 | printk("(%x), id %08lx.\n", type, (unsigned long)*id); | 375 | dump_firm_type(type); |
370 | 376 | printk("(%x), id %08lx.\n", type, (unsigned long)*id); | |
377 | } | ||
371 | return i; | 378 | return i; |
372 | } | 379 | } |
373 | 380 | ||
@@ -378,16 +385,20 @@ static int load_firmware(struct dvb_frontend *fe, unsigned int type, | |||
378 | int pos, rc; | 385 | int pos, rc; |
379 | unsigned char *p, *endp, buf[priv->max_len]; | 386 | unsigned char *p, *endp, buf[priv->max_len]; |
380 | 387 | ||
381 | tuner_info("%s called\n", __FUNCTION__); | 388 | tuner_dbg("%s called\n", __FUNCTION__); |
382 | 389 | ||
383 | pos = seek_firmware(fe, type, id); | 390 | pos = seek_firmware(fe, type, id); |
384 | if (pos < 0) | 391 | if (pos < 0) |
385 | return pos; | 392 | return pos; |
386 | 393 | ||
394 | tuner_info("Loading firmware for type="); | ||
395 | dump_firm_type(type); | ||
396 | printk("(%x), id %08lx.\n", type, (unsigned long)*id); | ||
397 | |||
387 | p = priv->firm[pos].ptr; | 398 | p = priv->firm[pos].ptr; |
388 | 399 | ||
389 | if (!p) { | 400 | if (!p) { |
390 | printk(KERN_ERR PREFIX "Firmware pointer were freed!"); | 401 | tuner_err("Firmware pointer were freed!"); |
391 | return -EINVAL; | 402 | return -EINVAL; |
392 | } | 403 | } |
393 | endp = p + priv->firm[pos].size; | 404 | endp = p + priv->firm[pos].size; |
@@ -397,7 +408,7 @@ static int load_firmware(struct dvb_frontend *fe, unsigned int type, | |||
397 | 408 | ||
398 | /* Checks if there's enough bytes to read */ | 409 | /* Checks if there's enough bytes to read */ |
399 | if (p + sizeof(size) > endp) { | 410 | if (p + sizeof(size) > endp) { |
400 | tuner_info("missing bytes\n"); | 411 | tuner_err("Firmware chunk size is wrong\n"); |
401 | return -EINVAL; | 412 | return -EINVAL; |
402 | } | 413 | } |
403 | 414 | ||
@@ -412,7 +423,7 @@ static int load_firmware(struct dvb_frontend *fe, unsigned int type, | |||
412 | rc = priv->tuner_callback(priv->video_dev, | 423 | rc = priv->tuner_callback(priv->video_dev, |
413 | XC2028_TUNER_RESET, 0); | 424 | XC2028_TUNER_RESET, 0); |
414 | if (rc < 0) { | 425 | if (rc < 0) { |
415 | tuner_info("Error at RESET code %d\n", | 426 | tuner_err("Error at RESET code %d\n", |
416 | (*p) & 0x7f); | 427 | (*p) & 0x7f); |
417 | return -EINVAL; | 428 | return -EINVAL; |
418 | } | 429 | } |
@@ -426,7 +437,7 @@ static int load_firmware(struct dvb_frontend *fe, unsigned int type, | |||
426 | } | 437 | } |
427 | 438 | ||
428 | if ((size + p > endp)) { | 439 | if ((size + p > endp)) { |
429 | tuner_info("missing bytes: need %d, have %d\n", | 440 | tuner_err("missing bytes: need %d, have %d\n", |
430 | size, (int)(endp - p)); | 441 | size, (int)(endp - p)); |
431 | return -EINVAL; | 442 | return -EINVAL; |
432 | } | 443 | } |
@@ -444,7 +455,7 @@ static int load_firmware(struct dvb_frontend *fe, unsigned int type, | |||
444 | 455 | ||
445 | i2c_send(rc, priv, buf, len + 1); | 456 | i2c_send(rc, priv, buf, len + 1); |
446 | if (rc < 0) { | 457 | if (rc < 0) { |
447 | tuner_info("%d returned from send\n", rc); | 458 | tuner_err("%d returned from send\n", rc); |
448 | return -EINVAL; | 459 | return -EINVAL; |
449 | } | 460 | } |
450 | 461 | ||
@@ -462,7 +473,7 @@ static int load_scode(struct dvb_frontend *fe, unsigned int type, | |||
462 | int pos, rc; | 473 | int pos, rc; |
463 | unsigned char *p; | 474 | unsigned char *p; |
464 | 475 | ||
465 | tuner_info("%s called\n", __FUNCTION__); | 476 | tuner_dbg("%s called\n", __FUNCTION__); |
466 | 477 | ||
467 | pos = seek_firmware(fe, type, id); | 478 | pos = seek_firmware(fe, type, id); |
468 | if (pos < 0) | 479 | if (pos < 0) |
@@ -471,7 +482,7 @@ static int load_scode(struct dvb_frontend *fe, unsigned int type, | |||
471 | p = priv->firm[pos].ptr; | 482 | p = priv->firm[pos].ptr; |
472 | 483 | ||
473 | if (!p) { | 484 | if (!p) { |
474 | printk(KERN_ERR PREFIX "Firmware pointer were freed!"); | 485 | tuner_err("Firmware pointer were freed!"); |
475 | return -EINVAL; | 486 | return -EINVAL; |
476 | } | 487 | } |
477 | 488 | ||
@@ -500,7 +511,7 @@ static int check_firmware(struct dvb_frontend *fe, enum tuner_mode new_mode, | |||
500 | unsigned int type0 = 0, type = 0; | 511 | unsigned int type0 = 0, type = 0; |
501 | int change_digital_bandwidth; | 512 | int change_digital_bandwidth; |
502 | 513 | ||
503 | tuner_info("%s called\n", __FUNCTION__); | 514 | tuner_dbg("%s called\n", __FUNCTION__); |
504 | 515 | ||
505 | if (!priv->firm) { | 516 | if (!priv->firm) { |
506 | if (!priv->ctrl.fname) | 517 | if (!priv->ctrl.fname) |
@@ -511,7 +522,7 @@ static int check_firmware(struct dvb_frontend *fe, enum tuner_mode new_mode, | |||
511 | return rc; | 522 | return rc; |
512 | } | 523 | } |
513 | 524 | ||
514 | tuner_info("I am in mode %u and I should switch to mode %i\n", | 525 | tuner_dbg("I am in mode %u and I should switch to mode %i\n", |
515 | priv->mode, new_mode); | 526 | priv->mode, new_mode); |
516 | 527 | ||
517 | /* first of all, determine whether we have switched the mode */ | 528 | /* first of all, determine whether we have switched the mode */ |
@@ -522,7 +533,7 @@ static int check_firmware(struct dvb_frontend *fe, enum tuner_mode new_mode, | |||
522 | 533 | ||
523 | change_digital_bandwidth = (priv->mode == T_DIGITAL_TV | 534 | change_digital_bandwidth = (priv->mode == T_DIGITAL_TV |
524 | && bandwidth != priv->bandwidth) ? 1 : 0; | 535 | && bandwidth != priv->bandwidth) ? 1 : 0; |
525 | tuner_info("old bandwidth %u, new bandwidth %u\n", priv->bandwidth, | 536 | tuner_dbg("old bandwidth %u, new bandwidth %u\n", priv->bandwidth, |
526 | bandwidth); | 537 | bandwidth); |
527 | 538 | ||
528 | if (priv->need_load_generic) { | 539 | if (priv->need_load_generic) { |
@@ -544,8 +555,8 @@ static int check_firmware(struct dvb_frontend *fe, enum tuner_mode new_mode, | |||
544 | 555 | ||
545 | rc = load_firmware(fe, type0, &std0); | 556 | rc = load_firmware(fe, type0, &std0); |
546 | if (rc < 0) { | 557 | if (rc < 0) { |
547 | tuner_info("Error %d while loading generic firmware\n", | 558 | tuner_err("Error %d while loading generic firmware\n", |
548 | rc); | 559 | rc); |
549 | return rc; | 560 | return rc; |
550 | } | 561 | } |
551 | 562 | ||
@@ -555,7 +566,7 @@ static int check_firmware(struct dvb_frontend *fe, enum tuner_mode new_mode, | |||
555 | change_digital_bandwidth = 1; | 566 | change_digital_bandwidth = 1; |
556 | } | 567 | } |
557 | 568 | ||
558 | tuner_info("I should change bandwidth %u\n", change_digital_bandwidth); | 569 | tuner_dbg("I should change bandwidth %u\n", change_digital_bandwidth); |
559 | 570 | ||
560 | if (change_digital_bandwidth) { | 571 | if (change_digital_bandwidth) { |
561 | 572 | ||
@@ -577,13 +588,13 @@ static int check_firmware(struct dvb_frontend *fe, enum tuner_mode new_mode, | |||
577 | break; | 588 | break; |
578 | 589 | ||
579 | default: | 590 | default: |
580 | tuner_info("error: bandwidth not supported.\n"); | 591 | tuner_err("error: bandwidth not supported.\n"); |
581 | }; | 592 | }; |
582 | priv->bandwidth = bandwidth; | 593 | priv->bandwidth = bandwidth; |
583 | } | 594 | } |
584 | 595 | ||
585 | /* Load INIT1, if needed */ | 596 | /* Load INIT1, if needed */ |
586 | tuner_info("Load init1 firmware, if exists\n"); | 597 | tuner_dbg("Load init1 firmware, if exists\n"); |
587 | type0 = BASE | INIT1; | 598 | type0 = BASE | INIT1; |
588 | if (priv->ctrl.type == XC2028_FIRM_MTS) | 599 | if (priv->ctrl.type == XC2028_FIRM_MTS) |
589 | type0 |= MTS; | 600 | type0 |= MTS; |
@@ -597,9 +608,8 @@ static int check_firmware(struct dvb_frontend *fe, enum tuner_mode new_mode, | |||
597 | if (priv->ctrl.type == XC2028_FIRM_MTS) | 608 | if (priv->ctrl.type == XC2028_FIRM_MTS) |
598 | type |= MTS; | 609 | type |= MTS; |
599 | 610 | ||
600 | tuner_info("Firmware standard to load: %08lx\n", (unsigned long)std); | ||
601 | if (priv->firm_type & std) { | 611 | if (priv->firm_type & std) { |
602 | tuner_info("Std-specific firmware already loaded.\n"); | 612 | tuner_dbg("Std-specific firmware already loaded.\n"); |
603 | return 0; | 613 | return 0; |
604 | } | 614 | } |
605 | 615 | ||
@@ -608,7 +618,7 @@ static int check_firmware(struct dvb_frontend *fe, enum tuner_mode new_mode, | |||
608 | return rc; | 618 | return rc; |
609 | 619 | ||
610 | /* Load SCODE firmware, if exists */ | 620 | /* Load SCODE firmware, if exists */ |
611 | tuner_info("Trying to load scode 0\n"); | 621 | tuner_dbg("Trying to load scode 0\n"); |
612 | type |= SCODE; | 622 | type |= SCODE; |
613 | 623 | ||
614 | rc = load_scode(fe, type, &std, 0); | 624 | rc = load_scode(fe, type, &std, 0); |
@@ -631,7 +641,7 @@ static int xc2028_signal(struct dvb_frontend *fe, u16 *strength) | |||
631 | struct xc2028_data *priv = fe->tuner_priv; | 641 | struct xc2028_data *priv = fe->tuner_priv; |
632 | int frq_lock, signal = 0; | 642 | int frq_lock, signal = 0; |
633 | 643 | ||
634 | tuner_info("%s called\n", __FUNCTION__); | 644 | tuner_dbg("%s called\n", __FUNCTION__); |
635 | 645 | ||
636 | mutex_lock(&priv->lock); | 646 | mutex_lock(&priv->lock); |
637 | 647 | ||
@@ -669,7 +679,7 @@ static int generic_set_tv_freq(struct dvb_frontend *fe, u32 freq /* in Hz */ , | |||
669 | unsigned char buf[5]; | 679 | unsigned char buf[5]; |
670 | u32 div, offset = 0; | 680 | u32 div, offset = 0; |
671 | 681 | ||
672 | tuner_info("%s called\n", __FUNCTION__); | 682 | tuner_dbg("%s called\n", __FUNCTION__); |
673 | 683 | ||
674 | mutex_lock(&priv->lock); | 684 | mutex_lock(&priv->lock); |
675 | 685 | ||
@@ -684,7 +694,7 @@ static int generic_set_tv_freq(struct dvb_frontend *fe, u32 freq /* in Hz */ , | |||
684 | goto ret; | 694 | goto ret; |
685 | 695 | ||
686 | msleep(10); | 696 | msleep(10); |
687 | tuner_info("should set frequency %d kHz)\n", freq / 1000); | 697 | tuner_dbg("should set frequency %d kHz)\n", freq / 1000); |
688 | 698 | ||
689 | if (check_firmware(fe, new_mode, std, bandwidth) < 0) | 699 | if (check_firmware(fe, new_mode, std, bandwidth) < 0) |
690 | goto ret; | 700 | goto ret; |
@@ -721,7 +731,7 @@ static int generic_set_tv_freq(struct dvb_frontend *fe, u32 freq /* in Hz */ , | |||
721 | 731 | ||
722 | priv->frequency = freq; | 732 | priv->frequency = freq; |
723 | 733 | ||
724 | printk("divider= %02x %02x %02x %02x (freq=%d.%02d)\n", | 734 | tuner_dbg("divider= %02x %02x %02x %02x (freq=%d.%02d)\n", |
725 | buf[1], buf[2], buf[3], buf[4], | 735 | buf[1], buf[2], buf[3], buf[4], |
726 | freq / 1000000, (freq % 1000000) / 10000); | 736 | freq / 1000000, (freq % 1000000) / 10000); |
727 | 737 | ||
@@ -738,7 +748,7 @@ static int xc2028_set_tv_freq(struct dvb_frontend *fe, | |||
738 | { | 748 | { |
739 | struct xc2028_data *priv = fe->tuner_priv; | 749 | struct xc2028_data *priv = fe->tuner_priv; |
740 | 750 | ||
741 | tuner_info("%s called\n", __FUNCTION__); | 751 | tuner_dbg("%s called\n", __FUNCTION__); |
742 | 752 | ||
743 | return generic_set_tv_freq(fe, 62500l * p->frequency, T_ANALOG_TV, | 753 | return generic_set_tv_freq(fe, 62500l * p->frequency, T_ANALOG_TV, |
744 | p->std, BANDWIDTH_8_MHZ /* NOT USED */); | 754 | p->std, BANDWIDTH_8_MHZ /* NOT USED */); |
@@ -749,11 +759,11 @@ static int xc2028_set_params(struct dvb_frontend *fe, | |||
749 | { | 759 | { |
750 | struct xc2028_data *priv = fe->tuner_priv; | 760 | struct xc2028_data *priv = fe->tuner_priv; |
751 | 761 | ||
752 | tuner_info("%s called\n", __FUNCTION__); | 762 | tuner_dbg("%s called\n", __FUNCTION__); |
753 | 763 | ||
754 | /* FIXME: Only OFDM implemented */ | 764 | /* FIXME: Only OFDM implemented */ |
755 | if (fe->ops.info.type != FE_OFDM) { | 765 | if (fe->ops.info.type != FE_OFDM) { |
756 | tuner_info("DTV type not implemented.\n"); | 766 | tuner_err("DTV type not implemented.\n"); |
757 | return -EINVAL; | 767 | return -EINVAL; |
758 | } | 768 | } |
759 | 769 | ||
@@ -767,7 +777,7 @@ static int xc2028_dvb_release(struct dvb_frontend *fe) | |||
767 | { | 777 | { |
768 | struct xc2028_data *priv = fe->tuner_priv; | 778 | struct xc2028_data *priv = fe->tuner_priv; |
769 | 779 | ||
770 | tuner_info("%s called\n", __FUNCTION__); | 780 | tuner_dbg("%s called\n", __FUNCTION__); |
771 | 781 | ||
772 | priv->count--; | 782 | priv->count--; |
773 | 783 | ||
@@ -787,7 +797,7 @@ static int xc2028_get_frequency(struct dvb_frontend *fe, u32 *frequency) | |||
787 | { | 797 | { |
788 | struct xc2028_data *priv = fe->tuner_priv; | 798 | struct xc2028_data *priv = fe->tuner_priv; |
789 | 799 | ||
790 | tuner_info("%s called\n", __FUNCTION__); | 800 | tuner_dbg("%s called\n", __FUNCTION__); |
791 | 801 | ||
792 | *frequency = priv->frequency; | 802 | *frequency = priv->frequency; |
793 | 803 | ||
@@ -799,7 +809,7 @@ static int xc2028_set_config(struct dvb_frontend *fe, void *priv_cfg) | |||
799 | struct xc2028_data *priv = fe->tuner_priv; | 809 | struct xc2028_data *priv = fe->tuner_priv; |
800 | struct xc2028_ctrl *p = priv_cfg; | 810 | struct xc2028_ctrl *p = priv_cfg; |
801 | 811 | ||
802 | tuner_info("%s called\n", __FUNCTION__); | 812 | tuner_dbg("%s called\n", __FUNCTION__); |
803 | 813 | ||
804 | priv->ctrl.type = p->type; | 814 | priv->ctrl.type = p->type; |
805 | 815 | ||
@@ -817,8 +827,6 @@ static int xc2028_set_config(struct dvb_frontend *fe, void *priv_cfg) | |||
817 | if (p->max_len > 0) | 827 | if (p->max_len > 0) |
818 | priv->max_len = p->max_len; | 828 | priv->max_len = p->max_len; |
819 | 829 | ||
820 | tuner_info("%s OK\n", __FUNCTION__); | ||
821 | |||
822 | return 0; | 830 | return 0; |
823 | } | 831 | } |
824 | 832 | ||
@@ -845,7 +853,8 @@ int xc2028_attach(struct dvb_frontend *fe, struct i2c_adapter *i2c_adap, | |||
845 | { | 853 | { |
846 | struct xc2028_data *priv; | 854 | struct xc2028_data *priv; |
847 | 855 | ||
848 | printk(KERN_INFO PREFIX "Xcv2028/3028 init called!\n"); | 856 | if (debug) |
857 | printk(KERN_DEBUG PREFIX "Xcv2028/3028 init called!\n"); | ||
849 | 858 | ||
850 | if (NULL == dev) | 859 | if (NULL == dev) |
851 | return -ENODEV; | 860 | return -ENODEV; |