V4L/DVB: af9013: add support for tda18218 silicon tuner
authorAntti Palosaari <crope@iki.fi>
Fri, 13 Aug 2010 06:49:24 +0000 (03:49 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Thu, 21 Oct 2010 03:04:42 +0000 (01:04 -0200)
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/dvb/frontends/af9013.c
drivers/media/dvb/frontends/af9013_priv.h

index dac917f7bb7f8b79f6939a60aa1f43b40c580656..a780c32ebce4ca674eefc5a2a034c2ce42f89d53 100644 (file)
@@ -486,6 +486,19 @@ static int af9013_set_freq_ctrl(struct af9013_state *state, fe_bandwidth_t bw)
                                if_sample_freq = 4300000; /* 4.3 MHz */
                                break;
                        }
+               } else if (state->config.tuner == AF9013_TUNER_TDA18218) {
+                       switch (bw) {
+                       case BANDWIDTH_6_MHZ:
+                               if_sample_freq = 3000000; /* 3 MHz */
+                               break;
+                       case BANDWIDTH_7_MHZ:
+                               if_sample_freq = 3500000; /* 3.5 MHz */
+                               break;
+                       case BANDWIDTH_8_MHZ:
+                       default:
+                               if_sample_freq = 4000000; /* 4 MHz */
+                               break;
+                       }
                }
 
                while (if_sample_freq > (adc_freq / 2))
@@ -1393,6 +1406,7 @@ static int af9013_init(struct dvb_frontend *fe)
                init = tuner_init_mt2060_2;
                break;
        case AF9013_TUNER_TDA18271:
+       case AF9013_TUNER_TDA18218:
                len = ARRAY_SIZE(tuner_init_tda18271);
                init = tuner_init_tda18271;
                break;
index 0fd42b7e248ea7f2bc347097b6f95ff6b314da23..0dcca60f0668f86cfff80b31f6fc31005b9fd031 100644 (file)
@@ -791,8 +791,9 @@ static struct regdesc tuner_init_unknown[] = {
        { 0x9bd9, 0, 8, 0x08 },
 };
 
-/* NXP TDA18271 tuner init
-   AF9013_TUNER_TDA18271   = 156 */
+/* NXP TDA18271 & TDA18218 tuner init
+   AF9013_TUNER_TDA18271   = 156
+   AF9013_TUNER_TDA18218   = 179 */
 static struct regdesc tuner_init_tda18271[] = {
        { 0x9bd5, 0, 8, 0x01 },
        { 0x9bd6, 0, 8, 0x04 },