diff options
Diffstat (limited to 'firmware/target/arm/audio-pp.c')
-rw-r--r-- | firmware/target/arm/audio-pp.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/firmware/target/arm/audio-pp.c b/firmware/target/arm/audio-pp.c index 9fff197520..783342ef37 100644 --- a/firmware/target/arm/audio-pp.c +++ b/firmware/target/arm/audio-pp.c | |||
@@ -35,6 +35,7 @@ void audio_input_mux(int source, unsigned flags) | |||
35 | /* Prevent pops from unneeded switching */ | 35 | /* Prevent pops from unneeded switching */ |
36 | static int last_source = AUDIO_SRC_PLAYBACK; | 36 | static int last_source = AUDIO_SRC_PLAYBACK; |
37 | #ifdef HAVE_FMRADIO_REC | 37 | #ifdef HAVE_FMRADIO_REC |
38 | bool recording = flags & SRCF_RECORDING; | ||
38 | static bool last_recording = false; | 39 | static bool last_recording = false; |
39 | #endif | 40 | #endif |
40 | 41 | ||
@@ -62,6 +63,10 @@ void audio_input_mux(int source, unsigned flags) | |||
62 | #endif | 63 | #endif |
63 | #ifdef HAVE_LINEIN_REC | 64 | #ifdef HAVE_LINEIN_REC |
64 | case AUDIO_SRC_LINEIN: /* recording only */ | 65 | case AUDIO_SRC_LINEIN: /* recording only */ |
66 | #if defined(IRIVER_H10) || defined(IRIVER_H10_5GB) | ||
67 | /* Switch line in source to line-in */ | ||
68 | GPIO_SET_BITWISE(GPIOB_OUTPUT_VAL, 0x04); | ||
69 | #endif | ||
65 | if (source != last_source) | 70 | if (source != last_source) |
66 | { | 71 | { |
67 | audiohw_enable_recording(false); /* source line */ | 72 | audiohw_enable_recording(false); /* source line */ |
@@ -71,17 +76,20 @@ void audio_input_mux(int source, unsigned flags) | |||
71 | #endif | 76 | #endif |
72 | #ifdef HAVE_FMRADIO_REC | 77 | #ifdef HAVE_FMRADIO_REC |
73 | case AUDIO_SRC_FMRADIO: /* recording and playback */ | 78 | case AUDIO_SRC_FMRADIO: /* recording and playback */ |
79 | #if defined(IRIVER_H10) || defined(IRIVER_H10_5GB) | ||
80 | /* Switch line in source to tuner */ | ||
81 | GPIO_CLEAR_BITWISE(GPIOB_OUTPUT_VAL, 0x04); | ||
82 | #endif /* Set line-in vol to 0dB*/ | ||
74 | if (!recording) | 83 | if (!recording) |
75 | audiohw_set_recvol(0, 0, AUDIO_GAIN_LINEIN); | 84 | audiohw_set_recvol(0x17, 0x17, AUDIO_GAIN_LINEIN); |
76 | 85 | ||
77 | if (source == last_source && recording == last_recording) | 86 | if (source == last_source && recording == last_recording) |
78 | break; | 87 | break; |
79 | 88 | ||
80 | last_recording = recording; | 89 | last_recording = recording; |
81 | 90 | ||
82 | /* I2S recording and playback */ | 91 | audiohw_enable_recording(false); /* select line-in source */ |
83 | audiohw_enable_recording(false); /* source line */ | 92 | audiohw_set_monitor(!recording); /* enable bypass mode */ |
84 | audiohw_set_monitor(!recording); | ||
85 | break; | 93 | break; |
86 | #endif | 94 | #endif |
87 | } /* end switch */ | 95 | } /* end switch */ |