aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHans Verkuil <hverkuil@xs4all.nl>2006-01-09 12:25:16 -0500
committerMauro Carvalho Chehab <mchehab@brturbo.com.br>2006-01-09 12:25:16 -0500
commit39e8f40da20a803a17e16304e73fd31050b1871c (patch)
tree35b3736436840a47d222457619c6c4595020eebe
parentade0836c8c3bf72edafd18d3256c4fd874a8236f (diff)
V4L/DVB (3105): Remove AUDC_CONFIG_PINNACLE horror, fix mt20xx radio support.
- Remove AUDC_CONFIG_PINNACLE horror. This also fixes radio support for mt20xx tuners. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@brturbo.com.br>
-rw-r--r--drivers/media/video/bttv-cards.c18
-rw-r--r--drivers/media/video/bttv-driver.c1
-rw-r--r--drivers/media/video/bttvp.h2
-rw-r--r--drivers/media/video/mt20xx.c7
-rw-r--r--drivers/media/video/tda9887.c41
-rw-r--r--drivers/media/video/tuner-core.c13
-rw-r--r--include/media/audiochip.h11
7 files changed, 20 insertions, 73 deletions
diff --git a/drivers/media/video/bttv-cards.c b/drivers/media/video/bttv-cards.c
index 80bcbc4ea3a4..c94092351b79 100644
--- a/drivers/media/video/bttv-cards.c
+++ b/drivers/media/video/bttv-cards.c
@@ -3056,26 +3056,33 @@ static void miro_pinnacle_gpio(struct bttv *btv)
3056 switch (id) { 3056 switch (id) {
3057 case 1: 3057 case 1:
3058 info = "PAL / mono"; 3058 info = "PAL / mono";
3059 btv->tda9887_conf = TDA9887_INTERCARRIER;
3059 break; 3060 break;
3060 case 2: 3061 case 2:
3061 info = "PAL+SECAM / stereo"; 3062 info = "PAL+SECAM / stereo";
3062 btv->has_radio = 1; 3063 btv->has_radio = 1;
3064 btv->tda9887_conf = TDA9887_QSS;
3063 break; 3065 break;
3064 case 3: 3066 case 3:
3065 info = "NTSC / stereo"; 3067 info = "NTSC / stereo";
3066 btv->has_radio = 1; 3068 btv->has_radio = 1;
3069 btv->tda9887_conf = TDA9887_QSS;
3067 break; 3070 break;
3068 case 4: 3071 case 4:
3069 info = "PAL+SECAM / mono"; 3072 info = "PAL+SECAM / mono";
3073 btv->tda9887_conf = TDA9887_QSS;
3070 break; 3074 break;
3071 case 5: 3075 case 5:
3072 info = "NTSC / mono"; 3076 info = "NTSC / mono";
3077 btv->tda9887_conf = TDA9887_INTERCARRIER;
3073 break; 3078 break;
3074 case 6: 3079 case 6:
3075 info = "NTSC / stereo"; 3080 info = "NTSC / stereo";
3081 btv->tda9887_conf = TDA9887_INTERCARRIER;
3076 break; 3082 break;
3077 case 7: 3083 case 7:
3078 info = "PAL / stereo"; 3084 info = "PAL / stereo";
3085 btv->tda9887_conf = TDA9887_INTERCARRIER;
3079 break; 3086 break;
3080 default: 3087 default:
3081 info = "oops: unknown card"; 3088 info = "oops: unknown card";
@@ -3086,8 +3093,7 @@ static void miro_pinnacle_gpio(struct bttv *btv)
3086 printk(KERN_INFO 3093 printk(KERN_INFO
3087 "bttv%d: pinnacle/mt: id=%d info=\"%s\" radio=%s\n", 3094 "bttv%d: pinnacle/mt: id=%d info=\"%s\" radio=%s\n",
3088 btv->c.nr, id, info, btv->has_radio ? "yes" : "no"); 3095 btv->c.nr, id, info, btv->has_radio ? "yes" : "no");
3089 btv->tuner_type = 33; 3096 btv->tuner_type = TUNER_MT2032;
3090 btv->pinnacle_id = id;
3091 } 3097 }
3092} 3098}
3093 3099
@@ -3389,9 +3395,9 @@ void __devinit bttv_init_card2(struct bttv *btv)
3389 bttv_call_i2c_clients(btv, TUNER_SET_TYPE_ADDR, &tun_setup); 3395 bttv_call_i2c_clients(btv, TUNER_SET_TYPE_ADDR, &tun_setup);
3390 } 3396 }
3391 3397
3392 if (btv->pinnacle_id != UNSET) { 3398 if (btv->tda9887_conf) {
3393 bttv_call_i2c_clients(btv, AUDC_CONFIG_PINNACLE, 3399 bttv_call_i2c_clients(btv, TDA9887_SET_CONFIG,
3394 &btv->pinnacle_id); 3400 &btv->tda9887_conf);
3395 } 3401 }
3396 3402
3397 btv->svhs = bttv_tvcards[btv->c.type].svhs; 3403 btv->svhs = bttv_tvcards[btv->c.type].svhs;
@@ -3443,7 +3449,7 @@ void __devinit bttv_init_card2(struct bttv *btv)
3443 3449
3444 /* tuner modules */ 3450 /* tuner modules */
3445 tda9887 = 0; 3451 tda9887 = 0;
3446 if (btv->pinnacle_id != UNSET) 3452 if (btv->tda9887_conf)
3447 tda9887 = 1; 3453 tda9887 = 1;
3448 if (0 == tda9887 && 0 == bttv_tvcards[btv->c.type].has_dvb && 3454 if (0 == tda9887 && 0 == bttv_tvcards[btv->c.type].has_dvb &&
3449 bttv_I2CRead(btv, I2C_TDA9887, "TDA9887") >=0) 3455 bttv_I2CRead(btv, I2C_TDA9887, "TDA9887") >=0)
diff --git a/drivers/media/video/bttv-driver.c b/drivers/media/video/bttv-driver.c
index 03f925724ce9..39e9178e599e 100644
--- a/drivers/media/video/bttv-driver.c
+++ b/drivers/media/video/bttv-driver.c
@@ -3947,7 +3947,6 @@ static int __devinit bttv_probe(struct pci_dev *dev,
3947 3947
3948 btv->i2c_rc = -1; 3948 btv->i2c_rc = -1;
3949 btv->tuner_type = UNSET; 3949 btv->tuner_type = UNSET;
3950 btv->pinnacle_id = UNSET;
3951 btv->new_input = UNSET; 3950 btv->new_input = UNSET;
3952 btv->has_radio=radio[btv->c.nr]; 3951 btv->has_radio=radio[btv->c.nr];
3953 3952
diff --git a/drivers/media/video/bttvp.h b/drivers/media/video/bttvp.h
index 1e6a5632c3c7..d04d02385349 100644
--- a/drivers/media/video/bttvp.h
+++ b/drivers/media/video/bttvp.h
@@ -270,7 +270,7 @@ struct bttv {
270 /* card configuration info */ 270 /* card configuration info */
271 unsigned int cardid; /* pci subsystem id (bt878 based ones) */ 271 unsigned int cardid; /* pci subsystem id (bt878 based ones) */
272 unsigned int tuner_type; /* tuner chip type */ 272 unsigned int tuner_type; /* tuner chip type */
273 unsigned int pinnacle_id; 273 unsigned int tda9887_conf;
274 unsigned int svhs; 274 unsigned int svhs;
275 struct bttv_pll_info pll; 275 struct bttv_pll_info pll;
276 int triton1; 276 int triton1;
diff --git a/drivers/media/video/mt20xx.c b/drivers/media/video/mt20xx.c
index 2180018f06de..e2df722ebaeb 100644
--- a/drivers/media/video/mt20xx.c
+++ b/drivers/media/video/mt20xx.c
@@ -494,6 +494,13 @@ int microtune_init(struct i2c_client *c)
494 t->tv_freq = NULL; 494 t->tv_freq = NULL;
495 t->radio_freq = NULL; 495 t->radio_freq = NULL;
496 t->standby = NULL; 496 t->standby = NULL;
497 if (t->std & V4L2_STD_525_60) {
498 tuner_dbg("pinnacle ntsc\n");
499 t->radio_if2 = 41300 * 1000;
500 } else {
501 tuner_dbg("pinnacle pal\n");
502 t->radio_if2 = 33300 * 1000;
503 }
497 name = "unknown"; 504 name = "unknown";
498 505
499 i2c_master_send(c,buf,1); 506 i2c_master_send(c,buf,1);
diff --git a/drivers/media/video/tda9887.c b/drivers/media/video/tda9887.c
index ae4029a07449..ceaa29975c8e 100644
--- a/drivers/media/video/tda9887.c
+++ b/drivers/media/video/tda9887.c
@@ -57,7 +57,6 @@ struct tda9887 {
57 v4l2_std_id std; 57 v4l2_std_id std;
58 enum tuner_mode mode; 58 enum tuner_mode mode;
59 unsigned int config; 59 unsigned int config;
60 unsigned int pinnacle_id;
61 unsigned int using_v4l2; 60 unsigned int using_v4l2;
62 unsigned int radio_mode; 61 unsigned int radio_mode;
63 unsigned char data[4]; 62 unsigned char data[4];
@@ -481,34 +480,6 @@ static int tda9887_set_config(struct tda9887 *t, char *buf)
481 480
482/* ---------------------------------------------------------------------- */ 481/* ---------------------------------------------------------------------- */
483 482
484static int tda9887_set_pinnacle(struct tda9887 *t, char *buf)
485{
486 unsigned int bCarrierMode = UNSET;
487
488 if (t->std & V4L2_STD_625_50) {
489 if ((1 == t->pinnacle_id) || (7 == t->pinnacle_id)) {
490 bCarrierMode = cIntercarrier;
491 } else {
492 bCarrierMode = cQSS;
493 }
494 }
495 if (t->std & V4L2_STD_525_60) {
496 if ((5 == t->pinnacle_id) || (6 == t->pinnacle_id)) {
497 bCarrierMode = cIntercarrier;
498 } else {
499 bCarrierMode = cQSS;
500 }
501 }
502
503 if (bCarrierMode != UNSET) {
504 buf[1] &= ~0x04;
505 buf[1] |= bCarrierMode;
506 }
507 return 0;
508}
509
510/* ---------------------------------------------------------------------- */
511
512static char pal[] = "-"; 483static char pal[] = "-";
513module_param_string(pal, pal, sizeof(pal), 0644); 484module_param_string(pal, pal, sizeof(pal), 0644);
514static char secam[] = "-"; 485static char secam[] = "-";
@@ -593,9 +564,6 @@ static int tda9887_configure(struct tda9887 *t)
593 t->data[1] |= cOutputPort1Inactive; 564 t->data[1] |= cOutputPort1Inactive;
594 t->data[1] |= cOutputPort2Inactive; 565 t->data[1] |= cOutputPort2Inactive;
595 566
596 if (UNSET != t->pinnacle_id) {
597 tda9887_set_pinnacle(t,t->data);
598 }
599 tda9887_set_config(t,t->data); 567 tda9887_set_config(t,t->data);
600 tda9887_set_insmod(t,t->data); 568 tda9887_set_insmod(t,t->data);
601 569
@@ -634,7 +602,6 @@ static int tda9887_attach(struct i2c_adapter *adap, int addr, int kind)
634 602
635 t->client = client_template; 603 t->client = client_template;
636 t->std = 0; 604 t->std = 0;
637 t->pinnacle_id = UNSET;
638 t->radio_mode = V4L2_TUNER_MODE_STEREO; 605 t->radio_mode = V4L2_TUNER_MODE_STEREO;
639 606
640 tda9887_info("chip found @ 0x%x (%s)\n", addr<<1, adap->name); 607 tda9887_info("chip found @ 0x%x (%s)\n", addr<<1, adap->name);
@@ -698,14 +665,6 @@ tda9887_command(struct i2c_client *client, unsigned int cmd, void *arg)
698 tda9887_configure(t); 665 tda9887_configure(t);
699 break; 666 break;
700 } 667 }
701 case AUDC_CONFIG_PINNACLE:
702 {
703 int *i = arg;
704
705 t->pinnacle_id = *i;
706 tda9887_configure(t);
707 break;
708 }
709 case TDA9887_SET_CONFIG: 668 case TDA9887_SET_CONFIG:
710 { 669 {
711 int *i = arg; 670 int *i = arg;
diff --git a/drivers/media/video/tuner-core.c b/drivers/media/video/tuner-core.c
index ae76113886fd..c8ff849e8903 100644
--- a/drivers/media/video/tuner-core.c
+++ b/drivers/media/video/tuner-core.c
@@ -510,7 +510,6 @@ static void tuner_status(struct i2c_client *client)
510static int tuner_command(struct i2c_client *client, unsigned int cmd, void *arg) 510static int tuner_command(struct i2c_client *client, unsigned int cmd, void *arg)
511{ 511{
512 struct tuner *t = i2c_get_clientdata(client); 512 struct tuner *t = i2c_get_clientdata(client);
513 unsigned int *iarg = (int *)arg;
514 513
515 switch (cmd) { 514 switch (cmd) {
516 /* --- configuration --- */ 515 /* --- configuration --- */
@@ -533,18 +532,6 @@ static int tuner_command(struct i2c_client *client, unsigned int cmd, void *arg)
533 t->standby (client); 532 t->standby (client);
534 break; 533 break;
535 } 534 }
536 case AUDC_CONFIG_PINNACLE:
537 switch (*iarg) {
538 case 2:
539 tuner_dbg("pinnacle pal\n");
540 t->radio_if2 = 33300 * 1000;
541 break;
542 case 3:
543 tuner_dbg("pinnacle ntsc\n");
544 t->radio_if2 = 41300 * 1000;
545 break;
546 }
547 break;
548 case VIDIOCSAUDIO: 535 case VIDIOCSAUDIO:
549 if (check_mode(t, "VIDIOCSAUDIO") == EINVAL) 536 if (check_mode(t, "VIDIOCSAUDIO") == EINVAL)
550 return 0; 537 return 0;
diff --git a/include/media/audiochip.h b/include/media/audiochip.h
index b7d4b0930408..411f09fc4574 100644
--- a/include/media/audiochip.h
+++ b/include/media/audiochip.h
@@ -40,15 +40,4 @@ enum audiochip {
40#define AUDIO_MUTE 0x80 40#define AUDIO_MUTE 0x80
41#define AUDIO_UNMUTE 0x81 41#define AUDIO_UNMUTE 0x81
42 42
43/* all the stuff below is obsolete and just here for reference. I'll
44 * remove it once the driver is tested and works fine.
45 *
46 * Instead creating alot of tiny API's for all kinds of different
47 * chips, we'll just pass throuth the v4l ioctl structs (v4l2 not
48 * yet...). It is a bit less flexible, but most/all used i2c chips
49 * make sense in v4l context only. So I think that's acceptable...
50 */
51
52/* misc stuff to pass around config info to i2c chips */
53#define AUDC_CONFIG_PINNACLE _IOW('m',32,int)
54#endif /* AUDIOCHIP_H */ 43#endif /* AUDIOCHIP_H */