summaryrefslogtreecommitdiff
path: root/firmware/target/arm/gigabeat/meg-fx/wmcodec-meg-fx.c
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/target/arm/gigabeat/meg-fx/wmcodec-meg-fx.c')
-rw-r--r--firmware/target/arm/gigabeat/meg-fx/wmcodec-meg-fx.c61
1 files changed, 61 insertions, 0 deletions
diff --git a/firmware/target/arm/gigabeat/meg-fx/wmcodec-meg-fx.c b/firmware/target/arm/gigabeat/meg-fx/wmcodec-meg-fx.c
new file mode 100644
index 0000000000..a793f5a1f4
--- /dev/null
+++ b/firmware/target/arm/gigabeat/meg-fx/wmcodec-meg-fx.c
@@ -0,0 +1,61 @@
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/*
41 * Reset the I2S BIT.FORMAT I2S, 16bit, FIFO.FORMAT 32bit
42 */
43void i2s_reset(void)
44{
45}
46
47/*
48 * Initialise the WM8975 for playback via headphone and line out.
49 * Note, I'm using the WM8750 datasheet as its apparently close.
50 */
51int wmcodec_init(void) {
52 /* reset I2C */
53 i2c_init();
54
55 return 0;
56}
57
58void wmcodec_write(int reg, int data)
59{
60 i2c_send(0x34, (reg<<1) | ((data&0x100)>>8),data&0xff);
61}