summaryrefslogtreecommitdiff
path: root/nuttx/configs/sama5d4-ek/src
diff options
context:
space:
mode:
authorGregory Nutt <gnutt@nuttx.org>2014-07-19 13:07:55 -0600
committerGregory Nutt <gnutt@nuttx.org>2014-07-19 13:07:55 -0600
commitaac310bd799c35e10f5c08513ce24ea2218bb024 (patch)
tree3026d8e8cd0b4472376dbd1d5eebde88e36fd085 /nuttx/configs/sama5d4-ek/src
parent00b2d4894179ea169fc8cc4cb44f48bb70fe2c42 (diff)
downloadpx4-nuttx-aac310bd799c35e10f5c08513ce24ea2218bb024.tar.gz
px4-nuttx-aac310bd799c35e10f5c08513ce24ea2218bb024.tar.bz2
px4-nuttx-aac310bd799c35e10f5c08513ce24ea2218bb024.zip
SAMA5: Add slow clock support
Diffstat (limited to 'nuttx/configs/sama5d4-ek/src')
-rw-r--r--nuttx/configs/sama5d4-ek/src/sam_wm8904.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/nuttx/configs/sama5d4-ek/src/sam_wm8904.c b/nuttx/configs/sama5d4-ek/src/sam_wm8904.c
index 09d188b84..78b169e04 100644
--- a/nuttx/configs/sama5d4-ek/src/sam_wm8904.c
+++ b/nuttx/configs/sama5d4-ek/src/sam_wm8904.c
@@ -49,10 +49,14 @@
#include <nuttx/audio/i2s.h>
#include <nuttx/audio/wm8904.h>
+#include <arch/board/board.h>
+
#include "up_arch.h"
#include "sam_pio.h"
#include "sam_twi.h"
#include "sam_ssc.h"
+#include "sam_sckc.h"
+#include "sam_pck.h"
#include "sama5d4-ek.h"
@@ -270,6 +274,18 @@ int sam_wm8904_initialize(int minor)
goto errout_with_i2s;
}
+ /* Configure the DAC master clock. This clock is provided by PCK0 (PB26)
+ * that is connected to the WM8904 BCLK/GPIO4 and also drives the SSC
+ * TK0 input clock.
+ */
+
+ sam_sckc_enable(true);
+ (void)sam_pck_configure(PCK0, BOARD_SLOWCLK_FREQUENCY);
+
+ /* Enable the DAC master clock */
+
+ sam_pck_enable(PCK0, true);
+
/* Configure WM8904 interrupts */
sam_pioirq(PIO_INT_WM8904);