summaryrefslogtreecommitdiffstats
path: root/firmware/target/arm/imx233/audioin-imx233.c
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/target/arm/imx233/audioin-imx233.c')
-rw-r--r--firmware/target/arm/imx233/audioin-imx233.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/firmware/target/arm/imx233/audioin-imx233.c b/firmware/target/arm/imx233/audioin-imx233.c
index 4c2ee657f9..dcb9c7c4b4 100644
--- a/firmware/target/arm/imx233/audioin-imx233.c
+++ b/firmware/target/arm/imx233/audioin-imx233.c
@@ -18,10 +18,16 @@
* KIND, either express or implied.
*
****************************************************************************/
-#include "audioout-imx233.h"
+#include "audioin-imx233.h"
void imx233_audioin_preinit(void)
{
+ /* Enable AUDIOIN block */
+ imx233_reset_block(&HW_AUDIOIN_CTRL);
+ /* Enable ADC */
+ __REG_CLR(HW_AUDIOIN_ANACLKCTRL) = HW_AUDIOIN_ANACLKCTRL__CLKGATE;
+ /* Set word-length to 16-bit */
+ __REG_SET(HW_AUDIOIN_CTRL) = HW_AUDIOIN_CTRL__WORD_LENGTH;
}
void imx233_audioin_postinit(void)
@@ -30,4 +36,9 @@ void imx233_audioin_postinit(void)
void imx233_audioin_close(void)
{
+ /* TODO mute */
+ /* Gate off ADC */
+ __REG_SET(HW_AUDIOIN_ANACLKCTRL) = HW_AUDIOIN_ANACLKCTRL__CLKGATE;
+ /* will also gate off the module */
+ __REG_CLR(HW_AUDIOIN_CTRL) = HW_AUDIOIN_CTRL__RUN;
}