aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media')
-rw-r--r--drivers/media/common/tuners/tda18212.c49
-rw-r--r--drivers/media/common/tuners/tda18212.h4
2 files changed, 44 insertions, 9 deletions
diff --git a/drivers/media/common/tuners/tda18212.c b/drivers/media/common/tuners/tda18212.c
index e29cc2bc113a..6374a1e010bf 100644
--- a/drivers/media/common/tuners/tda18212.c
+++ b/drivers/media/common/tuners/tda18212.c
@@ -136,12 +136,24 @@ static int tda18212_set_params(struct dvb_frontend *fe,
136 int ret, i; 136 int ret, i;
137 u32 if_khz; 137 u32 if_khz;
138 u8 buf[9]; 138 u8 buf[9];
139 #define DVBT_6 0
140 #define DVBT_7 1
141 #define DVBT_8 2
142 #define DVBT2_6 3
143 #define DVBT2_7 4
144 #define DVBT2_8 5
145 #define DVBC_6 6
146 #define DVBC_8 7
139 static const u8 bw_params[][3] = { 147 static const u8 bw_params[][3] = {
140 /* 0f 13 23 */ 148 /* reg: 0f 13 23 */
141 { 0xb3, 0x20, 0x03 }, /* DVB-T 6 MHz */ 149 [DVBT_6] = { 0xb3, 0x20, 0x03 },
142 { 0xb3, 0x31, 0x01 }, /* DVB-T 7 MHz */ 150 [DVBT_7] = { 0xb3, 0x31, 0x01 },
143 { 0xb3, 0x22, 0x01 }, /* DVB-T 8 MHz */ 151 [DVBT_8] = { 0xb3, 0x22, 0x01 },
144 { 0x92, 0x53, 0x03 }, /* DVB-C */ 152 [DVBT2_6] = { 0xbc, 0x20, 0x03 },
153 [DVBT2_7] = { 0xbc, 0x72, 0x03 },
154 [DVBT2_8] = { 0xbc, 0x22, 0x01 },
155 [DVBC_6] = { 0x92, 0x50, 0x03 },
156 [DVBC_8] = { 0x92, 0x53, 0x03 },
145 }; 157 };
146 158
147 dbg("delsys=%d RF=%d BW=%d\n", 159 dbg("delsys=%d RF=%d BW=%d\n",
@@ -155,15 +167,34 @@ static int tda18212_set_params(struct dvb_frontend *fe,
155 switch (c->bandwidth_hz) { 167 switch (c->bandwidth_hz) {
156 case 6000000: 168 case 6000000:
157 if_khz = priv->cfg->if_dvbt_6; 169 if_khz = priv->cfg->if_dvbt_6;
158 i = 0; 170 i = DVBT_6;
159 break; 171 break;
160 case 7000000: 172 case 7000000:
161 if_khz = priv->cfg->if_dvbt_7; 173 if_khz = priv->cfg->if_dvbt_7;
162 i = 1; 174 i = DVBT_7;
163 break; 175 break;
164 case 8000000: 176 case 8000000:
165 if_khz = priv->cfg->if_dvbt_8; 177 if_khz = priv->cfg->if_dvbt_8;
166 i = 2; 178 i = DVBT_8;
179 break;
180 default:
181 ret = -EINVAL;
182 goto error;
183 }
184 break;
185 case SYS_DVBT2:
186 switch (c->bandwidth_hz) {
187 case 6000000:
188 if_khz = priv->cfg->if_dvbt2_6;
189 i = DVBT2_6;
190 break;
191 case 7000000:
192 if_khz = priv->cfg->if_dvbt2_7;
193 i = DVBT2_7;
194 break;
195 case 8000000:
196 if_khz = priv->cfg->if_dvbt2_8;
197 i = DVBT2_8;
167 break; 198 break;
168 default: 199 default:
169 ret = -EINVAL; 200 ret = -EINVAL;
@@ -172,7 +203,7 @@ static int tda18212_set_params(struct dvb_frontend *fe,
172 break; 203 break;
173 case SYS_DVBC_ANNEX_AC: 204 case SYS_DVBC_ANNEX_AC:
174 if_khz = priv->cfg->if_dvbc; 205 if_khz = priv->cfg->if_dvbc;
175 i = 3; 206 i = DVBC_8;
176 break; 207 break;
177 default: 208 default:
178 ret = -EINVAL; 209 ret = -EINVAL;
diff --git a/drivers/media/common/tuners/tda18212.h b/drivers/media/common/tuners/tda18212.h
index 83b497f59e1b..9bd5da4aabb7 100644
--- a/drivers/media/common/tuners/tda18212.h
+++ b/drivers/media/common/tuners/tda18212.h
@@ -29,6 +29,10 @@ struct tda18212_config {
29 u16 if_dvbt_6; 29 u16 if_dvbt_6;
30 u16 if_dvbt_7; 30 u16 if_dvbt_7;
31 u16 if_dvbt_8; 31 u16 if_dvbt_8;
32 u16 if_dvbt2_5;
33 u16 if_dvbt2_6;
34 u16 if_dvbt2_7;
35 u16 if_dvbt2_8;
32 u16 if_dvbc; 36 u16 if_dvbc;
33}; 37};
34 38