Loading include/sound/soc-dapm.h +1 −1 Original line number Diff line number Diff line Loading @@ -461,6 +461,7 @@ int snd_soc_dapm_nc_pin_unlocked(struct snd_soc_dapm_context *dapm, int snd_soc_dapm_get_pin_status(struct snd_soc_dapm_context *dapm, const char *pin); int snd_soc_dapm_sync(struct snd_soc_dapm_context *dapm); int snd_soc_dapm_sync_unlocked(struct snd_soc_dapm_context *dapm); int snd_soc_dapm_force_enable_pin(struct snd_soc_dapm_context *dapm, const char *pin); int snd_soc_dapm_force_enable_pin_unlocked(struct snd_soc_dapm_context *dapm, Loading @@ -470,7 +471,6 @@ int snd_soc_dapm_ignore_suspend(struct snd_soc_dapm_context *dapm, void snd_soc_dapm_auto_nc_codec_pins(struct snd_soc_codec *codec); /* Mostly internal - should not normally be used */ void dapm_mark_dirty(struct snd_soc_dapm_widget *w, const char *reason); void dapm_mark_io_dirty(struct snd_soc_dapm_context *dapm); /* dapm path query */ Loading include/sound/soc.h +11 −0 Original line number Diff line number Diff line Loading @@ -1208,4 +1208,15 @@ extern struct dentry *snd_soc_debugfs_root; extern const struct dev_pm_ops snd_soc_pm_ops; /* Helper functions */ static inline void snd_soc_dapm_mutex_lock(struct snd_soc_dapm_context *dapm) { mutex_lock(&dapm->card->dapm_mutex); } static inline void snd_soc_dapm_mutex_unlock(struct snd_soc_dapm_context *dapm) { mutex_unlock(&dapm->card->dapm_mutex); } #endif sound/soc/codecs/adav80x.c +11 −6 Original line number Diff line number Diff line Loading @@ -541,6 +541,7 @@ static int adav80x_set_sysclk(struct snd_soc_codec *codec, unsigned int freq, int dir) { struct adav80x *adav80x = snd_soc_codec_get_drvdata(codec); struct snd_soc_dapm_context *dapm = &codec->dapm; if (dir == SND_SOC_CLOCK_IN) { switch (clk_id) { Loading Loading @@ -573,7 +574,7 @@ static int adav80x_set_sysclk(struct snd_soc_codec *codec, regmap_write(adav80x->regmap, ADAV80X_ICLK_CTRL2, iclk_ctrl2); snd_soc_dapm_sync(&codec->dapm); snd_soc_dapm_sync(dapm); } } else { unsigned int mask; Loading @@ -600,17 +601,21 @@ static int adav80x_set_sysclk(struct snd_soc_codec *codec, adav80x->sysclk_pd[clk_id] = false; } snd_soc_dapm_mutex_lock(dapm); if (adav80x->sysclk_pd[0]) snd_soc_dapm_disable_pin(&codec->dapm, "PLL1"); snd_soc_dapm_disable_pin_unlocked(dapm, "PLL1"); else snd_soc_dapm_force_enable_pin(&codec->dapm, "PLL1"); snd_soc_dapm_force_enable_pin_unlocked(dapm, "PLL1"); if (adav80x->sysclk_pd[1] || adav80x->sysclk_pd[2]) snd_soc_dapm_disable_pin(&codec->dapm, "PLL2"); snd_soc_dapm_disable_pin_unlocked(dapm, "PLL2"); else snd_soc_dapm_force_enable_pin(&codec->dapm, "PLL2"); snd_soc_dapm_force_enable_pin_unlocked(dapm, "PLL2"); snd_soc_dapm_sync(&codec->dapm); snd_soc_dapm_sync_unlocked(dapm); snd_soc_dapm_mutex_unlock(dapm); } return 0; Loading sound/soc/codecs/wm5100.c +9 −3 Original line number Diff line number Diff line Loading @@ -2100,6 +2100,7 @@ static void wm5100_micd_irq(struct wm5100_priv *wm5100) int wm5100_detect(struct snd_soc_codec *codec, struct snd_soc_jack *jack) { struct wm5100_priv *wm5100 = snd_soc_codec_get_drvdata(codec); struct snd_soc_dapm_context *dapm = &codec->dapm; if (jack) { wm5100->jack = jack; Loading @@ -2117,9 +2118,14 @@ int wm5100_detect(struct snd_soc_codec *codec, struct snd_soc_jack *jack) WM5100_ACCDET_RATE_MASK); /* We need the charge pump to power MICBIAS */ snd_soc_dapm_force_enable_pin(&codec->dapm, "CP2"); snd_soc_dapm_force_enable_pin(&codec->dapm, "SYSCLK"); snd_soc_dapm_sync(&codec->dapm); snd_soc_dapm_mutex_lock(dapm); snd_soc_dapm_force_enable_pin_unlocked(dapm, "CP2"); snd_soc_dapm_force_enable_pin_unlocked(dapm, "SYSCLK"); snd_soc_dapm_sync_unlocked(dapm); snd_soc_dapm_mutex_unlock(dapm); /* We start off just enabling microphone detection - even a * plain headphone will trigger detection. Loading sound/soc/codecs/wm8962.c +9 −4 Original line number Diff line number Diff line Loading @@ -3089,6 +3089,7 @@ static irqreturn_t wm8962_irq(int irq, void *data) int wm8962_mic_detect(struct snd_soc_codec *codec, struct snd_soc_jack *jack) { struct wm8962_priv *wm8962 = snd_soc_codec_get_drvdata(codec); struct snd_soc_dapm_context *dapm = &codec->dapm; int irq_mask, enable; wm8962->jack = jack; Loading @@ -3109,14 +3110,18 @@ int wm8962_mic_detect(struct snd_soc_codec *codec, struct snd_soc_jack *jack) snd_soc_jack_report(wm8962->jack, 0, SND_JACK_MICROPHONE | SND_JACK_BTN_0); snd_soc_dapm_mutex_lock(dapm); if (jack) { snd_soc_dapm_force_enable_pin(&codec->dapm, "SYSCLK"); snd_soc_dapm_force_enable_pin(&codec->dapm, "MICBIAS"); snd_soc_dapm_force_enable_pin_unlocked(dapm, "SYSCLK"); snd_soc_dapm_force_enable_pin_unlocked(dapm, "MICBIAS"); } else { snd_soc_dapm_disable_pin(&codec->dapm, "SYSCLK"); snd_soc_dapm_disable_pin(&codec->dapm, "MICBIAS"); snd_soc_dapm_disable_pin_unlocked(dapm, "SYSCLK"); snd_soc_dapm_disable_pin_unlocked(dapm, "MICBIAS"); } snd_soc_dapm_mutex_unlock(dapm); return 0; } EXPORT_SYMBOL_GPL(wm8962_mic_detect); Loading Loading
include/sound/soc-dapm.h +1 −1 Original line number Diff line number Diff line Loading @@ -461,6 +461,7 @@ int snd_soc_dapm_nc_pin_unlocked(struct snd_soc_dapm_context *dapm, int snd_soc_dapm_get_pin_status(struct snd_soc_dapm_context *dapm, const char *pin); int snd_soc_dapm_sync(struct snd_soc_dapm_context *dapm); int snd_soc_dapm_sync_unlocked(struct snd_soc_dapm_context *dapm); int snd_soc_dapm_force_enable_pin(struct snd_soc_dapm_context *dapm, const char *pin); int snd_soc_dapm_force_enable_pin_unlocked(struct snd_soc_dapm_context *dapm, Loading @@ -470,7 +471,6 @@ int snd_soc_dapm_ignore_suspend(struct snd_soc_dapm_context *dapm, void snd_soc_dapm_auto_nc_codec_pins(struct snd_soc_codec *codec); /* Mostly internal - should not normally be used */ void dapm_mark_dirty(struct snd_soc_dapm_widget *w, const char *reason); void dapm_mark_io_dirty(struct snd_soc_dapm_context *dapm); /* dapm path query */ Loading
include/sound/soc.h +11 −0 Original line number Diff line number Diff line Loading @@ -1208,4 +1208,15 @@ extern struct dentry *snd_soc_debugfs_root; extern const struct dev_pm_ops snd_soc_pm_ops; /* Helper functions */ static inline void snd_soc_dapm_mutex_lock(struct snd_soc_dapm_context *dapm) { mutex_lock(&dapm->card->dapm_mutex); } static inline void snd_soc_dapm_mutex_unlock(struct snd_soc_dapm_context *dapm) { mutex_unlock(&dapm->card->dapm_mutex); } #endif
sound/soc/codecs/adav80x.c +11 −6 Original line number Diff line number Diff line Loading @@ -541,6 +541,7 @@ static int adav80x_set_sysclk(struct snd_soc_codec *codec, unsigned int freq, int dir) { struct adav80x *adav80x = snd_soc_codec_get_drvdata(codec); struct snd_soc_dapm_context *dapm = &codec->dapm; if (dir == SND_SOC_CLOCK_IN) { switch (clk_id) { Loading Loading @@ -573,7 +574,7 @@ static int adav80x_set_sysclk(struct snd_soc_codec *codec, regmap_write(adav80x->regmap, ADAV80X_ICLK_CTRL2, iclk_ctrl2); snd_soc_dapm_sync(&codec->dapm); snd_soc_dapm_sync(dapm); } } else { unsigned int mask; Loading @@ -600,17 +601,21 @@ static int adav80x_set_sysclk(struct snd_soc_codec *codec, adav80x->sysclk_pd[clk_id] = false; } snd_soc_dapm_mutex_lock(dapm); if (adav80x->sysclk_pd[0]) snd_soc_dapm_disable_pin(&codec->dapm, "PLL1"); snd_soc_dapm_disable_pin_unlocked(dapm, "PLL1"); else snd_soc_dapm_force_enable_pin(&codec->dapm, "PLL1"); snd_soc_dapm_force_enable_pin_unlocked(dapm, "PLL1"); if (adav80x->sysclk_pd[1] || adav80x->sysclk_pd[2]) snd_soc_dapm_disable_pin(&codec->dapm, "PLL2"); snd_soc_dapm_disable_pin_unlocked(dapm, "PLL2"); else snd_soc_dapm_force_enable_pin(&codec->dapm, "PLL2"); snd_soc_dapm_force_enable_pin_unlocked(dapm, "PLL2"); snd_soc_dapm_sync(&codec->dapm); snd_soc_dapm_sync_unlocked(dapm); snd_soc_dapm_mutex_unlock(dapm); } return 0; Loading
sound/soc/codecs/wm5100.c +9 −3 Original line number Diff line number Diff line Loading @@ -2100,6 +2100,7 @@ static void wm5100_micd_irq(struct wm5100_priv *wm5100) int wm5100_detect(struct snd_soc_codec *codec, struct snd_soc_jack *jack) { struct wm5100_priv *wm5100 = snd_soc_codec_get_drvdata(codec); struct snd_soc_dapm_context *dapm = &codec->dapm; if (jack) { wm5100->jack = jack; Loading @@ -2117,9 +2118,14 @@ int wm5100_detect(struct snd_soc_codec *codec, struct snd_soc_jack *jack) WM5100_ACCDET_RATE_MASK); /* We need the charge pump to power MICBIAS */ snd_soc_dapm_force_enable_pin(&codec->dapm, "CP2"); snd_soc_dapm_force_enable_pin(&codec->dapm, "SYSCLK"); snd_soc_dapm_sync(&codec->dapm); snd_soc_dapm_mutex_lock(dapm); snd_soc_dapm_force_enable_pin_unlocked(dapm, "CP2"); snd_soc_dapm_force_enable_pin_unlocked(dapm, "SYSCLK"); snd_soc_dapm_sync_unlocked(dapm); snd_soc_dapm_mutex_unlock(dapm); /* We start off just enabling microphone detection - even a * plain headphone will trigger detection. Loading
sound/soc/codecs/wm8962.c +9 −4 Original line number Diff line number Diff line Loading @@ -3089,6 +3089,7 @@ static irqreturn_t wm8962_irq(int irq, void *data) int wm8962_mic_detect(struct snd_soc_codec *codec, struct snd_soc_jack *jack) { struct wm8962_priv *wm8962 = snd_soc_codec_get_drvdata(codec); struct snd_soc_dapm_context *dapm = &codec->dapm; int irq_mask, enable; wm8962->jack = jack; Loading @@ -3109,14 +3110,18 @@ int wm8962_mic_detect(struct snd_soc_codec *codec, struct snd_soc_jack *jack) snd_soc_jack_report(wm8962->jack, 0, SND_JACK_MICROPHONE | SND_JACK_BTN_0); snd_soc_dapm_mutex_lock(dapm); if (jack) { snd_soc_dapm_force_enable_pin(&codec->dapm, "SYSCLK"); snd_soc_dapm_force_enable_pin(&codec->dapm, "MICBIAS"); snd_soc_dapm_force_enable_pin_unlocked(dapm, "SYSCLK"); snd_soc_dapm_force_enable_pin_unlocked(dapm, "MICBIAS"); } else { snd_soc_dapm_disable_pin(&codec->dapm, "SYSCLK"); snd_soc_dapm_disable_pin(&codec->dapm, "MICBIAS"); snd_soc_dapm_disable_pin_unlocked(dapm, "SYSCLK"); snd_soc_dapm_disable_pin_unlocked(dapm, "MICBIAS"); } snd_soc_dapm_mutex_unlock(dapm); return 0; } EXPORT_SYMBOL_GPL(wm8962_mic_detect); Loading