aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/common/tuners/tda18212.c
diff options
context:
space:
mode:
authorAntti Palosaari <crope@iki.fi>2011-08-12 17:29:10 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2011-11-07 07:25:56 -0500
commitb682ad1d178d1686a4db07535d1e611342cde012 (patch)
treeae659570852ddf8e6b6ec88ed4d8ec3d95f6a57b /drivers/media/common/tuners/tda18212.c
parent33cdf5b0e75142096d79cbe3cb7c3dc797499562 (diff)
[media] tda18212: add DVB-T2 support
Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/common/tuners/tda18212.c')
-rw-r--r--drivers/media/common/tuners/tda18212.c49
1 files changed, 40 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;