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

1 // SPDX-License-Identifier: GPL-2.0-only
3 * ak4535.c -- AK4535 ALSA Soc Audio driver
31 unsigned int sysclk;
55 static bool ak4535_volatile(struct device *dev, unsigned int reg) in ak4535_volatile()
65 static const char *ak4535_mono_gain[] = {"+6dB", "-17dB"};
66 static const char *ak4535_mono_out[] = {"(L + R)/2", "Hi-Z"};
86 SOC_SINGLE("Mic Boost (+20dB) Switch", AK4535_MIC, 0, 1, 0),
87 SOC_ENUM("Mic Select", ak4535_enum[4]),
98 SOC_SINGLE("Mic Sidetone Volume", AK4535_VOL, 4, 7, 0),
103 SOC_DAPM_SINGLE("Mic Sidetone Switch", AK4535_SIG1, 4, 1, 0),
109 SOC_DAPM_SINGLE("Mic Sidetone Switch", AK4535_SIG2, 4, 1, 0),
116 SOC_DAPM_SINGLE("Mic Capture Switch", AK4535_MIC, 2, 1, 0),
177 SND_SOC_DAPM_PGA("Mic", AK4535_PM1, 1, 0, NULL, 0),
182 SND_SOC_DAPM_MICBIAS("Mic Int Bias", AK4535_MIC, 3, 0),
183 SND_SOC_DAPM_MICBIAS("Mic Ext Bias", AK4535_MIC, 4, 0),
194 {"Stereo Mixer", "Mic Sidetone Switch", "Mic"},
198 {"Mono1 Mixer", "Mic Sidetone Switch", "Mic"},
201 /* Mic */
202 {"Mic", NULL, "AIN"},
203 {"Input Mux", "Internal", "Mic Int Bias"},
204 {"Input Mux", "External", "Mic Ext Bias"},
205 {"Mic Int Bias", NULL, "MICIN"},
206 {"Mic Ext Bias", NULL, "MICEXT"},
244 {"Input Mixer", "Mic Capture Switch", "Mic"},
248 static int ak4535_set_dai_sysclk(struct snd_soc_dai *codec_dai, in ak4535_set_dai_sysclk()
249 int clk_id, unsigned int freq, int dir) in ak4535_set_dai_sysclk()
251 struct snd_soc_component *component = codec_dai->component; in ak4535_set_dai_sysclk()
254 ak4535->sysclk = freq; in ak4535_set_dai_sysclk()
258 static int ak4535_hw_params(struct snd_pcm_substream *substream, in ak4535_hw_params()
262 struct snd_soc_component *component = dai->component; in ak4535_hw_params()
265 int rate = params_rate(params), fs = 256; in ak4535_hw_params()
268 fs = ak4535->sysclk / rate; in ak4535_hw_params()
287 static int ak4535_set_dai_fmt(struct snd_soc_dai *codec_dai, in ak4535_set_dai_fmt()
288 unsigned int fmt) in ak4535_set_dai_fmt()
290 struct snd_soc_component *component = codec_dai->component; in ak4535_set_dai_fmt()
302 return -EINVAL; in ak4535_set_dai_fmt()
312 static int ak4535_mute(struct snd_soc_dai *dai, int mute, int direction) in ak4535_mute()
314 struct snd_soc_component *component = dai->component; in ak4535_mute()
324 static int ak4535_set_bias_level(struct snd_soc_component *component, in ak4535_set_bias_level()
358 .name = "ak4535-hifi",
374 static int ak4535_resume(struct snd_soc_component *component) in ak4535_resume()
407 static int ak4535_i2c_probe(struct i2c_client *i2c) in ak4535_i2c_probe()
410 int ret; in ak4535_i2c_probe()
412 ak4535 = devm_kzalloc(&i2c->dev, sizeof(struct ak4535_priv), in ak4535_i2c_probe()
415 return -ENOMEM; in ak4535_i2c_probe()
417 ak4535->regmap = devm_regmap_init_i2c(i2c, &ak4535_regmap); in ak4535_i2c_probe()
418 if (IS_ERR(ak4535->regmap)) { in ak4535_i2c_probe()
419 ret = PTR_ERR(ak4535->regmap); in ak4535_i2c_probe()
420 dev_err(&i2c->dev, "Failed to init regmap: %d\n", ret); in ak4535_i2c_probe()
426 ret = devm_snd_soc_register_component(&i2c->dev, in ak4535_i2c_probe()