forked from len0rd/rockbox
iRiver: Channel 2 shouldn't be monitored except for radio playback.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@11616 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
a1af87ffe7
commit
ce3ade1360
1 changed files with 14 additions and 9 deletions
|
|
@ -58,6 +58,7 @@ void audio_set_source(int source, unsigned flags)
|
||||||
/* Prevent pops from unneeded switching */
|
/* Prevent pops from unneeded switching */
|
||||||
static int last_source = AUDIO_SRC_PLAYBACK;
|
static int last_source = AUDIO_SRC_PLAYBACK;
|
||||||
bool recording = flags & SRCF_RECORDING;
|
bool recording = flags & SRCF_RECORDING;
|
||||||
|
static bool last_recording = false;
|
||||||
|
|
||||||
switch (source)
|
switch (source)
|
||||||
{
|
{
|
||||||
|
|
@ -77,7 +78,7 @@ void audio_set_source(int source, unsigned flags)
|
||||||
if (source != last_source)
|
if (source != last_source)
|
||||||
{
|
{
|
||||||
uda1380_enable_recording(true); /* source mic */
|
uda1380_enable_recording(true); /* source mic */
|
||||||
uda1380_set_monitor(true);
|
uda1380_set_monitor(false);
|
||||||
/* Int. when 6 samples in FIFO, PDIR2 src = iis1RcvData */
|
/* Int. when 6 samples in FIFO, PDIR2 src = iis1RcvData */
|
||||||
DATAINCONTROL = (3 << 14) | (4 << 3);
|
DATAINCONTROL = (3 << 14) | (4 << 3);
|
||||||
}
|
}
|
||||||
|
|
@ -87,7 +88,7 @@ void audio_set_source(int source, unsigned flags)
|
||||||
if (source != last_source)
|
if (source != last_source)
|
||||||
{
|
{
|
||||||
uda1380_enable_recording(false); /* source line */
|
uda1380_enable_recording(false); /* source line */
|
||||||
uda1380_set_monitor(true);
|
uda1380_set_monitor(false);
|
||||||
/* Int. when 6 samples in FIFO, PDIR2 src = iis1RcvData */
|
/* Int. when 6 samples in FIFO, PDIR2 src = iis1RcvData */
|
||||||
DATAINCONTROL = (3 << 14) | (4 << 3);
|
DATAINCONTROL = (3 << 14) | (4 << 3);
|
||||||
}
|
}
|
||||||
|
|
@ -106,6 +107,14 @@ void audio_set_source(int source, unsigned flags)
|
||||||
#endif /* HAVE_SPDIF_IN */
|
#endif /* HAVE_SPDIF_IN */
|
||||||
|
|
||||||
case AUDIO_SRC_FMRADIO: /* recording and playback */
|
case AUDIO_SRC_FMRADIO: /* recording and playback */
|
||||||
|
if (!recording)
|
||||||
|
uda1380_set_recvol(0, 0, AUDIO_GAIN_LINEIN);
|
||||||
|
|
||||||
|
if (source == last_source && recording == last_recording)
|
||||||
|
break;
|
||||||
|
|
||||||
|
last_recording = recording;
|
||||||
|
|
||||||
if (recording)
|
if (recording)
|
||||||
{
|
{
|
||||||
/* Int. when 6 samples in FIFO, PDIR2 src = iis1RcvData */
|
/* Int. when 6 samples in FIFO, PDIR2 src = iis1RcvData */
|
||||||
|
|
@ -113,17 +122,13 @@ void audio_set_source(int source, unsigned flags)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
uda1380_set_recvol(0, 0, AUDIO_GAIN_LINEIN);
|
|
||||||
/* Reset PDIR2 data flow */
|
/* Reset PDIR2 data flow */
|
||||||
DATAINCONTROL = (1 << 9);
|
DATAINCONTROL = (1 << 9);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (source != last_source)
|
/* I2S recording and playback */
|
||||||
{
|
uda1380_enable_recording(false); /* source line */
|
||||||
/* I2S recording and playback */
|
uda1380_set_monitor(!recording);
|
||||||
uda1380_enable_recording(false); /* source line */
|
|
||||||
uda1380_set_monitor(true);
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
} /* end switch */
|
} /* end switch */
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue