Update the manual according to the changes in r26587 (PLA_EXIT and PLA_CANCEL on...
[kugel-rb.git] / firmware / target / coldfire / wmcodec-coldfire.c
blob4403b9a2a287026d10514cfd5d433a5f6a8266e4
1 /***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id:$
10 * Coldfire specific code for Wolfson audio codecs based on
11 * wmcodec-pp.c
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 ****************************************************************************/
29 #include "system.h"
30 #include "audiohw.h"
31 #include "i2c-coldfire.h"
32 #include "i2s.h"
33 #include "wmcodec.h"
35 #if defined(MPIO_HD200)
36 #define I2C_CODEC_ADDRESS 0x34
37 #define I2C_IFACE I2C_IFACE_1
38 #endif
40 void audiohw_init(void)
42 audiohw_preinit();
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);
51 return;