Lines Matching +full:mic +full:- +full:int

1 // SPDX-License-Identifier: GPL-2.0-or-later
28 unsigned int sysclk;
34 unsigned int clk_out_pwr;
71 "Line", "Mic",
85 48, 127, TLV_DB_SCALE_ITEM(-7400, 100, 0)
88 static const DECLARE_TLV_DB_SCALE(ssm260x_inpga_tlv, -3450, 150, 0);
89 static const DECLARE_TLV_DB_SCALE(ssm260x_sidetone_tlv, -1500, 300, 0);
99 SOC_ENUM("Playback De-emphasis", ssm2602_enum[1]),
110 SOC_SINGLE("Mic Boost (+20dB)", SSM2602_APANA, 0, 1, 0),
111 SOC_SINGLE("Mic Boost2 (+20dB)", SSM2602_APANA, 8, 1, 0),
118 SOC_DAPM_SINGLE("Mic Sidetone Switch", SSM2602_APANA, 5, 1, 0),
128 static int ssm2602_mic_switch_event(struct snd_soc_dapm_widget *w,
129 struct snd_kcontrol *kcontrol, int event)
165 SND_SOC_DAPM_MICBIAS("Mic Bias", SSM2602_PWR, 1, 1),
167 SND_SOC_DAPM_SWITCH_E("Mic Switch", SSM2602_APANA, 1, 1, &mic_ctl,
178 ARRAY_SIZE(ssm260x_output_mixer_controls) - 1), /* Last element is the mic */
196 {"Output Mixer", "Mic Sidetone Switch", "Mic Bias"},
202 {"Input Mux", "Mic", "Mic Switch"},
205 {"Mic Switch", NULL, "Mic Bias"},
207 {"Mic Bias", NULL, "MICIN"},
214 static const unsigned int ssm2602_rates_12288000[] = {
223 static const unsigned int ssm2602_rates_11289600[] = {
290 static inline int ssm2602_get_coeff(int mclk, int rate)
292 int i;
302 return -EINVAL;
305 static int ssm2602_hw_params(struct snd_pcm_substream *substream,
309 struct snd_soc_component *component = dai->component;
311 int srate = ssm2602_get_coeff(ssm2602->sysclk, params_rate(params));
312 unsigned int iface;
317 regmap_write(ssm2602->regmap, SSM2602_SRATE, srate);
334 return -EINVAL;
336 regmap_update_bits(ssm2602->regmap, SSM2602_IFACE,
341 static int ssm2602_startup(struct snd_pcm_substream *substream,
344 struct snd_soc_component *component = dai->component;
347 if (ssm2602->sysclk_constraints) {
348 snd_pcm_hw_constraint_list(substream->runtime, 0,
350 ssm2602->sysclk_constraints);
356 static int ssm2602_mute(struct snd_soc_dai *dai, int mute, int direction)
358 struct ssm2602_priv *ssm2602 = snd_soc_component_get_drvdata(dai->component);
361 regmap_update_bits(ssm2602->regmap, SSM2602_APDIGI,
365 regmap_update_bits(ssm2602->regmap, SSM2602_APDIGI,
370 static int ssm2602_set_dai_sysclk(struct snd_soc_dai *codec_dai,
371 int clk_id, unsigned int freq, int dir)
373 struct snd_soc_component *component = codec_dai->component;
378 return -EINVAL;
385 ssm2602->sysclk_constraints = &ssm2602_constraints_12288000;
391 ssm2602->sysclk_constraints = &ssm2602_constraints_11289600;
395 ssm2602->sysclk_constraints = NULL;
398 return -EINVAL;
401 ssm2602->sysclk = freq;
403 unsigned int mask;
413 return -EINVAL;
417 ssm2602->clk_out_pwr |= mask;
419 ssm2602->clk_out_pwr &= ~mask;
421 regmap_update_bits(ssm2602->regmap, SSM2602_PWR,
422 PWR_CLK_OUT_PDN | PWR_OSC_PDN, ssm2602->clk_out_pwr);
428 static int ssm2602_set_dai_fmt(struct snd_soc_dai *codec_dai,
429 unsigned int fmt)
431 struct ssm2602_priv *ssm2602 = snd_soc_component_get_drvdata(codec_dai->component);
432 unsigned int iface = 0;
442 return -EINVAL;
462 return -EINVAL;
479 return -EINVAL;
483 regmap_write(ssm2602->regmap, SSM2602_IFACE, iface);
487 static int ssm2602_set_bias_level(struct snd_soc_component *component,
495 regmap_update_bits(ssm2602->regmap, SSM2602_PWR,
497 ssm2602->clk_out_pwr);
503 regmap_update_bits(ssm2602->regmap, SSM2602_PWR,
509 regmap_update_bits(ssm2602->regmap, SSM2602_PWR,
536 .name = "ssm2602-hifi",
554 static int ssm2602_resume(struct snd_soc_component *component)
558 regcache_sync(ssm2602->regmap);
563 static int ssm2602_component_probe(struct snd_soc_component *component)
567 int ret;
569 regmap_update_bits(ssm2602->regmap, SSM2602_LOUT1V,
571 regmap_update_bits(ssm2602->regmap, SSM2602_ROUT1V,
588 static int ssm2604_component_probe(struct snd_soc_component *component)
591 int ret;
602 static int ssm260x_component_probe(struct snd_soc_component *component)
605 int ret;
607 ret = regmap_write(ssm2602->regmap, SSM2602_RESET, 0);
609 dev_err(component->dev, "Failed to issue reset: %d\n", ret);
613 regmap_register_patch(ssm2602->regmap, ssm2602_patch,
617 regmap_update_bits(ssm2602->regmap, SSM2602_LINVOL,
619 regmap_update_bits(ssm2602->regmap, SSM2602_RINVOL,
622 regmap_write(ssm2602->regmap, SSM2602_APANA, APANA_SELECT_DAC |
625 switch (ssm2602->type) {
653 static bool ssm2602_register_volatile(struct device *dev, unsigned int reg)
671 int ssm2602_probe(struct device *dev, enum ssm2602_type type,
681 return -ENOMEM;
684 ssm2602->type = type;
685 ssm2602->regmap = regmap;