1 /***************************************************************************
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
10 * TCC specific code for Wolfson audio codecs
12 * Based on code from the ipodlinux project - http://ipodlinux.org/
13 * Adapted for Rockbox in December 2005
15 * Original file: linux/arch/armnommu/mach-ipod/audio.c
17 * Copyright (c) 2003-2005 Bernard Leach (leachbj@bouncycastle.org)
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.
24 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
25 * KIND, either express or implied.
27 ****************************************************************************/
35 /* The D2's audio codec uses an I2C address of 0x34 */
36 #define I2C_AUDIO_ADDRESS 0x34
37 #elif defined (IAUDIO_7) || defined(LOGIK_DAX) || defined(SANSA_M200)
38 #define I2C_AUDIO_ADDRESS 0x34
40 #error wmcodec not implemented for this target!
44 void audiohw_init(void)
46 #if defined(HAVE_WM8731) || defined(HAVE_WM8751) || defined(HAVE_WM8985)
51 void wmcodec_write(int reg
, int data
)
54 d
[0] = (reg
<< 1) | ((data
& 0x100) >> 8);
57 i2c_write(I2C_AUDIO_ADDRESS
, d
, 2);