Straighten out some audio path APIs and misc. audio stuff. Having recording is not a prerequisite to having input/output source selection which is probably most useful when adding a audio input features like FM to a new port without forcing recording to be implemented first.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13599 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Michael Sevakis 2007-06-08 23:42:04 +00:00
parent a85793fc54
commit 2d48d0ffa6
22 changed files with 237 additions and 154 deletions

View file

@ -29,7 +29,7 @@ void audio_set_output_source(int source)
source = AUDIO_SRC_PLAYBACK;
} /* audio_set_output_source */
void audio_set_source(int source, unsigned flags)
void audio_input_mux(int source, unsigned flags)
{
(void)flags;
/* Prevent pops from unneeded switching */
@ -87,6 +87,6 @@ void audio_set_source(int source, unsigned flags)
} /* end switch */
last_source = source;
} /* audio_set_source */
} /* audio_input_mux */

View file

@ -39,7 +39,7 @@ void audio_set_output_source(int source)
set_fiq_status(oldmode);
} /* audio_set_output_source */
void audio_set_source(int source, unsigned flags)
void audio_input_mux(int source, unsigned flags)
{
static int last_source = AUDIO_SRC_PLAYBACK;
static bool last_recording = false;
@ -89,6 +89,4 @@ void audio_set_source(int source, unsigned flags)
} /* end switch */
last_source = source;
} /* audio_set_source */
} /* audio_input_mux */

View file

@ -35,7 +35,7 @@ void audio_set_output_source(int source)
set_irq_level(level);
} /* audio_set_output_source */
void audio_set_source(int source, unsigned flags)
void audio_input_mux(int source, unsigned flags)
{
/* Prevent pops from unneeded switching */
static int last_source = AUDIO_SRC_PLAYBACK;
@ -79,5 +79,4 @@ void audio_set_source(int source, unsigned flags)
or_l((1 << 29), &GPIO_FUNCTION);
last_source = source;
} /* audio_set_source */
} /* audio_input_mux */

View file

@ -35,7 +35,7 @@ void audio_set_output_source(int source)
set_irq_level(level);
} /* audio_set_output_source */
void audio_set_source(int source, unsigned flags)
void audio_input_mux(int source, unsigned flags)
{
/* Prevent pops from unneeded switching */
static int last_source = AUDIO_SRC_PLAYBACK;
@ -109,5 +109,5 @@ void audio_set_source(int source, unsigned flags)
or_l((1 << 29), &GPIO_FUNCTION);
last_source = source;
} /* audio_set_source */
} /* audio_input_mux */

View file

@ -44,7 +44,7 @@ void audio_set_output_source(int source)
set_irq_level(level);
} /* audio_set_output_source */
void audio_set_source(int source, unsigned flags)
void audio_input_mux(int source, unsigned flags)
{
/* Prevent pops from unneeded switching */
static int last_source = AUDIO_SRC_PLAYBACK;
@ -131,6 +131,4 @@ void audio_set_source(int source, unsigned flags)
or_l(MUX_BIT, &GPIO_FUNCTION);
last_source = source;
} /* audio_set_source */
} /* audio_input_mux */

View file

@ -89,7 +89,8 @@ void spdif_power_enable(bool on)
#ifndef BOOTLOADER
/* Make sure the feed is reset */
spdif_set_output_source(spdif_get_output_source(NULL), true);
spdif_set_output_source(spdif_get_output_source(NULL)
IF_SPDIF_POWER_(, true));
#endif
}

View file

@ -33,7 +33,8 @@ void spdif_init(void)
{
/* PHASECONFIG setup: gain = 3*2^13, source = EBUIN */
PHASECONFIG = (6 << 3) | (4 << 0);
spdif_set_output_source(AUDIO_SRC_PLAYBACK, true);
spdif_set_output_source(AUDIO_SRC_PLAYBACK
IF_SPDIF_POWER_(, true));
}
/* Return the S/PDIF frequency in herz - unrounded */

View file

@ -271,7 +271,7 @@ void pcm_init(void)
/* Initialize default register values. */
audiohw_init();
audio_set_source(AUDIO_SRC_PLAYBACK, SRCF_PLAYBACK);
audio_input_mux(AUDIO_SRC_PLAYBACK, SRCF_PLAYBACK);
audiohw_set_frequency(freq_ent[FPARM_FSEL]);
coldfire_set_pllcr_audio_bits(PLLCR_SET_AUDIO_BITS_DEFPARM);