static int wm2000_probe(struct snd_soc_codec *codec) { struct wm2000_priv *wm2000 = dev_get_drvdata(codec->dev); /* This will trigger a transition to standby mode by default */ wm2000_anc_set_mode(wm2000); return 0; }
static int wm2000_probe(struct snd_soc_codec *codec) { struct wm2000_priv *wm2000 = dev_get_drvdata(codec->dev); /* */ wm2000_anc_set_mode(wm2000); return 0; }
static int wm2000_resume(struct snd_soc_codec *codec) { struct wm2000_priv *wm2000 = dev_get_drvdata(codec->dev); int ret; printk( "wm2000 anc power resume\n"); wm2000_clk_enable(); ret = wm2000_anc_set_mode(wm2000); wm2000_clk_disable(); return ret; }
static int wm2000_probe(struct snd_soc_codec *codec) { struct wm2000_priv *wm2000 = dev_get_drvdata(codec->dev); codec->control_data = wm2000->regmap; snd_soc_codec_set_cache_io(codec, 16, 8, SND_SOC_REGMAP); printk("wm2000 wm2000 probe\n"); /* This will trigger a transition to standby mode by default */ wm2000_anc_set_mode(wm2000); 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); }
static int wm2000_speaker_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); struct wm2000_priv *wm2000 = dev_get_drvdata(codec->dev); int val = ucontrol->value.enumerated.item[0]; if (val > 1) return -EINVAL; wm2000->spk_ena = val; return wm2000_anc_set_mode(wm2000); }
static int wm2000_anc_mode_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); struct wm2000_priv *wm2000 = dev_get_drvdata(codec->dev); int anc_active = ucontrol->value.enumerated.item[0]; if (anc_active > 1) return -EINVAL; wm2000->anc_active = anc_active; return wm2000_anc_set_mode(wm2000); }
static int wm2000_anc_incall_mode_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); struct wm2000_priv *wm2000 = dev_get_drvdata(codec->dev); int incall_active = ucontrol->value.enumerated.item[0]; printk("wm2000 anc incall mode put incall_active=%d\n",incall_active); if (incall_active > 1) return -EINVAL; wm2000->incall_mode = incall_active; return wm2000_anc_set_mode(wm2000); }
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); }
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; }
static int wm2000_speaker_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol); struct wm2000_priv *wm2000 = dev_get_drvdata(codec->dev); unsigned int val = ucontrol->value.integer.value[0]; int ret; if (val > 1) return -EINVAL; mutex_lock(&wm2000->lock); wm2000->spk_ena = val; ret = wm2000_anc_set_mode(wm2000); mutex_unlock(&wm2000->lock); return ret; }
static int wm2000_anc_mode_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol); struct wm2000_priv *wm2000 = dev_get_drvdata(codec->dev); int anc_active = ucontrol->value.integer.value[0]; int ret; if (anc_active > 1) return -EINVAL; mutex_lock(&wm2000->lock); wm2000->anc_active = anc_active; ret = wm2000_anc_set_mode(wm2000); mutex_unlock(&wm2000->lock); return ret; }