aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/common/tuners/mt2063.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/common/tuners/mt2063.c')
-rw-r--r--drivers/media/common/tuners/mt2063.c46
1 files changed, 17 insertions, 29 deletions
diff --git a/drivers/media/common/tuners/mt2063.c b/drivers/media/common/tuners/mt2063.c
index b2678a468a0e..75cb1d2ccdbc 100644
--- a/drivers/media/common/tuners/mt2063.c
+++ b/drivers/media/common/tuners/mt2063.c
@@ -2051,9 +2051,9 @@ static int mt2063_set_analog_params(struct dvb_frontend *fe,
2051 */ 2051 */
2052#define MAX_SYMBOL_RATE_6MHz 5217391 2052#define MAX_SYMBOL_RATE_6MHz 5217391
2053 2053
2054static int mt2063_set_params(struct dvb_frontend *fe, 2054static int mt2063_set_params(struct dvb_frontend *fe)
2055 struct dvb_frontend_parameters *params)
2056{ 2055{
2056 struct dtv_frontend_properties *c = &fe->dtv_property_cache;
2057 struct mt2063_state *state = fe->tuner_priv; 2057 struct mt2063_state *state = fe->tuner_priv;
2058 int status; 2058 int status;
2059 s32 pict_car = 0; 2059 s32 pict_car = 0;
@@ -2065,37 +2065,25 @@ static int mt2063_set_params(struct dvb_frontend *fe,
2065 s32 if_mid = 0; 2065 s32 if_mid = 0;
2066 s32 rcvr_mode = 0; 2066 s32 rcvr_mode = 0;
2067 2067
2068 switch (fe->ops.info.type) { 2068 if (c->bandwidth_hz == 0)
2069 case FE_OFDM: 2069 return -EINVAL;
2070 switch (params->u.ofdm.bandwidth) { 2070 if (c->bandwidth_hz <= 6000000)
2071 case BANDWIDTH_6_MHZ: 2071 ch_bw = 6000000;
2072 ch_bw = 6000000; 2072 else if (c->bandwidth_hz <= 7000000)
2073 break; 2073 ch_bw = 7000000;
2074 case BANDWIDTH_7_MHZ: 2074 else
2075 ch_bw = 7000000; 2075 ch_bw = 8000000;
2076 break; 2076
2077 case BANDWIDTH_8_MHZ: 2077 switch (c->delivery_system) {
2078 ch_bw = 8000000; 2078 case SYS_DVBT:
2079 break;
2080 default:
2081 return -EINVAL;
2082 }
2083 rcvr_mode = MT2063_OFFAIR_COFDM; 2079 rcvr_mode = MT2063_OFFAIR_COFDM;
2084 pict_car = 36125000; 2080 pict_car = 36125000;
2085 pict2chanb_vsb = -(ch_bw / 2); 2081 pict2chanb_vsb = -(ch_bw / 2);
2086 pict2snd1 = 0; 2082 pict2snd1 = 0;
2087 pict2snd2 = 0; 2083 pict2snd2 = 0;
2088 break; 2084 break;
2089 case FE_QAM: 2085 case SYS_DVBC_ANNEX_A:
2090 /* 2086 case SYS_DVBC_ANNEX_C:
2091 * Using a 8MHz bandwidth sometimes fail
2092 * with 6MHz-spaced channels, due to inter-carrier
2093 * interference. So, it is better to narrow-down the filter
2094 */
2095 if (params->u.qam.symbol_rate <= MAX_SYMBOL_RATE_6MHz)
2096 ch_bw = 6000000;
2097 else
2098 ch_bw = 8000000;
2099 rcvr_mode = MT2063_CABLE_QAM; 2087 rcvr_mode = MT2063_CABLE_QAM;
2100 pict_car = 36125000; 2088 pict_car = 36125000;
2101 pict2snd1 = 0; 2089 pict2snd1 = 0;
@@ -2115,12 +2103,12 @@ static int mt2063_set_params(struct dvb_frontend *fe,
2115 if (status < 0) 2103 if (status < 0)
2116 return status; 2104 return status;
2117 2105
2118 status = MT2063_Tune(state, (params->frequency + (pict2chanb_vsb + (ch_bw / 2)))); 2106 status = MT2063_Tune(state, (c->frequency + (pict2chanb_vsb + (ch_bw / 2))));
2119 2107
2120 if (status < 0) 2108 if (status < 0)
2121 return status; 2109 return status;
2122 2110
2123 state->frequency = params->frequency; 2111 state->frequency = c->frequency;
2124 return 0; 2112 return 0;
2125} 2113}
2126 2114