Exemplo n.º 1
0
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);
}
Exemplo n.º 2
0
void pmic_init(void)
{
	s32	dal_rc;
	u8	dev_type;
	u32	stereo;

	dal_rc = CAD_RES_SUCCESS;
	dev_type = 0;

	if (pmic_spkr_is_stereo_en(&stereo))
		pmic_is_stereo = 0;
	else
		pmic_is_stereo = 1;

	D("pmic stereo out val = 0x%08x\n", stereo);

	/* Initialize the PMIC MIC and SPKR */
	if (pmic_is_stereo) {
		pmic_spkr_set_gain(LEFT_SPKR, SPKR_GAIN_PLUS12DB);
		pmic_spkr_set_gain(RIGHT_SPKR, SPKR_GAIN_PLUS12DB);
	} else
		pmic_set_speaker_gain(SPKR_GAIN_PLUS12DB);

	pmic_mic_set_volt(MIC_VOLT_1_80V);

	pmic_initialized = 1;
}
Exemplo n.º 3
0
void analog_init(void)
{
	
	pmic_spkr_set_gain(LEFT_SPKR, SPKR_GAIN_PLUS12DB);
	pmic_spkr_set_gain(RIGHT_SPKR, SPKR_GAIN_PLUS12DB);
	pmic_mic_set_volt(MIC_VOLT_1_80V);

	gpio_direction_output(GPIO_HEADSET_AMP, 1);
	gpio_set_value(GPIO_HEADSET_AMP, 0);
}
void analog_init(void)
{
	/* stereo pmic init */
	pmic_spkr_set_gain(LEFT_SPKR, SPKR_GAIN_PLUS12DB);
	pmic_spkr_set_gain(RIGHT_SPKR, SPKR_GAIN_PLUS12DB);
	pmic_mic_set_volt(MIC_VOLT_1_80V);

#if !HUAWEI_HWID(S70)
	gpio_direction_output(GPIO_HEADSET_AMP, 1);
	gpio_set_value(GPIO_HEADSET_AMP, 0);
#else
    /* switch speaker off */
#if HUAWEI_HWID_L2(S7, S7201)
	pmic_secure_mpp_control_digital_output(
			PM_MPP_12,
			PM_MPP__DLOGIC__LVL_VDD,
			PM_MPP__DLOGIC_OUT__CTRL_LOW);
#endif
	gpio_set_value(GPIO_SPK_PWN, 0);  /* 0: MUTE; 1: ON*/
#endif
}
Exemplo n.º 5
0
static int debug_spkr_set_gain(char *buf, int size)
{
	int	left_right;
	int	enable;
	int	cnt;

	cnt = sscanf(buf, "%d %d", &left_right, &enable);
	if (cnt < 2) {
		printk(KERN_ERR "%s: sscanf failed cnt=%d" , __func__, cnt);
		return -EINVAL;
	}
	if (pmic_spkr_set_gain(left_right, enable) >= 0) {
		debug_spkr_left_right = left_right;
		return size;
	}
	return -EFAULT;
}