void __init rider_audio_init(void)
{
	mutex_init(&bt_sco_lock);
	mutex_init(&mic_lock);

#ifdef CONFIG_MSM8X60_AUDIO
	pr_aud_info("%s\n", __func__);
	htc_8x60_register_analog_ops(&ops);
	htc_8x60_register_icodec_ops(&iops);
	htc_8x60_register_ecodec_ops(&eops);
	acoustic_register_ops(&acoustic);
	htc_8x60_register_aic3254_ops(&aops);
	msm_set_voc_freq(8000, 8000);
#endif

	aic3254_register_ctl_ops(&cops);

	/* PMIC GPIO Init (See board-rider.c) */
	/* Reset AIC3254 */
	rider_reset_3254();
	gpio_tlmm_config(
		GPIO_CFG(RIDER_AUD_CDC_LDO_SEL, 0, GPIO_CFG_OUTPUT,
			GPIO_CFG_PULL_DOWN, GPIO_CFG_2MA), GPIO_CFG_DISABLE);
	gpio_tlmm_config(msm_snddev_gpio[0], GPIO_CFG_DISABLE);
	gpio_tlmm_config(msm_snddev_gpio[1], GPIO_CFG_DISABLE);
	gpio_tlmm_config(msm_snddev_gpio[2], GPIO_CFG_DISABLE);
}
void __init runnymede_audio_init(void)
{

	mutex_init(&bt_sco_lock);
	mutex_init(&audio_2v85_usage_lock);
	audio_2v85_usage_counter = 0;

	htc_7x30_register_analog_ops(&ops);
	htc_7x30_register_icodec_ops(&iops);
	htc_7x30_register_ecodec_ops(&eops);
	htc_7x30_register_voice_ops(&vops);
	acoustic_register_ops(&acoustic);
	acdb_register_ops(&acdb);
	aic3254_register_ctl_ops(&cops);

	gpio_request(runnymede_AUD_MICPATH_SEL, "aud_mic_sel");
	gpio_direction_output(runnymede_AUD_MICPATH_SEL, 1);
	gpio_set_value(runnymede_AUD_MICPATH_SEL, 0);

	mutex_lock(&bt_sco_lock);
	config_gpio_table(aux_pcm_gpio_off, ARRAY_SIZE(aux_pcm_gpio_off));
	gpio_set_value(runnymede_GPIO_BT_PCM_OUT, 0);
	gpio_set_value(runnymede_GPIO_BT_PCM_SYNC, 0);
	gpio_set_value(runnymede_GPIO_BT_PCM_CLK, 0);
	mutex_unlock(&bt_sco_lock);
}
void __init doubleshot_audio_init(void)
{
	mutex_init(&mic_lock);

	pr_aud_info("%s\n", __func__);
	htc_8x60_register_analog_ops(&ops);
	htc_register_q6asm_ops(&qops);
	acoustic_register_ops(&acoustic);
	htc_8x60_register_aic3254_ops(&aops);
	msm_set_voc_freq(8000, 8000);	
	aic3254_register_ctl_ops(&cops);
	doubleshot_audio_gpios_init();
	doubleshot_reset_3254();
}
Exemplo n.º 4
0
void __init mecha_audio_init(void)
{
	static struct pm8058_gpio tpa2051_pwr = {
		.direction      = PM_GPIO_DIR_OUT,
		.output_buffer  = PM_GPIO_OUT_BUF_CMOS,
		.output_value   = 0,
		.pull	        = PM_GPIO_PULL_NO,
		.vin_sel	= 6,	  /* S3 1.8 V */
		.out_strength   = PM_GPIO_STRENGTH_HIGH,
		.function	= PM_GPIO_FUNC_NORMAL,
	};

	mutex_init(&bt_sco_lock);

#ifdef CONFIG_MSM7KV2_AUDIO
	htc_7x30_register_analog_ops(&ops);
	htc_7x30_register_icodec_ops(&iops);
	htc_7x30_register_ecodec_ops(&eops);
	htc_7x30_register_voice_ops(&vops);
	acoustic_register_ops(&acoustic);
	acdb_register_ops(&acdb);
#endif
	aic3254_register_ctl_ops(&cops);

	pm8058_gpio_config(MECHA_AUD_SPK_SD, &tpa2051_pwr);

	if (system_rev == 0)
		pm8058_gpio_config(MECHA_GPIO_AUD_AMP_EN_XA, &tpa2051_pwr);
	else {
		gpio_request(MECHA_GPIO_AUD_AMP_EN, "aud_amp_en");
		gpio_direction_output(MECHA_GPIO_AUD_AMP_EN, 1);
		gpio_set_value(MECHA_GPIO_AUD_AMP_EN, 0);
	}

	gpio_request(MECHA_AUD_MICPATH_SEL, "aud_mic_sel");
	gpio_direction_output(MECHA_AUD_MICPATH_SEL, 1);
	gpio_set_value(MECHA_AUD_MICPATH_SEL, 0);

	gpio_set_value(MECHA_AUD_CODEC_RST, 0);
	mdelay(1);
	gpio_set_value(MECHA_AUD_CODEC_RST, 1);

	mutex_lock(&bt_sco_lock);
	config_gpio_table(aux_pcm_gpio_off, ARRAY_SIZE(aux_pcm_gpio_off));
	gpio_set_value(MECHA_GPIO_BT_PCM_OUT, 0);
	gpio_set_value(MECHA_GPIO_BT_PCM_SYNC, 0);
	gpio_set_value(MECHA_GPIO_BT_PCM_CLK, 0);
	mutex_unlock(&bt_sco_lock);
}
void __init doubleshot_audio_init(void)
{
	int i = 0;
	mutex_init(&bt_sco_lock);
	mutex_init(&mic_lock);

#ifdef CONFIG_MSM8X60_AUDIO
	pr_aud_info("%s\n", __func__);
	htc_8x60_register_analog_ops(&ops);
	htc_8x60_register_icodec_ops(&iops);
	htc_8x60_register_ecodec_ops(&eops);
	acoustic_register_ops(&acoustic);
	htc_8x60_register_aic3254_ops(&aops);

	/*fix voice sample rate as 8KHz for 3254 dual mic.*/
	msm_set_voc_freq(8000, 8000);
#endif
	aic3254_register_ctl_ops(&cops);

	/* PMIC GPIO Init (See board-doubleshot.c) */

	/*
	EVT XA : 0x0000FFFF
	DVT XB : 0x0101FFFF
	DVT XC : 0x0202FFFF

	Use XB as critiria because there are some XA devices did
	not follow this rule.
	*/
	pr_info("%s: system_rev = 0x%08x", __func__, system_rev);
	switch (system_rev)
	{
	case XA_DEV:
		emic_micbias = OTHC_MICBIAS_1;
		bmic_micbias = OTHC_MICBIAS_2;
		break;
	case XB_DEV:
	case XC_DEV:
	default:
		emic_micbias = OTHC_MICBIAS_2;
		bmic_micbias = OTHC_MICBIAS_1;
		break;
	}
	/* Reset AIC3254 */
	doubleshot_reset_3254();
	for (i=0 ; i<sizeof(msm_snddev_gpio); i++)
		gpio_tlmm_config(msm_snddev_gpio[i], GPIO_CFG_DISABLE);
}
void __init holiday_audio_init(void)
{
	int i = 0;
	mutex_init(&bt_sco_lock);
	mutex_init(&mic_lock);
	pr_aud_info("%s: 0x%x\n", __func__, skuid);
	switch (skuid) {
	case SKU_ATT1:
	case SKU_ATT2:
	case SKU_ATT3:
		support_audience = 1;
		break;
	default:
		support_audience = 0;
		break;
	}

#ifdef CONFIG_MSM8X60_AUDIO
	pr_aud_info("%s\n", __func__);
	htc_8x60_register_analog_ops(&ops);
	htc_8x60_register_ecodec_ops(&eops);
	htc_8x60_register_icodec_ops(&iops);
	acoustic_register_ops(&acoustic);
	htc_8x60_register_aic3254_ops(&aops);
	htc_8x60_register_q6asm_ops(&qops);

#ifdef CONFIG_VP_A1026
	a1026_register_ctl_ops(&a1026ops);
#endif

	if (!support_audience)
		/*fix voice sample rate as 8KHz for 3254 dual mic.*/
		msm_set_voc_freq(8000, 8000);

	aic3254_register_ctl_ops(&cops);
#endif

	/* PMIC GPIO Init (See board-holiday.c) */
	/* Reset AIC3254 */
	holiday_reset_3254();
	for (i = 0; i < sizeof(msm_snddev_gpio); i++)
		gpio_tlmm_config(msm_snddev_gpio[i], GPIO_CFG_DISABLE);

	/* Configure A1026 GPIOs */
	audience_gpio_init();
}
void __init spade_audio_init(void)
{
	struct pm8058_gpio audio_pwr = {
		.direction      = PM_GPIO_DIR_OUT,
		.output_buffer  = PM_GPIO_OUT_BUF_CMOS,
		.output_value   = 0,
		.pull           = PM_GPIO_PULL_NO,
		.out_strength   = PM_GPIO_STRENGTH_HIGH,
		.function       = PM_GPIO_FUNC_NORMAL,
		.vin_sel        = 6,
	};

	mutex_init(&bt_sco_lock);
	mutex_init(&mic_lock);

#ifdef CONFIG_MSM7KV2_AUDIO
	htc_7x30_register_analog_ops(&ops);
	htc_7x30_register_icodec_ops(&iops);
	htc_7x30_register_ecodec_ops(&eops);
	htc_7x30_register_voice_ops(&vops);
	acoustic_register_ops(&acoustic);
#endif
	aic3254_register_ctl_ops(&cops);

	/* Init PMIC GPIO */
	pm8058_gpio_config(SPADE_AUD_EP_EN, &audio_pwr);
	pm8058_gpio_config(SPADE_AUD_SPK_ENO, &audio_pwr);
	pm8058_gpio_config(SPADE_AUD_HP_EN, &audio_pwr);

	/* Rest AIC3254 */
	gpio_set_value(SPADE_AUD_CODEC_RST, 0);
	mdelay(1);
	gpio_set_value(SPADE_AUD_CODEC_RST, 1);

	mutex_lock(&bt_sco_lock);
	config_gpio_table(aux_pcm_gpio_off, ARRAY_SIZE(aux_pcm_gpio_off));
	gpio_set_value(SPADE_GPIO_BT_PCM_OUT, 0);
	gpio_set_value(SPADE_GPIO_BT_PCM_SYNC, 0);
	gpio_set_value(SPADE_GPIO_BT_PCM_CLK, 0);
	mutex_unlock(&bt_sco_lock);
}
void __init mecha_audio_init(void)
{

	mutex_init(&bt_sco_lock);

#ifdef CONFIG_MSM7KV2_AUDIO
	htc_7x30_register_analog_ops(&ops);
	htc_7x30_register_icodec_ops(&iops);
	htc_7x30_register_ecodec_ops(&eops);
	htc_7x30_register_voice_ops(&vops);
	acoustic_register_ops(&acoustic);
	acdb_register_ops(&acdb);
#endif
	aic3254_register_ctl_ops(&cops);

#if 0
	pm8058_gpio_config(MECHA_AUD_SPK_SD, &tpa2051_pwr);

	if (system_rev == 0)
		pm8058_gpio_config(MECHA_GPIO_AUD_AMP_EN_XA, &tpa2051_pwr);
	else {
		gpio_request(MECHA_GPIO_AUD_AMP_EN, "aud_amp_en");
		gpio_direction_output(MECHA_GPIO_AUD_AMP_EN, 1);
		gpio_set_value(MECHA_GPIO_AUD_AMP_EN, 0);
	}
  #endif
	gpio_request(MECHA_AUD_MICPATH_SEL, "aud_mic_sel");
	gpio_direction_output(MECHA_AUD_MICPATH_SEL, 1);
	gpio_set_value(MECHA_AUD_MICPATH_SEL, 0);

	gpio_set_value(MECHA_AUD_CODEC_RST, 0);
	mdelay(1);
	gpio_set_value(MECHA_AUD_CODEC_RST, 1);

	mutex_lock(&bt_sco_lock);
	config_gpio_table(aux_pcm_gpio_off, ARRAY_SIZE(aux_pcm_gpio_off));
	gpio_set_value(MECHA_GPIO_BT_PCM_OUT, 0);
	gpio_set_value(MECHA_GPIO_BT_PCM_SYNC, 0);
	gpio_set_value(MECHA_GPIO_BT_PCM_CLK, 0);
	mutex_unlock(&bt_sco_lock);
}
void __init runnymede_audio_init(void)
{

	struct pm8058_gpio tpa2051_pwr = {
		.direction      = PM_GPIO_DIR_OUT,
		.output_buffer  = PM_GPIO_OUT_BUF_CMOS,
		.output_value   = 0,
		.pull           = PM_GPIO_PULL_NO,
		.vin_sel        = 6,      /* S3 1.8 V */
		.out_strength   = PM_GPIO_STRENGTH_HIGH,
		.function       = PM_GPIO_FUNC_NORMAL,
	};

	mutex_init(&bt_sco_lock);
	mutex_init(&audio_2v85_usage_lock);
	audio_2v85_usage_counter = 0;
#ifdef CONFIG_MSM7KV2_AUDIO
	htc_7x30_register_analog_ops(&ops);
	htc_7x30_register_icodec_ops(&iops);
	htc_7x30_register_ecodec_ops(&eops);
	htc_7x30_register_voice_ops(&vops);
	acoustic_register_ops(&acoustic);
	acdb_register_ops(&acdb);
#endif
	aic3254_register_ctl_ops(&cops);

	pm8058_gpio_config(runnymede_AUD_SPK_SD, &tpa2051_pwr);
	pm8058_gpio_config(runnymede_AUD_AMP_EN, &tpa2051_pwr);
	gpio_request(runnymede_AUD_MICPATH_SEL, "aud_mic_sel");
	gpio_direction_output(runnymede_AUD_MICPATH_SEL, 1);
	gpio_set_value(runnymede_AUD_MICPATH_SEL, 0);

	mutex_lock(&bt_sco_lock);
	config_gpio_table(aux_pcm_gpio_off, ARRAY_SIZE(aux_pcm_gpio_off));
	gpio_set_value(runnymede_GPIO_BT_PCM_OUT, 0);
	gpio_set_value(runnymede_GPIO_BT_PCM_SYNC, 0);
	gpio_set_value(runnymede_GPIO_BT_PCM_CLK, 0);
	mutex_unlock(&bt_sco_lock);
}
Exemplo n.º 10
0
void __init pyramid_audio_init(void)
{
	mutex_init(&bt_sco_lock);
	mutex_init(&mic_lock);

#ifdef CONFIG_MSM8X60_AUDIO
	pr_aud_info("%s\n", __func__);
	htc_8x60_register_analog_ops(&ops);
	htc_8x60_register_icodec_ops(&iops);
	htc_8x60_register_ecodec_ops(&eops);
	acoustic_register_ops(&acoustic);
	htc_8x60_register_aic3254_ops(&aops);
	htc_8x60_register_q6asm_ops(&qops);
	msm_set_voc_freq(8000, 8000);
#endif

	aic3254_register_ctl_ops(&cops);

	/* PMIC GPIO Init (See board-pyramid.c) */

	/* Reset AIC3254 */
	pyramid_reset_3254();
}
Exemplo n.º 11
0
void __init verdi_lte_audio_init(void)
{
	mutex_init(&bt_sco_lock);
	mutex_init(&mic_lock);

#ifdef CONFIG_MSM8X60_AUDIO_LTE
	pr_aud_info("%s\n", __func__);
	htc_8x60_register_analog_ops(&ops);
	htc_8x60_register_icodec_ops(&iops);
	htc_8x60_register_ecodec_ops(&eops);
	acoustic_register_ops(&acoustic);
	htc_8x60_register_aic3254_ops(&aops);
#endif

	aic3254_register_ctl_ops(&cops);

	/* PMIC GPIO Init (See board-verdi-lte.c) */

	mutex_init(&audio_2v85_usage_lock);
	audio_2v85_usage_counter = 0;
	verdi_lte_audio_2v85_set_voltage(1);

	/* Reset AIC3254 */
	gpio_tlmm_config(msm_aic3254_reset_gpio[0], GPIO_CFG_ENABLE);

	/* this PIN is only defined in XA board */
	if (system_rev == 0) {
		gpio_set_value(VERDI_LTE_AUD_LDO_SEL, 0);

		mdelay(1);
		config_gpio_table(msm_snddev_gpio_on, \
			ARRAY_SIZE(msm_snddev_gpio_on));
		gpio_set_value(VERDI_LTE_AUD_RX_MCLK1, 0);
		gpio_set_value(VERDI_LTE_AUD_QTR_TX_MCLK1, 0);
		gpio_set_value(VERDI_LTE_AUD_QTR_TX_I2S_SD2, 0);
	} else {
		config_gpio_table(msm_snddev_gpio_off, \
			ARRAY_SIZE(msm_snddev_gpio_off));
		gpio_set_value(VERDI_LTE_AUD_RX_MCLK1, 0);
		gpio_set_value(VERDI_LTE_AUD_QTR_TX_MCLK1, 0);
		gpio_set_value(VERDI_LTE_AUD_QTR_TX_I2S_SD2, 0);
	}

	config_gpio_table(verdi_lte_a1028_gpio, \
		ARRAY_SIZE(verdi_lte_a1028_gpio));
	gpio_set_value(VERDI_LTE_AUD_A1028_RESET, 0);
	gpio_set_value(VERDI_LTE_AUD_A1028_WAKEUP, 0);
	gpio_set_value(VERDI_LTE_AUD_A1028_INT, 0);

	config_gpio_table(verdi_lte_i2s_rx2_gpio, \
		ARRAY_SIZE(verdi_lte_i2s_rx2_gpio));
	gpio_set_value(VERDI_LTE_AUD_RX_CLK2, 0);
	gpio_set_value(VERDI_LTE_AUD_RX_WS2, 0);
	gpio_set_value(VERDI_LTE_AUD_RX_SD2, 0);
	gpio_set_value(VERDI_LTE_AUD_RX_MCLK2, 0);

	gpio_tlmm_config(msm_qtr_reset_gpio[0], GPIO_CFG_ENABLE);
	gpio_set_value(VERDI_LTE_AUD_QTR_RESET, 1);

	/* BT AUX PCM PIN init */
	config_gpio_table(aux_pcm_gpio_off, ARRAY_SIZE(aux_pcm_gpio_off));
	gpio_set_value(VERDI_LTE_GPIO_BT_PCM_OUT, 0);
	gpio_set_value(VERDI_LTE_GPIO_BT_PCM_SYNC, 0);
	gpio_set_value(VERDI_LTE_GPIO_BT_PCM_CLK, 0);

	audio_first_boot_counter = 0;
}