diff options
-rw-r--r-- | firmware/target/coldfire/iriver/audio-iriver.c | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/firmware/target/coldfire/iriver/audio-iriver.c b/firmware/target/coldfire/iriver/audio-iriver.c index 7a52ce1ff0..420ca309d8 100644 --- a/firmware/target/coldfire/iriver/audio-iriver.c +++ b/firmware/target/coldfire/iriver/audio-iriver.c | |||
@@ -58,6 +58,7 @@ void audio_set_source(int source, unsigned flags) | |||
58 | /* Prevent pops from unneeded switching */ | 58 | /* Prevent pops from unneeded switching */ |
59 | static int last_source = AUDIO_SRC_PLAYBACK; | 59 | static int last_source = AUDIO_SRC_PLAYBACK; |
60 | bool recording = flags & SRCF_RECORDING; | 60 | bool recording = flags & SRCF_RECORDING; |
61 | static bool last_recording = false; | ||
61 | 62 | ||
62 | switch (source) | 63 | switch (source) |
63 | { | 64 | { |
@@ -77,7 +78,7 @@ void audio_set_source(int source, unsigned flags) | |||
77 | if (source != last_source) | 78 | if (source != last_source) |
78 | { | 79 | { |
79 | uda1380_enable_recording(true); /* source mic */ | 80 | uda1380_enable_recording(true); /* source mic */ |
80 | uda1380_set_monitor(true); | 81 | uda1380_set_monitor(false); |
81 | /* Int. when 6 samples in FIFO, PDIR2 src = iis1RcvData */ | 82 | /* Int. when 6 samples in FIFO, PDIR2 src = iis1RcvData */ |
82 | DATAINCONTROL = (3 << 14) | (4 << 3); | 83 | DATAINCONTROL = (3 << 14) | (4 << 3); |
83 | } | 84 | } |
@@ -87,7 +88,7 @@ void audio_set_source(int source, unsigned flags) | |||
87 | if (source != last_source) | 88 | if (source != last_source) |
88 | { | 89 | { |
89 | uda1380_enable_recording(false); /* source line */ | 90 | uda1380_enable_recording(false); /* source line */ |
90 | uda1380_set_monitor(true); | 91 | uda1380_set_monitor(false); |
91 | /* Int. when 6 samples in FIFO, PDIR2 src = iis1RcvData */ | 92 | /* Int. when 6 samples in FIFO, PDIR2 src = iis1RcvData */ |
92 | DATAINCONTROL = (3 << 14) | (4 << 3); | 93 | DATAINCONTROL = (3 << 14) | (4 << 3); |
93 | } | 94 | } |
@@ -106,6 +107,14 @@ void audio_set_source(int source, unsigned flags) | |||
106 | #endif /* HAVE_SPDIF_IN */ | 107 | #endif /* HAVE_SPDIF_IN */ |
107 | 108 | ||
108 | case AUDIO_SRC_FMRADIO: /* recording and playback */ | 109 | case AUDIO_SRC_FMRADIO: /* recording and playback */ |
110 | if (!recording) | ||
111 | uda1380_set_recvol(0, 0, AUDIO_GAIN_LINEIN); | ||
112 | |||
113 | if (source == last_source && recording == last_recording) | ||
114 | break; | ||
115 | |||
116 | last_recording = recording; | ||
117 | |||
109 | if (recording) | 118 | if (recording) |
110 | { | 119 | { |
111 | /* Int. when 6 samples in FIFO, PDIR2 src = iis1RcvData */ | 120 | /* Int. when 6 samples in FIFO, PDIR2 src = iis1RcvData */ |
@@ -113,17 +122,13 @@ void audio_set_source(int source, unsigned flags) | |||
113 | } | 122 | } |
114 | else | 123 | else |
115 | { | 124 | { |
116 | uda1380_set_recvol(0, 0, AUDIO_GAIN_LINEIN); | ||
117 | /* Reset PDIR2 data flow */ | 125 | /* Reset PDIR2 data flow */ |
118 | DATAINCONTROL = (1 << 9); | 126 | DATAINCONTROL = (1 << 9); |
119 | } | 127 | } |
120 | 128 | ||
121 | if (source != last_source) | 129 | /* I2S recording and playback */ |
122 | { | 130 | uda1380_enable_recording(false); /* source line */ |
123 | /* I2S recording and playback */ | 131 | uda1380_set_monitor(!recording); |
124 | uda1380_enable_recording(false); /* source line */ | ||
125 | uda1380_set_monitor(true); | ||
126 | } | ||
127 | break; | 132 | break; |
128 | } /* end switch */ | 133 | } /* end switch */ |
129 | 134 | ||