Exemple #1
0
static int tegra_wm8903_event_int_mic(struct snd_soc_dapm_widget *w,
					struct snd_kcontrol *k, int event)
{
	struct snd_soc_dapm_context *dapm = w->dapm;
	struct snd_soc_card *card = dapm->card;
	struct tegra_wm8903 *machine = snd_soc_card_get_drvdata(card);
	struct tegra_wm8903_platform_data *pdata = machine->pdata;

	//printk(KERN_INFO "###### %s: %s\n", __FUNCTION__, SND_SOC_DAPM_EVENT_ON(event)?"Enable":"Disable");
	if(machine_is_avalon() || machine_is_sphinx()) {
		if (machine->dmic_reg) {
			if (SND_SOC_DAPM_EVENT_ON(event))
				regulator_enable(machine->dmic_reg);
			else
				regulator_disable(machine->dmic_reg);
		}
	}

	#ifdef CONFIG_SND_SOC_FM34
	tegra_pcm_control(SND_SOC_DAPM_EVENT_ON(event), machine->cap_substream);
	#endif

	if (!(machine->gpio_requested & GPIO_INT_MIC_EN))
		return 0;

	gpio_set_value_cansleep(pdata->gpio_int_mic_en,
				SND_SOC_DAPM_EVENT_ON(event));

	return 0;
}
Exemple #2
0
static void tegra_pcm_work(struct work_struct *work)
{
	struct tegra_runtime_data *prtd =
			container_of(work, struct tegra_runtime_data, work);
	struct snd_soc_pcm_runtime *rtd = prtd->substream->private_data;

	//printk(KERN_INFO "############### tegra_pcm_work %s state:%s func:%s\n", rtd->codec->name, prtd->running?"True":"False",
	//		prtd->substream->stream?"Capture":"Playback");

	if(rtd->codec)
		tegra_pcm_control(prtd->running, prtd->substream);
}