summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--firmware/export/config-h100.h3
-rw-r--r--firmware/export/config-h120.h3
-rw-r--r--firmware/pcm_playback.c13
3 files changed, 18 insertions, 1 deletions
diff --git a/firmware/export/config-h100.h b/firmware/export/config-h100.h
index 1327be7..7aeb42a 100644
--- a/firmware/export/config-h100.h
+++ b/firmware/export/config-h100.h
@@ -104,6 +104,9 @@
#endif
+/* Define this for S/PDIF output available */
+#define HAVE_SPDIF_OUT
+
/* Define this if you can control the S/PDIF power */
#define HAVE_SPDIF_POWER
#define SPDIF_POWER_INVERTED
diff --git a/firmware/export/config-h120.h b/firmware/export/config-h120.h
index fd001a4..5c6f763 100644
--- a/firmware/export/config-h120.h
+++ b/firmware/export/config-h120.h
@@ -99,6 +99,9 @@
#endif
+/* Define this for S/PDIF output available */
+#define HAVE_SPDIF_OUT
+
/* Define this if you can control the S/PDIF power */
#define HAVE_SPDIF_POWER
diff --git a/firmware/pcm_playback.c b/firmware/pcm_playback.c
index 05c5447..79eefe3 100644
--- a/firmware/pcm_playback.c
+++ b/firmware/pcm_playback.c
@@ -47,7 +47,9 @@
#ifdef HAVE_UDA1380
+#ifdef HAVE_SPDIF_OUT
#define EBU_DEFPARM ((7 << 12) | (3 << 8) | (1 << 5) | (5 << 2))
+#endif
#define IIS_DEFPARM(freq) ((freq << 12) | 0x300 | 4 << 2)
#define IIS_RESET 0x800
@@ -67,8 +69,9 @@ static void dma_start(const void *addr, long size)
size &= ~3; /* Size must be multiple of 4 */
/* Reset the audio FIFO */
- //IIS2CONFIG = IIS_RESET;
+#ifdef HAVE_SPDIF_OUT
EBU1CONFIG = IIS_RESET;
+#endif
/* Set up DMA transfer */
SAR0 = ((unsigned long)addr); /* Source address */
@@ -78,7 +81,9 @@ static void dma_start(const void *addr, long size)
/* Enable the FIFO and force one write to it */
IIS2CONFIG = IIS_DEFPARM(pcm_freq);
/* Also send the audio to S/PDIF */
+#ifdef HAVE_SPDIF_OUT
EBU1CONFIG = EBU_DEFPARM;
+#endif
DCR0 = DMA_INT | DMA_EEXT | DMA_CS | DMA_SINC | DMA_START;
}
@@ -90,7 +95,9 @@ static void dma_stop(void)
DCR0 = 0;
/* Reset the FIFO */
IIS2CONFIG = IIS_RESET | IIS_DEFPARM(pcm_freq);
+#ifdef HAVE_SPDIF_OUT
EBU1CONFIG = IIS_RESET;
+#endif
next_start = NULL;
next_size = 0;
@@ -220,7 +227,9 @@ void pcm_play_pause(bool play)
//BCR0 = next_size;
/* Enable the FIFO and force one write to it */
IIS2CONFIG = IIS_DEFPARM(pcm_freq);
+#ifdef HAVE_SPDIF_OUT
EBU1CONFIG = EBU_DEFPARM;
+#endif
DCR0 |= DMA_EEXT | DMA_START;
}
else if(!pcm_paused && !play)
@@ -230,7 +239,9 @@ void pcm_play_pause(bool play)
/* Disable DMA peripheral request. */
DCR0 &= ~DMA_EEXT;
IIS2CONFIG = IIS_RESET | IIS_DEFPARM(pcm_freq);
+#ifdef HAVE_SPDIF_OUT
EBU1CONFIG = IIS_RESET;
+#endif
}
pcm_paused = !play;
}