void bravo_analog_init(void)
{
	D("%s\n", __func__);
	/* stereo pmic init */
	pmic_spkr_set_gain(LEFT_SPKR, SPKR_GAIN_PLUS12DB);
	pmic_spkr_set_gain(RIGHT_SPKR, SPKR_GAIN_PLUS12DB);
	pmic_spkr_en_right_chan(OFF_CMD);
	pmic_spkr_en_left_chan(OFF_CMD);
	pmic_spkr_add_right_left_chan(OFF_CMD);
	pmic_spkr_en_stereo(OFF_CMD);
	pmic_spkr_select_usb_with_hpf_20hz(OFF_CMD);
	pmic_spkr_bypass_mux(OFF_CMD);
	pmic_spkr_en_hpf(ON_CMD);
	pmic_spkr_en_sink_curr_from_ref_volt_cir(OFF_CMD);
	pmic_spkr_set_mux_hpf_corner_freq(SPKR_FREQ_0_73KHZ);
	pmic_mic_set_volt(MIC_VOLT_1_80V);
	pmic_set_speaker_delay(SPKR_DLY_100MS);

	gpio_request(BRAVO_AUD_JACKHP_EN, "aud_jackhp_en");
	gpio_direction_output(BRAVO_AUD_JACKHP_EN, 1);
	gpio_set_value(BRAVO_AUD_JACKHP_EN, 0);

	mutex_lock(&bt_sco_lock);
	config_gpio_table(bt_sco_disable,
			ARRAY_SIZE(bt_sco_disable));
	gpio_set_value(BRAVO_BT_PCM_OUT, 0);
	mutex_unlock(&bt_sco_lock);
}
Beispiel #2
0
//Added by JRD for speaker PA control
void audio_opal_spkr_pa_enable(void)
{
	if(isSpkr && (isAudioEn || isIncallMode))
	{
		if(pmic_speaker_cmd(SPKR_ON) < 0)
			printk("==JRD===pmic_speaker_cmd() : SPKR_ON error!\n");

		if(pmic_spkr_en_left_chan(1) < 0)
			printk("==JRD===pmic_spkr_en_left_chan(1) : error!\n");

		if(isIncallMode){
			if(pmic_mic_en(1) < 0)
				printk("==JRD===pmic_mic_en(1) : error!\n");						
		}
	}
	else{
		if(pmic_spkr_en_left_chan(0) < 0)
			printk("==JRD===pmic_spkr_en_left_chan(0) : error!\n");

		if(pmic_speaker_cmd(SPKR_OFF) < 0)
			printk("==JRD===pmic_speaker_cmd() : SPKR_OFF error!\n");
	}
}
Beispiel #3
0
static int debug_spkr_en_left_chan(char *buf, int size)
{
	int	enable;
	int	cnt;

	cnt = sscanf(buf, "%d", &enable);
	if (cnt < 1) {
		printk(KERN_ERR "%s: sscanf failed cnt=%d" , __func__, cnt);
		return -EINVAL;
	}
	if (pmic_spkr_en_left_chan(enable) < 0)
		return -EFAULT;

	return size;
}