rockbox/firmware/target/arm/imx31/gigabeat-s/audio-gigabeat-s.c
Nils Wallménius 65f61d6cce FS#9609 FM radio support for the Gigabeat S, seeking/scanning is not yet
implemented but manual tuning works nicely. Thanks to Rafaël Carré,
Bertrik Sikken and Robert Menes for suggestions and debugging help.



git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19372 a1c6a512-1295-4272-9138-f99709370657
2008-12-09 20:48:04 +00:00

56 lines
2.1 KiB
C

/***************************************************************************
* __________ __ ___.
* Open \______ \ ____ ____ | | _\_ |__ _______ ___
* Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
* \/ \/ \/ \/ \/
* $Id$
*
* Copyright (C) 2008 by Nils Wallménius
*
* 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.
*
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
* KIND, either express or implied.
*
****************************************************************************/
#include "wm8978.h"
#include "audio.h"
void audio_set_output_source(int source)
{
(void)source; /* TODO */
}
void audio_input_mux(int source, unsigned int flags)
{
(void)flags;
switch (source)
{
case AUDIO_SRC_PLAYBACK:
/* deselect bypass patths and set volume to -15dB */
wmc_clear(WMC_LEFT_MIXER_CTRL, (WMC_BYPL2LMIX) | (7<<2));
wmc_clear(WMC_RIGHT_MIXER_CTRL, (WMC_BYPR2RMIX) | (7<<2));
/* disable L2/R2 inputs and boost stage */
wmc_clear(WMC_POWER_MANAGEMENT2,
WMC_INPPGAENR | WMC_INPPGAENL | WMC_BOOSTENL | WMC_BOOSTENR);
break;
case AUDIO_SRC_FMRADIO:
/* enable L2/R2 inputs and boost stage */
wmc_set(WMC_POWER_MANAGEMENT2,
WMC_INPPGAENR | WMC_INPPGAENL | WMC_BOOSTENL | WMC_BOOSTENR);
/* select bypass patths and set volume to 0dB */
wmc_set(WMC_LEFT_MIXER_CTRL, (WMC_BYPL2LMIX) | (5<<2));
wmc_set(WMC_RIGHT_MIXER_CTRL, (WMC_BYPR2RMIX) | (5<<2));
break;
default:
source = AUDIO_SRC_PLAYBACK;
}
}