Esempio n. 1
0
static int lm4853_event(struct snd_soc_dapm_widget *w,
			struct snd_kcontrol *k, int event)
{
	gpio_set_value(S3C2410_GPJ(1), SND_SOC_DAPM_EVENT_OFF(event));

	return 0;
}
static int lm4853_event(struct snd_soc_dapm_widget *w,
			struct snd_kcontrol *k, int event)
{
	gpio_set_value(GTA02_GPIO_AMP_SHUT, SND_SOC_DAPM_EVENT_OFF(event));

	return 0;
}
Esempio n. 3
0
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;
}
Esempio n. 4
0
static int qi_lb60_spk_event(struct snd_soc_dapm_widget *widget,
			     struct snd_kcontrol *ctrl, int event)
{
	int on = !SND_SOC_DAPM_EVENT_OFF(event);

	gpio_set_value(QI_LB60_SND_GPIO, on);
	gpio_set_value(QI_LB60_AMP_GPIO, on);

	return 0;
}
Esempio n. 5
0
static int sirf_audio_hp_event(struct snd_soc_dapm_widget *w,
				struct snd_kcontrol *ctrl, int event)
{
	struct snd_soc_dapm_context *dapm = w->dapm;
	struct snd_soc_card *card = dapm->card;
	struct sirf_audio_card *sirf_audio_card = snd_soc_card_get_drvdata(card);
	int on = !SND_SOC_DAPM_EVENT_OFF(event);
	if (gpio_is_valid(sirf_audio_card->gpio_hp_pa))
		gpio_set_value(sirf_audio_card->gpio_hp_pa, on);
	return 0;
}
Esempio n. 6
0
static int aiftx_power_control(struct snd_soc_dapm_widget *w,
		struct snd_kcontrol *k, int  event)
{
	struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm);
	struct nau8540 *nau8540 = snd_soc_component_get_drvdata(component);

	if (SND_SOC_DAPM_EVENT_OFF(event)) {
		regmap_write(nau8540->regmap, NAU8540_REG_RST, 0x0001);
		regmap_write(nau8540->regmap, NAU8540_REG_RST, 0x0000);
	}
	return 0;
}
static int pll_power_on_event(struct snd_soc_dapm_widget *w,
			      struct snd_kcontrol *kcontrol, int event)
{
	struct snd_soc_codec *codec = w->codec;

	if (SND_SOC_DAPM_EVENT_ON(event))
		dev_dbg(codec->dev, "pll->on pre_pmu");
	else if (SND_SOC_DAPM_EVENT_OFF(event))
		dev_dbg(codec->dev, "pll->off\n");

	mdelay(10);
	return 0;
}
Esempio n. 8
0
static int sn95031_vihf_event(struct snd_soc_dapm_widget *w,
		    struct snd_kcontrol *kcontrol, int event)
{
	if (SND_SOC_DAPM_EVENT_ON(event)) {
		pr_debug("VIHF SND_SOC_DAPM_EVENT_ON doing rail startup now\n");
		/* power up the rail */
		snd_soc_write(w->codec, SN95031_VIHF, 0x27);
		msleep(1);
	} else if (SND_SOC_DAPM_EVENT_OFF(event)) {
		pr_debug("VIHF SND_SOC_DAPM_EVENT_OFF doing rail shutdown\n");
		snd_soc_write(w->codec, SN95031_VIHF, 0x24);
	}
	return 0;
}
static int wm2000_anc_power_event(struct snd_soc_dapm_widget *w,
				  struct snd_kcontrol *kcontrol, int event)
{
	struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol);
	struct wm2000_priv *wm2000 = dev_get_drvdata(codec->dev);

	if (SND_SOC_DAPM_EVENT_ON(event))
		wm2000->anc_eng_ena = 1;

	if (SND_SOC_DAPM_EVENT_OFF(event))
		wm2000->anc_eng_ena = 0;

	return wm2000_anc_set_mode(wm2000);
}
int mfld_vibra_enable_clk(struct snd_soc_dapm_widget *w,
		struct snd_kcontrol *k, int event)
{
	int clk_id = 0;

	if (!strcmp(w->name, "Vibra1Clock"))
		clk_id = CLK0_VIBRA1;
	else if (!strcmp(w->name, "Vibra2Clock"))
		clk_id = CLK0_VIBRA2;

	if (SND_SOC_DAPM_EVENT_ON(event))
		intel_scu_ipc_set_osc_clk0(true, clk_id);
	else if (SND_SOC_DAPM_EVENT_OFF(event))
		intel_scu_ipc_set_osc_clk0(false, clk_id);
	return 0;
}
Esempio n. 11
0
static int adau1761_dapm_mic_event(struct snd_soc_dapm_widget *w,
	struct snd_kcontrol *k, int event)
{
	struct snd_soc_codec	*codec = w->codec;
	struct adau1761_priv	*cpriv = codec->private_data;
//	adau1761_platform_t	*pdata = cpriv->pdata;
	s3cdbg("%s(%d) event=%d\n", __func__, __LINE__, event);
	if (SND_SOC_DAPM_EVENT_ON(event)) {
//		pdata->mic_stdby_n( 1 );
	} else if (SND_SOC_DAPM_EVENT_OFF(event)) {
//		pdata->mic_stdby_n( 0 );
	} else {
		printk("%s(%d): Unknown event #%d\n", __func__, __LINE__, event);
	}
	return 0;
}
static int wm2000_anc_power_event(struct snd_soc_dapm_widget *w,
				  struct snd_kcontrol *kcontrol, int event)
{
	struct snd_soc_codec *codec = w->codec;
	struct wm2000_priv *wm2000 = dev_get_drvdata(codec->dev);

	if (SND_SOC_DAPM_EVENT_ON(event)) {
		wm2000->anc_eng_ena = 1;
		//printk( "wm2000 anc power event on\n");
	}

	if (SND_SOC_DAPM_EVENT_OFF(event)) {
		wm2000->anc_eng_ena = 0;
		//printk( "wm2000 anc power event off\n"); 
	}

	return wm2000_anc_set_mode(wm2000);
}
Esempio n. 13
0
static int sn95031_vhs_event(struct snd_soc_dapm_widget *w,
                             struct snd_kcontrol *kcontrol, int event)
{
    struct snd_soc_codec *codec = snd_soc_dapm_to_codec(w->dapm);

    if (SND_SOC_DAPM_EVENT_ON(event)) {
        pr_debug("VHS SND_SOC_DAPM_EVENT_ON doing rail startup now\n");
        /* power up the rail */
        snd_soc_write(codec, SN95031_VHSP, 0x3D);
        snd_soc_write(codec, SN95031_VHSN, 0x3F);
        msleep(1);
    } else if (SND_SOC_DAPM_EVENT_OFF(event)) {
        pr_debug("VHS SND_SOC_DAPM_EVENT_OFF doing rail shutdown\n");
        snd_soc_write(codec, SN95031_VHSP, 0xC4);
        snd_soc_write(codec, SN95031_VHSN, 0x04);
    }
    return 0;
}
static int mic_power_up_event(struct snd_soc_dapm_widget *w,
			struct snd_kcontrol *kcontrol, int event)
{
	struct snd_soc_codec *codec = w->codec;
	u8 ret = 0;

	if (SND_SOC_DAPM_EVENT_ON(event)) {

		/* Power up control of MICBIAS */
		snd_soc_update_bits(codec, MICBIAS_CTRL, 0x03, 0x03);
	}
	if (SND_SOC_DAPM_EVENT_OFF(event)) {

		/* Power down control of MICBIAS */
		snd_soc_update_bits(codec, MICBIAS_CTRL, 0x03, 0x03);
	}
	return ret;
}
Esempio n. 15
0
static int wm2000_anc_power_event(struct snd_soc_dapm_widget *w,
				  struct snd_kcontrol *kcontrol, int event)
{
	struct snd_soc_codec *codec = w->codec;
	struct wm2000_priv *wm2000 = dev_get_drvdata(codec->dev);
	int ret;

	mutex_lock(&wm2000->lock);

	if (SND_SOC_DAPM_EVENT_ON(event))
		wm2000->anc_eng_ena = 1;

	if (SND_SOC_DAPM_EVENT_OFF(event))
		wm2000->anc_eng_ena = 0;

	ret = wm2000_anc_set_mode(wm2000);

	mutex_unlock(&wm2000->lock);

	return ret;
}
Esempio n. 16
0
static int adc_power_control(struct snd_soc_dapm_widget *w,
		struct snd_kcontrol *k, int  event)
{
	struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm);
	struct nau8540 *nau8540 = snd_soc_component_get_drvdata(component);

	if (SND_SOC_DAPM_EVENT_ON(event)) {
		msleep(300);
		/* DO12 and DO34 pad output enable */
		regmap_update_bits(nau8540->regmap, NAU8540_REG_PCM_CTRL1,
			NAU8540_I2S_DO12_TRI, 0);
		regmap_update_bits(nau8540->regmap, NAU8540_REG_PCM_CTRL2,
			NAU8540_I2S_DO34_TRI, 0);
	} else if (SND_SOC_DAPM_EVENT_OFF(event)) {
		regmap_update_bits(nau8540->regmap, NAU8540_REG_PCM_CTRL1,
			NAU8540_I2S_DO12_TRI, NAU8540_I2S_DO12_TRI);
		regmap_update_bits(nau8540->regmap, NAU8540_REG_PCM_CTRL2,
			NAU8540_I2S_DO34_TRI, NAU8540_I2S_DO34_TRI);
	}
	return 0;
}
Esempio n. 17
0
static int sun8i_headphone_amp_event(struct snd_soc_dapm_widget *w,
				     struct snd_kcontrol *k, int event)
{
	struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm);

	if (SND_SOC_DAPM_EVENT_ON(event)) {
		snd_soc_component_update_bits(component, SUN8I_ADDA_PAEN_HP_CTRL,
					      BIT(SUN8I_ADDA_PAEN_HP_CTRL_HPPAEN),
					      BIT(SUN8I_ADDA_PAEN_HP_CTRL_HPPAEN));
		/*
		 * Need a delay to have the amplifier up. 700ms seems the best
		 * compromise between the time to let the amplifier up and the
		 * time not to feel this delay while playing a sound.
		 */
		msleep(700);
	} else if (SND_SOC_DAPM_EVENT_OFF(event)) {
		snd_soc_component_update_bits(component, SUN8I_ADDA_PAEN_HP_CTRL,
					      BIT(SUN8I_ADDA_PAEN_HP_CTRL_HPPAEN),
					      0x0);
	}

	return 0;
}