1 /***************************************************************************
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
10 * Coldfire specific code for Wolfson audio codecs based on
13 * Based on code from the ipodlinux project - http://ipodlinux.org/
14 * Adapted for Rockbox in December 2005
16 * Original file: linux/arch/armnommu/mach-ipod/audio.c
18 * Copyright (c) 2003-2005 Bernard Leach (leachbj@bouncycastle.org)
20 * This program is free software; you can redistribute it and/or
21 * modify it under the terms of the GNU General Public License
22 * as published by the Free Software Foundation; either version 2
23 * of the License, or (at your option) any later version.
25 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
26 * KIND, either express or implied.
28 ****************************************************************************/
31 #include "i2c-coldfire.h"
35 #if defined(MPIO_HD200)
36 #define I2C_CODEC_ADDRESS 0x34
37 #define I2C_IFACE I2C_IFACE_1
40 void audiohw_init(void)
45 void wmcodec_write(int reg
, int data
)
47 unsigned char wmdata
[2];
48 wmdata
[0] = (reg
<< 1) | ((data
& 0x100)>>8);
49 wmdata
[1] = data
& 0xff;
50 i2c_write(I2C_IFACE
,I2C_CODEC_ADDRESS
,wmdata
,2);