Loading sound/soc/codecs/adav80x.c +0 −1 Original line number Diff line number Diff line Loading @@ -865,7 +865,6 @@ const struct regmap_config adav80x_regmap_config = { .val_bits = 8, .pad_bits = 1, .reg_bits = 7, .read_flag_mask = 0x01, .max_register = ADAV80X_PLL_OUTE, Loading sound/soc/codecs/arizona.c +20 −29 Original line number Diff line number Diff line Loading @@ -1756,17 +1756,6 @@ int arizona_init_dai(struct arizona_priv *priv, int id) } EXPORT_SYMBOL_GPL(arizona_init_dai); static irqreturn_t arizona_fll_clock_ok(int irq, void *data) { struct arizona_fll *fll = data; arizona_fll_dbg(fll, "clock OK\n"); complete(&fll->ok); return IRQ_HANDLED; } static struct { unsigned int min; unsigned int max; Loading Loading @@ -2048,17 +2037,18 @@ static int arizona_is_enabled_fll(struct arizona_fll *fll) static int arizona_enable_fll(struct arizona_fll *fll) { struct arizona *arizona = fll->arizona; unsigned long time_left; bool use_sync = false; int already_enabled = arizona_is_enabled_fll(fll); struct arizona_fll_cfg cfg; int i; unsigned int val; if (already_enabled < 0) return already_enabled; if (already_enabled) { /* Facilitate smooth refclk across the transition */ regmap_update_bits_async(fll->arizona->regmap, fll->base + 0x7, regmap_update_bits_async(fll->arizona->regmap, fll->base + 0x9, ARIZONA_FLL1_GAIN_MASK, 0); regmap_update_bits_async(fll->arizona->regmap, fll->base + 1, ARIZONA_FLL1_FREERUN, Loading Loading @@ -2110,9 +2100,6 @@ static int arizona_enable_fll(struct arizona_fll *fll) if (!already_enabled) pm_runtime_get(arizona->dev); /* Clear any pending completions */ try_wait_for_completion(&fll->ok); regmap_update_bits_async(arizona->regmap, fll->base + 1, ARIZONA_FLL1_ENA, ARIZONA_FLL1_ENA); if (use_sync) Loading @@ -2124,10 +2111,24 @@ static int arizona_enable_fll(struct arizona_fll *fll) regmap_update_bits_async(arizona->regmap, fll->base + 1, ARIZONA_FLL1_FREERUN, 0); time_left = wait_for_completion_timeout(&fll->ok, msecs_to_jiffies(250)); if (time_left == 0) arizona_fll_dbg(fll, "Waiting for FLL lock...\n"); val = 0; for (i = 0; i < 15; i++) { if (i < 5) usleep_range(200, 400); else msleep(20); regmap_read(arizona->regmap, ARIZONA_INTERRUPT_RAW_STATUS_5, &val); if (val & (ARIZONA_FLL1_CLOCK_OK_STS << (fll->id - 1))) break; } if (i == 15) arizona_fll_warn(fll, "Timed out waiting for lock\n"); else arizona_fll_dbg(fll, "FLL locked (%d polls)\n", i); return 0; } Loading Loading @@ -2212,11 +2213,8 @@ EXPORT_SYMBOL_GPL(arizona_set_fll); int arizona_init_fll(struct arizona *arizona, int id, int base, int lock_irq, int ok_irq, struct arizona_fll *fll) { int ret; unsigned int val; init_completion(&fll->ok); fll->id = id; fll->base = base; fll->arizona = arizona; Loading @@ -2238,13 +2236,6 @@ int arizona_init_fll(struct arizona *arizona, int id, int base, int lock_irq, snprintf(fll->clock_ok_name, sizeof(fll->clock_ok_name), "FLL%d clock OK", id); ret = arizona_request_irq(arizona, ok_irq, fll->clock_ok_name, arizona_fll_clock_ok, fll); if (ret != 0) { dev_err(arizona->dev, "Failed to get FLL%d clock OK IRQ: %d\n", id, ret); } regmap_update_bits(arizona->regmap, fll->base + 1, ARIZONA_FLL1_FREERUN, 0); Loading sound/soc/codecs/arizona.h +0 −1 Original line number Diff line number Diff line Loading @@ -242,7 +242,6 @@ struct arizona_fll { int id; unsigned int base; unsigned int vco_mult; struct completion ok; unsigned int fout; int sync_src; Loading sound/soc/codecs/max98090.c +40 −6 Original line number Diff line number Diff line Loading @@ -850,6 +850,19 @@ static int max98090_micinput_event(struct snd_soc_dapm_widget *w, return 0; } static int max98090_shdn_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); struct max98090_priv *max98090 = snd_soc_codec_get_drvdata(codec); if (event & SND_SOC_DAPM_POST_PMU) max98090->shdn_pending = true; return 0; } static const char *mic1_mux_text[] = { "IN12", "IN56" }; static SOC_ENUM_SINGLE_DECL(mic1_mux_enum, Loading Loading @@ -1158,9 +1171,11 @@ static const struct snd_soc_dapm_widget max98090_dapm_widgets[] = { SND_SOC_DAPM_SUPPLY("SDOEN", M98090_REG_IO_CONFIGURATION, M98090_SDOEN_SHIFT, 0, NULL, 0), SND_SOC_DAPM_SUPPLY("DMICL_ENA", M98090_REG_DIGITAL_MIC_ENABLE, M98090_DIGMICL_SHIFT, 0, NULL, 0), M98090_DIGMICL_SHIFT, 0, max98090_shdn_event, SND_SOC_DAPM_POST_PMU), SND_SOC_DAPM_SUPPLY("DMICR_ENA", M98090_REG_DIGITAL_MIC_ENABLE, M98090_DIGMICR_SHIFT, 0, NULL, 0), M98090_DIGMICR_SHIFT, 0, max98090_shdn_event, SND_SOC_DAPM_POST_PMU), SND_SOC_DAPM_SUPPLY("AHPF", M98090_REG_FILTER_CONFIG, M98090_AHPF_SHIFT, 0, NULL, 0), Loading Loading @@ -1205,10 +1220,12 @@ static const struct snd_soc_dapm_widget max98090_dapm_widgets[] = { &max98090_right_adc_mixer_controls[0], ARRAY_SIZE(max98090_right_adc_mixer_controls)), SND_SOC_DAPM_ADC("ADCL", NULL, M98090_REG_INPUT_ENABLE, M98090_ADLEN_SHIFT, 0), SND_SOC_DAPM_ADC("ADCR", NULL, M98090_REG_INPUT_ENABLE, M98090_ADREN_SHIFT, 0), SND_SOC_DAPM_ADC_E("ADCL", NULL, M98090_REG_INPUT_ENABLE, M98090_ADLEN_SHIFT, 0, max98090_shdn_event, SND_SOC_DAPM_POST_PMU), SND_SOC_DAPM_ADC_E("ADCR", NULL, M98090_REG_INPUT_ENABLE, M98090_ADREN_SHIFT, 0, max98090_shdn_event, SND_SOC_DAPM_POST_PMU), SND_SOC_DAPM_AIF_OUT("AIFOUTL", "HiFi Capture", 0, SND_SOC_NOPM, 0, 0), Loading Loading @@ -2536,9 +2553,26 @@ static int max98090_remove(struct snd_soc_codec *codec) return 0; } static void max98090_seq_notifier(struct snd_soc_dapm_context *dapm, enum snd_soc_dapm_type event, int subseq) { struct snd_soc_codec *codec = snd_soc_dapm_to_codec(dapm); struct max98090_priv *max98090 = snd_soc_codec_get_drvdata(codec); if (max98090->shdn_pending) { snd_soc_update_bits(codec, M98090_REG_DEVICE_SHUTDOWN, M98090_SHDNN_MASK, 0); msleep(40); snd_soc_update_bits(codec, M98090_REG_DEVICE_SHUTDOWN, M98090_SHDNN_MASK, M98090_SHDNN_MASK); max98090->shdn_pending = false; } } static struct snd_soc_codec_driver soc_codec_dev_max98090 = { .probe = max98090_probe, .remove = max98090_remove, .seq_notifier = max98090_seq_notifier, .set_bias_level = max98090_set_bias_level, }; Loading sound/soc/codecs/max98090.h +1 −0 Original line number Diff line number Diff line Loading @@ -1543,6 +1543,7 @@ struct max98090_priv { unsigned int pa2en; unsigned int sidetone; bool master; bool shdn_pending; }; int max98090_mic_detect(struct snd_soc_codec *codec, Loading Loading
sound/soc/codecs/adav80x.c +0 −1 Original line number Diff line number Diff line Loading @@ -865,7 +865,6 @@ const struct regmap_config adav80x_regmap_config = { .val_bits = 8, .pad_bits = 1, .reg_bits = 7, .read_flag_mask = 0x01, .max_register = ADAV80X_PLL_OUTE, Loading
sound/soc/codecs/arizona.c +20 −29 Original line number Diff line number Diff line Loading @@ -1756,17 +1756,6 @@ int arizona_init_dai(struct arizona_priv *priv, int id) } EXPORT_SYMBOL_GPL(arizona_init_dai); static irqreturn_t arizona_fll_clock_ok(int irq, void *data) { struct arizona_fll *fll = data; arizona_fll_dbg(fll, "clock OK\n"); complete(&fll->ok); return IRQ_HANDLED; } static struct { unsigned int min; unsigned int max; Loading Loading @@ -2048,17 +2037,18 @@ static int arizona_is_enabled_fll(struct arizona_fll *fll) static int arizona_enable_fll(struct arizona_fll *fll) { struct arizona *arizona = fll->arizona; unsigned long time_left; bool use_sync = false; int already_enabled = arizona_is_enabled_fll(fll); struct arizona_fll_cfg cfg; int i; unsigned int val; if (already_enabled < 0) return already_enabled; if (already_enabled) { /* Facilitate smooth refclk across the transition */ regmap_update_bits_async(fll->arizona->regmap, fll->base + 0x7, regmap_update_bits_async(fll->arizona->regmap, fll->base + 0x9, ARIZONA_FLL1_GAIN_MASK, 0); regmap_update_bits_async(fll->arizona->regmap, fll->base + 1, ARIZONA_FLL1_FREERUN, Loading Loading @@ -2110,9 +2100,6 @@ static int arizona_enable_fll(struct arizona_fll *fll) if (!already_enabled) pm_runtime_get(arizona->dev); /* Clear any pending completions */ try_wait_for_completion(&fll->ok); regmap_update_bits_async(arizona->regmap, fll->base + 1, ARIZONA_FLL1_ENA, ARIZONA_FLL1_ENA); if (use_sync) Loading @@ -2124,10 +2111,24 @@ static int arizona_enable_fll(struct arizona_fll *fll) regmap_update_bits_async(arizona->regmap, fll->base + 1, ARIZONA_FLL1_FREERUN, 0); time_left = wait_for_completion_timeout(&fll->ok, msecs_to_jiffies(250)); if (time_left == 0) arizona_fll_dbg(fll, "Waiting for FLL lock...\n"); val = 0; for (i = 0; i < 15; i++) { if (i < 5) usleep_range(200, 400); else msleep(20); regmap_read(arizona->regmap, ARIZONA_INTERRUPT_RAW_STATUS_5, &val); if (val & (ARIZONA_FLL1_CLOCK_OK_STS << (fll->id - 1))) break; } if (i == 15) arizona_fll_warn(fll, "Timed out waiting for lock\n"); else arizona_fll_dbg(fll, "FLL locked (%d polls)\n", i); return 0; } Loading Loading @@ -2212,11 +2213,8 @@ EXPORT_SYMBOL_GPL(arizona_set_fll); int arizona_init_fll(struct arizona *arizona, int id, int base, int lock_irq, int ok_irq, struct arizona_fll *fll) { int ret; unsigned int val; init_completion(&fll->ok); fll->id = id; fll->base = base; fll->arizona = arizona; Loading @@ -2238,13 +2236,6 @@ int arizona_init_fll(struct arizona *arizona, int id, int base, int lock_irq, snprintf(fll->clock_ok_name, sizeof(fll->clock_ok_name), "FLL%d clock OK", id); ret = arizona_request_irq(arizona, ok_irq, fll->clock_ok_name, arizona_fll_clock_ok, fll); if (ret != 0) { dev_err(arizona->dev, "Failed to get FLL%d clock OK IRQ: %d\n", id, ret); } regmap_update_bits(arizona->regmap, fll->base + 1, ARIZONA_FLL1_FREERUN, 0); Loading
sound/soc/codecs/arizona.h +0 −1 Original line number Diff line number Diff line Loading @@ -242,7 +242,6 @@ struct arizona_fll { int id; unsigned int base; unsigned int vco_mult; struct completion ok; unsigned int fout; int sync_src; Loading
sound/soc/codecs/max98090.c +40 −6 Original line number Diff line number Diff line Loading @@ -850,6 +850,19 @@ static int max98090_micinput_event(struct snd_soc_dapm_widget *w, return 0; } static int max98090_shdn_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); struct max98090_priv *max98090 = snd_soc_codec_get_drvdata(codec); if (event & SND_SOC_DAPM_POST_PMU) max98090->shdn_pending = true; return 0; } static const char *mic1_mux_text[] = { "IN12", "IN56" }; static SOC_ENUM_SINGLE_DECL(mic1_mux_enum, Loading Loading @@ -1158,9 +1171,11 @@ static const struct snd_soc_dapm_widget max98090_dapm_widgets[] = { SND_SOC_DAPM_SUPPLY("SDOEN", M98090_REG_IO_CONFIGURATION, M98090_SDOEN_SHIFT, 0, NULL, 0), SND_SOC_DAPM_SUPPLY("DMICL_ENA", M98090_REG_DIGITAL_MIC_ENABLE, M98090_DIGMICL_SHIFT, 0, NULL, 0), M98090_DIGMICL_SHIFT, 0, max98090_shdn_event, SND_SOC_DAPM_POST_PMU), SND_SOC_DAPM_SUPPLY("DMICR_ENA", M98090_REG_DIGITAL_MIC_ENABLE, M98090_DIGMICR_SHIFT, 0, NULL, 0), M98090_DIGMICR_SHIFT, 0, max98090_shdn_event, SND_SOC_DAPM_POST_PMU), SND_SOC_DAPM_SUPPLY("AHPF", M98090_REG_FILTER_CONFIG, M98090_AHPF_SHIFT, 0, NULL, 0), Loading Loading @@ -1205,10 +1220,12 @@ static const struct snd_soc_dapm_widget max98090_dapm_widgets[] = { &max98090_right_adc_mixer_controls[0], ARRAY_SIZE(max98090_right_adc_mixer_controls)), SND_SOC_DAPM_ADC("ADCL", NULL, M98090_REG_INPUT_ENABLE, M98090_ADLEN_SHIFT, 0), SND_SOC_DAPM_ADC("ADCR", NULL, M98090_REG_INPUT_ENABLE, M98090_ADREN_SHIFT, 0), SND_SOC_DAPM_ADC_E("ADCL", NULL, M98090_REG_INPUT_ENABLE, M98090_ADLEN_SHIFT, 0, max98090_shdn_event, SND_SOC_DAPM_POST_PMU), SND_SOC_DAPM_ADC_E("ADCR", NULL, M98090_REG_INPUT_ENABLE, M98090_ADREN_SHIFT, 0, max98090_shdn_event, SND_SOC_DAPM_POST_PMU), SND_SOC_DAPM_AIF_OUT("AIFOUTL", "HiFi Capture", 0, SND_SOC_NOPM, 0, 0), Loading Loading @@ -2536,9 +2553,26 @@ static int max98090_remove(struct snd_soc_codec *codec) return 0; } static void max98090_seq_notifier(struct snd_soc_dapm_context *dapm, enum snd_soc_dapm_type event, int subseq) { struct snd_soc_codec *codec = snd_soc_dapm_to_codec(dapm); struct max98090_priv *max98090 = snd_soc_codec_get_drvdata(codec); if (max98090->shdn_pending) { snd_soc_update_bits(codec, M98090_REG_DEVICE_SHUTDOWN, M98090_SHDNN_MASK, 0); msleep(40); snd_soc_update_bits(codec, M98090_REG_DEVICE_SHUTDOWN, M98090_SHDNN_MASK, M98090_SHDNN_MASK); max98090->shdn_pending = false; } } static struct snd_soc_codec_driver soc_codec_dev_max98090 = { .probe = max98090_probe, .remove = max98090_remove, .seq_notifier = max98090_seq_notifier, .set_bias_level = max98090_set_bias_level, }; Loading
sound/soc/codecs/max98090.h +1 −0 Original line number Diff line number Diff line Loading @@ -1543,6 +1543,7 @@ struct max98090_priv { unsigned int pa2en; unsigned int sidetone; bool master; bool shdn_pending; }; int max98090_mic_detect(struct snd_soc_codec *codec, Loading