diff options
author | Tim Kaiser <timkaiser@t-online.de> | 2006-06-25 08:14:07 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2006-06-26 08:21:26 -0400 |
commit | 61391e0446e97bea44d93bd1624e5b32d3cc8474 (patch) | |
tree | c1a1579505a07a1c58c3c7f58ed8ba775acd02c0 /drivers/media/dvb/ttpci/av7110_av.c | |
parent | 4a4edcca22bf46622f34db74a876a7eb91d95865 (diff) |
V4L/DVB (4219): Av7110: analog sound output of DVB-C rev 2.3
Added support for the msp34x5 audio dac. Analog sound output of
Technotrend DVB-C 2300 (aka Hauppauge Nexus-CA) works now.
Signed-off-by: Tim Kaiser <timkaiser@t-online.de>
Signed-off-by: Marco Schluessler <marco@lordzodiac.de>
Signed-off-by: Oliver Endriss <o.endriss@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/dvb/ttpci/av7110_av.c')
-rw-r--r-- | drivers/media/dvb/ttpci/av7110_av.c | 25 |
1 files changed, 22 insertions, 3 deletions
diff --git a/drivers/media/dvb/ttpci/av7110_av.c b/drivers/media/dvb/ttpci/av7110_av.c index 2eff09f638d3..0f3a044aeb17 100644 --- a/drivers/media/dvb/ttpci/av7110_av.c +++ b/drivers/media/dvb/ttpci/av7110_av.c | |||
@@ -318,7 +318,17 @@ int av7110_set_volume(struct av7110 *av7110, int volleft, int volright) | |||
318 | msp_writereg(av7110, MSP_WR_DSP, 0x0000, val); /* loudspeaker */ | 318 | msp_writereg(av7110, MSP_WR_DSP, 0x0000, val); /* loudspeaker */ |
319 | msp_writereg(av7110, MSP_WR_DSP, 0x0006, val); /* headphonesr */ | 319 | msp_writereg(av7110, MSP_WR_DSP, 0x0006, val); /* headphonesr */ |
320 | return 0; | 320 | return 0; |
321 | |||
322 | case DVB_ADAC_MSP34x5: | ||
323 | vol = (volleft > volright) ? volleft : volright; | ||
324 | val = (vol * 0x73 / 255) << 8; | ||
325 | if (vol > 0) | ||
326 | balance = ((volright - volleft) * 127) / vol; | ||
327 | msp_writereg(av7110, MSP_WR_DSP, 0x0001, balance << 8); | ||
328 | msp_writereg(av7110, MSP_WR_DSP, 0x0000, val); /* loudspeaker */ | ||
329 | return 0; | ||
321 | } | 330 | } |
331 | |||
322 | return 0; | 332 | return 0; |
323 | } | 333 | } |
324 | 334 | ||
@@ -1267,23 +1277,32 @@ static int dvb_audio_ioctl(struct inode *inode, struct file *file, | |||
1267 | switch(av7110->audiostate.channel_select) { | 1277 | switch(av7110->audiostate.channel_select) { |
1268 | case AUDIO_STEREO: | 1278 | case AUDIO_STEREO: |
1269 | ret = audcom(av7110, AUDIO_CMD_STEREO); | 1279 | ret = audcom(av7110, AUDIO_CMD_STEREO); |
1270 | if (!ret) | 1280 | if (!ret) { |
1271 | if (av7110->adac_type == DVB_ADAC_CRYSTAL) | 1281 | if (av7110->adac_type == DVB_ADAC_CRYSTAL) |
1272 | i2c_writereg(av7110, 0x20, 0x02, 0x49); | 1282 | i2c_writereg(av7110, 0x20, 0x02, 0x49); |
1283 | else if (av7110->adac_type == DVB_ADAC_MSP34x5) | ||
1284 | msp_writereg(av7110, MSP_WR_DSP, 0x0008, 0x0220); | ||
1285 | } | ||
1273 | break; | 1286 | break; |
1274 | 1287 | ||
1275 | case AUDIO_MONO_LEFT: | 1288 | case AUDIO_MONO_LEFT: |
1276 | ret = audcom(av7110, AUDIO_CMD_MONO_L); | 1289 | ret = audcom(av7110, AUDIO_CMD_MONO_L); |
1277 | if (!ret) | 1290 | if (!ret) { |
1278 | if (av7110->adac_type == DVB_ADAC_CRYSTAL) | 1291 | if (av7110->adac_type == DVB_ADAC_CRYSTAL) |
1279 | i2c_writereg(av7110, 0x20, 0x02, 0x4a); | 1292 | i2c_writereg(av7110, 0x20, 0x02, 0x4a); |
1293 | else if (av7110->adac_type == DVB_ADAC_MSP34x5) | ||
1294 | msp_writereg(av7110, MSP_WR_DSP, 0x0008, 0x0200); | ||
1295 | } | ||
1280 | break; | 1296 | break; |
1281 | 1297 | ||
1282 | case AUDIO_MONO_RIGHT: | 1298 | case AUDIO_MONO_RIGHT: |
1283 | ret = audcom(av7110, AUDIO_CMD_MONO_R); | 1299 | ret = audcom(av7110, AUDIO_CMD_MONO_R); |
1284 | if (!ret) | 1300 | if (!ret) { |
1285 | if (av7110->adac_type == DVB_ADAC_CRYSTAL) | 1301 | if (av7110->adac_type == DVB_ADAC_CRYSTAL) |
1286 | i2c_writereg(av7110, 0x20, 0x02, 0x45); | 1302 | i2c_writereg(av7110, 0x20, 0x02, 0x45); |
1303 | else if (av7110->adac_type == DVB_ADAC_MSP34x5) | ||
1304 | msp_writereg(av7110, MSP_WR_DSP, 0x0008, 0x0210); | ||
1305 | } | ||
1287 | break; | 1306 | break; |
1288 | 1307 | ||
1289 | default: | 1308 | default: |