Пример #1
0
static int broadwell_rt286_codec_init(struct snd_soc_pcm_runtime *rtd)
{
	struct snd_soc_codec *codec = rtd->codec;
	int ret = 0;

	ret = snd_soc_jack_new(codec, "Headphone Jack", SND_JACK_HEADPHONE,
				&broadwell_hp);
	if (ret)
		return ret;

	ret = snd_soc_jack_add_pins(&broadwell_hp, 1, broadwell_hp_pins);
	if (ret)
		return ret;

	ret = snd_soc_jack_new(codec, "Mic Jack", SND_JACK_MICROPHONE,
				&broadwell_mic);
	if (ret)
		return ret;

	ret = snd_soc_jack_add_pins(&broadwell_mic, 1, broadwell_mic_pins);
	if (ret)
		return ret;

	rt286_mic_detect(codec, &broadwell_hp, &broadwell_mic);
	return 0;
}
Пример #2
0
static int skylake_rt286_codec_init(struct snd_soc_pcm_runtime *rtd)
{
	struct snd_soc_codec *codec = rtd->codec;
	int ret;

	ret = snd_soc_card_jack_new(rtd->card, "Headset",
		SND_JACK_HEADSET | SND_JACK_BTN_0,
		&skylake_headset,
		skylake_headset_pins, ARRAY_SIZE(skylake_headset_pins));

	if (ret)
		return ret;

	rt286_mic_detect(codec, &skylake_headset);

	return 0;
}
Пример #3
0
static int broadwell_rt286_codec_init(struct snd_soc_pcm_runtime *rtd)
{
	struct snd_soc_codec *codec = rtd->codec;
	int ret = 0;
	ret = snd_soc_jack_new(codec, "Headset",
		SND_JACK_HEADSET | SND_JACK_BTN_0, &broadwell_headset);

	if (ret)
		return ret;

	ret = snd_soc_jack_add_pins(&broadwell_headset,
		ARRAY_SIZE(broadwell_headset_pins),
		broadwell_headset_pins);
	if (ret)
		return ret;

	rt286_mic_detect(codec, &broadwell_headset);
	return 0;
}