1
0
Fork 0
forked from len0rd/rockbox

first step in audio driver unification: renaming the functions to audio_*

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@11670 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Marcoen Hirschberg 2006-12-06 10:24:59 +00:00
parent 46a608bf07
commit 77d039bab8
20 changed files with 229 additions and 240 deletions

View file

@ -788,7 +788,7 @@ static bool eq_hw_set_band0_cutoff(void)
sizeof(names) / sizeof(*names), NULL);
#ifndef SIMULATOR
wmcodec_set_equalizer_band(0, global_settings.eq_hw_band0_cutoff, 0,
audiohw_set_equalizer_band(0, global_settings.eq_hw_band0_cutoff, 0,
global_settings.eq_hw_band0_gain);
#endif
@ -803,7 +803,7 @@ static bool eq_hw_set_band0_gain(void)
eq_hw_gain_format);
#ifndef SIMULATOR
wmcodec_set_equalizer_band(0, global_settings.eq_hw_band0_cutoff, 0,
audiohw_set_equalizer_band(0, global_settings.eq_hw_band0_cutoff, 0,
global_settings.eq_hw_band0_gain);
#endif
@ -824,7 +824,7 @@ static bool eq_hw_set_band1_center(void)
sizeof(names) / sizeof(*names), NULL);
#ifndef SIMULATOR
wmcodec_set_equalizer_band(1, global_settings.eq_hw_band1_center,
audiohw_set_equalizer_band(1, global_settings.eq_hw_band1_center,
global_settings.eq_hw_band1_bandwidth,
global_settings.eq_hw_band1_gain);
#endif
@ -839,7 +839,7 @@ static bool eq_hw_set_band1_bandwidth(void)
BANDWIDTH_NAMES_SIZE, NULL);
#ifndef SIMULATOR
wmcodec_set_equalizer_band(1, global_settings.eq_hw_band1_center,
audiohw_set_equalizer_band(1, global_settings.eq_hw_band1_center,
global_settings.eq_hw_band1_bandwidth,
global_settings.eq_hw_band1_gain);
#endif
@ -855,7 +855,7 @@ static bool eq_hw_set_band1_gain(void)
eq_hw_gain_format);
#ifndef SIMULATOR
wmcodec_set_equalizer_band(1, global_settings.eq_hw_band1_center,
audiohw_set_equalizer_band(1, global_settings.eq_hw_band1_center,
global_settings.eq_hw_band1_bandwidth,
global_settings.eq_hw_band1_gain);
#endif
@ -877,7 +877,7 @@ static bool eq_hw_set_band2_center(void)
sizeof(names) / sizeof(*names), NULL);
#ifndef SIMULATOR
wmcodec_set_equalizer_band(2, global_settings.eq_hw_band2_center,
audiohw_set_equalizer_band(2, global_settings.eq_hw_band2_center,
global_settings.eq_hw_band2_bandwidth,
global_settings.eq_hw_band2_gain);
#endif
@ -892,7 +892,7 @@ static bool eq_hw_set_band2_bandwidth(void)
BANDWIDTH_NAMES_SIZE, NULL);
#ifndef SIMULATOR
wmcodec_set_equalizer_band(2, global_settings.eq_hw_band2_center,
audiohw_set_equalizer_band(2, global_settings.eq_hw_band2_center,
global_settings.eq_hw_band2_bandwidth,
global_settings.eq_hw_band2_gain);
#endif
@ -908,7 +908,7 @@ static bool eq_hw_set_band2_gain(void)
eq_hw_gain_format);
#ifndef SIMULATOR
wmcodec_set_equalizer_band(2, global_settings.eq_hw_band2_center,
audiohw_set_equalizer_band(2, global_settings.eq_hw_band2_center,
global_settings.eq_hw_band2_bandwidth,
global_settings.eq_hw_band2_gain);
#endif
@ -930,7 +930,7 @@ static bool eq_hw_set_band3_center(void)
sizeof(names) / sizeof(*names), NULL);
#ifndef SIMULATOR
wmcodec_set_equalizer_band(3, global_settings.eq_hw_band3_center,
audiohw_set_equalizer_band(3, global_settings.eq_hw_band3_center,
global_settings.eq_hw_band3_bandwidth,
global_settings.eq_hw_band3_gain);
#endif
@ -945,7 +945,7 @@ static bool eq_hw_set_band3_bandwidth(void)
BANDWIDTH_NAMES_SIZE, NULL);
#ifndef SIMULATOR
wmcodec_set_equalizer_band(3, global_settings.eq_hw_band3_center,
audiohw_set_equalizer_band(3, global_settings.eq_hw_band3_center,
global_settings.eq_hw_band3_bandwidth,
global_settings.eq_hw_band3_gain);
#endif
@ -961,7 +961,7 @@ static bool eq_hw_set_band3_gain(void)
eq_hw_gain_format);
#ifndef SIMULATOR
wmcodec_set_equalizer_band(3, global_settings.eq_hw_band3_center,
audiohw_set_equalizer_band(3, global_settings.eq_hw_band3_center,
global_settings.eq_hw_band3_bandwidth,
global_settings.eq_hw_band3_gain);
#endif
@ -983,7 +983,7 @@ static bool eq_hw_set_band4_cutoff(void)
sizeof(names) / sizeof(*names), NULL);
#ifndef SIMULATOR
wmcodec_set_equalizer_band(4, global_settings.eq_hw_band4_cutoff, 0,
audiohw_set_equalizer_band(4, global_settings.eq_hw_band4_cutoff, 0,
global_settings.eq_hw_band4_gain);
#endif
@ -998,7 +998,7 @@ static bool eq_hw_set_band4_gain(void)
eq_hw_gain_format);
#ifndef SIMULATOR
wmcodec_set_equalizer_band(4, global_settings.eq_hw_band4_cutoff, 0,
audiohw_set_equalizer_band(4, global_settings.eq_hw_band4_cutoff, 0,
global_settings.eq_hw_band4_gain);
#endif
@ -1011,28 +1011,28 @@ void eq_hw_enable(bool enable)
(void) enable;
#else
if (enable) {
wmcodec_set_equalizer_band(0, global_settings.eq_hw_band0_cutoff,
audiohw_set_equalizer_band(0, global_settings.eq_hw_band0_cutoff,
0, global_settings.eq_hw_band0_gain);
wmcodec_set_equalizer_band(1, global_settings.eq_hw_band1_center,
audiohw_set_equalizer_band(1, global_settings.eq_hw_band1_center,
global_settings.eq_hw_band1_bandwidth,
global_settings.eq_hw_band1_gain);
wmcodec_set_equalizer_band(2, global_settings.eq_hw_band2_center,
audiohw_set_equalizer_band(2, global_settings.eq_hw_band2_center,
global_settings.eq_hw_band2_bandwidth,
global_settings.eq_hw_band2_gain);
wmcodec_set_equalizer_band(3, global_settings.eq_hw_band3_center,
audiohw_set_equalizer_band(3, global_settings.eq_hw_band3_center,
global_settings.eq_hw_band3_bandwidth,
global_settings.eq_hw_band3_gain);
wmcodec_set_equalizer_band(4, global_settings.eq_hw_band4_cutoff,
audiohw_set_equalizer_band(4, global_settings.eq_hw_band4_cutoff,
0, global_settings.eq_hw_band4_gain);
} else {
wmcodec_set_equalizer_band(0, global_settings.eq_hw_band0_cutoff, 0, 0);
wmcodec_set_equalizer_band(1, global_settings.eq_hw_band1_center,
audiohw_set_equalizer_band(0, global_settings.eq_hw_band0_cutoff, 0, 0);
audiohw_set_equalizer_band(1, global_settings.eq_hw_band1_center,
global_settings.eq_hw_band1_bandwidth, 0);
wmcodec_set_equalizer_band(2, global_settings.eq_hw_band2_center,
audiohw_set_equalizer_band(2, global_settings.eq_hw_band2_center,
global_settings.eq_hw_band2_bandwidth, 0);
wmcodec_set_equalizer_band(3, global_settings.eq_hw_band3_center,
audiohw_set_equalizer_band(3, global_settings.eq_hw_band3_center,
global_settings.eq_hw_band3_bandwidth, 0);
wmcodec_set_equalizer_band(4, global_settings.eq_hw_band4_cutoff, 0, 0);
audiohw_set_equalizer_band(4, global_settings.eq_hw_band4_cutoff, 0, 0);
}
#endif
}

View file

@ -67,7 +67,7 @@ void tlv320_write_reg(unsigned reg, unsigned value)
/**
* Init our tlv with default values
*/
void tlv320_init(void)
void audiohw_init(void)
{
memset(tlv320_regs, 0, sizeof(tlv320_regs));
@ -75,14 +75,14 @@ void tlv320_init(void)
/* All ON except OUT, ADC, MIC and LINE */
tlv320_write_reg(REG_PC, PC_OUT | PC_ADC | PC_MIC | PC_LINE);
tlv320_set_recvol(0, 0, AUDIO_GAIN_MIC);
tlv320_set_recvol(0, 0, AUDIO_GAIN_LINEIN);
tlv320_mute(true);
audiohw_set_recvol(0, 0, AUDIO_GAIN_MIC);
audiohw_set_recvol(0, 0, AUDIO_GAIN_LINEIN);
audiohw_mute(true);
tlv320_write_reg(REG_AAP, AAP_DAC | AAP_MICM);
tlv320_write_reg(REG_DAP, 0x00); /* No deemphasis */
tlv320_write_reg(REG_DAIF, DAIF_IWL_16 | DAIF_FOR_I2S);
tlv320_write_reg(REG_DIA, DIA_ACT);
tlv320_set_frequency(-1); /* default */
audiohw_set_frequency(-1); /* default */
/* All ON except ADC, MIC and LINE */
tlv320_write_reg(REG_PC, PC_ADC | PC_MIC | PC_LINE);
}
@ -90,7 +90,7 @@ void tlv320_init(void)
/**
* Resets tlv320 to default values
*/
void tlv320_reset(void)
void audiohw_reset(void)
{
tlv320_write_reg(REG_RR, RR_RESET);
}
@ -104,7 +104,7 @@ void tlv320_reset(void)
* 44100: 1 = MCLK MCLK SCLK, LRCK: Audio Clk / 4 (default)
* 88200: 2 = MCLK*2 MCLK SCLK, LRCK: Audio Clk / 2
*/
void tlv320_set_frequency(unsigned fsel)
void audiohw_set_frequency(unsigned fsel)
{
/* All rates available for 11.2896MHz besides 8.021 */
unsigned char values_src[3] =
@ -126,7 +126,7 @@ void tlv320_set_frequency(unsigned fsel)
*
* Left & Right: 48 .. 121 .. 127 => Volume -73dB (mute) .. +0 dB .. +6 dB
*/
void tlv320_set_headphone_vol(int vol_l, int vol_r)
void audiohw_set_headphone_vol(int vol_l, int vol_r)
{
unsigned value_dap = tlv320_regs[REG_DAP];
unsigned value_dap_last = value_dap;
@ -156,7 +156,7 @@ void tlv320_set_headphone_vol(int vol_l, int vol_r)
* Mic (left): 0 .. 1 => Volume +0, +20 dB
*
*/
void tlv320_set_recvol(int left, int right, int type)
void audiohw_set_recvol(int left, int right, int type)
{
if (type == AUDIO_GAIN_MIC)
{
@ -180,7 +180,7 @@ void tlv320_set_recvol(int left, int right, int type)
* Mute (mute=true) or enable sound (mute=false)
*
*/
void tlv320_mute(bool mute)
void audiohw_mute(bool mute)
{
unsigned value_dap = tlv320_regs[REG_DAP];
unsigned value_l, value_r;
@ -205,16 +205,16 @@ void tlv320_mute(bool mute)
}
/* Nice shutdown of TLV320 codec */
void tlv320_close(void)
void audiohw_close(void)
{
tlv320_mute(true);
audiohw_mute(true);
sleep(HZ/8);
tlv320_write_reg(REG_PC, PC_OFF | PC_CLK | PC_OSC | PC_OUT |
PC_DAC | PC_ADC | PC_MIC | PC_LINE); /* All OFF */
}
void tlv320_enable_recording(bool source_mic)
void audiohw_enable_recording(bool source_mic)
{
unsigned value_aap, value_pc;
@ -234,7 +234,7 @@ void tlv320_enable_recording(bool source_mic)
tlv320_write_reg(REG_AAP, value_aap);
}
void tlv320_disable_recording(void)
void audiohw_disable_recording(void)
{
unsigned value_pc = tlv320_regs[REG_PC];
unsigned value_aap = tlv320_regs[REG_AAP];
@ -246,7 +246,7 @@ void tlv320_disable_recording(void)
tlv320_write_reg(REG_PC, value_pc);
}
void tlv320_set_monitor(bool enable)
void audiohw_set_monitor(bool enable)
{
unsigned value_aap, value_pc;

View file

@ -97,7 +97,7 @@ int uda1380_write_reg(unsigned char reg, unsigned short value)
/**
* Sets left and right master volume (0(max) to 252(muted))
*/
int uda1380_set_master_vol(int vol_l, int vol_r)
int audiohw_set_master_vol(int vol_l, int vol_r)
{
return uda1380_write_reg(REG_MASTER_VOL,
MASTER_VOL_LEFT(vol_l) | MASTER_VOL_RIGHT(vol_r));
@ -106,7 +106,7 @@ int uda1380_set_master_vol(int vol_l, int vol_r)
/**
* Sets mixer volume for both channels (0(max) to 228(muted))
*/
int uda1380_set_mixer_vol(int channel1, int channel2)
int audiohw_set_mixer_vol(int channel1, int channel2)
{
return uda1380_write_reg(REG_MIX_VOL,
MIX_VOL_CH_1(channel1) | MIX_VOL_CH_2(channel2));
@ -115,7 +115,7 @@ int uda1380_set_mixer_vol(int channel1, int channel2)
/**
* Sets the bass value (0-12)
*/
void uda1380_set_bass(int value)
void audiohw_set_bass(int value)
{
uda1380_write_reg(REG_EQ, (uda1380_regs[REG_EQ] & ~BASS_MASK)
| BASSL(value) | BASSR(value));
@ -124,7 +124,7 @@ void uda1380_set_bass(int value)
/**
* Sets the treble value (0-3)
*/
void uda1380_set_treble(int value)
void audiohw_set_treble(int value)
{
uda1380_write_reg(REG_EQ, (uda1380_regs[REG_EQ] & ~TREBLE_MASK)
| TREBLEL(value) | TREBLER(value));
@ -134,7 +134,7 @@ void uda1380_set_treble(int value)
* Mute (mute=1) or enable sound (mute=0)
*
*/
int uda1380_mute(int mute)
int audiohw_mute(int mute)
{
unsigned int value = uda1380_regs[REG_MUTE];
@ -147,7 +147,7 @@ int uda1380_mute(int mute)
}
/* Returns 0 if successful or -1 if some register failed */
int uda1380_set_regs(void)
int audiohw_set_regs(void)
{
int i;
memset(uda1380_regs, 0, sizeof(uda1380_regs));
@ -166,7 +166,7 @@ int uda1380_set_regs(void)
}
/* Silently enable / disable audio output */
void uda1380_enable_output(bool enable)
void audiohw_enable_output(bool enable)
{
if (enable) {
uda1380_write_reg(REG_PWR, uda1380_regs[REG_PWR] | PON_DAC | PON_HP);
@ -176,7 +176,7 @@ void uda1380_enable_output(bool enable)
}
}
void uda1380_reset(void)
void audiohw_reset(void)
{
#ifdef IRIVER_H300_SERIES
int mask = set_irq_level(HIGHEST_IRQ_LEVEL);
@ -203,7 +203,7 @@ void uda1380_reset(void)
* 44100: 2 = 25 to 50 MCLK SCLK, LRCK: Audio Clk / 4 (default)
* 88200: 3 = 50 to 100 MCLK SCLK, LRCK: Audio Clk / 2 <= TODO: Needs WSPLL
*/
void uda1380_set_frequency(unsigned fsel)
void audiohw_set_frequency(unsigned fsel)
{
static const unsigned short values_reg[4][2] =
{
@ -231,21 +231,21 @@ void uda1380_set_frequency(unsigned fsel)
}
/* Initialize UDA1380 codec with default register values (uda1380_defaults) */
int uda1380_init(void)
int audiohw_init(void)
{
recgain_mic = 0;
recgain_line = 0;
uda1380_reset();
audiohw_reset();
if (uda1380_set_regs() == -1)
if (audiohw_set_regs() == -1)
return -1;
return 0;
}
/* Nice shutdown of UDA1380 codec */
void uda1380_close(void)
void audiohw_close(void)
{
/* First enable mute and sleep a while */
uda1380_write_reg(REG_MUTE, MUTE_MASTER);
@ -263,7 +263,7 @@ void uda1380_close(void)
*
* source_mic: true=record from microphone, false=record from line-in (or radio)
*/
void uda1380_enable_recording(bool source_mic)
void audiohw_enable_recording(bool source_mic)
{
uda1380_regs[REG_0] &= ~(ADC_CLK | DAC_CLK);
uda1380_write_reg(REG_0, uda1380_regs[REG_0] | EN_ADC);
@ -298,7 +298,7 @@ void uda1380_enable_recording(bool source_mic)
/**
* Stop sending samples on the I2S bus
*/
void uda1380_disable_recording(void)
void audiohw_disable_recording(void)
{
uda1380_write_reg(REG_PGA, MUTE_ADC);
sleep(HZ/8);
@ -327,7 +327,7 @@ void uda1380_disable_recording(void)
be a peak or a dip. The small glitch is caused by the time between
setting the two gains
*/
void uda1380_set_recvol(int left, int right, int type)
void audiohw_set_recvol(int left, int right, int type)
{
int left_ag, right_ag;
@ -412,7 +412,7 @@ void uda1380_set_recvol(int left, int right, int type)
* Enable or disable recording monitor (so one can listen to the recording)
*
*/
void uda1380_set_monitor(int enable)
void audiohw_set_monitor(int enable)
{
if (enable) /* enable channel 2 */
uda1380_write_reg(REG_MUTE, uda1380_regs[REG_MUTE] & ~MUTE_CH2);

View file

@ -43,7 +43,7 @@
#define IPOD_PCM_LEVEL 0x65 /* -6dB */
int wmcodec_mute(int mute)
int audiohw_mute(int mute)
{
if (mute)
{
@ -70,7 +70,7 @@ static void codec_set_active(int active)
/* Silently enable / disable audio output */
void wmcodec_enable_output(bool enable)
void audiohw_enable_output(bool enable)
{
if (enable)
{
@ -96,7 +96,7 @@ void wmcodec_enable_output(bool enable)
/* IWL=00(16 bit) FORMAT=10(I2S format) */
wmcodec_write(AINTFCE, 0x42);
wmcodec_set_sample_rate(WM8731L_44100HZ);
audiohw_set_sample_rate(WM8731L_44100HZ);
/* set the volume to -6dB */
wmcodec_write(LOUTVOL, IPOD_PCM_LEVEL);
@ -112,17 +112,17 @@ void wmcodec_enable_output(bool enable)
/* We need to enable bit 4 of GPIOL for output for sound on H10 */
GPIOL_OUTPUT_VAL |= 0x10;
#endif
wmcodec_mute(0);
audiohw_mute(0);
} else {
#if defined(IRIVER_H10) || defined(IRIVER_H10_5GB)
/* We need to disable bit 4 of GPIOL to disable sound on H10 */
GPIOL_OUTPUT_VAL &= ~0x10;
#endif
wmcodec_mute(1);
audiohw_mute(1);
}
}
int wmcodec_set_master_vol(int vol_l, int vol_r)
int audiohw_set_master_vol(int vol_l, int vol_r)
{
/* +6 to -73dB 1dB steps (plus mute == 80levels) 7bits */
/* 1111111 == +6dB */
@ -136,7 +136,7 @@ int wmcodec_set_master_vol(int vol_l, int vol_r)
return 0;
}
int wmcodec_set_mixer_vol(int channel1, int channel2)
int audiohw_set_mixer_vol(int channel1, int channel2)
{
(void)channel1;
(void)channel2;
@ -144,18 +144,18 @@ int wmcodec_set_mixer_vol(int channel1, int channel2)
return 0;
}
void wmcodec_set_bass(int value)
void audiohw_set_bass(int value)
{
(void)value;
}
void wmcodec_set_treble(int value)
void audiohw_set_treble(int value)
{
(void)value;
}
/* Nice shutdown of WM8731 codec */
void wmcodec_close(void)
void audiohw_close(void)
{
/* set DACMU=1 DEEMPH=0 */
wmcodec_write(DACCTRL, 0x8);
@ -177,36 +177,36 @@ void wmcodec_close(void)
}
/* Change the order of the noise shaper, 5th order is recommended above 32kHz */
void wmcodec_set_nsorder(int order)
void audiohw_set_nsorder(int order)
{
(void)order;
}
void wmcodec_set_sample_rate(int sampling_control)
void audiohw_set_sample_rate(int sampling_control)
{
codec_set_active(0x0);
wmcodec_write(SAMPCTRL, sampling_control);
codec_set_active(0x1);
}
void wmcodec_enable_recording(bool source_mic)
void audiohw_enable_recording(bool source_mic)
{
(void)source_mic;
}
void wmcodec_disable_recording(void)
void audiohw_disable_recording(void)
{
}
void wmcodec_set_recvol(int left, int right, int type)
void audiohw_set_recvol(int left, int right, int type)
{
(void)left;
(void)right;
(void)type;
}
void wmcodec_set_monitor(int enable)
void audiohw_set_monitor(int enable)
{
(void)enable;
}

View file

@ -40,7 +40,7 @@
#include "wmcodec.h"
#include "wm8758.h"
void wmcodec_reset(void);
void audiohw_reset(void);
#define IPOD_PCM_LEVEL 0x65 /* -6dB */
@ -48,7 +48,7 @@ void wmcodec_reset(void);
//#define TREBCTRL 0x0b
/* Silently enable / disable audio output */
void wmcodec_enable_output(bool enable)
void audiohw_enable_output(bool enable)
{
if (enable)
{
@ -70,17 +70,17 @@ void wmcodec_enable_output(bool enable)
/* The iPod can handle multiple frequencies, but fix at 44.1KHz
for now */
wmcodec_set_sample_rate(WM8758_44100HZ);
audiohw_set_sample_rate(WM8758_44100HZ);
wmcodec_write(LOUTMIX,0x1); /* Enable mixer */
wmcodec_write(ROUTMIX,0x1); /* Enable mixer */
wmcodec_mute(0);
audiohw_mute(0);
} else {
wmcodec_mute(1);
audiohw_mute(1);
}
}
int wmcodec_set_master_vol(int vol_l, int vol_r)
int audiohw_set_master_vol(int vol_l, int vol_r)
{
/* OUT1 */
wmcodec_write(LOUT1VOL, 0x080 | vol_l);
@ -89,7 +89,7 @@ int wmcodec_set_master_vol(int vol_l, int vol_r)
return 0;
}
int wmcodec_set_lineout_vol(int vol_l, int vol_r)
int audiohw_set_lineout_vol(int vol_l, int vol_r)
{
/* OUT2 */
wmcodec_write(LOUT2VOL, vol_l);
@ -98,7 +98,7 @@ int wmcodec_set_lineout_vol(int vol_l, int vol_r)
return 0;
}
int wmcodec_set_mixer_vol(int channel1, int channel2)
int audiohw_set_mixer_vol(int channel1, int channel2)
{
(void)channel1;
(void)channel2;
@ -107,7 +107,7 @@ int wmcodec_set_mixer_vol(int channel1, int channel2)
}
/* We are using Linear bass control */
void wmcodec_set_bass(int value)
void audiohw_set_bass(int value)
{
(void)value;
#if 0
@ -121,7 +121,7 @@ void wmcodec_set_bass(int value)
#endif
}
void wmcodec_set_treble(int value)
void audiohw_set_treble(int value)
{
(void)value;
#if 0
@ -136,7 +136,7 @@ void wmcodec_set_treble(int value)
}
int wmcodec_mute(int mute)
int audiohw_mute(int mute)
{
if (mute)
{
@ -151,9 +151,9 @@ int wmcodec_mute(int mute)
}
/* Nice shutdown of WM8758 codec */
void wmcodec_close(void)
void audiohw_close(void)
{
wmcodec_mute(1);
audiohw_mute(1);
wmcodec_write(PWRMGMT3, 0x0);
@ -163,13 +163,13 @@ void wmcodec_close(void)
}
/* Change the order of the noise shaper, 5th order is recommended above 32kHz */
void wmcodec_set_nsorder(int order)
void audiohw_set_nsorder(int order)
{
(void)order;
}
/* Note: Disable output before calling this function */
void wmcodec_set_sample_rate(int sampling_control)
void audiohw_set_sample_rate(int sampling_control)
{
/**** We force 44.1KHz for now. ****/
(void)sampling_control;
@ -190,28 +190,28 @@ void wmcodec_set_sample_rate(int sampling_control)
wmcodec_write(SRATECTRL, (0 << 1));
}
void wmcodec_enable_recording(bool source_mic)
void audiohw_enable_recording(bool source_mic)
{
(void)source_mic;
}
void wmcodec_disable_recording(void) {
void audiohw_disable_recording(void) {
}
void wmcodec_set_recvol(int left, int right, int type) {
void audiohw_set_recvol(int left, int right, int type) {
(void)left;
(void)right;
(void)type;
}
void wmcodec_set_monitor(int enable) {
void audiohw_set_monitor(int enable) {
(void)enable;
}
void wmcodec_set_equalizer_band(int band, int freq, int bw, int gain)
void audiohw_set_equalizer_band(int band, int freq, int bw, int gain)
{
unsigned int eq = 0;

View file

@ -40,13 +40,13 @@
#include "wmcodec.h"
#include "wm8975.h"
void wmcodec_reset(void);
void audiohw_reset(void);
#define IPOD_PCM_LEVEL 0x65 /* -6dB */
/* Silently enable / disable audio output */
void wmcodec_enable_output(bool enable)
void audiohw_enable_output(bool enable)
{
if (enable)
{
@ -77,7 +77,7 @@ void wmcodec_enable_output(bool enable)
wmcodec_write(AINTFCE, 0x42);
/* The iPod can handle multiple frequencies, but fix at 44.1KHz for now */
wmcodec_set_sample_rate(WM8975_44100HZ);
audiohw_set_sample_rate(WM8975_44100HZ);
/* set the volume to -6dB */
wmcodec_write(LOUT1VOL, IPOD_PCM_LEVEL);
@ -94,13 +94,13 @@ void wmcodec_enable_output(bool enable)
wmcodec_write(MOUTMIX1, 0x0); /* Mono out Mix */
wmcodec_write(MOUTMIX2, 0x0);
wmcodec_mute(0);
audiohw_mute(0);
} else {
wmcodec_mute(1);
audiohw_mute(1);
}
}
int wmcodec_set_master_vol(int vol_l, int vol_r)
int audiohw_set_master_vol(int vol_l, int vol_r)
{
/* +6 to -73dB 1dB steps (plus mute == 80levels) 7bits */
/* 1111111 == +6dB */
@ -115,7 +115,7 @@ int wmcodec_set_master_vol(int vol_l, int vol_r)
return 0;
}
int wmcodec_set_lineout_vol(int vol_l, int vol_r)
int audiohw_set_lineout_vol(int vol_l, int vol_r)
{
/* OUT2 */
wmcodec_write(LOUT2VOL, vol_l);
@ -124,7 +124,7 @@ int wmcodec_set_lineout_vol(int vol_l, int vol_r)
return 0;
}
int wmcodec_set_mixer_vol(int channel1, int channel2)
int audiohw_set_mixer_vol(int channel1, int channel2)
{
(void)channel1;
(void)channel2;
@ -133,7 +133,7 @@ int wmcodec_set_mixer_vol(int channel1, int channel2)
}
/* We are using Linear bass control */
void wmcodec_set_bass(int value)
void audiohw_set_bass(int value)
{
int regvalues[]={11, 10, 10, 9, 8, 8, 0xf , 6, 6, 5, 4, 4, 3, 2, 1, 0};
@ -143,7 +143,7 @@ void wmcodec_set_bass(int value)
}
}
void wmcodec_set_treble(int value)
void audiohw_set_treble(int value)
{
int regvalues[]={11, 10, 10, 9, 8, 8, 0xf , 6, 6, 5, 4, 4, 3, 2, 1, 0};
@ -153,7 +153,7 @@ void wmcodec_set_treble(int value)
}
}
int wmcodec_mute(int mute)
int audiohw_mute(int mute)
{
if (mute)
{
@ -168,7 +168,7 @@ int wmcodec_mute(int mute)
}
/* Nice shutdown of WM8975 codec */
void wmcodec_close(void)
void audiohw_close(void)
{
/* 1. Set DACMU = 1 to soft-mute the audio DACs. */
wmcodec_write(DACCTRL, 0x8);
@ -181,35 +181,35 @@ void wmcodec_close(void)
}
/* Change the order of the noise shaper, 5th order is recommended above 32kHz */
void wmcodec_set_nsorder(int order)
void audiohw_set_nsorder(int order)
{
(void)order;
}
/* Note: Disable output before calling this function */
void wmcodec_set_sample_rate(int sampling_control) {
void audiohw_set_sample_rate(int sampling_control) {
wmcodec_write(0x08, sampling_control);
}
void wmcodec_enable_recording(bool source_mic) {
void audiohw_enable_recording(bool source_mic) {
(void)source_mic;
}
void wmcodec_disable_recording(void) {
void audiohw_disable_recording(void) {
}
void wmcodec_set_recvol(int left, int right, int type) {
void audiohw_set_recvol(int left, int right, int type) {
(void)left;
(void)right;
(void)type;
}
void wmcodec_set_monitor(int enable) {
void audiohw_set_monitor(int enable) {
(void)enable;
}

View file

@ -22,8 +22,8 @@
/*** definitions ***/
extern void tlv320_init(void);
extern void tlv320_reset(void);
extern void audiohw_init(void);
extern void audiohw_reset(void);
/**
* Sets internal sample rate for DAC and ADC relative to MCLK
* Selection for frequency:
@ -33,15 +33,15 @@ extern void tlv320_reset(void);
* 44100: 1 = MCLK MCLK SCLK, LRCK: Audio Clk / 4 (default)
* 88200: 2 = MCLK*2 MCLK SCLK, LRCK: Audio Clk / 2
*/
extern void tlv320_set_frequency(unsigned fsel);
extern void tlv320_enable_output(bool enable);
extern void tlv320_set_headphone_vol(int vol_l, int vol_r);
extern void tlv320_set_recvol(int left, int right, int type);
extern void tlv320_mute(bool mute);
extern void tlv320_close(void);
extern void tlv320_enable_recording(bool source_mic);
extern void tlv320_disable_recording(void);
extern void tlv320_set_monitor(bool enable);
extern void audiohw_set_frequency(unsigned fsel);
extern void audiohw_enable_output(bool enable);
extern void audiohw_set_headphone_vol(int vol_l, int vol_r);
extern void audiohw_set_recvol(int left, int right, int type);
extern void audiohw_mute(bool mute);
extern void audiohw_close(void);
extern void audiohw_enable_recording(bool source_mic);
extern void audiohw_disable_recording(void);
extern void audiohw_set_monitor(bool enable);
#define HEADPHONE_MUTE 0x30 /* 0110000 = -73db */

View file

@ -19,15 +19,15 @@
#ifndef _UDA1380_H
#define _UDA1380_H
extern void uda1380_reset(void);
extern int uda1380_init(void);
extern void uda1380_enable_output(bool enable);
extern int uda1380_set_master_vol(int vol_l, int vol_r);
extern int uda1380_set_mixer_vol(int channel1, int channel2);
extern void uda1380_set_bass(int value);
extern void uda1380_set_treble(int value);
extern int uda1380_mute(int mute);
extern void uda1380_close(void);
extern void audiohw_reset(void);
extern int audiohw_init(void);
extern void audiohw_enable_output(bool enable);
extern int audiohw_set_master_vol(int vol_l, int vol_r);
extern int audiohw_set_mixer_vol(int channel1, int channel2);
extern void audiohw_set_bass(int value);
extern void audiohw_set_treble(int value);
extern int audiohw_mute(int mute);
extern void audiohw_close(void);
/**
* Sets frequency settings for DAC and ADC relative to MCLK
*
@ -38,11 +38,11 @@ extern void uda1380_close(void);
* 44100: 2 = 25 to 50 SCLK, LRCK: Audio Clk / 4 (default)
* 88200: 3 = 50 to 100 SCLK, LRCK: Audio Clk / 2
*/
extern void uda1380_set_frequency(unsigned fsel);
extern void uda1380_enable_recording(bool source_mic);
extern void uda1380_disable_recording(void);
extern void uda1380_set_recvol(int left, int right, int type);
extern void uda1380_set_monitor(int enable);
extern void audiohw_set_frequency(unsigned fsel);
extern void audiohw_enable_recording(bool source_mic);
extern void audiohw_disable_recording(void);
extern void audiohw_set_recvol(int left, int right, int type);
extern void audiohw_set_monitor(int enable);
#define UDA1380_ADDR 0x30

View file

@ -20,22 +20,22 @@
#ifndef _WM8731L_H
#define _WM8731L_H
extern void wmcodec_reset(void);
extern int wmcodec_init(void);
extern void wmcodec_enable_output(bool enable);
extern int wmcodec_set_master_vol(int vol_l, int vol_r);
extern int wmcodec_set_mixer_vol(int channel1, int channel2);
extern void wmcodec_set_bass(int value);
extern void wmcodec_set_treble(int value);
extern int wmcodec_mute(int mute);
extern void wmcodec_close(void);
extern void wmcodec_set_nsorder(int order);
extern void wmcodec_set_sample_rate(int sampling_control);
extern void audiohw_reset(void);
extern int audiohw_init(void);
extern void audiohw_enable_output(bool enable);
extern int audiohw_set_master_vol(int vol_l, int vol_r);
extern int audiohw_set_mixer_vol(int channel1, int channel2);
extern void audiohw_set_bass(int value);
extern void audiohw_set_treble(int value);
extern int audiohw_mute(int mute);
extern void audiohw_close(void);
extern void audiohw_set_nsorder(int order);
extern void audiohw_set_sample_rate(int sampling_control);
extern void wmcodec_enable_recording(bool source_mic);
extern void wmcodec_disable_recording(void);
extern void wmcodec_set_recvol(int left, int right, int type);
extern void wmcodec_set_monitor(int enable);
extern void audiohw_enable_recording(bool source_mic);
extern void audiohw_disable_recording(void);
extern void audiohw_set_recvol(int left, int right, int type);
extern void audiohw_set_monitor(int enable);
/* Register addresses */
#define LINVOL 0x00

View file

@ -20,25 +20,25 @@
#ifndef _WM8758_H
#define _WM8758_H
extern void wmcodec_reset(void);
extern int wmcodec_init(void);
extern void wmcodec_enable_output(bool enable);
extern int wmcodec_set_master_vol(int vol_l, int vol_r);
extern int wmcodec_set_lineout_vol(int vol_l, int vol_r);
extern int wmcodec_set_mixer_vol(int channel1, int channel2);
extern void wmcodec_set_bass(int value);
extern void wmcodec_set_treble(int value);
extern int wmcodec_mute(int mute);
extern void wmcodec_close(void);
extern void wmcodec_set_nsorder(int order);
extern void wmcodec_set_sample_rate(int sampling_control);
extern void audiohw_reset(void);
extern int audiohw_init(void);
extern void audiohw_enable_output(bool enable);
extern int audiohw_set_master_vol(int vol_l, int vol_r);
extern int audiohw_set_lineout_vol(int vol_l, int vol_r);
extern int audiohw_set_mixer_vol(int channel1, int channel2);
extern void audiohw_set_bass(int value);
extern void audiohw_set_treble(int value);
extern int audiohw_mute(int mute);
extern void audiohw_close(void);
extern void audiohw_set_nsorder(int order);
extern void audiohw_set_sample_rate(int sampling_control);
extern void wmcodec_enable_recording(bool source_mic);
extern void wmcodec_disable_recording(void);
extern void wmcodec_set_recvol(int left, int right, int type);
extern void wmcodec_set_monitor(int enable);
extern void audiohw_enable_recording(bool source_mic);
extern void audiohw_disable_recording(void);
extern void audiohw_set_recvol(int left, int right, int type);
extern void audiohw_set_monitor(int enable);
extern void wmcodec_set_equalizer_band(int band, int freq, int bw, int gain);
extern void audiohw_set_equalizer_band(int band, int freq, int bw, int gain);
#define RESET 0x00
#define PWRMGMT1 0x01

View file

@ -20,23 +20,23 @@
#ifndef _WM8975_H
#define _WM8975_H
extern void wmcodec_reset(void);
extern int wmcodec_init(void);
extern void wmcodec_enable_output(bool enable);
extern int wmcodec_set_master_vol(int vol_l, int vol_r);
extern int wmcodec_set_lineout_vol(int vol_l, int vol_r);
extern int wmcodec_set_mixer_vol(int channel1, int channel2);
extern void wmcodec_set_bass(int value);
extern void wmcodec_set_treble(int value);
extern int wmcodec_mute(int mute);
extern void wmcodec_close(void);
extern void wmcodec_set_nsorder(int order);
extern void wmcodec_set_sample_rate(int sampling_control);
extern void audiohw_reset(void);
extern int audiohw_init(void);
extern void audiohw_enable_output(bool enable);
extern int audiohw_set_master_vol(int vol_l, int vol_r);
extern int audiohw_set_lineout_vol(int vol_l, int vol_r);
extern int audiohw_set_mixer_vol(int channel1, int channel2);
extern void audiohw_set_bass(int value);
extern void audiohw_set_treble(int value);
extern int audiohw_mute(int mute);
extern void audiohw_close(void);
extern void audiohw_set_nsorder(int order);
extern void audiohw_set_sample_rate(int sampling_control);
extern void wmcodec_enable_recording(bool source_mic);
extern void wmcodec_disable_recording(void);
extern void wmcodec_set_recvol(int left, int right, int type);
extern void wmcodec_set_monitor(int enable);
extern void audiohw_enable_recording(bool source_mic);
extern void audiohw_disable_recording(void);
extern void audiohw_set_recvol(int left, int right, int type);
extern void audiohw_set_monitor(int enable);
/* Register addresses */
#define LOUT1VOL 0x02

View file

@ -18,6 +18,6 @@
****************************************************************************/
void i2s_reset(void);
int wmcodec_init(void);
int audiohw_init(void);
void wmcodec_write(int reg, int data);

View file

@ -406,13 +406,13 @@ void pcm_init(void)
pcm_callback_for_more = NULL;
/* Initialize default register values. */
wmcodec_init();
audiohw_init();
/* Power on */
wmcodec_enable_output(true);
audiohw_enable_output(true);
/* Unmute the master channel (DAC should be at zero point now). */
wmcodec_mute(false);
audiohw_mute(false);
/* Call pcm_play_dma_stop to initialize everything. */
pcm_play_dma_stop();
@ -603,7 +603,7 @@ void pcm_mute(bool mute)
{
#if defined(HAVE_WM8975) || defined(HAVE_WM8758) \
|| defined(HAVE_WM8731) || defined(HAVE_WM8721)
wmcodec_mute(mute);
audiohw_mute(mute);
#endif
if (mute)
sleep(HZ/16);

View file

@ -1326,11 +1326,11 @@ void shutdown_hw(void)
mp3_shutdown();
#ifdef HAVE_UDA1380
uda1380_close();
audiohw_close();
#elif defined(HAVE_TLV320)
tlv320_close();
audiohw_close();
#elif defined(HAVE_WM8758) || defined(HAVE_WM8975) | defined(HAVE_WM8731)
wmcodec_close();
audiohw_close();
#endif
/* If HD is still active we try to wait for spindown, otherwise the
shutdown_timeout in power_thread_sleep will force a power off */

View file

@ -464,10 +464,10 @@ static void set_prescaled_volume(void)
#if CONFIG_CODEC == MAS3507D
mas_writereg(MAS_REG_KPRESCALE, prescale_table[prescale/10]);
#elif defined(HAVE_UDA1380)
uda1380_set_mixer_vol(tenthdb2mixer(-prescale), tenthdb2mixer(-prescale));
audiohw_set_mixer_vol(tenthdb2mixer(-prescale), tenthdb2mixer(-prescale));
#elif defined(HAVE_WM8975) || defined(HAVE_WM8758) \
|| defined(HAVE_WM8731) || defined(HAVE_WM8721) || defined(HAVE_WM8751)
wmcodec_set_mixer_vol(tenthdb2mixer(-prescale), tenthdb2mixer(-prescale));
audiohw_set_mixer_vol(tenthdb2mixer(-prescale), tenthdb2mixer(-prescale));
#endif
if (current_volume == VOLUME_MIN)
@ -491,16 +491,16 @@ static void set_prescaled_volume(void)
#if CONFIG_CODEC == MAS3507D
dac_volume(tenthdb2reg(l), tenthdb2reg(r), false);
#elif defined(HAVE_UDA1380)
uda1380_set_master_vol(tenthdb2master(l), tenthdb2master(r));
audiohw_set_master_vol(tenthdb2master(l), tenthdb2master(r));
#elif defined(HAVE_WM8975) || defined(HAVE_WM8758) \
|| defined(HAVE_WM8731) || defined(HAVE_WM8721) || defined(HAVE_WM8751)
wmcodec_set_master_vol(tenthdb2master(l), tenthdb2master(r));
audiohw_set_master_vol(tenthdb2master(l), tenthdb2master(r));
#if defined(HAVE_WM8975) || defined(HAVE_WM8758) || defined(HAVE_WM8751)
wmcodec_set_lineout_vol(tenthdb2master(0), tenthdb2master(0));
audiohw_set_lineout_vol(tenthdb2master(0), tenthdb2master(0));
#endif
#elif defined(HAVE_TLV320)
tlv320_set_headphone_vol(tenthdb2master(l), tenthdb2master(r));
audiohw_set_headphone_vol(tenthdb2master(l), tenthdb2master(r));
#endif
}
#endif /* (CONFIG_CODEC == MAS3507D) || defined HAVE_UDA1380 */
@ -649,13 +649,13 @@ void sound_set_bass(int value)
current_bass = value * 10;
set_prescaled_volume();
#elif defined(HAVE_UDA1380)
uda1380_set_bass(value >> 1);
audiohw_set_bass(value >> 1);
current_bass = value * 10;
set_prescaled_volume();
#elif defined HAVE_WM8975 || defined HAVE_WM8758 \
|| defined HAVE_WM8731 || defined(HAVE_WM8721) || defined(HAVE_WM8751)
current_bass = value * 10;
wmcodec_set_bass(value);
audiohw_set_bass(value);
set_prescaled_volume();
#elif CONFIG_CPU == PNX0101 || defined(HAVE_PP5024_CODEC)
/* TODO: implement for iFP and Sansa */
@ -675,12 +675,12 @@ void sound_set_treble(int value)
current_treble = value * 10;
set_prescaled_volume();
#elif defined(HAVE_UDA1380)
uda1380_set_treble(value >> 1);
audiohw_set_treble(value >> 1);
current_treble = value * 10;
set_prescaled_volume();
#elif defined(HAVE_WM8975) || defined(HAVE_WM8758) \
|| defined(HAVE_WM8731) || defined(HAVE_WM8721) || defined(HAVE_WM8751)
wmcodec_set_treble(value);
audiohw_set_treble(value);
current_treble = value * 10;
set_prescaled_volume();
#elif CONFIG_CPU == PNX0101 || defined(HAVE_PP5024_CODEC)

View file

@ -49,7 +49,7 @@ void i2s_reset(void)
* Initialise the WM8975 for playback via headphone and line out.
* Note, I'm using the WM8750 datasheet as its apparently close.
*/
int wmcodec_init(void) {
int audiohw_init(void) {
/* reset I2C */
i2c_init();

View file

@ -97,7 +97,7 @@ void i2s_reset(void)
* Initialise the WM8975 for playback via headphone and line out.
* Note, I'm using the WM8750 datasheet as its apparently close.
*/
int wmcodec_init(void) {
int audiohw_init(void) {
/* reset I2C */
i2c_init();

View file

@ -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);
}

View file

@ -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 */

View file

@ -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 */