diff options
author | Dave Chapman <dave@dchapman.com> | 2008-10-31 00:16:42 +0000 |
---|---|---|
committer | Dave Chapman <dave@dchapman.com> | 2008-10-31 00:16:42 +0000 |
commit | 42f77d4eb027afed4f4ef80f10c16112c2b7fe2b (patch) | |
tree | 2da09bcab257322dce48ddccc4a71d915318aa3a /firmware/target/arm/ascodec-pp.c | |
parent | 324816f0190dec308f3496a288820a47926b1c17 (diff) | |
download | rockbox-42f77d4eb027afed4f4ef80f10c16112c2b7fe2b.tar.gz rockbox-42f77d4eb027afed4f4ef80f10c16112c2b7fe2b.zip |
Abstract the PortalPlayer AS3514 handling with an "ascodec" API - inspired by the wmcodec API used with the Wolfson codecs. The intention is to implement this API for the AS3525 and then share code with the Sansa V2 ports.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18940 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/target/arm/ascodec-pp.c')
-rw-r--r-- | firmware/target/arm/ascodec-pp.c | 66 |
1 files changed, 66 insertions, 0 deletions
diff --git a/firmware/target/arm/ascodec-pp.c b/firmware/target/arm/ascodec-pp.c new file mode 100644 index 0000000000..30b6b1f8de --- /dev/null +++ b/firmware/target/arm/ascodec-pp.c | |||
@@ -0,0 +1,66 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * $Id$ | ||
9 | * | ||
10 | * Driver for AS3514 audio codec | ||
11 | * | ||
12 | * Copyright (c) 2007 Daniel Ankers | ||
13 | * Copyright (c) 2007 Christian Gmeiner | ||
14 | * | ||
15 | * This program is free software; you can redistribute it and/or | ||
16 | * modify it under the terms of the GNU General Public License | ||
17 | * as published by the Free Software Foundation; either version 2 | ||
18 | * of the License, or (at your option) any later version. | ||
19 | * | ||
20 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY | ||
21 | * KIND, either express or implied. | ||
22 | * | ||
23 | ****************************************************************************/ | ||
24 | #include "cpu.h" | ||
25 | #include "system.h" | ||
26 | |||
27 | #include "audiohw.h" | ||
28 | #include "i2s.h" | ||
29 | |||
30 | /* | ||
31 | * Initialise the PP I2C and I2S. | ||
32 | */ | ||
33 | void audiohw_init(void) | ||
34 | { | ||
35 | /* normal outputs for CDI and I2S pin groups */ | ||
36 | DEV_INIT2 &= ~0x300; | ||
37 | |||
38 | /*mini2?*/ | ||
39 | DEV_INIT1 &=~0x3000000; | ||
40 | /*mini2?*/ | ||
41 | |||
42 | /* device reset */ | ||
43 | DEV_RS |= DEV_I2S; | ||
44 | DEV_RS &=~DEV_I2S; | ||
45 | |||
46 | /* I2S device reset */ | ||
47 | DEV_RS |= DEV_I2S; | ||
48 | DEV_RS &=~DEV_I2S; | ||
49 | |||
50 | /* I2S device enable */ | ||
51 | DEV_EN |= DEV_I2S; | ||
52 | |||
53 | /* enable external dev clock clocks */ | ||
54 | DEV_EN |= DEV_EXTCLOCKS; | ||
55 | |||
56 | /* external dev clock to 24MHz */ | ||
57 | outl(inl(0x70000018) & ~0xc, 0x70000018); | ||
58 | |||
59 | i2s_reset(); | ||
60 | |||
61 | audiohw_preinit(); | ||
62 | } | ||
63 | |||
64 | void audiohw_postinit(void) | ||
65 | { | ||
66 | } | ||