aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media
diff options
context:
space:
mode:
authorVitaly Wool <vital@embeddedalley.com>2009-03-04 06:27:52 -0500
committerMauro Carvalho Chehab <mchehab@redhat.com>2009-03-30 11:43:07 -0400
commit2bd1d9eb1c27034a77c8e1887156da72d6160ae1 (patch)
treec80d2b235024e621e2633c6504511df1fbca20d4 /drivers/media
parent3341cc6e86da7b956084d5b6c9ca2e4f1c27f9bf (diff)
V4L/DVB (10833): em28xx: enable Compro VideoMate ForYou sound
Compro VideoMate uses an external audio DSP chip, controlled via tvaudio module (tda9874a). This patch improves em28xx infrastructure to support an external audio processor and fixes the Compro VideoMate entry to work with it. Signed-off-by: Vitaly Wool <vital@embeddedalley.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media')
-rw-r--r--drivers/media/video/em28xx/em28xx-cards.c21
-rw-r--r--drivers/media/video/em28xx/em28xx-core.c5
-rw-r--r--drivers/media/video/em28xx/em28xx-i2c.c6
-rw-r--r--drivers/media/video/em28xx/em28xx-video.c7
-rw-r--r--drivers/media/video/em28xx/em28xx.h1
5 files changed, 39 insertions, 1 deletions
diff --git a/drivers/media/video/em28xx/em28xx-cards.c b/drivers/media/video/em28xx/em28xx-cards.c
index f7c817765752..650ccfda1428 100644
--- a/drivers/media/video/em28xx/em28xx-cards.c
+++ b/drivers/media/video/em28xx/em28xx-cards.c
@@ -122,6 +122,22 @@ static struct em28xx_reg_seq default_tuner_gpio[] = {
122 { -1, -1, -1, -1}, 122 { -1, -1, -1, -1},
123}; 123};
124 124
125/* Mute/unmute */
126static struct em28xx_reg_seq compro_unmute_tv_gpio[] = {
127 {EM28XX_R08_GPIO, 5, 7, 10},
128 { -1, -1, -1, -1},
129};
130
131static struct em28xx_reg_seq compro_unmute_svid_gpio[] = {
132 {EM28XX_R08_GPIO, 4, 7, 10},
133 { -1, -1, -1, -1},
134};
135
136static struct em28xx_reg_seq compro_mute_gpio[] = {
137 {EM28XX_R08_GPIO, 6, 7, 10},
138 { -1, -1, -1, -1},
139};
140
125/* 141/*
126 * Board definitions 142 * Board definitions
127 */ 143 */
@@ -1225,14 +1241,17 @@ struct em28xx_board em28xx_boards[] = {
1225 .tda9887_conf = TDA9887_PRESENT, 1241 .tda9887_conf = TDA9887_PRESENT,
1226 .decoder = EM28XX_TVP5150, 1242 .decoder = EM28XX_TVP5150,
1227 .adecoder = EM28XX_TVAUDIO, 1243 .adecoder = EM28XX_TVAUDIO,
1244 .mute_gpio = compro_mute_gpio,
1228 .input = { { 1245 .input = { {
1229 .type = EM28XX_VMUX_TELEVISION, 1246 .type = EM28XX_VMUX_TELEVISION,
1230 .vmux = TVP5150_COMPOSITE0, 1247 .vmux = TVP5150_COMPOSITE0,
1231 .amux = EM28XX_AMUX_LINE_IN, 1248 .amux = EM28XX_AMUX_VIDEO,
1249 .gpio = compro_unmute_tv_gpio,
1232 }, { 1250 }, {
1233 .type = EM28XX_VMUX_SVIDEO, 1251 .type = EM28XX_VMUX_SVIDEO,
1234 .vmux = TVP5150_SVIDEO, 1252 .vmux = TVP5150_SVIDEO,
1235 .amux = EM28XX_AMUX_LINE_IN, 1253 .amux = EM28XX_AMUX_LINE_IN,
1254 .gpio = compro_unmute_svid_gpio,
1236 } }, 1255 } },
1237 }, 1256 },
1238 [EM2860_BOARD_KAIOMY_TVNPC_U2] = { 1257 [EM2860_BOARD_KAIOMY_TVNPC_U2] = {
diff --git a/drivers/media/video/em28xx/em28xx-core.c b/drivers/media/video/em28xx/em28xx-core.c
index eee8d015b249..c896d24032f5 100644
--- a/drivers/media/video/em28xx/em28xx-core.c
+++ b/drivers/media/video/em28xx/em28xx-core.c
@@ -378,6 +378,11 @@ static int em28xx_set_audio_source(struct em28xx *dev)
378 } 378 }
379 } 379 }
380 380
381 if (dev->board.mute_gpio && dev->mute)
382 em28xx_gpio_set(dev, dev->board.mute_gpio);
383 else
384 em28xx_gpio_set(dev, INPUT(dev->ctl_input)->gpio);
385
381 ret = em28xx_write_reg_bits(dev, EM28XX_R0E_AUDIOSRC, input, 0xc0); 386 ret = em28xx_write_reg_bits(dev, EM28XX_R0E_AUDIOSRC, input, 0xc0);
382 if (ret < 0) 387 if (ret < 0)
383 return ret; 388 return ret;
diff --git a/drivers/media/video/em28xx/em28xx-i2c.c b/drivers/media/video/em28xx/em28xx-i2c.c
index 2dab43d22da2..02c12fe6361b 100644
--- a/drivers/media/video/em28xx/em28xx-i2c.c
+++ b/drivers/media/video/em28xx/em28xx-i2c.c
@@ -510,12 +510,17 @@ static int attach_inform(struct i2c_client *client)
510 dprintk1(1, "attach_inform: tvp5150 detected.\n"); 510 dprintk1(1, "attach_inform: tvp5150 detected.\n");
511 break; 511 break;
512 512
513 case 0xb0:
514 dprintk1(1, "attach_inform: tda9874 detected\n");
515 break;
516
513 default: 517 default:
514 if (!dev->tuner_addr) 518 if (!dev->tuner_addr)
515 dev->tuner_addr = client->addr; 519 dev->tuner_addr = client->addr;
516 520
517 dprintk1(1, "attach inform: detected I2C address %x\n", 521 dprintk1(1, "attach inform: detected I2C address %x\n",
518 client->addr << 1); 522 client->addr << 1);
523 dprintk1(1, "driver id %d\n", client->driver->id);
519 524
520 } 525 }
521 526
@@ -554,6 +559,7 @@ static char *i2c_devs[128] = {
554 [0x80 >> 1] = "msp34xx", 559 [0x80 >> 1] = "msp34xx",
555 [0x88 >> 1] = "msp34xx", 560 [0x88 >> 1] = "msp34xx",
556 [0xa0 >> 1] = "eeprom", 561 [0xa0 >> 1] = "eeprom",
562 [0xb0 >> 1] = "tda9874",
557 [0xb8 >> 1] = "tvp5150a", 563 [0xb8 >> 1] = "tvp5150a",
558 [0xba >> 1] = "tvp5150a", 564 [0xba >> 1] = "tvp5150a",
559 [0xc0 >> 1] = "tuner (analog)", 565 [0xc0 >> 1] = "tuner (analog)",
diff --git a/drivers/media/video/em28xx/em28xx-video.c b/drivers/media/video/em28xx/em28xx-video.c
index efd641587e04..575472f1e702 100644
--- a/drivers/media/video/em28xx/em28xx-video.c
+++ b/drivers/media/video/em28xx/em28xx-video.c
@@ -540,6 +540,13 @@ static void video_mux(struct em28xx *dev, int index)
540 &route); 540 &route);
541 } 541 }
542 542
543 if (dev->board.adecoder != EM28XX_NOADECODER) {
544 route.input = dev->ctl_ainput;
545 route.output = dev->ctl_aoutput;
546 em28xx_i2c_call_clients(dev, VIDIOC_INT_S_AUDIO_ROUTING,
547 &route);
548 }
549
543 em28xx_audio_analog_set(dev); 550 em28xx_audio_analog_set(dev);
544} 551}
545 552
diff --git a/drivers/media/video/em28xx/em28xx.h b/drivers/media/video/em28xx/em28xx.h
index 57a4084f9b5e..a33a58da016e 100644
--- a/drivers/media/video/em28xx/em28xx.h
+++ b/drivers/media/video/em28xx/em28xx.h
@@ -374,6 +374,7 @@ struct em28xx_board {
374 struct em28xx_reg_seq *dvb_gpio; 374 struct em28xx_reg_seq *dvb_gpio;
375 struct em28xx_reg_seq *suspend_gpio; 375 struct em28xx_reg_seq *suspend_gpio;
376 struct em28xx_reg_seq *tuner_gpio; 376 struct em28xx_reg_seq *tuner_gpio;
377 struct em28xx_reg_seq *mute_gpio;
377 378
378 unsigned int is_em2800:1; 379 unsigned int is_em2800:1;
379 unsigned int has_msp34xx:1; 380 unsigned int has_msp34xx:1;