Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4176e7ea authored by Mauro Carvalho Chehab's avatar Mauro Carvalho Chehab
Browse files

[media] r820t: avoid rewrite all regs when not needed

parent 52775fd5
Loading
Loading
Loading
Loading
+5 −6
Original line number Original line Diff line number Diff line
@@ -2006,18 +2006,17 @@ static int r820t_imr_callibrate(struct r820t_priv *priv)
	if (priv->init_done)
	if (priv->init_done)
		return 0;
		return 0;


	/* Initialize registers */
	rc = r820t_write(priv, 0x05,
			 r820t_init_array, sizeof(r820t_init_array));
	if (rc < 0)
		return rc;

	/* Detect Xtal capacitance */
	/* Detect Xtal capacitance */
	if ((priv->cfg->rafael_chip == CHIP_R820T) ||
	if ((priv->cfg->rafael_chip == CHIP_R820T) ||
	    (priv->cfg->rafael_chip == CHIP_R828S) ||
	    (priv->cfg->rafael_chip == CHIP_R828S) ||
	    (priv->cfg->rafael_chip == CHIP_R820C)) {
	    (priv->cfg->rafael_chip == CHIP_R820C)) {
		priv->xtal_cap_sel = XTAL_HIGH_CAP_0P;
		priv->xtal_cap_sel = XTAL_HIGH_CAP_0P;
	} else {
	} else {
		/* Initialize registers */
		rc = r820t_write(priv, 0x05,
				r820t_init_array, sizeof(r820t_init_array));
		if (rc < 0)
			return rc;
		for (i = 0; i < 3; i++) {
		for (i = 0; i < 3; i++) {
			rc = r820t_xtal_check(priv);
			rc = r820t_xtal_check(priv);
			if (rc < 0)
			if (rc < 0)