Commit 5403bbae authored by Michel Ludwig's avatar Michel Ludwig Committed by Mauro Carvalho Chehab
Browse files

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: default avatarMichel Ludwig <michel.ludwig@gmail.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@infradead.org>
parent a37b4c9b
Loading
Loading
Loading
Loading
+20 −0
Original line number Original line Diff line number Diff line
@@ -461,6 +461,23 @@ static int load_firmware(struct dvb_frontend *fe, unsigned int type,
			}
			}
			continue;
			continue;
		}
		}
		if (size >= 0xff00) {
			switch (size) {
			case 0xff00:
				rc = priv->tuner_callback(priv->video_dev,
							XC2028_RESET_CLK, 0);
				if (rc < 0) {
					tuner_err("Error at RESET code %d\n",
						  (*p) & 0x7f);
					return -EINVAL;
				}
			default:
				tuner_info("Invalid RESET code %d\n",
					   size & 0x7f);
				return -EINVAL;

			}
		}


		/* Checks for a sleep command */
		/* Checks for a sleep command */
		if (size & 0x8000) {
		if (size & 0x8000) {
@@ -627,6 +644,9 @@ static int check_firmware(struct dvb_frontend *fe, enum tuner_mode new_mode,
		priv->bandwidth = bandwidth;
		priv->bandwidth = bandwidth;
	}
	}


	if (!change_digital_bandwidth && priv->mode == T_DIGITAL_TV)
		return 0;

	/* Load INIT1, if needed */
	/* Load INIT1, if needed */
	tuner_dbg("Load init1 firmware, if exists\n");
	tuner_dbg("Load init1 firmware, if exists\n");
	type0 = BASE | INIT1;
	type0 = BASE | INIT1;