Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 130753
b: refs/heads/master
c: 8866f9c
h: refs/heads/master
i:
  130751: 4b63be3
v: v3
  • Loading branch information
Mauro Carvalho Chehab committed Jan 29, 2009
1 parent 08fb2e1 commit 2e17bbf
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: fc96ab730268b8b652ae2494088e8bd4572f58aa
refs/heads/master: 8866f9cf8d85f3614855a49b9d9056f265d0cd33
9 changes: 9 additions & 0 deletions trunk/drivers/media/video/em28xx/em28xx-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
19 changes: 19 additions & 0 deletions trunk/drivers/media/video/em28xx/em28xx.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 2e17bbf

Please sign in to comment.