Lines Matching +full:eq +full:- +full:level

1 // SPDX-License-Identifier: GPL-2.0-only
3 * da732x.c --- Dialog DA732X ALSA SoC Audio Driver
24 #include <sound/soc-dapm.h>
41 * da732x register cache - default settings
184 return -EINVAL; in da732x_get_input_div()
327 struct soc_enum *enum_ctrl = (struct soc_enum *)kcontrol->private_value; in da732x_hpf_set()
328 unsigned int reg = enum_ctrl->reg; in da732x_hpf_set()
329 unsigned int sel = ucontrol->value.enumerated.item[0]; in da732x_hpf_set()
343 return -EINVAL; in da732x_hpf_set()
355 struct soc_enum *enum_ctrl = (struct soc_enum *)kcontrol->private_value; in da732x_hpf_get()
356 unsigned int reg = enum_ctrl->reg; in da732x_hpf_get()
363 ucontrol->value.enumerated.item[0] = DA732X_HPF_VOICE; in da732x_hpf_get()
366 ucontrol->value.enumerated.item[0] = DA732X_HPF_MUSIC; in da732x_hpf_get()
369 ucontrol->value.enumerated.item[0] = DA732X_HPF_DISABLED; in da732x_hpf_get()
476 SOC_SINGLE("ADC1 EQ Switch", DA732X_REG_ADC1_EQ5,
478 SOC_SINGLE_TLV("ADC1 EQ Band 1 Volume", DA732X_REG_ADC1_EQ12,
481 SOC_SINGLE_TLV("ADC1 EQ Band 2 Volume", DA732X_REG_ADC1_EQ12,
484 SOC_SINGLE_TLV("ADC1 EQ Band 3 Volume", DA732X_REG_ADC1_EQ34,
487 SOC_SINGLE_TLV("ADC1 EQ Band 4 Volume", DA732X_REG_ADC1_EQ34,
490 SOC_SINGLE_TLV("ADC1 EQ Band 5 Volume", DA732X_REG_ADC1_EQ5,
493 SOC_SINGLE_TLV("ADC1 EQ Overall Volume", DA732X_REG_ADC1_EQ5,
497 SOC_SINGLE("ADC2 EQ Switch", DA732X_REG_ADC2_EQ5,
499 SOC_SINGLE_TLV("ADC2 EQ Band 1 Volume", DA732X_REG_ADC2_EQ12,
502 SOC_SINGLE_TLV("ADC2 EQ Band 2 Volume", DA732X_REG_ADC2_EQ12,
505 SOC_SINGLE_TLV("ADC2 EQ Band 3 Volume", DA732X_REG_ADC2_EQ34,
508 SOC_SINGLE_TLV("ACD2 EQ Band 4 Volume", DA732X_REG_ADC2_EQ34,
511 SOC_SINGLE_TLV("ACD2 EQ Band 5 Volume", DA732X_REG_ADC2_EQ5,
514 SOC_SINGLE_TLV("ADC2 EQ Overall Volume", DA732X_REG_ADC1_EQ5,
518 SOC_SINGLE("DAC1 EQ Switch", DA732X_REG_DAC1_EQ5,
520 SOC_SINGLE_TLV("DAC1 EQ Band 1 Volume", DA732X_REG_DAC1_EQ12,
523 SOC_SINGLE_TLV("DAC1 EQ Band 2 Volume", DA732X_REG_DAC1_EQ12,
526 SOC_SINGLE_TLV("DAC1 EQ Band 3 Volume", DA732X_REG_DAC1_EQ34,
529 SOC_SINGLE_TLV("DAC1 EQ Band 4 Volume", DA732X_REG_DAC1_EQ34,
532 SOC_SINGLE_TLV("DAC1 EQ Band 5 Volume", DA732X_REG_DAC1_EQ5,
536 SOC_SINGLE("DAC2 EQ Switch", DA732X_REG_DAC2_EQ5,
538 SOC_SINGLE_TLV("DAC2 EQ Band 1 Volume", DA732X_REG_DAC2_EQ12,
541 SOC_SINGLE_TLV("DAC2 EQ Band 2 Volume", DA732X_REG_DAC2_EQ12,
544 SOC_SINGLE_TLV("DAC2 EQ Band 3 Volume", DA732X_REG_DAC2_EQ34,
547 SOC_SINGLE_TLV("DAC2 EQ Band 4 Volume", DA732X_REG_DAC2_EQ34,
550 SOC_SINGLE_TLV("DAC2 EQ Band 5 Volume", DA732X_REG_DAC2_EQ5,
554 SOC_SINGLE("DAC3 EQ Switch", DA732X_REG_DAC3_EQ5,
556 SOC_SINGLE_TLV("DAC3 EQ Band 1 Volume", DA732X_REG_DAC3_EQ12,
559 SOC_SINGLE_TLV("DAC3 EQ Band 2 Volume", DA732X_REG_DAC3_EQ12,
562 SOC_SINGLE_TLV("DAC3 EQ Band 3 Volume", DA732X_REG_DAC3_EQ34,
565 SOC_SINGLE_TLV("DAC3 EQ Band 4 Volume", DA732X_REG_DAC3_EQ34,
568 SOC_SINGLE_TLV("DAC3 EQ Band 5 Volume", DA732X_REG_DAC3_EQ5,
604 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in da732x_adc_event()
608 switch (w->reg) { in da732x_adc_event()
620 return -EINVAL; in da732x_adc_event()
623 snd_soc_component_update_bits(component, w->reg, DA732X_ADC_RST_MASK, in da732x_adc_event()
625 snd_soc_component_update_bits(component, w->reg, DA732X_ADC_PD_MASK, in da732x_adc_event()
629 snd_soc_component_update_bits(component, w->reg, DA732X_ADC_PD_MASK, in da732x_adc_event()
631 snd_soc_component_update_bits(component, w->reg, DA732X_ADC_RST_MASK, in da732x_adc_event()
634 switch (w->reg) { in da732x_adc_event()
644 return -EINVAL; in da732x_adc_event()
649 return -EINVAL; in da732x_adc_event()
658 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in da732x_out_pga_event()
662 snd_soc_component_update_bits(component, w->reg, in da732x_out_pga_event()
663 (1 << w->shift) | DA732X_OUT_HIZ_EN, in da732x_out_pga_event()
664 (1 << w->shift) | DA732X_OUT_HIZ_EN); in da732x_out_pga_event()
667 snd_soc_component_update_bits(component, w->reg, in da732x_out_pga_event()
668 (1 << w->shift) | DA732X_OUT_HIZ_EN, in da732x_out_pga_event()
669 (1 << w->shift) | DA732X_OUT_HIZ_DIS); in da732x_out_pga_event()
672 return -EINVAL; in da732x_out_pga_event()
944 struct snd_soc_component *component = dai->component; in da732x_hw_params()
949 reg_aif = dai->driver->base; in da732x_hw_params()
965 return -EINVAL; in da732x_hw_params()
1003 return -EINVAL; in da732x_hw_params()
1014 struct snd_soc_component *component = dai->component; in da732x_set_dai_fmt()
1019 switch (dai->id) { in da732x_set_dai_fmt()
1033 return -EINVAL; in da732x_set_dai_fmt()
1046 return -EINVAL; in da732x_set_dai_fmt()
1063 return -EINVAL; in da732x_set_dai_fmt()
1076 return -EINVAL; in da732x_set_dai_fmt()
1095 return -EINVAL; in da732x_set_dai_fmt()
1099 return -EINVAL; in da732x_set_dai_fmt()
1126 da732x->pll_en = false; in da732x_set_dai_pll()
1130 if (da732x->pll_en) in da732x_set_dai_pll()
1131 return -EBUSY; in da732x_set_dai_pll()
1135 switch (da732x->sysclk) { in da732x_set_dai_pll()
1146 dev_err(component->dev, in da732x_set_dai_pll()
1148 return -EINVAL; in da732x_set_dai_pll()
1152 indiv = da732x_get_input_div(component, da732x->sysclk); in da732x_set_dai_pll()
1156 fref = da732x->sysclk / BIT(indiv); in da732x_set_dai_pll()
1170 da732x->pll_en = true; in da732x_set_dai_pll()
1178 struct snd_soc_component *component = dai->component; in da732x_set_dai_sysclk()
1181 da732x->sysclk = freq; in da732x_set_dai_sysclk()
1408 enum snd_soc_bias_level level) in da732x_set_bias_level() argument
1412 switch (level) { in da732x_set_bias_level()
1471 regcache_cache_only(da732x->regmap, false); in da732x_set_bias_level()
1472 regcache_sync(da732x->regmap); in da732x_set_bias_level()
1479 da732x->pll_en = false; in da732x_set_bias_level()
1483 regcache_cache_only(da732x->regmap, true); in da732x_set_bias_level()
1487 da732x->pll_en = false; in da732x_set_bias_level()
1514 da732x = devm_kzalloc(&i2c->dev, sizeof(struct da732x_priv), in da732x_i2c_probe()
1517 return -ENOMEM; in da732x_i2c_probe()
1521 da732x->regmap = devm_regmap_init_i2c(i2c, &da732x_regmap); in da732x_i2c_probe()
1522 if (IS_ERR(da732x->regmap)) { in da732x_i2c_probe()
1523 ret = PTR_ERR(da732x->regmap); in da732x_i2c_probe()
1524 dev_err(&i2c->dev, "Failed to initialize regmap\n"); in da732x_i2c_probe()
1528 ret = regmap_read(da732x->regmap, DA732X_REG_ID, &reg); in da732x_i2c_probe()
1530 dev_err(&i2c->dev, "Failed to read ID register: %d\n", ret); in da732x_i2c_probe()
1534 dev_info(&i2c->dev, "Revision: %d.%d\n", in da732x_i2c_probe()
1538 ret = devm_snd_soc_register_component(&i2c->dev, in da732x_i2c_probe()
1542 dev_err(&i2c->dev, "Failed to register component.\n"); in da732x_i2c_probe()