本文整理汇总了C++中SOC_DAPM_PIN_SWITCH函数的典型用法代码示例。如果您正苦于以下问题:C++ SOC_DAPM_PIN_SWITCH函数的具体用法?C++ SOC_DAPM_PIN_SWITCH怎么用?C++ SOC_DAPM_PIN_SWITCH使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了SOC_DAPM_PIN_SWITCH函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SOC_DAPM_PIN_SWITCH
static struct snd_soc_jack broadwell_headset;
/* Headset jack detection DAPM pins */
static struct snd_soc_jack_pin broadwell_headset_pins[] = {
{
.pin = "Mic Jack",
.mask = SND_JACK_MICROPHONE,
},
{
.pin = "Headphone Jack",
.mask = SND_JACK_HEADPHONE,
},
};
static const struct snd_kcontrol_new broadwell_controls[] = {
SOC_DAPM_PIN_SWITCH("Speaker"),
SOC_DAPM_PIN_SWITCH("Headphone Jack"),
};
static const struct snd_soc_dapm_widget broadwell_widgets[] = {
SND_SOC_DAPM_HP("Headphone Jack", NULL),
SND_SOC_DAPM_SPK("Speaker", NULL),
SND_SOC_DAPM_MIC("Mic Jack", NULL),
SND_SOC_DAPM_MIC("DMIC1", NULL),
SND_SOC_DAPM_MIC("DMIC2", NULL),
SND_SOC_DAPM_LINE("Line Jack", NULL),
};
static const struct snd_soc_dapm_route broadwell_rt286_map[] = {
/* speaker */
示例2: SOC_DAPM_PIN_SWITCH
// HP MIC
{"micbias1", NULL, "Headset Jack"},
{"MIC3", NULL, "micbias1"},
{"Ext Spk", NULL, "SPOLP"},
{"Ext Spk", NULL, "SPOLN"},
{"Ext Spk", NULL, "SPORP"},
{"Ext Spk", NULL, "SPORN"},
{"Headphone Jack", NULL, "HPOL"},
{"Headphone Jack", NULL, "HPOR"},
} ;
static const struct snd_kcontrol_new rockchip_rt3261_controls[] = {
SOC_DAPM_PIN_SWITCH("Mic Jack"),
SOC_DAPM_PIN_SWITCH("Headset Jack"),
SOC_DAPM_PIN_SWITCH("Ext Spk"),
SOC_DAPM_PIN_SWITCH("Headphone Jack"),
};
/*
* Logic for a rt3261 as connected on a rockchip board.
*/
static int rockchip_rt3261_init(struct snd_soc_pcm_runtime *rtd)
{
struct snd_soc_codec *codec = rtd->codec;
struct snd_soc_dapm_context *dapm = &codec->dapm;
DBG("Enter::%s----%d\n",__FUNCTION__,__LINE__);
示例3: SOC_ENUM_EXT
return 0;
drvdata->mclk_sel = val;
return 1;
}
/*
* Controls
*/
static struct snd_kcontrol_new mop500_ab8500_ctrls[] = {
SOC_ENUM_EXT("Master Clock Select",
soc_enum_mclk,
mclk_input_control_get, mclk_input_control_put),
SOC_DAPM_PIN_SWITCH("Headset Left"),
SOC_DAPM_PIN_SWITCH("Headset Right"),
SOC_DAPM_PIN_SWITCH("Earpiece"),
SOC_DAPM_PIN_SWITCH("Speaker Left"),
SOC_DAPM_PIN_SWITCH("Speaker Right"),
SOC_DAPM_PIN_SWITCH("LineOut Left"),
SOC_DAPM_PIN_SWITCH("LineOut Right"),
SOC_DAPM_PIN_SWITCH("Vibra 1"),
SOC_DAPM_PIN_SWITCH("Vibra 2"),
SOC_DAPM_PIN_SWITCH("Mic 1"),
SOC_DAPM_PIN_SWITCH("Mic 2"),
SOC_DAPM_PIN_SWITCH("LineIn Left"),
SOC_DAPM_PIN_SWITCH("LineIn Right"),
SOC_DAPM_PIN_SWITCH("DMic 1"),
SOC_DAPM_PIN_SWITCH("DMic 2"),
SOC_DAPM_PIN_SWITCH("DMic 3"),
示例4: SOC_DAPM_PIN_SWITCH
/* */
{"MIC1", NULL, "Mic Bias"},
{"Mic Bias", NULL, "Headset Mic"},
/* */
{"MIC2", NULL, "Mic Bias"},
{"MIC2N", NULL, "Mic Bias"},
{"Mic Bias", NULL, "Handset Mic"},
/* */
{"ACIN", NULL, "ACOP"},
};
static const struct snd_kcontrol_new neo1973_wm8753_controls[] = {
SOC_DAPM_PIN_SWITCH("GSM Line Out"),
SOC_DAPM_PIN_SWITCH("GSM Line In"),
SOC_DAPM_PIN_SWITCH("Headset Mic"),
SOC_DAPM_PIN_SWITCH("Handset Mic"),
};
/* */
static int gta02_speaker_enabled;
static int lm4853_set_spk(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{
gta02_speaker_enabled = ucontrol->value.integer.value[0];
gpio_set_value(GTA02_GPIO_HP_IN, !gta02_speaker_enabled);
示例5: SOC_DAPM_PIN_SWITCH
SND_SOC_DAIFMT_CBM_CFM,
.ignore_suspend = 1,
.params = &sub_params,
.init = lowland_wm9081_init,
},
};
static struct snd_soc_codec_conf lowland_codec_conf[] = {
{
.dev_name = "wm9081.1-006c",
.name_prefix = "Sub",
},
};
static const struct snd_kcontrol_new controls[] = {
SOC_DAPM_PIN_SWITCH("Main Speaker"),
SOC_DAPM_PIN_SWITCH("Main DMIC"),
SOC_DAPM_PIN_SWITCH("Main AMIC"),
SOC_DAPM_PIN_SWITCH("WM1250 Input"),
SOC_DAPM_PIN_SWITCH("WM1250 Output"),
SOC_DAPM_PIN_SWITCH("Headphone"),
};
static struct snd_soc_dapm_widget widgets[] = {
SND_SOC_DAPM_HP("Headphone", NULL),
SND_SOC_DAPM_MIC("Headset Mic", NULL),
SND_SOC_DAPM_SPK("Main Speaker", NULL),
SND_SOC_DAPM_MIC("Main AMIC", NULL),
SND_SOC_DAPM_MIC("Main DMIC", NULL),
示例6: SOC_DAPM_PIN_SWITCH
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
*/
#include <linux/module.h>
#include <sound/core.h>
#include <sound/pcm.h>
#include <sound/soc.h>
#include <sound/jack.h>
#include "../codecs/wm8994.h"
#include "mmp-sspa.h"
static const struct snd_kcontrol_new brownstone_dapm_control[] = {
SOC_DAPM_PIN_SWITCH("Ext Spk"),
};
static const struct snd_soc_dapm_widget brownstone_dapm_widgets[] = {
SND_SOC_DAPM_SPK("Ext Spk", NULL),
SND_SOC_DAPM_HP("Headset Stereophone", NULL),
SND_SOC_DAPM_MIC("Headset Mic", NULL),
SND_SOC_DAPM_MIC("Main Mic", NULL),
};
static const struct snd_soc_dapm_route brownstone_audio_map[] = {
{"Ext Spk", NULL, "SPKOUTLP"},
{"Ext Spk", NULL, "SPKOUTLN"},
{"Ext Spk", NULL, "SPKOUTRP"},
{"Ext Spk", NULL, "SPKOUTRN"},
示例7: midas_wm1811_aif3_hw_params
.hw_params = midas_wm1811_aif2_hw_params,
};
static int midas_wm1811_aif3_hw_params(struct snd_pcm_substream *substream,
struct snd_pcm_hw_params *params)
{
pr_err("%s: enter\n", __func__);
return 0;
}
static struct snd_soc_ops midas_wm1811_aif3_ops = {
.hw_params = midas_wm1811_aif3_hw_params,
};
static const struct snd_kcontrol_new midas_controls[] = {
SOC_DAPM_PIN_SWITCH("HP"),
SOC_DAPM_PIN_SWITCH("SPK"),
SOC_DAPM_PIN_SWITCH("RCV"),
SOC_DAPM_PIN_SWITCH("FM In"),
SOC_DAPM_PIN_SWITCH("LINE"),
SOC_DAPM_PIN_SWITCH("HDMI"),
SOC_DAPM_PIN_SWITCH("Main Mic"),
SOC_DAPM_PIN_SWITCH("Sub Mic"),
SOC_DAPM_PIN_SWITCH("Third Mic"),
SOC_DAPM_PIN_SWITCH("Headset Mic"),
SOC_ENUM_EXT("AIF2 Mode", aif2_mode_enum[0],
get_aif2_mode, set_aif2_mode),
SOC_ENUM_EXT("KPCS Mode", kpcs_mode_enum[0],
get_kpcs_mode, set_kpcs_mode),
示例8: SND_SOC_DAPM_SPK
.name = "Headset Mic detection",
.report = SND_JACK_MICROPHONE,
.debounce_time = 150,
.invert = 1
};
static const struct snd_soc_dapm_widget tegra_rt5677_dapm_widgets[] = {
SND_SOC_DAPM_SPK("Speaker", NULL),
SND_SOC_DAPM_HP("Headphone", tegra_rt5677_event_hp),
SND_SOC_DAPM_MIC("Headset Mic", NULL),
SND_SOC_DAPM_MIC("Internal Mic 1", NULL),
SND_SOC_DAPM_MIC("Internal Mic 2", NULL),
};
static const struct snd_kcontrol_new tegra_rt5677_controls[] = {
SOC_DAPM_PIN_SWITCH("Speaker"),
SOC_DAPM_PIN_SWITCH("Headphone"),
SOC_DAPM_PIN_SWITCH("Headset Mic"),
SOC_DAPM_PIN_SWITCH("Internal Mic 1"),
SOC_DAPM_PIN_SWITCH("Internal Mic 2"),
};
static int tegra_rt5677_asoc_init(struct snd_soc_pcm_runtime *rtd)
{
struct tegra_rt5677 *machine = snd_soc_card_get_drvdata(rtd->card);
snd_soc_card_jack_new(rtd->card, "Headphone Jack", SND_JACK_HEADPHONE,
&tegra_rt5677_hp_jack,
&tegra_rt5677_hp_jack_pins, 1);
if (gpio_is_valid(machine->gpio_hp_det)) {
示例9: S3C64XX_GPL
.pin = "Internal Speaker",
.mask = SND_JACK_HEADPHONE,
},
};
static struct snd_soc_jack_gpio smartq_jack_gpios[] = {
{
.gpio = S3C64XX_GPL(12),
.name = "headphone detect",
.report = SND_JACK_HEADPHONE,
.debounce_time = 200,
},
};
static const struct snd_kcontrol_new wm8987_smartq_controls[] = {
SOC_DAPM_PIN_SWITCH("Internal Speaker"),
SOC_DAPM_PIN_SWITCH("Headphone Jack"),
SOC_DAPM_PIN_SWITCH("Internal Mic"),
};
static int smartq_speaker_event(struct snd_soc_dapm_widget *w,
struct snd_kcontrol *k,
int event)
{
gpio_set_value(S3C64XX_GPK(12), SND_SOC_DAPM_EVENT_OFF(event));
return 0;
}
static const struct snd_soc_dapm_widget wm8987_dapm_widgets[] = {
SND_SOC_DAPM_SPK("Internal Speaker", smartq_speaker_event),
示例10: switch
switch (reg) {
case MX27VIS_AMP_GAIN:
ucontrol->value.integer.value[0] = mx27vis_amp_gain;
break;
case MX27VIS_AMP_MUTE:
ucontrol->value.integer.value[0] = mx27vis_amp_mute;
break;
}
return 0;
}
/* From 6dB to 24dB in steps of 6dB */
static const DECLARE_TLV_DB_SCALE(mx27vis_amp_tlv, 600, 600, 0);
static const struct snd_kcontrol_new mx27vis_aic32x4_controls[] = {
SOC_DAPM_PIN_SWITCH("External Mic"),
SOC_SINGLE_EXT_TLV("LO Ext Boost", MX27VIS_AMP_GAIN, 0, 3, 0,
mx27vis_amp_get, mx27vis_amp_set, mx27vis_amp_tlv),
SOC_DOUBLE_EXT("LO Ext Mute Switch", MX27VIS_AMP_MUTE, 0, 1, 1, 0,
mx27vis_amp_get, mx27vis_amp_set),
};
static const struct snd_soc_dapm_widget aic32x4_dapm_widgets[] = {
SND_SOC_DAPM_MIC("External Mic", NULL),
};
static const struct snd_soc_dapm_route aic32x4_dapm_routes[] = {
{"Mic Bias", NULL, "External Mic"},
{"IN1_R", NULL, "Mic Bias"},
{"IN2_R", NULL, "Mic Bias"},
{"IN3_R", NULL, "Mic Bias"},
示例11: SND_SOC_DAPM_HP
static struct snd_soc_jack_gpio tegra_rt5640_hp_jack_gpio = {
.name = "Headphone detection",
.report = SND_JACK_HEADPHONE,
.debounce_time = 150,
.invert = 1,
};
static const struct snd_soc_dapm_widget tegra_rt5640_dapm_widgets[] = {
SND_SOC_DAPM_HP("Headphones", NULL),
SND_SOC_DAPM_SPK("Speakers", NULL),
SND_SOC_DAPM_MIC("Mic Jack", NULL),
};
static const struct snd_kcontrol_new tegra_rt5640_controls[] = {
SOC_DAPM_PIN_SWITCH("Speakers"),
};
static int tegra_rt5640_asoc_init(struct snd_soc_pcm_runtime *rtd)
{
struct tegra_rt5640 *machine = snd_soc_card_get_drvdata(rtd->card);
snd_soc_card_jack_new(rtd->card, "Headphones", SND_JACK_HEADPHONE,
&tegra_rt5640_hp_jack, tegra_rt5640_hp_jack_pins,
ARRAY_SIZE(tegra_rt5640_hp_jack_pins));
if (gpio_is_valid(machine->gpio_hp_det)) {
tegra_rt5640_hp_jack_gpio.gpio = machine->gpio_hp_det;
tegra_rt5640_hp_jack_gpio.invert =
!!(machine->gpio_hp_det_flags & OF_GPIO_ACTIVE_LOW);
snd_soc_jack_add_gpios(&tegra_rt5640_hp_jack,
示例12: snd_soc_dai_set_pll
ret = snd_soc_dai_set_pll(aif2_dai, WM8994_FLL2,
0, 0, 0);
if (ret < 0) {
pr_err("Failed to stop FLL2: %d\n", ret);
return ret;
}
break;
default:
return -EINVAL;
}
return 0;
}
static const struct snd_kcontrol_new controls[] = {
SOC_DAPM_PIN_SWITCH("WM1250 Input"),
SOC_DAPM_PIN_SWITCH("WM1250 Output"),
};
static struct snd_soc_dapm_widget widgets[] = {
SND_SOC_DAPM_HP("Headphone", NULL),
SND_SOC_DAPM_MIC("AMIC", NULL),
SND_SOC_DAPM_MIC("DMIC", NULL),
SND_SOC_DAPM_SUPPLY_S("Baseband Clock", -1, SND_SOC_NOPM, 0, 0,
bbclk_ev,
SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMD),
};
static struct snd_soc_dapm_route audio_paths[] = {
示例13: SND_SOC_DAPM_HP
static struct snd_soc_jack_gpio tegra_max98090_mic_jack_gpio = {
.name = "Mic detection",
.report = SND_JACK_MICROPHONE,
.debounce_time = 150,
.invert = 1,
};
static const struct snd_soc_dapm_widget tegra_max98090_dapm_widgets[] = {
SND_SOC_DAPM_HP("Headphones", NULL),
SND_SOC_DAPM_SPK("Speakers", NULL),
SND_SOC_DAPM_MIC("Mic Jack", NULL),
SND_SOC_DAPM_MIC("Int Mic", NULL),
};
static const struct snd_kcontrol_new tegra_max98090_controls[] = {
SOC_DAPM_PIN_SWITCH("Headphones"),
SOC_DAPM_PIN_SWITCH("Speakers"),
SOC_DAPM_PIN_SWITCH("Mic Jack"),
SOC_DAPM_PIN_SWITCH("Int Mic"),
};
static int tegra_max98090_asoc_init(struct snd_soc_pcm_runtime *rtd)
{
struct tegra_max98090 *machine = snd_soc_card_get_drvdata(rtd->card);
if (gpio_is_valid(machine->gpio_hp_det)) {
snd_soc_card_jack_new(rtd->card, "Headphones",
SND_JACK_HEADPHONE,
&tegra_max98090_hp_jack,
tegra_max98090_hp_jack_pins,
ARRAY_SIZE(tegra_max98090_hp_jack_pins));
示例14: SOC_DAPM_PIN_SWITCH
{"Mono Out", NULL, "MONO1"},
{"Mono Out", NULL, "MONO2"},
{"Headphone Jack", NULL, "ROUT1"},
{"Headphone Jack", NULL, "LOUT1"},
{"Headphone Jack", NULL, "OUT4"},
{"Mic Bias", NULL, "Mic Jack"},
{"MIC1", NULL, "Mic Bias"},
{"Mic Bias", NULL, "Int Mic"},
{"MIC2", NULL, "Mic Bias"},
{"MIC2N", NULL, "Mic Bias"},
{"LINE1", NULL, "LineIn Jack"},
{"LINE2", NULL, "LineIn Jack"},
};
static const struct snd_kcontrol_new tegra_wm8753_controls[] = {
SOC_DAPM_PIN_SWITCH("Int Spk"),
SOC_DAPM_PIN_SWITCH("Earpiece"),
SOC_DAPM_PIN_SWITCH("Mono Out"),
SOC_DAPM_PIN_SWITCH("Headphone Jack"),
SOC_DAPM_PIN_SWITCH("Mic Jack"),
SOC_DAPM_PIN_SWITCH("Int Mic"),
SOC_DAPM_PIN_SWITCH("LineIn Jack"),
};
static int tegra_wm8753_init(struct snd_soc_pcm_runtime *rtd)
{
struct snd_soc_codec *codec = rtd->codec;
struct snd_soc_dapm_context *dapm = &codec->dapm;
struct snd_soc_card *card = codec->card;
struct tegra_wm8753 *machine = snd_soc_card_get_drvdata(card);
struct tegra_asoc_platform_data *pdata = machine->pdata;
示例15: SND_SOC_DAPM_SPK
SND_SOC_DAPM_SPK("Speaker", NULL),
};
static const struct snd_soc_dapm_route rk_audio_map[] = {
{"IN34", NULL, "Headset Mic"},
{"IN34", NULL, "MICBIAS"},
{"Headset Mic", NULL, "MICBIAS"},
{"DMICL", NULL, "Int Mic"},
{"Headphone", NULL, "HPL"},
{"Headphone", NULL, "HPR"},
{"Speaker", NULL, "SPKL"},
{"Speaker", NULL, "SPKR"},
};
static const struct snd_kcontrol_new rk_mc_controls[] = {
SOC_DAPM_PIN_SWITCH("Headphone"),
SOC_DAPM_PIN_SWITCH("Headset Mic"),
SOC_DAPM_PIN_SWITCH("Int Mic"),
SOC_DAPM_PIN_SWITCH("Speaker"),
};
static int rk_aif1_hw_params(struct snd_pcm_substream *substream,
struct snd_pcm_hw_params *params)
{
int ret = 0;
struct snd_soc_pcm_runtime *rtd = substream->private_data;
struct snd_soc_dai *cpu_dai = rtd->cpu_dai;
struct snd_soc_dai *codec_dai = rtd->codec_dai;
int mclk;
switch (params_rate(params)) {