aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichel Ludwig <michel.ludwig@gmail.com>2007-11-16 05:49:49 -0500
committerMauro Carvalho Chehab <mchehab@infradead.org>2008-01-25 16:02:14 -0500
commit5403bbae9bfebe1f2df3a022c83e54f70906cefe (patch)
tree5a39bb22938d9c360b23c77e07513f8a7643e071
parenta37b4c9bc87a74ed5003c385eae264fc0acf6b35 (diff)
V4L/DVB (6612): Allow RESET_CLK callback and avoids unneeded loading
TM5600/TM6000 needs clock reset during firmware load. This patch adds the capability of caling a callback method for this. Also, avoids uneeded firmware loads. Signed-off-by: Michel Ludwig <michel.ludwig@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
-rw-r--r--drivers/media/video/tuner-xc2028.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/drivers/media/video/tuner-xc2028.c b/drivers/media/video/tuner-xc2028.c
index 0a2ffe4f38d0..89e6e64786ea 100644
--- a/drivers/media/video/tuner-xc2028.c
+++ b/drivers/media/video/tuner-xc2028.c
@@ -461,6 +461,23 @@ static int load_firmware(struct dvb_frontend *fe, unsigned int type,
461 } 461 }
462 continue; 462 continue;
463 } 463 }
464 if (size >= 0xff00) {
465 switch (size) {
466 case 0xff00:
467 rc = priv->tuner_callback(priv->video_dev,
468 XC2028_RESET_CLK, 0);
469 if (rc < 0) {
470 tuner_err("Error at RESET code %d\n",
471 (*p) & 0x7f);
472 return -EINVAL;
473 }
474 default:
475 tuner_info("Invalid RESET code %d\n",
476 size & 0x7f);
477 return -EINVAL;
478
479 }
480 }
464 481
465 /* Checks for a sleep command */ 482 /* Checks for a sleep command */
466 if (size & 0x8000) { 483 if (size & 0x8000) {
@@ -627,6 +644,9 @@ static int check_firmware(struct dvb_frontend *fe, enum tuner_mode new_mode,
627 priv->bandwidth = bandwidth; 644 priv->bandwidth = bandwidth;
628 } 645 }
629 646
647 if (!change_digital_bandwidth && priv->mode == T_DIGITAL_TV)
648 return 0;
649
630 /* Load INIT1, if needed */ 650 /* Load INIT1, if needed */
631 tuner_dbg("Load init1 firmware, if exists\n"); 651 tuner_dbg("Load init1 firmware, if exists\n");
632 type0 = BASE | INIT1; 652 type0 = BASE | INIT1;