static int __init deluxe_u_audio_init(void)
{
        int ret = 0;

	static uint32_t audio_i2s_table[] = {
		GPIO_CFG(35, 0, GPIO_CFG_INPUT, GPIO_CFG_PULL_DOWN, GPIO_CFG_2MA),
		GPIO_CFG(36, 0, GPIO_CFG_INPUT, GPIO_CFG_PULL_DOWN, GPIO_CFG_2MA),
		GPIO_CFG(37, 0, GPIO_CFG_INPUT, GPIO_CFG_PULL_DOWN, GPIO_CFG_2MA),
	};
	pr_info("%s", __func__);
	gpio_request(HAC_PAMP_GPIO, "AUDIO_HAC_AMP");
	gpio_direction_output(HAC_PAMP_GPIO, 0);
	gpio_free(HAC_PAMP_GPIO);
	gpio_tlmm_config(audio_i2s_table[0], GPIO_CFG_DISABLE);
	gpio_tlmm_config(audio_i2s_table[1], GPIO_CFG_DISABLE);
	gpio_tlmm_config(audio_i2s_table[2], GPIO_CFG_DISABLE);

	htc_register_q6asm_ops(&qops);
	htc_register_pcm_routing_ops(&rops);
	htc_register_compr_q6_ops(&cops);
	acoustic_register_ops(&acoustic);
	pr_info("%s", __func__);
	return ret;

}
static int __init ville_audio_init(void)
{
	int ret;

	if (!cpu_is_msm8960()) {
		pr_info("%s: Not the right machine type\n", __func__);
		return -ENODEV ;
	}
	pr_info("%s", __func__);

	msm8960_snd_device = platform_device_alloc("soc-audio", 0);
	if (!msm8960_snd_device) {
		pr_err("Platform device allocation failed\n");
		return -ENOMEM;
	}

	memcpy(msm8960_dai, msm8960_dai_common, sizeof(msm8960_dai_common));
	memcpy(msm8960_dai + ARRAY_SIZE(msm8960_dai_common),
		msm8960_dai_delta_tabla2x, sizeof(msm8960_dai_delta_tabla2x));

	platform_set_drvdata(msm8960_snd_device, &snd_soc_card_msm8960);
	ret = platform_device_add(msm8960_snd_device);
	if (ret) {
		platform_device_put(msm8960_snd_device);
		return ret;
	}

	msm8960_snd_tabla1x_device = platform_device_alloc("soc-audio", 1);
	if (!msm8960_snd_tabla1x_device) {
		pr_err("Platform device allocation failed\n");
		return -ENOMEM;
	}

	memcpy(msm8960_tabla1x_dai, msm8960_dai_common,
		sizeof(msm8960_dai_common));
	memcpy(msm8960_tabla1x_dai + ARRAY_SIZE(msm8960_dai_common),
		msm8960_dai_delta_tabla1x, sizeof(msm8960_dai_delta_tabla1x));

	platform_set_drvdata(msm8960_snd_tabla1x_device,
		&snd_soc_tabla1x_card_msm8960);
	ret = platform_device_add(msm8960_snd_tabla1x_device);
	if (ret) {
		platform_device_put(msm8960_snd_tabla1x_device);
		return ret;
	}

	mutex_init(&cdc_mclk_mutex);
	htc_register_q6asm_ops(&qops);
	htc_register_pcm_routing_ops(&rops);
	acoustic_register_ops(&acoustic);
	return ret;

}
static int __init m7wl_audio_init(void)
{
        int ret = 0;

	htc_register_q6asm_ops(&qops);
	htc_register_pcm_routing_ops(&rops);
	htc_register_compr_q6_ops(&cops);
	acoustic_register_ops(&acoustic);
	m7wl_audio_pmic_mpp_config();
	pr_info("%s", __func__);
	return ret;

}
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();
}
static int __init m7wl_audio_init(void)
{
        int ret = 0;

	
	gpio_request(RCV_PAMP_GPIO, "AUDIO_RCV_AMP");
	gpio_tlmm_config(GPIO_CFG(67, 0, GPIO_CFG_OUTPUT, GPIO_CFG_PULL_DOWN, GPIO_CFG_2MA), GPIO_CFG_DISABLE);
	htc_register_q6asm_ops(&qops);
	htc_register_pcm_routing_ops(&rops);
	htc_register_compr_q6_ops(&cops);
	acoustic_register_ops(&acoustic);
	pr_info("%s", __func__);
	return ret;

}
void __init shooter_u_audio_init(void)
{
	int i = 0;
	mutex_init(&mic_lock);

	pr_aud_info("%s\n", __func__);
	htc_8x60_register_analog_ops(&ops);
	htc_8x60_register_icodec_ops(&iops);
	htc_register_q6asm_ops(&qops);
	acoustic_register_ops(&acoustic);

	
	for (i = 0 ; i < ARRAY_SIZE(msm_snddev_gpio); i++)
		gpio_tlmm_config(msm_snddev_gpio[i], GPIO_CFG_DISABLE);

	shooter_u_audio_gpios_init();
}
예제 #7
0
static int __init k2cl_audio_init(void)
{
	int ret = 0;
	pr_info("%s", __func__);

	/* SPK AMP */
	gpio_tlmm_config(GPIO_CFG(MSM_AUD_SPK_EN, 0, GPIO_CFG_OUTPUT,
		 GPIO_CFG_NO_PULL, GPIO_CFG_2MA), GPIO_CFG_ENABLE);
	gpio_set_value(MSM_AUD_SPK_EN, 0);

	htc_register_q6asm_ops(&qops);
	htc_register_pcm_routing_ops(&rops);
	htc_register_compr_q6_ops(&cops);
	acoustic_register_ops(&acoustic);

	return ret;
}
void __init villec2_audio_init(void)
{
	int i = 0;
	mutex_init(&bt_sco_lock);
	mutex_init(&mic_lock);

	pr_aud_info("%s\n", __func__);
	htc_8x60_register_analog_ops(&ops);
	htc_8x60_register_ecodec_ops(&eops);
	htc_8x60_register_icodec_ops(&iops);
	htc_8x60_register_dev_ctrl_ops(&dops);
	htc_register_q6asm_ops(&qops);
	acoustic_register_ops(&acoustic);

	/* PMIC GPIO Init (See board-villec2.c) */
	for (i = 0 ; i < ARRAY_SIZE(msm_snddev_gpio); i++)
		gpio_tlmm_config(msm_snddev_gpio[i], GPIO_CFG_DISABLE);
}
static int __init zara_cl_audio_init(void)
{
	int ret = 0;
	pr_info("%s", __func__);

	
	gpio_request(MSM_AUD_REC_EN, "AUDIO_RCV_AMP");
	gpio_tlmm_config(GPIO_CFG(MSM_AUD_REC_EN, 0, GPIO_CFG_OUTPUT,
		GPIO_CFG_NO_PULL, GPIO_CFG_2MA), GPIO_CFG_ENABLE);
	gpio_set_value(MSM_AUD_REC_EN, 0);

	
	gpio_request(MSM_AUD_RECEIVER_SEL, "AUD_RECEIVER_SEL");
	gpio_tlmm_config(GPIO_CFG(MSM_AUD_RECEIVER_SEL, 0, GPIO_CFG_OUTPUT,
		GPIO_CFG_NO_PULL, GPIO_CFG_2MA), GPIO_CFG_ENABLE);
	gpio_set_value(MSM_AUD_RECEIVER_SEL, 0);

	htc_register_q6asm_ops(&qops);
	htc_register_pcm_routing_ops(&rops);
	htc_register_compr_q6_ops(&cops);
	acoustic_register_ops(&acoustic);

	return ret;
}
예제 #10
0
static int __init jet_audio_init(void)
{
	int ret = 0, rc = 0;
	struct pm_gpio param = {
		.direction	= PM_GPIO_DIR_OUT,
		.output_buffer	= PM_GPIO_OUT_BUF_CMOS,
		.output_value	= 0,
		.pull		= PM_GPIO_PULL_NO,
		.vin_sel	= PM_GPIO_VIN_L17,
		.out_strength	= PM_GPIO_STRENGTH_MED,
		.function	= PM_GPIO_FUNC_NORMAL,
	};

	if (!cpu_is_msm8960()) {
		pr_info("%s: Not the right machine type\n", __func__);
		return -ENODEV ;
	}

	pr_info("%s", __func__);

	msm8960_snd_device = platform_device_alloc("soc-audio", 0);
	if (!msm8960_snd_device) {
		pr_err("Platform device allocation failed\n");
		return -ENOMEM;
	}

	memcpy(msm8960_dai, msm8960_dai_common, sizeof(msm8960_dai_common));
	memcpy(msm8960_dai + ARRAY_SIZE(msm8960_dai_common),
		msm8960_dai_delta_tabla2x, sizeof(msm8960_dai_delta_tabla2x));

	platform_set_drvdata(msm8960_snd_device, &snd_soc_card_msm8960);
	ret = platform_device_add(msm8960_snd_device);
	if (ret) {
		platform_device_put(msm8960_snd_device);
		return ret;
	}

	msm8960_snd_tabla1x_device = platform_device_alloc("soc-audio", 1);
	if (!msm8960_snd_tabla1x_device) {
		pr_err("Platform device allocation failed\n");
		return -ENOMEM;
	}

	memcpy(msm8960_tabla1x_dai, msm8960_dai_common,
		sizeof(msm8960_dai_common));
	memcpy(msm8960_tabla1x_dai + ARRAY_SIZE(msm8960_dai_common),
		msm8960_dai_delta_tabla1x, sizeof(msm8960_dai_delta_tabla1x));

	platform_set_drvdata(msm8960_snd_tabla1x_device,
		&snd_soc_tabla1x_card_msm8960);
	ret = platform_device_add(msm8960_snd_tabla1x_device);
	if (ret) {
		platform_device_put(msm8960_snd_tabla1x_device);
		return ret;
	}

	rc = gpio_request(PM8921_GPIO_PM_TO_SYS(JET_PMGPIO_AUD_AMP_EN),
					"jet_en");
	rc = pm8xxx_gpio_config(PM8921_GPIO_PM_TO_SYS(JET_PMGPIO_AUD_AMP_EN),
			&param);
	if (rc < 0)
		pr_aud_err("failed to configure tpa2051_en gpio\n");

	mutex_init(&cdc_mclk_mutex);
	htc_register_q6asm_ops(&qops);
	htc_register_pcm_routing_ops(&rops);
	acoustic_register_ops(&acoustic);
	return ret;

}
late_initcall(jet_audio_init);

static void __exit jet_audio_exit(void)
{

	if (!cpu_is_msm8960()) {
		pr_info("%s: Not the right machine type\n", __func__);
		return ;
	}
	pr_info("%s", __func__);

	platform_device_unregister(msm8960_snd_device);
	platform_device_unregister(msm8960_snd_tabla1x_device);
	gpio_free(PAMP_GPIO);
	mutex_destroy(&cdc_mclk_mutex);
}
module_exit(jet_audio_exit);

MODULE_DESCRIPTION("ALSA Platform Jet");
MODULE_LICENSE("GPL v2");