summaryrefslogtreecommitdiff
path: root/firmware/target/coldfire
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/target/coldfire')
-rw-r--r--firmware/target/coldfire/iaudio/x5/audio-x5.c20
-rw-r--r--firmware/target/coldfire/iriver/audio-iriver.c26
-rw-r--r--firmware/target/coldfire/pcm-coldfire.c19
3 files changed, 27 insertions, 38 deletions
diff --git a/firmware/target/coldfire/iaudio/x5/audio-x5.c b/firmware/target/coldfire/iaudio/x5/audio-x5.c
index 70d5313a7e..0e2ba60c1d 100644
--- a/firmware/target/coldfire/iaudio/x5/audio-x5.c
+++ b/firmware/target/coldfire/iaudio/x5/audio-x5.c
@@ -23,7 +23,7 @@
/**
* Note that microphone is mono, only left value is used
- * See tlv320_set_recvol() for exact ranges.
+ * See audiohw_set_recvol() for exact ranges.
*
* @param type AUDIO_GAIN_MIC, AUDIO_GAIN_LINEIN
*
@@ -31,7 +31,7 @@
void audio_set_recording_gain(int left, int right, int type)
{
//logf("rcmrec: t=%d l=%d r=%d", type, left, right);
- tlv320_set_recvol(left, right, type);
+ audiohw_set_recvol(left, right, type);
} /* audio_set_recording_gain */
void audio_set_output_source(int source)
@@ -61,8 +61,8 @@ void audio_set_source(int source, unsigned flags)
case AUDIO_SRC_PLAYBACK:
if (source != last_source)
{
- tlv320_disable_recording();
- tlv320_set_monitor(false);
+ audiohw_disable_recording();
+ audiohw_set_monitor(false);
/* Reset PDIR2 data flow */
DATAINCONTROL = (1 << 9);
}
@@ -71,7 +71,7 @@ void audio_set_source(int source, unsigned flags)
case AUDIO_SRC_MIC: /* recording only */
if (source != last_source)
{
- tlv320_enable_recording(true); /* source mic */
+ audiohw_enable_recording(true); /* source mic */
/* Int. when 6 samples in FIFO, PDIR2 src = iis1RcvData */
DATAINCONTROL = (3 << 14) | (4 << 3);
}
@@ -80,7 +80,7 @@ void audio_set_source(int source, unsigned flags)
case AUDIO_SRC_LINEIN: /* recording only */
if (source != last_source)
{
- tlv320_enable_recording(false); /* source line */
+ audiohw_enable_recording(false); /* source line */
/* Int. when 6 samples in FIFO, PDIR2 src = iis1RcvData */
DATAINCONTROL = (3 << 14) | (4 << 3);
}
@@ -88,7 +88,7 @@ void audio_set_source(int source, unsigned flags)
case AUDIO_SRC_FMRADIO: /* recording and playback */
if (!recording)
- tlv320_set_recvol(23, 23, AUDIO_GAIN_LINEIN);
+ audiohw_set_recvol(23, 23, AUDIO_GAIN_LINEIN);
/* I2S recording and analog playback */
if (source == last_source && recording == last_recording)
@@ -100,12 +100,12 @@ void audio_set_source(int source, unsigned flags)
{
/* Int. when 6 samples in FIFO, PDIR2 src = iis1RcvData */
DATAINCONTROL = (3 << 14) | (4 << 3);
- tlv320_enable_recording(false); /* source line */
+ audiohw_enable_recording(false); /* source line */
}
else
{
- tlv320_disable_recording();
- tlv320_set_monitor(true); /* analog bypass */
+ audiohw_disable_recording();
+ audiohw_set_monitor(true); /* analog bypass */
/* Reset PDIR2 data flow */
DATAINCONTROL = (1 << 9);
}
diff --git a/firmware/target/coldfire/iriver/audio-iriver.c b/firmware/target/coldfire/iriver/audio-iriver.c
index 420ca309d8..5a5e80bc46 100644
--- a/firmware/target/coldfire/iriver/audio-iriver.c
+++ b/firmware/target/coldfire/iriver/audio-iriver.c
@@ -23,7 +23,7 @@
/**
* Note that microphone is mono, only left value is used
- * See uda1380_set_recvol() for exact ranges.
+ * See audiohw_set_recvol() for exact ranges.
*
* @param type AUDIO_GAIN_MIC, AUDIO_GAIN_LINEIN
*
@@ -31,7 +31,7 @@
void audio_set_recording_gain(int left, int right, int type)
{
//logf("rcmrec: t=%d l=%d r=%d", type, left, right);
- uda1380_set_recvol(left, right, type);
+ audiohw_set_recvol(left, right, type);
} /* audio_set_recording_gain */
void audio_set_output_source(int source)
@@ -67,8 +67,8 @@ void audio_set_source(int source, unsigned flags)
case AUDIO_SRC_PLAYBACK:
if (source != last_source)
{
- uda1380_disable_recording();
- uda1380_set_monitor(false);
+ audiohw_disable_recording();
+ audiohw_set_monitor(false);
/* Reset PDIR2 data flow */
DATAINCONTROL = (1 << 9);
}
@@ -77,8 +77,8 @@ void audio_set_source(int source, unsigned flags)
case AUDIO_SRC_MIC: /* recording only */
if (source != last_source)
{
- uda1380_enable_recording(true); /* source mic */
- uda1380_set_monitor(false);
+ audiohw_enable_recording(true); /* source mic */
+ audiohw_set_monitor(false);
/* Int. when 6 samples in FIFO, PDIR2 src = iis1RcvData */
DATAINCONTROL = (3 << 14) | (4 << 3);
}
@@ -87,8 +87,8 @@ void audio_set_source(int source, unsigned flags)
case AUDIO_SRC_LINEIN: /* recording only */
if (source != last_source)
{
- uda1380_enable_recording(false); /* source line */
- uda1380_set_monitor(false);
+ audiohw_enable_recording(false); /* source line */
+ audiohw_set_monitor(false);
/* Int. when 6 samples in FIFO, PDIR2 src = iis1RcvData */
DATAINCONTROL = (3 << 14) | (4 << 3);
}
@@ -98,8 +98,8 @@ void audio_set_source(int source, unsigned flags)
case AUDIO_SRC_SPDIF: /* recording only */
if (source != last_source)
{
- uda1380_disable_recording();
- uda1380_set_monitor(false);
+ audiohw_disable_recording();
+ audiohw_set_monitor(false);
/* Int. when 6 samples in FIFO, PDIR2 src = ebu1RcvData */
DATAINCONTROL = (3 << 14) | (7 << 3);
}
@@ -108,7 +108,7 @@ void audio_set_source(int source, unsigned flags)
case AUDIO_SRC_FMRADIO: /* recording and playback */
if (!recording)
- uda1380_set_recvol(0, 0, AUDIO_GAIN_LINEIN);
+ audiohw_set_recvol(0, 0, AUDIO_GAIN_LINEIN);
if (source == last_source && recording == last_recording)
break;
@@ -127,8 +127,8 @@ void audio_set_source(int source, unsigned flags)
}
/* I2S recording and playback */
- uda1380_enable_recording(false); /* source line */
- uda1380_set_monitor(!recording);
+ audiohw_enable_recording(false); /* source line */
+ audiohw_set_monitor(!recording);
break;
} /* end switch */
diff --git a/firmware/target/coldfire/pcm-coldfire.c b/firmware/target/coldfire/pcm-coldfire.c
index 4e4e557d9b..6db3e943dc 100644
--- a/firmware/target/coldfire/pcm-coldfire.c
+++ b/firmware/target/coldfire/pcm-coldfire.c
@@ -30,17 +30,6 @@
#include "spdif.h"
#endif
-/* Avoid further #ifdef's for some codec functions */
-#if defined(HAVE_UDA1380)
-#define ac_init uda1380_init
-#define ac_mute uda1380_mute
-#define ac_set_frequency uda1380_set_frequency
-#elif defined(HAVE_TLV320)
-#define ac_init tlv320_init
-#define ac_mute tlv320_mute
-#define ac_set_frequency tlv320_set_frequency
-#endif
-
/* peaks */
static int play_peak_left, play_peak_right;
static unsigned long *rec_peak_addr;
@@ -136,7 +125,7 @@ void pcm_apply_settings(bool reset)
if (pcm_freq != last_pcm_freq)
{
last_pcm_freq = pcm_freq;
- ac_set_frequency(freq_ent[FPARM_FSEL]);
+ audiohw_set_frequency(freq_ent[FPARM_FSEL]);
coldfire_set_pllcr_audio_bits(PLLCR_SET_AUDIO_BITS_DEFPARM);
}
@@ -211,7 +200,7 @@ void pcm_init(void)
#endif
/* Initialize default register values. */
- ac_init();
+ audiohw_init();
#if defined(HAVE_UDA1380)
/* Sleep a while so the power can stabilize (especially a long
@@ -225,7 +214,7 @@ void pcm_init(void)
/* UDA1380: Unmute the master channel
(DAC should be at zero point now). */
- ac_mute(false);
+ audiohw_mute(false);
/* Call pcm_play_dma_stop to initialize everything. */
pcm_play_dma_stop();
@@ -402,7 +391,7 @@ void pcm_record_more(void *start, size_t size)
void pcm_mute(bool mute)
{
- ac_mute(mute);
+ audiohw_mute(mute);
if (mute)
sleep(HZ/16);
} /* pcm_mute */