summaryrefslogtreecommitdiff
path: root/firmware/target/arm/s5l8700/wmcodec-s5l8700.c
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/target/arm/s5l8700/wmcodec-s5l8700.c')
-rw-r--r--firmware/target/arm/s5l8700/wmcodec-s5l8700.c46
1 files changed, 46 insertions, 0 deletions
diff --git a/firmware/target/arm/s5l8700/wmcodec-s5l8700.c b/firmware/target/arm/s5l8700/wmcodec-s5l8700.c
new file mode 100644
index 0000000000..3c7c24994d
--- /dev/null
+++ b/firmware/target/arm/s5l8700/wmcodec-s5l8700.c
@@ -0,0 +1,46 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 * TCC specific code for Wolfson audio codecs
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 * This program is free software; you can redistribute it and/or
20 * modify it under the terms of the GNU General Public License
21 * as published by the Free Software Foundation; either version 2
22 * of the License, or (at your option) any later version.
23 *
24 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
25 * KIND, either express or implied.
26 *
27 ****************************************************************************/
28
29#include "system.h"
30#include "audiohw.h"
31#include "i2c-s5l8700.h"
32#include "wmcodec.h"
33
34void audiohw_init(void)
35{
36#if defined(HAVE_WM8731) || defined(HAVE_WM8751) || defined(HAVE_WM8985)
37 audiohw_preinit();
38#endif
39}
40
41void wmcodec_write(int reg, int data)
42{
43 unsigned char d = data & 0xff;
44
45 i2c_write(0x34, (reg << 1) | ((data & 0x100) >> 8), 1, &d);
46}