diff options
Diffstat (limited to 'firmware/target')
-rw-r--r-- | firmware/target/coldfire/iriver/h100/spdif-h100.c | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/firmware/target/coldfire/iriver/h100/spdif-h100.c b/firmware/target/coldfire/iriver/h100/spdif-h100.c index 20e5bc3c45..8de96238a5 100644 --- a/firmware/target/coldfire/iriver/h100/spdif-h100.c +++ b/firmware/target/coldfire/iriver/h100/spdif-h100.c | |||
@@ -62,16 +62,34 @@ void spdif_set_output_source(int source, bool src_on) | |||
62 | [AUDIO_SRC_FMRADIO+1] = (7 << 12) | (4 << 8) | (1 << 5) | (5 << 2), | 62 | [AUDIO_SRC_FMRADIO+1] = (7 << 12) | (4 << 8) | (1 << 5) | (5 << 2), |
63 | }; | 63 | }; |
64 | 64 | ||
65 | int level; | ||
66 | unsigned long playing, recording; | ||
67 | |||
65 | if ((unsigned)source >= ARRAYLEN(ebu1_config)) | 68 | if ((unsigned)source >= ARRAYLEN(ebu1_config)) |
66 | source = AUDIO_SRC_PLAYBACK; | 69 | source = AUDIO_SRC_PLAYBACK; |
67 | 70 | ||
68 | EBU1CONFIG = 0x800; /* Reset before reprogram */ | ||
69 | |||
70 | spdif_source = source; | 71 | spdif_source = source; |
71 | spdif_on = spdif_powered() && src_on; | 72 | spdif_on = spdif_powered() && src_on; |
72 | 73 | ||
74 | level = set_irq_level(HIGHEST_IRQ_LEVEL); | ||
75 | |||
76 | /* Check if DMA peripheral requests are enabled */ | ||
77 | playing = DCR0 & DMA_EEXT; | ||
78 | recording = DCR1 & DMA_EEXT; | ||
79 | |||
80 | EBU1CONFIG = 0x800; /* Reset before reprogram */ | ||
81 | |||
73 | /* Tranceiver must be powered or else monitoring will be disabled */ | 82 | /* Tranceiver must be powered or else monitoring will be disabled */ |
74 | EBU1CONFIG = spdif_on ? ebu1_config[source + 1] : 0; | 83 | EBU1CONFIG = spdif_on ? ebu1_config[source + 1] : 0; |
84 | |||
85 | /* Kick-start DMAs if in progress */ | ||
86 | if (recording) | ||
87 | DCR1 |= DMA_START; | ||
88 | |||
89 | if (playing) | ||
90 | DCR0 |= DMA_START; | ||
91 | |||
92 | set_irq_level(level); | ||
75 | } /* spdif_set_output_source */ | 93 | } /* spdif_set_output_source */ |
76 | 94 | ||
77 | /* Return the last set S/PDIF audio source */ | 95 | /* Return the last set S/PDIF audio source */ |