diff options
author | Michael Sevakis <jethead71@rockbox.org> | 2006-12-05 07:38:55 +0000 |
---|---|---|
committer | Michael Sevakis <jethead71@rockbox.org> | 2006-12-05 07:38:55 +0000 |
commit | 81484e4b759f088033755e5edb07422d5ee70a2b (patch) | |
tree | fcac1a645a9fc6284c736b862254c76fba2c0779 /firmware/target | |
parent | 82cdc6914db939a842a4bf8182da904edcd11e1c (diff) | |
download | rockbox-81484e4b759f088033755e5edb07422d5ee70a2b.tar.gz rockbox-81484e4b759f088033755e5edb07422d5ee70a2b.zip |
H1x0: Enable optical output to be switched on or off during playback and recording. Fixes FS#6414 - H120 opto out toggle freezes codec. Really DMA just needed a kickstart after setting the optical TXSRC if the peripheral requests were currently enabled (the method of detection).
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@11661 a1c6a512-1295-4272-9138-f99709370657
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 */ |