diff options
author | Hartmut Hackmann <hartmut.hackmann@t-online.de> | 2006-10-30 18:00:16 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2006-12-10 05:51:10 -0500 |
commit | cbb94521cff24c98c2dbee28fb95e007c6bcaa43 (patch) | |
tree | bd55a7bce8ba3aa998cb68a612c3e0d784a64f1b /drivers | |
parent | a75ec3f033625fb02ccc855fcd2e322275633fc4 (diff) |
V4L/DVB (4792): Add support for the Compro Videomate DVB-T200A
This board has the same PCI ID as the T200, so the exact board type
is determined from the eeprom.
The original patch was provided by Francis Barber <fedora@barber-family.id.au>
Signed-off-by: Hartmut Hackmann <hartmut.hackmann@t-online.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/media/video/saa7134/saa7134-cards.c | 49 | ||||
-rw-r--r-- | drivers/media/video/saa7134/saa7134-dvb.c | 40 | ||||
-rw-r--r-- | drivers/media/video/saa7134/saa7134.h | 1 |
3 files changed, 77 insertions, 13 deletions
diff --git a/drivers/media/video/saa7134/saa7134-cards.c b/drivers/media/video/saa7134/saa7134-cards.c index 8109c8ef09ff..f5ad450dd7c4 100644 --- a/drivers/media/video/saa7134/saa7134-cards.c +++ b/drivers/media/video/saa7134/saa7134-cards.c | |||
@@ -3101,6 +3101,31 @@ struct saa7134_board saa7134_boards[] = { | |||
3101 | .gpio = 0x00, | 3101 | .gpio = 0x00, |
3102 | }, | 3102 | }, |
3103 | }, | 3103 | }, |
3104 | [SAA7134_BOARD_VIDEOMATE_DVBT_200A] = { | ||
3105 | /* Francis Barber <fedora@barber-family.id.au> */ | ||
3106 | .name = "Compro Videomate DVB-T200A", | ||
3107 | .audio_clock = 0x00187de7, | ||
3108 | .tuner_type = TUNER_ABSENT, | ||
3109 | .radio_type = UNSET, | ||
3110 | .tuner_addr = ADDR_UNSET, | ||
3111 | .radio_addr = ADDR_UNSET, | ||
3112 | .tda9887_conf = TDA9887_PRESENT | TDA9887_PORT1_ACTIVE, | ||
3113 | .mpeg = SAA7134_MPEG_DVB, | ||
3114 | .inputs = {{ | ||
3115 | .name = name_tv, | ||
3116 | .vmux = 3, | ||
3117 | .amux = TV, | ||
3118 | .tv = 1, | ||
3119 | },{ | ||
3120 | .name = name_comp1, | ||
3121 | .vmux = 1, | ||
3122 | .amux = LINE2, | ||
3123 | },{ | ||
3124 | .name = name_svideo, | ||
3125 | .vmux = 8, | ||
3126 | .amux = LINE2, | ||
3127 | }}, | ||
3128 | }, | ||
3104 | }; | 3129 | }; |
3105 | 3130 | ||
3106 | const unsigned int saa7134_bcount = ARRAY_SIZE(saa7134_boards); | 3131 | const unsigned int saa7134_bcount = ARRAY_SIZE(saa7134_boards); |
@@ -3823,6 +3848,7 @@ int saa7134_board_init1(struct saa7134_dev *dev) | |||
3823 | case SAA7134_BOARD_VIDEOMATE_TV_GOLD_PLUSII: | 3848 | case SAA7134_BOARD_VIDEOMATE_TV_GOLD_PLUSII: |
3824 | case SAA7134_BOARD_VIDEOMATE_DVBT_300: | 3849 | case SAA7134_BOARD_VIDEOMATE_DVBT_300: |
3825 | case SAA7134_BOARD_VIDEOMATE_DVBT_200: | 3850 | case SAA7134_BOARD_VIDEOMATE_DVBT_200: |
3851 | case SAA7134_BOARD_VIDEOMATE_DVBT_200A: | ||
3826 | case SAA7134_BOARD_MANLI_MTV001: | 3852 | case SAA7134_BOARD_MANLI_MTV001: |
3827 | case SAA7134_BOARD_MANLI_MTV002: | 3853 | case SAA7134_BOARD_MANLI_MTV002: |
3828 | case SAA7134_BOARD_BEHOLD_409FM: | 3854 | case SAA7134_BOARD_BEHOLD_409FM: |
@@ -4064,6 +4090,29 @@ int saa7134_board_init2(struct saa7134_dev *dev) | |||
4064 | dev->name, i); | 4090 | dev->name, i); |
4065 | } | 4091 | } |
4066 | break; | 4092 | break; |
4093 | case SAA7134_BOARD_VIDEOMATE_DVBT_200: | ||
4094 | case SAA7134_BOARD_VIDEOMATE_DVBT_200A: | ||
4095 | /* The T200 and the T200A share the same pci id. Consequently, | ||
4096 | * we are going to query eeprom to try to find out which one we | ||
4097 | * are actually looking at. */ | ||
4098 | |||
4099 | /* Don't do this if the board was specifically selected with an | ||
4100 | * insmod option or if we have the default configuration T200*/ | ||
4101 | if(!dev->autodetected || (dev->eedata[0x41] == 0xd0)) | ||
4102 | break; | ||
4103 | if(dev->eedata[0x41] == 0x02) { | ||
4104 | /* Reconfigure board as T200A */ | ||
4105 | dev->board = SAA7134_BOARD_VIDEOMATE_DVBT_200A; | ||
4106 | dev->tuner_type = saa7134_boards[dev->board].tuner_type; | ||
4107 | dev->tda9887_conf = saa7134_boards[dev->board].tda9887_conf; | ||
4108 | printk(KERN_INFO "%s: Reconfigured board as %s\n", | ||
4109 | dev->name, saa7134_boards[dev->board].name); | ||
4110 | } else { | ||
4111 | printk(KERN_WARNING "%s: Unexpected tuner type info: %x in eeprom\n", | ||
4112 | dev->name, dev->eedata[0x41]); | ||
4113 | break; | ||
4114 | } | ||
4115 | break; | ||
4067 | } | 4116 | } |
4068 | return 0; | 4117 | return 0; |
4069 | } | 4118 | } |
diff --git a/drivers/media/video/saa7134/saa7134-dvb.c b/drivers/media/video/saa7134/saa7134-dvb.c index 706450c27a57..098d8a6a0813 100644 --- a/drivers/media/video/saa7134/saa7134-dvb.c +++ b/drivers/media/video/saa7134/saa7134-dvb.c | |||
@@ -336,7 +336,7 @@ static struct tda1004x_config philips_tu1216_61_config = { | |||
336 | 336 | ||
337 | /* ------------------------------------------------------------------ */ | 337 | /* ------------------------------------------------------------------ */ |
338 | 338 | ||
339 | static int philips_europa_tuner_init(struct dvb_frontend *fe) | 339 | static int philips_td1316_tuner_init(struct dvb_frontend *fe) |
340 | { | 340 | { |
341 | struct saa7134_dev *dev = fe->dvb->priv; | 341 | struct saa7134_dev *dev = fe->dvb->priv; |
342 | static u8 msg[] = { 0x0b, 0xf5, 0x86, 0xab }; | 342 | static u8 msg[] = { 0x0b, 0xf5, 0x86, 0xab }; |
@@ -347,18 +347,8 @@ static int philips_europa_tuner_init(struct dvb_frontend *fe) | |||
347 | fe->ops.i2c_gate_ctrl(fe, 1); | 347 | fe->ops.i2c_gate_ctrl(fe, 1); |
348 | if (i2c_transfer(&dev->i2c_adap, &init_msg, 1) != 1) | 348 | if (i2c_transfer(&dev->i2c_adap, &init_msg, 1) != 1) |
349 | return -EIO; | 349 | return -EIO; |
350 | msleep(1); | ||
351 | |||
352 | /* switch the board to dvb mode */ | ||
353 | init_msg.addr = 0x43; | ||
354 | init_msg.len = 0x02; | ||
355 | msg[0] = 0x00; | ||
356 | msg[1] = 0x40; | ||
357 | if (fe->ops.i2c_gate_ctrl) | 350 | if (fe->ops.i2c_gate_ctrl) |
358 | fe->ops.i2c_gate_ctrl(fe, 1); | 351 | fe->ops.i2c_gate_ctrl(fe, 0); |
359 | if (i2c_transfer(&dev->i2c_adap, &init_msg, 1) != 1) | ||
360 | return -EIO; | ||
361 | |||
362 | return 0; | 352 | return 0; |
363 | } | 353 | } |
364 | 354 | ||
@@ -367,6 +357,22 @@ static int philips_td1316_tuner_set_params(struct dvb_frontend *fe, struct dvb_f | |||
367 | return philips_tda6651_pll_set(0x61, fe, params); | 357 | return philips_tda6651_pll_set(0x61, fe, params); |
368 | } | 358 | } |
369 | 359 | ||
360 | static int philips_europa_tuner_init(struct dvb_frontend *fe) | ||
361 | { | ||
362 | struct saa7134_dev *dev = fe->dvb->priv; | ||
363 | static u8 msg[] = { 0x00, 0x40}; | ||
364 | struct i2c_msg init_msg = {.addr = 0x43,.flags = 0,.buf = msg,.len = sizeof(msg) }; | ||
365 | |||
366 | |||
367 | if (philips_td1316_tuner_init(fe)) | ||
368 | return -EIO; | ||
369 | msleep(1); | ||
370 | if (i2c_transfer(&dev->i2c_adap, &init_msg, 1) != 1) | ||
371 | return -EIO; | ||
372 | |||
373 | return 0; | ||
374 | } | ||
375 | |||
370 | static int philips_europa_tuner_sleep(struct dvb_frontend *fe) | 376 | static int philips_europa_tuner_sleep(struct dvb_frontend *fe) |
371 | { | 377 | { |
372 | struct saa7134_dev *dev = fe->dvb->priv; | 378 | struct saa7134_dev *dev = fe->dvb->priv; |
@@ -1324,7 +1330,15 @@ static int dvb_init(struct saa7134_dev *dev) | |||
1324 | dev->dvb.frontend->ops.tuner_ops.set_params = philips_fmd1216_tuner_set_params; | 1330 | dev->dvb.frontend->ops.tuner_ops.set_params = philips_fmd1216_tuner_set_params; |
1325 | } | 1331 | } |
1326 | break; | 1332 | break; |
1327 | 1333 | case SAA7134_BOARD_VIDEOMATE_DVBT_200A: | |
1334 | dev->dvb.frontend = dvb_attach(tda10046_attach, | ||
1335 | &philips_europa_config, | ||
1336 | &dev->i2c_adap); | ||
1337 | if (dev->dvb.frontend) { | ||
1338 | dev->dvb.frontend->ops.tuner_ops.init = philips_td1316_tuner_init; | ||
1339 | dev->dvb.frontend->ops.tuner_ops.set_params = philips_td1316_tuner_set_params; | ||
1340 | } | ||
1341 | break; | ||
1328 | default: | 1342 | default: |
1329 | printk("%s: Huh? unknown DVB card?\n",dev->name); | 1343 | printk("%s: Huh? unknown DVB card?\n",dev->name); |
1330 | break; | 1344 | break; |
diff --git a/drivers/media/video/saa7134/saa7134.h b/drivers/media/video/saa7134/saa7134.h index 40603f392145..0c0f4651bd09 100644 --- a/drivers/media/video/saa7134/saa7134.h +++ b/drivers/media/video/saa7134/saa7134.h | |||
@@ -229,6 +229,7 @@ struct saa7134_format { | |||
229 | #define SAA7134_BOARD_ASUS_EUROPA2_HYBRID 100 | 229 | #define SAA7134_BOARD_ASUS_EUROPA2_HYBRID 100 |
230 | #define SAA7134_BOARD_PINNACLE_PCTV_310i 101 | 230 | #define SAA7134_BOARD_PINNACLE_PCTV_310i 101 |
231 | #define SAA7134_BOARD_AVERMEDIA_STUDIO_507 102 | 231 | #define SAA7134_BOARD_AVERMEDIA_STUDIO_507 102 |
232 | #define SAA7134_BOARD_VIDEOMATE_DVBT_200A 103 | ||
232 | 233 | ||
233 | #define SAA7134_MAXBOARDS 8 | 234 | #define SAA7134_MAXBOARDS 8 |
234 | #define SAA7134_INPUT_MAX 8 | 235 | #define SAA7134_INPUT_MAX 8 |