Lines Matching +full:ain1 +full:- +full:ain2
1 // SPDX-License-Identifier: GPL-2.0-only
3 * wm8776.c -- WM8776 ALSA SoC Audio driver
5 * Copyright 2009-12 Wolfson Microelectronics plc
83 static const DECLARE_TLV_DB_SCALE(hp_tlv, -12100, 100, 1);
84 static const DECLARE_TLV_DB_SCALE(dac_tlv, -12750, 50, 1);
85 static const DECLARE_TLV_DB_SCALE(adc_tlv, -10350, 50, 1);
104 SOC_DAPM_SINGLE("AIN1 Switch", WM8776_ADCMUX, 0, 1, 0),
105 SOC_DAPM_SINGLE("AIN2 Switch", WM8776_ADCMUX, 1, 1, 0),
120 SND_SOC_DAPM_INPUT("AIN1"),
121 SND_SOC_DAPM_INPUT("AIN2"),
144 { "Input Mixer", "AIN1 Switch", "AIN1" },
145 { "Input Mixer", "AIN2 Switch", "AIN2" },
166 struct snd_soc_component *component = dai->component; in wm8776_set_fmt()
169 switch (dai->driver->id) { in wm8776_set_fmt()
179 return -EINVAL; in wm8776_set_fmt()
191 return -EINVAL; in wm8776_set_fmt()
204 return -EINVAL; in wm8776_set_fmt()
220 return -EINVAL; in wm8776_set_fmt()
243 struct snd_soc_component *component = dai->component; in wm8776_hw_params()
249 switch (dai->driver->id) { in wm8776_hw_params()
261 return -EINVAL; in wm8776_hw_params()
279 dev_err(component->dev, "Unsupported sample size: %i\n", in wm8776_hw_params()
281 return -EINVAL; in wm8776_hw_params()
287 if (wm8776->sysclk[dai->driver->id] / params_rate(params) in wm8776_hw_params()
293 dev_err(component->dev, in wm8776_hw_params()
295 wm8776->sysclk[dai->driver->id], params_rate(params)); in wm8776_hw_params()
296 return -EINVAL; in wm8776_hw_params()
299 dev_dbg(component->dev, "MCLK is %dfs\n", mclk_ratios[i]); in wm8776_hw_params()
304 dev_dbg(component->dev, "DAI in slave mode\n"); in wm8776_hw_params()
314 struct snd_soc_component *component = dai->component; in wm8776_mute()
322 struct snd_soc_component *component = dai->component; in wm8776_set_sysclk()
325 if (WARN_ON(dai->driver->id >= ARRAY_SIZE(wm8776->sysclk))) in wm8776_set_sysclk()
326 return -EINVAL; in wm8776_set_sysclk()
328 wm8776->sysclk[dai->driver->id] = freq; in wm8776_set_sysclk()
345 regcache_sync(wm8776->regmap); in wm8776_set_bias_level()
379 .name = "wm8776-hifi-playback",
393 .name = "wm8776-hifi-capture",
414 dev_err(component->dev, "Failed to issue reset: %d\n", ret); in wm8776_probe()
465 wm8776 = devm_kzalloc(&spi->dev, sizeof(struct wm8776_priv), in wm8776_spi_probe()
468 return -ENOMEM; in wm8776_spi_probe()
470 wm8776->regmap = devm_regmap_init_spi(spi, &wm8776_regmap); in wm8776_spi_probe()
471 if (IS_ERR(wm8776->regmap)) in wm8776_spi_probe()
472 return PTR_ERR(wm8776->regmap); in wm8776_spi_probe()
476 ret = devm_snd_soc_register_component(&spi->dev, in wm8776_spi_probe()
497 wm8776 = devm_kzalloc(&i2c->dev, sizeof(struct wm8776_priv), in wm8776_i2c_probe()
500 return -ENOMEM; in wm8776_i2c_probe()
502 wm8776->regmap = devm_regmap_init_i2c(i2c, &wm8776_regmap); in wm8776_i2c_probe()
503 if (IS_ERR(wm8776->regmap)) in wm8776_i2c_probe()
504 return PTR_ERR(wm8776->regmap); in wm8776_i2c_probe()
508 ret = devm_snd_soc_register_component(&i2c->dev, in wm8776_i2c_probe()