[media] r820t: add support for diplexer
authorMauro Carvalho Chehab <mchehab@redhat.com>
Wed, 10 Apr 2013 11:51:45 +0000 (08:51 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Wed, 17 Apr 2013 00:28:31 +0000 (21:28 -0300)
This is part of the original driver, and adding it doesn't hurt,
so add it, to better sync the code.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Tested-by: Antti Palosaari <crope@iki.fi>
drivers/media/tuners/r820t.c
drivers/media/tuners/r820t.h

index bb154449a2cfd0d997cc46584b07c0731a60bfff..5be4635c521d8fa2f54b97d053b4748c0f3e484c 100644 (file)
@@ -101,6 +101,7 @@ struct r820t_freq_range {
 };
 
 #define VCO_POWER_REF   0x02
+#define DIP_FREQ       32000000
 
 /*
  * Static constants
@@ -751,6 +752,17 @@ static int r820t_sysfreq_sel(struct r820t_priv *priv, u32 freq,
                break;
        }
 
+       if (priv->cfg->use_diplexer &&
+          ((priv->cfg->rafael_chip == CHIP_R820T) ||
+          (priv->cfg->rafael_chip == CHIP_R828S) ||
+          (priv->cfg->rafael_chip == CHIP_R820C))) {
+               if (freq > DIP_FREQ)
+                       air_cable1_in = 0x00;
+               else
+                       air_cable1_in = 0x60;
+               cable2_in = 0x00;
+       }
+
        rc = r820t_write_reg_mask(priv, 0x1d, lna_top, 0xc7);
        if (rc < 0)
                return rc;
index a64a7b63072912e67582672510d7eca5b7eaa276..949575a41d49b091a0f3377559879f1cf7c3b9db 100644 (file)
@@ -32,10 +32,10 @@ enum r820t_chip {
 
 struct r820t_config {
        u8 i2c_addr;            /* 0x34 */
-
        u32 xtal;
        enum r820t_chip rafael_chip;
        unsigned max_i2c_msg_len;
+       bool use_diplexer;
 };
 
 #if IS_ENABLED(CONFIG_MEDIA_TUNER_R820T)