diff options
author | Michael Krufky <mkrufky@m1k.net> | 2005-11-09 00:35:32 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2005-11-09 10:56:03 -0500 |
commit | c0b11b914de27e0e82b5311cf9b498a1b008b591 (patch) | |
tree | 3eb9ff604ca727f5a86d3b592a01c528b99de454 | |
parent | f7b67195ea571b8540ac79daf27f5932ec40c098 (diff) |
[PATCH] dvb: Add support for Air2PC/AirStar 2 ATSC 3rd generation (HD5000)
Added support for Air2PC/AirStar 2 ATSC 3rd generation (HD5000)
Signed-off-by: Taylor Jacob <rtjacob@earthlink.net>
Signed-off-by: Michael Krufky <mkrufky@m1k.net>
Cc: Johannes Stezenbach <js@linuxtv.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-rw-r--r-- | drivers/media/dvb/b2c2/flexcop-fe-tuner.c | 53 | ||||
-rw-r--r-- | drivers/media/dvb/b2c2/flexcop-misc.c | 1 | ||||
-rw-r--r-- | drivers/media/dvb/b2c2/flexcop-reg.h | 1 | ||||
-rw-r--r-- | drivers/media/dvb/b2c2/flexcop.c | 1 | ||||
-rw-r--r-- | drivers/media/dvb/frontends/dvb-pll.c | 2 | ||||
-rw-r--r-- | drivers/media/dvb/frontends/lgdt330x.c | 15 | ||||
-rw-r--r-- | drivers/media/dvb/frontends/lgdt330x.h | 4 |
7 files changed, 74 insertions, 3 deletions
diff --git a/drivers/media/dvb/b2c2/flexcop-fe-tuner.c b/drivers/media/dvb/b2c2/flexcop-fe-tuner.c index bf5651b98bbb..a35330315f65 100644 --- a/drivers/media/dvb/b2c2/flexcop-fe-tuner.c +++ b/drivers/media/dvb/b2c2/flexcop-fe-tuner.c | |||
@@ -13,6 +13,8 @@ | |||
13 | #include "bcm3510.h" | 13 | #include "bcm3510.h" |
14 | #include "stv0297.h" | 14 | #include "stv0297.h" |
15 | #include "mt312.h" | 15 | #include "mt312.h" |
16 | #include "lgdt330x.h" | ||
17 | #include "dvb-pll.h" | ||
16 | 18 | ||
17 | /* lnb control */ | 19 | /* lnb control */ |
18 | 20 | ||
@@ -295,6 +297,52 @@ static int flexcop_fe_request_firmware(struct dvb_frontend* fe, const struct fir | |||
295 | return request_firmware(fw, name, fc->dev); | 297 | return request_firmware(fw, name, fc->dev); |
296 | } | 298 | } |
297 | 299 | ||
300 | static int lgdt3303_pll_set(struct dvb_frontend* fe, | ||
301 | struct dvb_frontend_parameters* params) | ||
302 | { | ||
303 | struct flexcop_device *fc = fe->dvb->priv; | ||
304 | u8 buf[4]; | ||
305 | struct i2c_msg msg = | ||
306 | { .addr = 0x61, .flags = 0, .buf = buf, .len = 4 }; | ||
307 | int err; | ||
308 | |||
309 | dvb_pll_configure(&dvb_pll_tdvs_tua6034,buf, params->frequency, 0); | ||
310 | dprintk(1, "%s: tuner at 0x%02x bytes: 0x%02x 0x%02x 0x%02x 0x%02x\n", | ||
311 | __FUNCTION__, msg.addr, buf[0],buf[1],buf[2],buf[3]); | ||
312 | if ((err = i2c_transfer(&fc->i2c_adap, &msg, 1)) != 1) { | ||
313 | printk(KERN_WARNING "lgdt3303: %s error " | ||
314 | "(addr %02x <- %02x, err = %i)\n", | ||
315 | __FUNCTION__, buf[0], buf[1], err); | ||
316 | if (err < 0) | ||
317 | return err; | ||
318 | else | ||
319 | return -EREMOTEIO; | ||
320 | } | ||
321 | |||
322 | buf[0] = 0x86 | 0x18; | ||
323 | buf[1] = 0x50; | ||
324 | msg.len = 2; | ||
325 | if ((err = i2c_transfer(&fc->i2c_adap, &msg, 1)) != 1) { | ||
326 | printk(KERN_WARNING "lgdt3303: %s error " | ||
327 | "(addr %02x <- %02x, err = %i)\n", | ||
328 | __FUNCTION__, buf[0], buf[1], err); | ||
329 | if (err < 0) | ||
330 | return err; | ||
331 | else | ||
332 | return -EREMOTEIO; | ||
333 | } | ||
334 | |||
335 | return 0; | ||
336 | } | ||
337 | |||
338 | static struct lgdt330x_config air2pc_atsc_hd5000_config = { | ||
339 | .demod_address = 0x59, | ||
340 | .demod_chip = LGDT3303, | ||
341 | .serial_mpeg = 0x04, | ||
342 | .pll_set = lgdt3303_pll_set, | ||
343 | .clock_polarity_flip = 1, | ||
344 | }; | ||
345 | |||
298 | static struct nxt2002_config samsung_tbmv_config = { | 346 | static struct nxt2002_config samsung_tbmv_config = { |
299 | .demod_address = 0x0a, | 347 | .demod_address = 0x0a, |
300 | .request_firmware = flexcop_fe_request_firmware, | 348 | .request_firmware = flexcop_fe_request_firmware, |
@@ -457,6 +505,11 @@ int flexcop_frontend_init(struct flexcop_device *fc) | |||
457 | fc->dev_type = FC_AIR_ATSC2; | 505 | fc->dev_type = FC_AIR_ATSC2; |
458 | info("found the nxt2002 at i2c address: 0x%02x",samsung_tbmv_config.demod_address); | 506 | info("found the nxt2002 at i2c address: 0x%02x",samsung_tbmv_config.demod_address); |
459 | } else | 507 | } else |
508 | /* try the air atsc 3nd generation (lgdt3303) */ | ||
509 | if ((fc->fe = lgdt330x_attach(&air2pc_atsc_hd5000_config, &fc->i2c_adap)) != NULL) { | ||
510 | fc->dev_type = FC_AIR_ATSC3; | ||
511 | info("found the lgdt3303 at i2c address: 0x%02x",air2pc_atsc_hd5000_config.demod_address); | ||
512 | } else | ||
460 | /* try the air atsc 1nd generation (bcm3510)/panasonic ct10s */ | 513 | /* try the air atsc 1nd generation (bcm3510)/panasonic ct10s */ |
461 | if ((fc->fe = bcm3510_attach(&air2pc_atsc_first_gen_config, &fc->i2c_adap)) != NULL) { | 514 | if ((fc->fe = bcm3510_attach(&air2pc_atsc_first_gen_config, &fc->i2c_adap)) != NULL) { |
462 | fc->dev_type = FC_AIR_ATSC1; | 515 | fc->dev_type = FC_AIR_ATSC1; |
diff --git a/drivers/media/dvb/b2c2/flexcop-misc.c b/drivers/media/dvb/b2c2/flexcop-misc.c index 3a08d38b318a..62282d8dbfa8 100644 --- a/drivers/media/dvb/b2c2/flexcop-misc.c +++ b/drivers/media/dvb/b2c2/flexcop-misc.c | |||
@@ -51,6 +51,7 @@ const char *flexcop_device_names[] = { | |||
51 | "Sky2PC/SkyStar 2 DVB-S", | 51 | "Sky2PC/SkyStar 2 DVB-S", |
52 | "Sky2PC/SkyStar 2 DVB-S (old version)", | 52 | "Sky2PC/SkyStar 2 DVB-S (old version)", |
53 | "Cable2PC/CableStar 2 DVB-C", | 53 | "Cable2PC/CableStar 2 DVB-C", |
54 | "Air2PC/AirStar 2 ATSC 3rd generation (HD5000)", | ||
54 | }; | 55 | }; |
55 | 56 | ||
56 | const char *flexcop_bus_names[] = { | 57 | const char *flexcop_bus_names[] = { |
diff --git a/drivers/media/dvb/b2c2/flexcop-reg.h b/drivers/media/dvb/b2c2/flexcop-reg.h index 4ae1eb5bfe98..23cc6431e2b8 100644 --- a/drivers/media/dvb/b2c2/flexcop-reg.h +++ b/drivers/media/dvb/b2c2/flexcop-reg.h | |||
@@ -26,6 +26,7 @@ typedef enum { | |||
26 | FC_SKY, | 26 | FC_SKY, |
27 | FC_SKY_OLD, | 27 | FC_SKY_OLD, |
28 | FC_CABLE, | 28 | FC_CABLE, |
29 | FC_AIR_ATSC3, | ||
29 | } flexcop_device_type_t; | 30 | } flexcop_device_type_t; |
30 | 31 | ||
31 | typedef enum { | 32 | typedef enum { |
diff --git a/drivers/media/dvb/b2c2/flexcop.c b/drivers/media/dvb/b2c2/flexcop.c index 12873d435406..123ed96f6faa 100644 --- a/drivers/media/dvb/b2c2/flexcop.c +++ b/drivers/media/dvb/b2c2/flexcop.c | |||
@@ -193,6 +193,7 @@ static void flexcop_reset(struct flexcop_device *fc) | |||
193 | v204 = fc->read_ibi_reg(fc,misc_204); | 193 | v204 = fc->read_ibi_reg(fc,misc_204); |
194 | v204.misc_204.Per_reset_sig = 0; | 194 | v204.misc_204.Per_reset_sig = 0; |
195 | fc->write_ibi_reg(fc,misc_204,v204); | 195 | fc->write_ibi_reg(fc,misc_204,v204); |
196 | msleep(1); | ||
196 | v204.misc_204.Per_reset_sig = 1; | 197 | v204.misc_204.Per_reset_sig = 1; |
197 | fc->write_ibi_reg(fc,misc_204,v204); | 198 | fc->write_ibi_reg(fc,misc_204,v204); |
198 | } | 199 | } |
diff --git a/drivers/media/dvb/frontends/dvb-pll.c b/drivers/media/dvb/frontends/dvb-pll.c index 536c35d969b7..6668839f9474 100644 --- a/drivers/media/dvb/frontends/dvb-pll.c +++ b/drivers/media/dvb/frontends/dvb-pll.c | |||
@@ -226,7 +226,7 @@ struct dvb_pll_desc dvb_pll_tua6034 = { | |||
226 | EXPORT_SYMBOL(dvb_pll_tua6034); | 226 | EXPORT_SYMBOL(dvb_pll_tua6034); |
227 | 227 | ||
228 | /* Infineon TUA6034 | 228 | /* Infineon TUA6034 |
229 | * used in LG Innotek TDVS-H062F | 229 | * used in LG TDVS H061F and LG TDVS H062F |
230 | */ | 230 | */ |
231 | struct dvb_pll_desc dvb_pll_tdvs_tua6034 = { | 231 | struct dvb_pll_desc dvb_pll_tdvs_tua6034 = { |
232 | .name = "LG/Infineon TUA6034", | 232 | .name = "LG/Infineon TUA6034", |
diff --git a/drivers/media/dvb/frontends/lgdt330x.c b/drivers/media/dvb/frontends/lgdt330x.c index 145918877d2f..10fc4e7878af 100644 --- a/drivers/media/dvb/frontends/lgdt330x.c +++ b/drivers/media/dvb/frontends/lgdt330x.c | |||
@@ -27,6 +27,7 @@ | |||
27 | * DViCO FusionHDTV 3 Gold-T | 27 | * DViCO FusionHDTV 3 Gold-T |
28 | * DViCO FusionHDTV 5 Gold | 28 | * DViCO FusionHDTV 5 Gold |
29 | * DViCO FusionHDTV 5 Lite | 29 | * DViCO FusionHDTV 5 Lite |
30 | * Air2PC/AirStar 2 ATSC 3rd generation (HD5000) | ||
30 | * | 31 | * |
31 | * TODO: | 32 | * TODO: |
32 | * signal strength always returns 0. | 33 | * signal strength always returns 0. |
@@ -223,6 +224,11 @@ static int lgdt330x_init(struct dvb_frontend* fe) | |||
223 | 0x4c, 0x14 | 224 | 0x4c, 0x14 |
224 | }; | 225 | }; |
225 | 226 | ||
227 | static u8 flip_lgdt3303_init_data[] = { | ||
228 | 0x4c, 0x14, | ||
229 | 0x87, 0xf3 | ||
230 | }; | ||
231 | |||
226 | struct lgdt330x_state* state = fe->demodulator_priv; | 232 | struct lgdt330x_state* state = fe->demodulator_priv; |
227 | char *chip_name; | 233 | char *chip_name; |
228 | int err; | 234 | int err; |
@@ -235,8 +241,13 @@ static int lgdt330x_init(struct dvb_frontend* fe) | |||
235 | break; | 241 | break; |
236 | case LGDT3303: | 242 | case LGDT3303: |
237 | chip_name = "LGDT3303"; | 243 | chip_name = "LGDT3303"; |
238 | err = i2c_write_demod_bytes(state, lgdt3303_init_data, | 244 | if (state->config->clock_polarity_flip) { |
239 | sizeof(lgdt3303_init_data)); | 245 | err = i2c_write_demod_bytes(state, flip_lgdt3303_init_data, |
246 | sizeof(flip_lgdt3303_init_data)); | ||
247 | } else { | ||
248 | err = i2c_write_demod_bytes(state, lgdt3303_init_data, | ||
249 | sizeof(lgdt3303_init_data)); | ||
250 | } | ||
240 | break; | 251 | break; |
241 | default: | 252 | default: |
242 | chip_name = "undefined"; | 253 | chip_name = "undefined"; |
diff --git a/drivers/media/dvb/frontends/lgdt330x.h b/drivers/media/dvb/frontends/lgdt330x.h index e209ba1e47c5..2a6529cccf1a 100644 --- a/drivers/media/dvb/frontends/lgdt330x.h +++ b/drivers/media/dvb/frontends/lgdt330x.h | |||
@@ -47,6 +47,10 @@ struct lgdt330x_config | |||
47 | 47 | ||
48 | /* Need to set device param for start_dma */ | 48 | /* Need to set device param for start_dma */ |
49 | int (*set_ts_params)(struct dvb_frontend* fe, int is_punctured); | 49 | int (*set_ts_params)(struct dvb_frontend* fe, int is_punctured); |
50 | |||
51 | /* Flip the polarity of the mpeg data transfer clock using alternate init data | ||
52 | * This option applies ONLY to LGDT3303 - 0:disabled (default) 1:enabled */ | ||
53 | int clock_polarity_flip; | ||
50 | }; | 54 | }; |
51 | 55 | ||
52 | extern struct dvb_frontend* lgdt330x_attach(const struct lgdt330x_config* config, | 56 | extern struct dvb_frontend* lgdt330x_attach(const struct lgdt330x_config* config, |