summaryrefslogtreecommitdiffstats
path: root/firmware/target/arm/imx233/audioin-imx233.c
diff options
context:
space:
mode:
authorAmaury Pouly <amaury.pouly@gmail.com>2012-02-05 15:26:32 +0100
committerAmaury Pouly <amaury.pouly@gmail.com>2012-02-05 16:05:07 +0100
commit0aca81d807ed4159113fa7ae5bceaa6dee3abf38 (patch)
treef4ec92cb222ef56da42e387df6b46fff99cf03d4 /firmware/target/arm/imx233/audioin-imx233.c
parentcd89b31133334f97f841ecf52481c648173a05f9 (diff)
downloadrockbox-0aca81d807ed4159113fa7ae5bceaa6dee3abf38.tar.gz
rockbox-0aca81d807ed4159113fa7ae5bceaa6dee3abf38.tar.bz2
rockbox-0aca81d807ed4159113fa7ae5bceaa6dee3abf38.zip
imx233: add audioin init code, add adc dma interrupts, fix register defines
Change-Id: I204afbd3390f8dcde6ea1315ea6aa8dde12d3749
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;
}