1
0
Fork 0
forked from len0rd/rockbox

Remove pcm_mute() which has been unused since r19308

Remove audiohw_mute from header as well, and make this function static
to each driver (commented out when it was unused)

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25733 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Rafaël Carré 2010-04-27 00:05:02 +00:00
parent 5e88c4b4de
commit f2f34881ec
17 changed files with 92 additions and 114 deletions

View file

@ -113,7 +113,7 @@ int sound_val2phys(int setting, int value)
return result; return result;
} }
void audiohw_mute(bool mute) /*static void audiohw_mute(bool mute)
{ {
if (mute) if (mute)
{ {
@ -125,7 +125,7 @@ void audiohw_mute(bool mute)
udelay(200000); udelay(200000);
akc_clear(AK4537_DAC, SMUTE); akc_clear(AK4537_DAC, SMUTE);
} }
} }*/
void audiohw_preinit(void) void audiohw_preinit(void)
{ {

View file

@ -229,6 +229,16 @@ void audiohw_preinit(void)
#endif #endif
} }
static void audiohw_mute(bool mute)
{
if (mute) {
as3514_set(AS3514_HPH_OUT_L, HPH_OUT_L_HP_MUTE);
} else {
as3514_clear(AS3514_HPH_OUT_L, HPH_OUT_L_HP_MUTE);
}
}
void audiohw_postinit(void) void audiohw_postinit(void)
{ {
/* wait until outputs have stabilized */ /* wait until outputs have stabilized */
@ -280,16 +290,6 @@ void audiohw_set_lineout_vol(int vol_l, int vol_r)
as3514_write_masked(AS3514_LINE_OUT_L, vol_l, AS3514_VOL_MASK); as3514_write_masked(AS3514_LINE_OUT_L, vol_l, AS3514_VOL_MASK);
} }
void audiohw_mute(bool mute)
{
if (mute) {
as3514_set(AS3514_HPH_OUT_L, HPH_OUT_L_HP_MUTE);
} else {
as3514_clear(AS3514_HPH_OUT_L, HPH_OUT_L_HP_MUTE);
}
}
/* Nice shutdown of AS3514 audio codec */ /* Nice shutdown of AS3514 audio codec */
void audiohw_close(void) void audiohw_close(void)
{ {

View file

@ -101,6 +101,30 @@ static void tlv320_write_reg(unsigned reg, unsigned value)
tlv320_regs[reg] = value; tlv320_regs[reg] = value;
} }
static void audiohw_mute(bool mute)
{
unsigned value_dap = tlv320_regs[REG_DAP];
unsigned value_l, value_r;
if (mute)
{
value_l = LHV_LHV(HEADPHONE_MUTE);
value_r = RHV_RHV(HEADPHONE_MUTE);
value_dap |= DAP_DACM;
}
else
{
value_l = LHV_LHV(tlv320.vol_l);
value_r = RHV_RHV(tlv320.vol_r);
if (value_l > HEADPHONE_MUTE || value_r > HEADPHONE_MUTE)
value_dap &= ~DAP_DACM;
}
tlv320_write_reg(REG_LHV, LHV_LZC | value_l);
tlv320_write_reg(REG_RHV, RHV_RZC | value_r);
tlv320_write_reg(REG_DAP, value_dap);
}
/* public functions */ /* public functions */
/** /**
@ -238,30 +262,6 @@ void audiohw_set_recvol(int left, int right, int type)
} }
#endif #endif
void audiohw_mute(bool mute)
{
unsigned value_dap = tlv320_regs[REG_DAP];
unsigned value_l, value_r;
if (mute)
{
value_l = LHV_LHV(HEADPHONE_MUTE);
value_r = RHV_RHV(HEADPHONE_MUTE);
value_dap |= DAP_DACM;
}
else
{
value_l = LHV_LHV(tlv320.vol_l);
value_r = RHV_RHV(tlv320.vol_r);
if (value_l > HEADPHONE_MUTE || value_r > HEADPHONE_MUTE)
value_dap &= ~DAP_DACM;
}
tlv320_write_reg(REG_LHV, LHV_LZC | value_l);
tlv320_write_reg(REG_RHV, RHV_RZC | value_r);
tlv320_write_reg(REG_DAP, value_dap);
}
/* Nice shutdown of TLV320 codec */ /* Nice shutdown of TLV320 codec */
void audiohw_close(void) void audiohw_close(void)
{ {

View file

@ -81,17 +81,7 @@ void audiohw_init(void)
tsc2100_writereg(TSAC4_PAGE, TSAC4_ADDRESS, val); tsc2100_writereg(TSAC4_PAGE, TSAC4_ADDRESS, val);
} }
void audiohw_postinit(void) static void audiohw_mute(bool mute)
{
audiohw_mute(false);
}
void audiohw_set_master_vol(int vol_l, int vol_r)
{
tsc2100_writereg(TSDACGAIN_PAGE, TSDACGAIN_ADDRESS, (short)((vol_l<<8) | vol_r) );
}
void audiohw_mute(bool mute)
{ {
short vol = tsc2100_readreg(TSDACGAIN_PAGE, TSDACGAIN_ADDRESS); short vol = tsc2100_readreg(TSDACGAIN_PAGE, TSDACGAIN_ADDRESS);
/* left mute bit == 1<<15 /* left mute bit == 1<<15
@ -108,6 +98,16 @@ void audiohw_mute(bool mute)
tsc2100_writereg(TSDACGAIN_PAGE, TSDACGAIN_ADDRESS, vol); tsc2100_writereg(TSDACGAIN_PAGE, TSDACGAIN_ADDRESS, vol);
} }
void audiohw_postinit(void)
{
audiohw_mute(false);
}
void audiohw_set_master_vol(int vol_l, int vol_r)
{
tsc2100_writereg(TSDACGAIN_PAGE, TSDACGAIN_ADDRESS, (short)((vol_l<<8) | vol_r) );
}
void audiohw_close(void) void audiohw_close(void)
{ {
/* mute headphones */ /* mute headphones */

View file

@ -210,14 +210,14 @@ void audiohw_set_treble(int value)
udacodec_write (UDA_REG_DATA0, UDA_DATA_CTRL1 | uda_regs [UDA_REG_ID_CTRL1] ); udacodec_write (UDA_REG_DATA0, UDA_DATA_CTRL1 | uda_regs [UDA_REG_ID_CTRL1] );
} }
void audiohw_mute(bool mute) /*static void audiohw_mute(bool mute)
{ {
if (mute) if (mute)
uda_regs [UDA_REG_ID_CTRL2] |= UDA_MUTE_ON; uda_regs [UDA_REG_ID_CTRL2] |= UDA_MUTE_ON;
else else
uda_regs [UDA_REG_ID_CTRL2] &= ~UDA_MUTE_ON; uda_regs [UDA_REG_ID_CTRL2] &= ~UDA_MUTE_ON;
udacodec_write (UDA_REG_DATA0, UDA_DATA_CTRL2 | uda_regs [UDA_REG_ID_CTRL2] ); udacodec_write (UDA_REG_DATA0, UDA_DATA_CTRL2 | uda_regs [UDA_REG_ID_CTRL2] );*/
} }
void audiohw_set_prescaler(int val) void audiohw_set_prescaler(int val)

View file

@ -171,7 +171,7 @@ void audiohw_set_treble(int value)
| TREBLEL(value) | TREBLER(value)); | TREBLEL(value) | TREBLER(value));
} }
void audiohw_mute(bool mute) static void audiohw_mute(bool mute)
{ {
unsigned int value = uda1380_regs[REG_MUTE]; unsigned int value = uda1380_regs[REG_MUTE];

View file

@ -149,7 +149,7 @@ int sound_val2phys(int setting, int value)
return result; return result;
} }
void audiohw_mute(bool mute) static void audiohw_mute(bool mute)
{ {
if (mute) { if (mute) {
/* Set DACMU = 1 to soft-mute the audio DACs. */ /* Set DACMU = 1 to soft-mute the audio DACs. */

View file

@ -99,6 +99,13 @@ static int adaptivebass2hw(int value)
} }
#endif #endif
static void audiohw_mute(bool mute)
{
/* Mute: Set DACMU = 1 to soft-mute the audio DACs. */
/* Unmute: Set DACMU = 0 to soft-un-mute the audio DACs. */
wmcodec_write(DACCTRL, mute ? DACCTRL_DACMU : 0);
}
/* Reset and power up the WM8751 */ /* Reset and power up the WM8751 */
void audiohw_preinit(void) void audiohw_preinit(void)
{ {
@ -230,13 +237,6 @@ void audiohw_set_treble(int value)
TREBCTRL_TREB(tone_tenthdb2hw(value))); TREBCTRL_TREB(tone_tenthdb2hw(value)));
} }
void audiohw_mute(bool mute)
{
/* Mute: Set DACMU = 1 to soft-mute the audio DACs. */
/* Unmute: Set DACMU = 0 to soft-un-mute the audio DACs. */
wmcodec_write(DACCTRL, mute ? DACCTRL_DACMU : 0);
}
/* Nice shutdown of WM8751 codec */ /* Nice shutdown of WM8751 codec */
void audiohw_close(void) void audiohw_close(void)
{ {

View file

@ -116,7 +116,7 @@ int sound_val2phys(int setting, int value)
return result; return result;
} }
void audiohw_mute(bool mute) static void audiohw_mute(bool mute)
{ {
if (mute) { if (mute) {
wmcodec_write(DACCTRL, DACCTRL_SOFTMUTE); wmcodec_write(DACCTRL, DACCTRL_SOFTMUTE);

View file

@ -113,7 +113,7 @@ int sound_val2phys(int setting, int value)
return result; return result;
} }
void audiohw_mute(bool mute) static void audiohw_mute(bool mute)
{ {
if (mute) { if (mute) {
/* Set DACMU = 1 to soft-mute the audio DACs. */ /* Set DACMU = 1 to soft-mute the audio DACs. */

View file

@ -346,25 +346,7 @@ void audiohw_set_headphone_vol(int vol_l, int vol_r)
} }
} }
void audiohw_close(void) static void audiohw_mute(bool mute)
{
/* 1. Mute all analogue outputs */
audiohw_mute(true);
audiohw_enable_headphone_jack(false);
/* 2. Disable power management register 1. R1 = 00 */
wmc_write(WMC_POWER_MANAGEMENT1, 0x000);
/* 3. Disable power management register 2. R2 = 00 */
wmc_write(WMC_POWER_MANAGEMENT2, 0x000);
/* 4. Disable power management register 3. R3 = 00 */
wmc_write(WMC_POWER_MANAGEMENT3, 0x000);
/* 5. Remove external power supplies. */
}
void audiohw_mute(bool mute)
{ {
wmc_vol.ahw_mute = mute; wmc_vol.ahw_mute = mute;
@ -385,6 +367,24 @@ void audiohw_mute(bool mute)
} }
} }
void audiohw_close(void)
{
/* 1. Mute all analogue outputs */
audiohw_mute(true);
audiohw_enable_headphone_jack(false);
/* 2. Disable power management register 1. R1 = 00 */
wmc_write(WMC_POWER_MANAGEMENT1, 0x000);
/* 3. Disable power management register 2. R2 = 00 */
wmc_write(WMC_POWER_MANAGEMENT2, 0x000);
/* 4. Disable power management register 3. R3 = 00 */
wmc_write(WMC_POWER_MANAGEMENT3, 0x000);
/* 5. Remove external power supplies. */
}
void audiohw_set_frequency(int fsel) void audiohw_set_frequency(int fsel)
{ {
/* For 16.9344MHz MCLK, codec as master. */ /* For 16.9344MHz MCLK, codec as master. */

View file

@ -165,6 +165,18 @@ void audiohw_preinit(void)
wmcodec_write(OUT4ADC, 0x0); /* POBCTRL = 0 */ wmcodec_write(OUT4ADC, 0x0); /* POBCTRL = 0 */
} }
static void audiohw_mute(bool mute)
{
if (mute)
{
/* Set DACMU = 1 to soft-mute the audio DACs. */
wmcodec_write(DACCTRL, 0x4c);
} else {
/* Set DACMU = 0 to soft-un-mute the audio DACs. */
wmcodec_write(DACCTRL, 0xc);
}
}
void audiohw_postinit(void) void audiohw_postinit(void)
{ {
sleep(HZ/2); sleep(HZ/2);
@ -217,18 +229,6 @@ void audiohw_set_treble_cutoff(int value)
wmcodec_write(EQ5, eq5_reg); wmcodec_write(EQ5, eq5_reg);
} }
void audiohw_mute(bool mute)
{
if (mute)
{
/* Set DACMU = 1 to soft-mute the audio DACs. */
wmcodec_write(DACCTRL, 0x4c);
} else {
/* Set DACMU = 0 to soft-un-mute the audio DACs. */
wmcodec_write(DACCTRL, 0xc);
}
}
/* Nice shutdown of WM8985 codec */ /* Nice shutdown of WM8985 codec */
void audiohw_close(void) void audiohw_close(void)
{ {

View file

@ -222,12 +222,6 @@ void audiohw_set_prescaler(int val);
void audiohw_set_balance(int val); void audiohw_set_balance(int val);
#endif #endif
/**
* Mute or enable sound.
* @param mute true or false.
*/
void audiohw_mute(bool mute);
#ifdef AUDIOHW_HAVE_TREBLE #ifdef AUDIOHW_HAVE_TREBLE
/** /**
* Set new treble value. * Set new treble value.

View file

@ -79,7 +79,6 @@ const void* pcm_get_peak_buffer(int* count);
size_t pcm_get_bytes_waiting(void); size_t pcm_get_bytes_waiting(void);
void pcm_play_stop(void); void pcm_play_stop(void);
void pcm_mute(bool mute);
void pcm_play_pause(bool play); void pcm_play_pause(bool play);
bool pcm_is_paused(void); bool pcm_is_paused(void);
bool pcm_is_playing(void); bool pcm_is_playing(void);

View file

@ -355,16 +355,6 @@ bool pcm_is_paused(void)
return pcm_paused; return pcm_paused;
} }
void pcm_mute(bool mute)
{
#ifndef SIMULATOR
audiohw_mute(mute);
#endif
if (mute)
sleep(HZ/16);
}
#ifdef HAVE_RECORDING #ifdef HAVE_RECORDING
/** Low level pcm recording apis **/ /** Low level pcm recording apis **/

View file

@ -39,8 +39,3 @@ void audiohw_init(void)
void audiohw_close(void) void audiohw_close(void)
{ {
} }
void audiohw_mute(bool mute)
{
(void) mute;
}

View file

@ -266,7 +266,7 @@ static void HP_turn_off(void)
} }
#endif #endif
void audiohw_mute(bool mute) static void audiohw_mute(bool mute)
{ {
if(mute) if(mute)
REG_ICDC_CDCCR1 |= ICDC_CDCCR1_HPMUTE; REG_ICDC_CDCCR1 |= ICDC_CDCCR1_HPMUTE;