[media] r820t: avoid rewrite all regs when not needed
authorMauro Carvalho Chehab <mchehab@redhat.com>
Thu, 11 Apr 2013 16:22:21 +0000 (13:22 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Wed, 17 Apr 2013 00:33:59 +0000 (21:33 -0300)
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Tested-by: Antti Palosaari <crope@iki.fi>
drivers/media/tuners/r820t.c

index 2e6a690ffb1a7f0a270aec2ffae9f8d2296c9c40..fc660f27edb3e9a786c18f5d2f16201a037b2280 100644 (file)
@@ -2006,18 +2006,17 @@ static int r820t_imr_callibrate(struct r820t_priv *priv)
        if (priv->init_done)
                return 0;
 
-       /* Initialize registers */
-       rc = r820t_write(priv, 0x05,
-                        r820t_init_array, sizeof(r820t_init_array));
-       if (rc < 0)
-               return rc;
-
        /* Detect Xtal capacitance */
        if ((priv->cfg->rafael_chip == CHIP_R820T) ||
            (priv->cfg->rafael_chip == CHIP_R828S) ||
            (priv->cfg->rafael_chip == CHIP_R820C)) {
                priv->xtal_cap_sel = XTAL_HIGH_CAP_0P;
        } 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++) {
                        rc = r820t_xtal_check(priv);
                        if (rc < 0)