Exemplo n.º 1
0
static void handle_tone_onoff(void)
{
    if (bass || treble)
    {
        handle_dsp_power(DSP_MODULE_TONE, 1);
        cscodec_setbits(BTCTL, 0, BTCTL_TCEN);
    }
    else
    {
        cscodec_setbits(BTCTL, BTCTL_TCEN, 0);
        handle_dsp_power(DSP_MODULE_TONE, 0);
    }
}
Exemplo n.º 2
0
void audiohw_set_treble(int value)
{
    treble = value;
    handle_dsp_power();
    if (value >= -105 && value <= 120)
        cscodec_setbits(TONECTL, TONECTL_TREB_MASK,
                        (8 - value / 15) << TONECTL_TREB_SHIFT);
}
Exemplo n.º 3
0
void audiohw_set_bass(int value)
{
    bass = value;
    handle_dsp_power();
    if (value >= -105 && value <= 120)
        cscodec_setbits(TONECTL, TONECTL_BASS_MASK,
                        (8 - value / 15) << TONECTL_BASS_SHIFT);
}
Exemplo n.º 4
0
void audiohw_set_monitor(bool enable)
{
    if (enable)
    {
        /* enable DSP power if it is actually disabled */
        handle_dsp_power(DSP_MODULE_MONITOR, 1);
        /* unmute ADC mixer */
        cscodec_write(AMIXACTL, 0);
        cscodec_write(AMIXBCTL, 0);
    }
    else
    {
        /* mute ADC mixer */
        cscodec_write(AMIXACTL, AMIXACTL_AMIXAMUTE);
        cscodec_write(AMIXBCTL, AMIXBCTL_AMIXBMUTE);
        /* disable DSP power if it is not being used by other modules */
        handle_dsp_power(DSP_MODULE_MONITOR, 0);
    }
}