aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/common
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@redhat.com>2011-07-22 16:05:15 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2012-01-04 19:48:57 -0500
commit2e1d5885f4964e949eb9a4c1ecf297c297140134 (patch)
tree678a6dc4668c9eb686fddd7705d147ab91e45ffe /drivers/media/common
parentdb6587bfd251384ff96c8891ded9a07c849daf00 (diff)
[media] mt2063: Rewrite tuning logic
Several vars at set_parms functions were set, but unused. Remove them and change the logic to return -EINVAL if the analog set_param is used for digital mode. At the analog side, cleans the logic that sets the several analog standards. Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/common')
-rw-r--r--drivers/media/common/tuners/mt2063.c62
1 files changed, 13 insertions, 49 deletions
diff --git a/drivers/media/common/tuners/mt2063.c b/drivers/media/common/tuners/mt2063.c
index cd67417dc4cd..b72105d3305c 100644
--- a/drivers/media/common/tuners/mt2063.c
+++ b/drivers/media/common/tuners/mt2063.c
@@ -2013,14 +2013,11 @@ static int mt2063_set_analog_params(struct dvb_frontend *fe,
2013 struct analog_parameters *params) 2013 struct analog_parameters *params)
2014{ 2014{
2015 struct mt2063_state *state = fe->tuner_priv; 2015 struct mt2063_state *state = fe->tuner_priv;
2016 s32 pict_car = 0; 2016 s32 pict_car;
2017 s32 pict2chanb_vsb = 0; 2017 s32 pict2chanb_vsb;
2018 s32 pict2chanb_snd = 0; 2018 s32 ch_bw;
2019 s32 pict2snd1 = 0; 2019 s32 if_mid;
2020 s32 pict2snd2 = 0; 2020 s32 rcvr_mode;
2021 s32 ch_bw = 0;
2022 s32 if_mid = 0;
2023 s32 rcvr_mode = 0;
2024 int status; 2021 int status;
2025 2022
2026 dprintk(2, "\n"); 2023 dprintk(2, "\n");
@@ -2030,8 +2027,6 @@ static int mt2063_set_analog_params(struct dvb_frontend *fe,
2030 pict_car = 38900000; 2027 pict_car = 38900000;
2031 ch_bw = 8000000; 2028 ch_bw = 8000000;
2032 pict2chanb_vsb = -(ch_bw / 2); 2029 pict2chanb_vsb = -(ch_bw / 2);
2033 pict2snd1 = 0;
2034 pict2snd2 = 0;
2035 rcvr_mode = MT2063_OFFAIR_ANALOG; 2030 rcvr_mode = MT2063_OFFAIR_ANALOG;
2036 break; 2031 break;
2037 case V4L2_TUNER_ANALOG_TV: 2032 case V4L2_TUNER_ANALOG_TV:
@@ -2040,42 +2035,19 @@ static int mt2063_set_analog_params(struct dvb_frontend *fe,
2040 pict_car = 38900000; 2035 pict_car = 38900000;
2041 ch_bw = 6000000; 2036 ch_bw = 6000000;
2042 pict2chanb_vsb = -1250000; 2037 pict2chanb_vsb = -1250000;
2043 pict2snd1 = 4500000;
2044 pict2snd2 = 0;
2045 } else if (params->std & V4L2_STD_PAL_I) {
2046 pict_car = 38900000;
2047 ch_bw = 8000000;
2048 pict2chanb_vsb = -1250000;
2049 pict2snd1 = 6000000;
2050 pict2snd2 = 0;
2051 } else if (params->std & V4L2_STD_PAL_B) {
2052 pict_car = 38900000;
2053 ch_bw = 8000000;
2054 pict2chanb_vsb = -1250000;
2055 pict2snd1 = 5500000;
2056 pict2snd2 = 5742000;
2057 } else if (params->std & V4L2_STD_PAL_G) { 2038 } else if (params->std & V4L2_STD_PAL_G) {
2058 pict_car = 38900000; 2039 pict_car = 38900000;
2059 ch_bw = 7000000; 2040 ch_bw = 7000000;
2060 pict2chanb_vsb = -1250000; 2041 pict2chanb_vsb = -1250000;
2061 pict2snd1 = 5500000; 2042 } else { /* PAL/SECAM standards */
2062 pict2snd2 = 0;
2063 } else if (params->std & V4L2_STD_PAL_DK) {
2064 pict_car = 38900000; 2043 pict_car = 38900000;
2065 ch_bw = 8000000; 2044 ch_bw = 8000000;
2066 pict2chanb_vsb = -1250000; 2045 pict2chanb_vsb = -1250000;
2067 pict2snd1 = 6500000;
2068 pict2snd2 = 0;
2069 } else { /* PAL-L */
2070 pict_car = 38900000;
2071 ch_bw = 8000000;
2072 pict2chanb_vsb = -1250000;
2073 pict2snd1 = 6500000;
2074 pict2snd2 = 0;
2075 } 2046 }
2076 break; 2047 break;
2048 default:
2049 return -EINVAL;
2077 } 2050 }
2078 pict2chanb_snd = pict2chanb_vsb - ch_bw;
2079 if_mid = pict_car - (pict2chanb_vsb + (ch_bw / 2)); 2051 if_mid = pict_car - (pict2chanb_vsb + (ch_bw / 2));
2080 2052
2081 state->AS_Data.f_LO2_Step = 125000; /* FIXME: probably 5000 for FM */ 2053 state->AS_Data.f_LO2_Step = 125000; /* FIXME: probably 5000 for FM */
@@ -2107,14 +2079,11 @@ static int mt2063_set_params(struct dvb_frontend *fe)
2107 struct dtv_frontend_properties *c = &fe->dtv_property_cache; 2079 struct dtv_frontend_properties *c = &fe->dtv_property_cache;
2108 struct mt2063_state *state = fe->tuner_priv; 2080 struct mt2063_state *state = fe->tuner_priv;
2109 int status; 2081 int status;
2110 s32 pict_car = 0; 2082 s32 pict_car;
2111 s32 pict2chanb_vsb = 0; 2083 s32 pict2chanb_vsb;
2112 s32 pict2chanb_snd = 0; 2084 s32 ch_bw;
2113 s32 pict2snd1 = 0; 2085 s32 if_mid;
2114 s32 pict2snd2 = 0; 2086 s32 rcvr_mode;
2115 s32 ch_bw = 0;
2116 s32 if_mid = 0;
2117 s32 rcvr_mode = 0;
2118 2087
2119 dprintk(2, "\n"); 2088 dprintk(2, "\n");
2120 2089
@@ -2132,21 +2101,16 @@ static int mt2063_set_params(struct dvb_frontend *fe)
2132 rcvr_mode = MT2063_OFFAIR_COFDM; 2101 rcvr_mode = MT2063_OFFAIR_COFDM;
2133 pict_car = 36125000; 2102 pict_car = 36125000;
2134 pict2chanb_vsb = -(ch_bw / 2); 2103 pict2chanb_vsb = -(ch_bw / 2);
2135 pict2snd1 = 0;
2136 pict2snd2 = 0;
2137 break; 2104 break;
2138 case SYS_DVBC_ANNEX_A: 2105 case SYS_DVBC_ANNEX_A:
2139 case SYS_DVBC_ANNEX_C: 2106 case SYS_DVBC_ANNEX_C:
2140 rcvr_mode = MT2063_CABLE_QAM; 2107 rcvr_mode = MT2063_CABLE_QAM;
2141 pict_car = 36125000; 2108 pict_car = 36125000;
2142 pict2snd1 = 0;
2143 pict2snd2 = 0;
2144 pict2chanb_vsb = -(ch_bw / 2); 2109 pict2chanb_vsb = -(ch_bw / 2);
2145 break; 2110 break;
2146 default: 2111 default:
2147 return -EINVAL; 2112 return -EINVAL;
2148 } 2113 }
2149 pict2chanb_snd = pict2chanb_vsb - ch_bw;
2150 if_mid = pict_car - (pict2chanb_vsb + (ch_bw / 2)); 2114 if_mid = pict_car - (pict2chanb_vsb + (ch_bw / 2));
2151 2115
2152 state->AS_Data.f_LO2_Step = 125000; /* FIXME: probably 5000 for FM */ 2116 state->AS_Data.f_LO2_Step = 125000; /* FIXME: probably 5000 for FM */