summaryrefslogtreecommitdiff
path: root/nuttx/configs/sama5d3x-ek/src
diff options
context:
space:
mode:
authorGregory Nutt <gnutt@nuttx.org>2014-08-03 11:01:02 -0600
committerGregory Nutt <gnutt@nuttx.org>2014-08-03 11:01:02 -0600
commit35b34c62b2540d2360bdfce132493fcdb97858af (patch)
treefc31fd617af4d1bfcd32f08c94610e4115c7768b /nuttx/configs/sama5d3x-ek/src
parent7a2b927bea5c999810c12d5bcca76ee91ab3d925 (diff)
downloadpx4-nuttx-35b34c62b2540d2360bdfce132493fcdb97858af.tar.gz
px4-nuttx-35b34c62b2540d2360bdfce132493fcdb97858af.tar.bz2
px4-nuttx-35b34c62b2540d2360bdfce132493fcdb97858af.zip
SAMA5 WM8904: Add option to use MAINCK as WM8904 MCLK
Diffstat (limited to 'nuttx/configs/sama5d3x-ek/src')
-rw-r--r--nuttx/configs/sama5d3x-ek/src/sam_wm8904.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/nuttx/configs/sama5d3x-ek/src/sam_wm8904.c b/nuttx/configs/sama5d3x-ek/src/sam_wm8904.c
index f1f955afb..d44f9523c 100644
--- a/nuttx/configs/sama5d3x-ek/src/sam_wm8904.c
+++ b/nuttx/configs/sama5d3x-ek/src/sam_wm8904.c
@@ -120,7 +120,11 @@ static struct sama5d3ek_mwinfo_s g_mxtinfo =
{
.address = WM8904_I2C_ADDRESS,
.frequency = CONFIG_SAMA5D3xEK_WM8904_I2CFREQUENCY,
+#ifdef CONFIG_SAMA5D3xEK_WM8904_SRCSCK
.mclk = BOARD_SLOWCLK_FREQUENCY,
+#else
+ .mclk = BOARD_MAINCK_FREQUENCY,
+#endif
.attach = wm8904_attach,
.enable = wm8904_enable,
@@ -281,8 +285,16 @@ int sam_wm8904_initialize(int minor)
* that is connected to the WM8904 MCLK.
*/
+#ifdef CONFIG_SAMA5D3xEK_WM8904_SRCSCK
+ /* Drive the DAC with the slow clock (32.768 KHz) */
+
sam_sckc_enable(true);
(void)sam_pck_configure(PCK0, PCKSRC_SCK, BOARD_SLOWCLK_FREQUENCY);
+#else
+ /* Drive the DAC with the main clock (12 MHz) */
+
+ (void)sam_pck_configure(PCK0, PCKSRC_MAINCK, BOARD_MAINCK_FREQUENCY);
+#endif
/* Enable the DAC master clock */