summaryrefslogtreecommitdiff
path: root/firmware/target/arm/s3c2440/gigabeat-fx/wmcodec-meg-fx.c
diff options
context:
space:
mode:
authorMarcoen Hirschberg <marcoen@gmail.com>2007-04-18 12:22:27 +0000
committerMarcoen Hirschberg <marcoen@gmail.com>2007-04-18 12:22:27 +0000
commitf44f961812c059b69df19ac5bd828986ba10513f (patch)
tree9b19de69126ed041992f31a7c690db841a36af6f /firmware/target/arm/s3c2440/gigabeat-fx/wmcodec-meg-fx.c
parentc3dcc87aa494934943769b70fd752af1271d196a (diff)
downloadrockbox-f44f961812c059b69df19ac5bd828986ba10513f.tar.gz
rockbox-f44f961812c059b69df19ac5bd828986ba10513f.zip
move the Gigabeat from gigabeat/meg-fx to s3c2440/gigabeat-fx to avoid problems with possible ports in the future: Gigabeat S/V (i.mx31 based) and Kenwood HD20GA7/HD20GA9 (s3c2440 based)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13200 a1c6a512-1295-4272-9138-f99709370657
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.c71
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 */
44void 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 */
52int 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
64void audiohw_postinit(void)
65{
66}
67
68void wmcodec_write(int reg, int data)
69{
70 i2c_send(0x34, (reg<<1) | ((data&0x100)>>8), data&0xff);
71}