1
0
Fork 0

V4L/DVB (10228): em28xx: fix audio output PCM IN selection

Some em28xx devices use the PCM IN AC 97 PIN for digital audio. However,
currently, the PCM IN selection is not set by the driver. This patch allows
specifying the PCM IN expected output, via board description table.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
hifive-unleashed-5.1
Mauro Carvalho Chehab 2009-01-12 21:50:52 -03:00
parent fc96ab7302
commit 8866f9cf8d
2 changed files with 28 additions and 0 deletions

View File

@ -454,6 +454,15 @@ int em28xx_audio_analog_set(struct em28xx *dev)
em28xx_warn("couldn't setup AC97 register %d\n",
outputs[i].reg);
}
if (dev->ctl_aoutput & EM28XX_AOUT_PCM_IN) {
int sel = ac97_return_record_select(dev->ctl_aoutput);
/* Use the same input for both left and right channels */
sel |= (sel << 8);
em28xx_write_ac97(dev, AC97_RECORD_SELECT, sel);
}
}
return ret;

View File

@ -300,13 +300,32 @@ enum em28xx_amux {
};
enum em28xx_aout {
/* AC97 outputs */
EM28XX_AOUT_MASTER = 1 << 0,
EM28XX_AOUT_LINE = 1 << 1,
EM28XX_AOUT_MONO = 1 << 2,
EM28XX_AOUT_LFE = 1 << 3,
EM28XX_AOUT_SURR = 1 << 4,
/* PCM IN Mixer - used by AC97_RECORD_SELECT register */
EM28XX_AOUT_PCM_IN = 1 << 7,
/* Bits 10-8 are used to indicate the PCM IN record select */
EM28XX_AOUT_PCM_MIC_PCM = 0 << 8,
EM28XX_AOUT_PCM_CD = 1 << 8,
EM28XX_AOUT_PCM_VIDEO = 2 << 8,
EM28XX_AOUT_PCM_AUX = 3 << 8,
EM28XX_AOUT_PCM_LINE = 4 << 8,
EM28XX_AOUT_PCM_STEREO = 5 << 8,
EM28XX_AOUT_PCM_MONO = 6 << 8,
EM28XX_AOUT_PCM_PHONE = 7 << 8,
};
static int ac97_return_record_select(int a_out)
{
return (a_out & 0x700) >> 8;
}
struct em28xx_reg_seq {
int reg;
unsigned char val, mask;