2007-09-21 15:51:53 +00:00
|
|
|
/***************************************************************************
|
|
|
|
* __________ __ ___.
|
|
|
|
* Open \______ \ ____ ____ | | _\_ |__ _______ ___
|
|
|
|
* Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
|
|
|
|
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
|
|
|
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
|
|
|
* \/ \/ \/ \/ \/
|
|
|
|
* $Id$
|
|
|
|
*
|
2010-04-09 01:21:53 +00:00
|
|
|
* Copyright (C) 2007 by Michael Sevakis
|
2007-09-21 15:51:53 +00:00
|
|
|
*
|
2008-06-28 18:10:04 +00:00
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
* of the License, or (at your option) any later version.
|
2007-09-21 15:51:53 +00:00
|
|
|
*
|
|
|
|
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
|
|
|
* KIND, either express or implied.
|
|
|
|
*
|
|
|
|
****************************************************************************/
|
2008-05-03 15:14:52 +00:00
|
|
|
#include "config.h"
|
|
|
|
#include "system.h"
|
2010-04-09 01:21:53 +00:00
|
|
|
#include "i2s.h"
|
2008-04-27 10:30:54 +00:00
|
|
|
|
2010-04-09 01:21:53 +00:00
|
|
|
void i2s_reset(void)
|
2007-09-21 15:51:53 +00:00
|
|
|
{
|
2008-11-22 12:17:26 +00:00
|
|
|
/* How SYSCLK for codec is derived (USBPLL=338.688MHz).
|
|
|
|
*
|
|
|
|
* SSI post dividers (SSI2 PODF=4, SSI2 PRE PODF=0):
|
2009-03-09 04:25:25 +00:00
|
|
|
* 338688000Hz / 5 = 67737600Hz = ssi1_clk
|
2008-11-22 12:17:26 +00:00
|
|
|
*
|
|
|
|
* SSI bit clock dividers (DIV2=1, PSR=0, PM=0):
|
2009-03-09 04:25:25 +00:00
|
|
|
* ssi1_clk / 4 = 16934400Hz = INT_BIT_CLK (MCLK)
|
2008-11-22 12:17:26 +00:00
|
|
|
*
|
|
|
|
* WM Codec post divider (MCLKDIV=1.5):
|
|
|
|
* INT_BIT_CLK (MCLK) / 1.5 = 11289600Hz = 256*fs = SYSCLK
|
|
|
|
*/
|
2010-06-30 02:02:46 +00:00
|
|
|
bitmod32(&CCM_PDR1,
|
|
|
|
((1-1) << CCM_PDR1_SSI1_PRE_PODF_POS) |
|
|
|
|
((5-1) << CCM_PDR1_SSI1_PODF_POS) |
|
|
|
|
((8-1) << CCM_PDR1_SSI2_PRE_PODF_POS) |
|
|
|
|
((64-1) << CCM_PDR1_SSI2_PODF_POS),
|
|
|
|
CCM_PDR1_SSI1_PODF | CCM_PDR1_SSI2_PODF |
|
|
|
|
CCM_PDR1_SSI1_PRE_PODF | CCM_PDR1_SSI2_PRE_PODF);
|
2007-09-21 15:51:53 +00:00
|
|
|
}
|