diff options
author | Olivier DANET <odanet@caramail.com> | 2006-08-08 14:48:10 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2006-09-26 10:53:45 -0400 |
commit | 46f73f936665ab26c8501634e6aa34464fcc1521 (patch) | |
tree | 540ad8149d7460f0d0adf90c9294bc3e59716bf0 /drivers/media/dvb/dvb-usb | |
parent | 83fa907963662ecaade803cec4c9c3e14b69ad7d (diff) |
V4L/DVB: Update for MT2060 to use dvb_tuner_ops
new tuner api
minor fixes for tuning
Signed-off-by: Olivier DANET <odanet@caramail.com>
Signed-off-by: Patrick Boettcher <pb@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/dvb/dvb-usb')
-rw-r--r-- | drivers/media/dvb/dvb-usb/dibusb-common.c | 87 | ||||
-rw-r--r-- | drivers/media/dvb/dvb-usb/dibusb.h | 1 |
2 files changed, 5 insertions, 83 deletions
diff --git a/drivers/media/dvb/dvb-usb/dibusb-common.c b/drivers/media/dvb/dvb-usb/dibusb-common.c index a32ff63d170b..78a604dfadfc 100644 --- a/drivers/media/dvb/dvb-usb/dibusb-common.c +++ b/drivers/media/dvb/dvb-usb/dibusb-common.c | |||
@@ -168,40 +168,6 @@ int dibusb_read_eeprom_byte(struct dvb_usb_device *d, u8 offs, u8 *val) | |||
168 | } | 168 | } |
169 | EXPORT_SYMBOL(dibusb_read_eeprom_byte); | 169 | EXPORT_SYMBOL(dibusb_read_eeprom_byte); |
170 | 170 | ||
171 | static struct mt2060_config stk3000p_mt2060_config = { | ||
172 | .i2c_address = 0x60, | ||
173 | }; | ||
174 | |||
175 | static int dibusb_tuner_init(struct dvb_frontend *fe) | ||
176 | { | ||
177 | struct dvb_usb_device *d = fe->dvb->priv; | ||
178 | struct dibusb_state *st = d->priv; | ||
179 | |||
180 | if (d->tuner_pass_ctrl && st->mt2060_present) { | ||
181 | int ret; | ||
182 | d->tuner_pass_ctrl(d->fe, 1, stk3000p_mt2060_config.i2c_address); | ||
183 | ret = mt2060_init(&st->mt2060); | ||
184 | d->tuner_pass_ctrl(d->fe, 0, 0); | ||
185 | return ret; | ||
186 | } | ||
187 | return dvb_usb_pll_init_i2c(fe); | ||
188 | } | ||
189 | |||
190 | static int dibusb_tuner_set(struct dvb_frontend *fe, struct dvb_frontend_parameters *fep) | ||
191 | { | ||
192 | struct dvb_usb_device *d = fe->dvb->priv; | ||
193 | struct dibusb_state *st = d->priv; | ||
194 | |||
195 | if (d->tuner_pass_ctrl && st->mt2060_present) { | ||
196 | int ret; | ||
197 | d->tuner_pass_ctrl(d->fe, 1, stk3000p_mt2060_config.i2c_address); | ||
198 | ret = mt2060_set(&st->mt2060,fep); | ||
199 | d->tuner_pass_ctrl(d->fe,0,0); | ||
200 | return ret; | ||
201 | } | ||
202 | return dvb_usb_pll_set_i2c(fe,fep); | ||
203 | } | ||
204 | |||
205 | static const struct dib3000p_agc_config dib3000p_agc_panasonic_env57h1xd5 = { | 171 | static const struct dib3000p_agc_config dib3000p_agc_panasonic_env57h1xd5 = { |
206 | { 0x51, 0x301d, 0x0, 0x1cc7, 0xdc29, 0x570a, | 172 | { 0x51, 0x301d, 0x0, 0x1cc7, 0xdc29, 0x570a, |
207 | 0xbae1, 0x8ccd, 0x3b6d, 0x551d, 0xa, 0x951e } | 173 | 0xbae1, 0x8ccd, 0x3b6d, 0x551d, 0xa, 0x951e } |
@@ -212,64 +178,21 @@ static const struct dib3000p_agc_config dib3000p_agc_microtune_mt2060 = { | |||
212 | 0xa8f6, 0x5eb8, 0x65ff, 0x40ff, 0x8a, 0x1114 } | 178 | 0xa8f6, 0x5eb8, 0x65ff, 0x40ff, 0x8a, 0x1114 } |
213 | }; | 179 | }; |
214 | 180 | ||
181 | static struct mt2060_config stk3000p_mt2060_config = { | ||
182 | .i2c_address = 0x60, | ||
183 | }; | ||
184 | |||
215 | int dibusb_dib3000mc_frontend_attach(struct dvb_usb_device *d) | 185 | int dibusb_dib3000mc_frontend_attach(struct dvb_usb_device *d) |
216 | { | 186 | { |
217 | struct dib3000_config demod_cfg; | 187 | struct dib3000_config demod_cfg; |
218 | struct dibusb_state *st = d->priv; | 188 | struct dibusb_state *st = d->priv; |
219 | |||
220 | demod_cfg.agc = &dib3000p_agc_panasonic_env57h1xd5; | ||
221 | demod_cfg.pll_set = dibusb_tuner_set; | ||
222 | demod_cfg.pll_init = dibusb_tuner_init; | ||
223 | |||
224 | for (demod_cfg.demod_address = 0x8; demod_cfg.demod_address < 0xd; demod_cfg.demod_address++) | ||
225 | if ((d->fe = dib3000mc_attach(&demod_cfg,&d->i2c_adap,&st->ops)) != NULL) { | ||
226 | d->tuner_pass_ctrl = st->ops.tuner_pass_ctrl; | ||
227 | return 0; | ||
228 | } | ||
229 | |||
230 | return -ENODEV; | 189 | return -ENODEV; |
231 | } | 190 | } |
232 | EXPORT_SYMBOL(dibusb_dib3000mc_frontend_attach); | 191 | EXPORT_SYMBOL(dibusb_dib3000mc_frontend_attach); |
233 | 192 | ||
234 | int dibusb_dib3000mc_tuner_attach (struct dvb_usb_device *d) | 193 | int dibusb_dib3000mc_tuner_attach (struct dvb_usb_device *d) |
235 | { | 194 | { |
236 | int ret; | 195 | return -ENODEV; |
237 | u8 a,b; | ||
238 | u16 if1 = 1220; | ||
239 | |||
240 | if (d->tuner_pass_ctrl) { | ||
241 | struct dibusb_state *st = d->priv; | ||
242 | d->tuner_pass_ctrl(d->fe, 1, stk3000p_mt2060_config.i2c_address); | ||
243 | // First IF calibration for Liteon Sticks | ||
244 | if (d->udev->descriptor.idVendor == USB_VID_LITEON && | ||
245 | d->udev->descriptor.idProduct == USB_PID_LITEON_DVB_T_WARM) { | ||
246 | |||
247 | dibusb_read_eeprom_byte(d,0x7E,&a); | ||
248 | dibusb_read_eeprom_byte(d,0x7F,&b); | ||
249 | |||
250 | if (a == 0xFF && b == 0xFF) | ||
251 | if1 = 1220; | ||
252 | else if (a == 0x00) | ||
253 | if1 = 1220+b; | ||
254 | else if (a == 0x80) | ||
255 | if1 = 1220-b; | ||
256 | else { | ||
257 | warn("LITE-ON DVB-T Tuner : Strange IF1 calibration :%2X %2X\n",(int)a,(int)b); | ||
258 | if1 = 1220; | ||
259 | } | ||
260 | } | ||
261 | if ((ret = mt2060_attach(&st->mt2060,&stk3000p_mt2060_config, &d->i2c_adap,if1)) != 0) { | ||
262 | /* not found - use panasonic pll parameters */ | ||
263 | d->pll_addr = 0x60; | ||
264 | d->pll_desc = &dvb_pll_env57h1xd5; | ||
265 | } else { | ||
266 | st->mt2060_present = 1; | ||
267 | /* set the correct agc parameters for the dib3000p */ | ||
268 | dib3000mc_set_agc_config(d->fe, &dib3000p_agc_microtune_mt2060); | ||
269 | } | ||
270 | d->tuner_pass_ctrl(d->fe,0,0); | ||
271 | } | ||
272 | return 0; | ||
273 | } | 196 | } |
274 | EXPORT_SYMBOL(dibusb_dib3000mc_tuner_attach); | 197 | EXPORT_SYMBOL(dibusb_dib3000mc_tuner_attach); |
275 | 198 | ||
diff --git a/drivers/media/dvb/dvb-usb/dibusb.h b/drivers/media/dvb/dvb-usb/dibusb.h index 7fd57d053b9f..e21de8b668f6 100644 --- a/drivers/media/dvb/dvb-usb/dibusb.h +++ b/drivers/media/dvb/dvb-usb/dibusb.h | |||
@@ -97,7 +97,6 @@ | |||
97 | 97 | ||
98 | struct dibusb_state { | 98 | struct dibusb_state { |
99 | struct dib_fe_xfer_ops ops; | 99 | struct dib_fe_xfer_ops ops; |
100 | struct mt2060_state mt2060; | ||
101 | int mt2060_present; | 100 | int mt2060_present; |
102 | 101 | ||
103 | /* for RC5 remote control */ | 102 | /* for RC5 remote control */ |