diff options
Diffstat (limited to 'firmware/target/arm/s3c2440/gigabeat-fx/wmcodec-meg-fx.c')
-rw-r--r-- | firmware/target/arm/s3c2440/gigabeat-fx/wmcodec-meg-fx.c | 71 |
1 files changed, 71 insertions, 0 deletions
diff --git a/firmware/target/arm/s3c2440/gigabeat-fx/wmcodec-meg-fx.c b/firmware/target/arm/s3c2440/gigabeat-fx/wmcodec-meg-fx.c new file mode 100644 index 0000000000..fe42b7527a --- /dev/null +++ b/firmware/target/arm/s3c2440/gigabeat-fx/wmcodec-meg-fx.c | |||
@@ -0,0 +1,71 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * $Id$ | ||
9 | * | ||
10 | * Gigabeat specific code for the Wolfson codec | ||
11 | * | ||
12 | * Based on code from the ipodlinux project - http://ipodlinux.org/ | ||
13 | * Adapted for Rockbox in December 2005 | ||
14 | * | ||
15 | * Original file: linux/arch/armnommu/mach-ipod/audio.c | ||
16 | * | ||
17 | * Copyright (c) 2003-2005 Bernard Leach (leachbj@bouncycastle.org) | ||
18 | * | ||
19 | * All files in this archive are subject to the GNU General Public License. | ||
20 | * See the file COPYING in the source tree root for full license agreement. | ||
21 | * | ||
22 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY | ||
23 | * KIND, either express or implied. | ||
24 | * | ||
25 | ****************************************************************************/ | ||
26 | #include "lcd.h" | ||
27 | #include "cpu.h" | ||
28 | #include "kernel.h" | ||
29 | #include "thread.h" | ||
30 | #include "power.h" | ||
31 | #include "debug.h" | ||
32 | #include "system.h" | ||
33 | #include "sprintf.h" | ||
34 | #include "button.h" | ||
35 | #include "string.h" | ||
36 | #include "file.h" | ||
37 | #include "buffer.h" | ||
38 | #include "audio.h" | ||
39 | #include "i2c.h" | ||
40 | #include "i2c-meg-fx.h" | ||
41 | /* | ||
42 | * Reset the I2S BIT.FORMAT I2S, 16bit, FIFO.FORMAT 32bit | ||
43 | */ | ||
44 | void i2s_reset(void) | ||
45 | { | ||
46 | } | ||
47 | |||
48 | /* | ||
49 | * Initialise the WM8975 for playback via headphone and line out. | ||
50 | * Note, I'm using the WM8750 datasheet as its apparently close. | ||
51 | */ | ||
52 | int audiohw_init(void) { | ||
53 | /* reset I2C */ | ||
54 | i2c_init(); | ||
55 | |||
56 | /* GPC5 controls headphone output */ | ||
57 | GPCCON &= ~(0x3 << 10); | ||
58 | GPCCON |= (1 << 10); | ||
59 | GPCDAT |= (1 << 5); | ||
60 | |||
61 | return 0; | ||
62 | } | ||
63 | |||
64 | void audiohw_postinit(void) | ||
65 | { | ||
66 | } | ||
67 | |||
68 | void wmcodec_write(int reg, int data) | ||
69 | { | ||
70 | i2c_send(0x34, (reg<<1) | ((data&0x100)>>8), data&0xff); | ||
71 | } | ||