2006-10-20 17:12:42 +00:00
|
|
|
/***************************************************************************
|
|
|
|
* __________ __ ___.
|
|
|
|
* Open \______ \ ____ ____ | | _\_ |__ _______ ___
|
|
|
|
* Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
|
|
|
|
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
|
|
|
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
|
|
|
* \/ \/ \/ \/ \/
|
|
|
|
* $Id$
|
|
|
|
*
|
|
|
|
* Gigabeat specific code for the Wolfson codec
|
|
|
|
*
|
|
|
|
* Based on code from the ipodlinux project - http://ipodlinux.org/
|
|
|
|
* Adapted for Rockbox in December 2005
|
|
|
|
*
|
|
|
|
* Original file: linux/arch/armnommu/mach-ipod/audio.c
|
|
|
|
*
|
|
|
|
* Copyright (c) 2003-2005 Bernard Leach (leachbj@bouncycastle.org)
|
|
|
|
*
|
2008-06-28 18:10:04 +00:00
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
* of the License, or (at your option) any later version.
|
2006-10-20 17:12:42 +00:00
|
|
|
*
|
|
|
|
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
|
|
|
* KIND, either express or implied.
|
|
|
|
*
|
|
|
|
****************************************************************************/
|
|
|
|
#include "cpu.h"
|
|
|
|
#include "kernel.h"
|
2007-05-03 18:08:00 +00:00
|
|
|
#include "sound.h"
|
2006-10-27 10:51:34 +00:00
|
|
|
#include "i2c-meg-fx.h"
|
2008-07-18 23:28:54 +00:00
|
|
|
#include "wmcodec.h"
|
2006-10-20 17:12:42 +00:00
|
|
|
|
2007-06-13 06:49:37 +00:00
|
|
|
void audiohw_init(void)
|
2007-05-03 18:08:00 +00:00
|
|
|
{
|
2006-12-29 02:49:12 +00:00
|
|
|
/* GPC5 controls headphone output */
|
|
|
|
GPCCON &= ~(0x3 << 10);
|
|
|
|
GPCCON |= (1 << 10);
|
|
|
|
GPCDAT |= (1 << 5);
|
2006-10-20 17:12:42 +00:00
|
|
|
|
2007-05-03 18:08:00 +00:00
|
|
|
audiohw_preinit();
|
2007-03-11 05:04:48 +00:00
|
|
|
}
|
|
|
|
|
2006-10-20 17:12:42 +00:00
|
|
|
void wmcodec_write(int reg, int data)
|
|
|
|
{
|
2007-06-26 02:11:30 +00:00
|
|
|
unsigned char d[2];
|
|
|
|
d[0] = (reg << 1) | ((data & 0x100) >> 8);
|
|
|
|
d[1] = data;
|
|
|
|
i2c_write(0x34, d, 2);
|
2006-10-20 17:12:42 +00:00
|
|
|
}
|