Lines Matching +full:de +full:- +full:emphasis
1 // SPDX-License-Identifier: GPL-2.0
21 #include <sound/soc-dapm.h>
86 * from -127 to 0 dB in 0.5 dB steps (mute instead of -127.5 dB)
88 static DECLARE_TLV_DB_SCALE(dac_tlv, -12750, 50, 1);
103 * 0, 0, 0 : Sharp Roll-Off Filter
104 * 0, 0, 1 : Slow Roll-Off Filter
105 * 0, 1, 0 : Short delay Sharp Roll-Off Filter
106 * 0, 1, 1 : Short delay Slow Roll-Off Filter
107 * 1, *, * : Super Slow Roll-Off Filter
110 "Sharp Roll-Off Filter",
111 "Slow Roll-Off Filter",
112 "Short delay Sharp Roll-Off Filter",
113 "Short delay Slow Roll-Off Filter",
114 "Super Slow Roll-Off Filter"
125 * SC1-0 bits: Sound Mode Setting
135 /* FIR2-0 bits: FIR Filter Mode Setting */
141 /* ATS1-0 bits Attenuation Speed */
195 ucontrol->value.enumerated.item[0] = ak4458->digfil; in get_digfil()
207 num = ucontrol->value.enumerated.item[0]; in set_digfil()
209 return -EINVAL; in set_digfil()
211 ak4458->digfil = num; in set_digfil()
216 ((ak4458->digfil & 0x02) << 4)); in set_digfil()
221 (ak4458->digfil & 0x01)); in set_digfil()
226 ((ak4458->digfil & 0x04) >> 2)); in set_digfil()
240 SOC_ENUM("AK4458 De-emphasis Response DAC1", ak4458_dac1_dem_enum),
241 SOC_ENUM("AK4458 De-emphasis Response DAC2", ak4458_dac2_dem_enum),
242 SOC_ENUM("AK4458 De-emphasis Response DAC3", ak4458_dac3_dem_enum),
243 SOC_ENUM("AK4458 De-emphasis Response DAC4", ak4458_dac4_dem_enum),
288 SOC_ENUM("AK4497 De-emphasis Response DAC", ak4458_dac1_dem_enum),
313 switch (ak4458->slots * ak4458->slot_width) { in ak4458_get_tdm_mode()
349 struct snd_soc_component *component = dai->component; in ak4458_hw_params()
351 int pcm_width = max(params_physical_width(params), ak4458->slot_width); in ak4458_hw_params()
356 ak4458->fs = nfs1; in ak4458_hw_params()
360 channels_max = dai->driver->playback.channels_max; in ak4458_hw_params()
383 if (ak4458->drvdata->type == AK4497) { in ak4458_hw_params()
387 dev_err(dai->dev, "DSD512 not supported.\n"); in ak4458_hw_params()
388 return -EINVAL; in ak4458_hw_params()
392 dev_err(dai->dev, "Unsupported dsd bclk.\n"); in ak4458_hw_params()
393 return -EINVAL; in ak4458_hw_params()
408 if (ak4458->fmt == SND_SOC_DAIFMT_I2S) in ak4458_hw_params()
414 switch (ak4458->fmt) { in ak4458_hw_params()
431 return -EINVAL; in ak4458_hw_params()
435 return -EINVAL; in ak4458_hw_params()
446 (ak4458->fmt == SND_SOC_DAIFMT_DSP_B) && in ak4458_hw_params()
452 if (ak4458->drvdata->type == AK4497) { in ak4458_hw_params()
454 0x4, (ak4458->dsd_path << 2)); in ak4458_hw_params()
472 struct snd_soc_component *component = dai->component; in ak4458_set_dai_fmt()
483 dev_err(component->dev, "Clock provider mode unsupported\n"); in ak4458_set_dai_fmt()
484 return -EINVAL; in ak4458_set_dai_fmt()
493 ak4458->fmt = fmt & SND_SOC_DAIFMT_FORMAT_MASK; in ak4458_set_dai_fmt()
496 dev_err(component->dev, "Audio format 0x%02X unsupported\n", in ak4458_set_dai_fmt()
498 return -EINVAL; in ak4458_set_dai_fmt()
504 ak4458->fmt == SND_SOC_DAIFMT_PDM ? in ak4458_set_dai_fmt()
522 struct snd_soc_component *component = dai->component; in ak4458_set_dai_mute()
527 nfs = ak4458->fs; in ak4458_set_dai_mute()
537 if (ak4458->mute_gpiod) in ak4458_set_dai_mute()
538 gpiod_set_value_cansleep(ak4458->mute_gpiod, 1); in ak4458_set_dai_mute()
540 if (ak4458->mute_gpiod) in ak4458_set_dai_mute()
541 gpiod_set_value_cansleep(ak4458->mute_gpiod, 0); in ak4458_set_dai_mute()
552 struct snd_soc_component *component = dai->component; in ak4458_set_tdm_slot()
556 ak4458->slots = slots; in ak4458_set_tdm_slot()
557 ak4458->slot_width = slot_width; in ak4458_set_tdm_slot()
593 ret = snd_pcm_hw_constraint_list(substream->runtime, 0, in ak4458_startup()
610 .name = "ak4458-aif",
622 .name = "ak4497-aif",
635 if (ak4458->reset_gpiod) { in ak4458_reset()
636 gpiod_set_value_cansleep(ak4458->reset_gpiod, active); in ak4458_reset()
638 } else if (!IS_ERR_OR_NULL(ak4458->reset)) { in ak4458_reset()
640 reset_control_assert(ak4458->reset); in ak4458_reset()
642 reset_control_deassert(ak4458->reset); in ak4458_reset()
652 regcache_cache_only(ak4458->regmap, true); in ak4458_runtime_suspend()
656 if (ak4458->mute_gpiod) in ak4458_runtime_suspend()
657 gpiod_set_value_cansleep(ak4458->mute_gpiod, 0); in ak4458_runtime_suspend()
659 regulator_bulk_disable(ARRAY_SIZE(ak4458->supplies), in ak4458_runtime_suspend()
660 ak4458->supplies); in ak4458_runtime_suspend()
669 ret = regulator_bulk_enable(ARRAY_SIZE(ak4458->supplies), in ak4458_runtime_resume()
670 ak4458->supplies); in ak4458_runtime_resume()
672 dev_err(ak4458->dev, "Failed to enable supplies: %d\n", ret); in ak4458_runtime_resume()
676 if (ak4458->mute_gpiod) in ak4458_runtime_resume()
677 gpiod_set_value_cansleep(ak4458->mute_gpiod, 1); in ak4458_runtime_resume()
681 regcache_cache_only(ak4458->regmap, false); in ak4458_runtime_resume()
682 regcache_mark_dirty(ak4458->regmap); in ak4458_runtime_resume()
684 return regcache_sync(ak4458->regmap); in ak4458_runtime_resume()
745 ak4458 = devm_kzalloc(&i2c->dev, sizeof(*ak4458), GFP_KERNEL); in ak4458_i2c_probe()
747 return -ENOMEM; in ak4458_i2c_probe()
749 ak4458->regmap = devm_regmap_init_i2c(i2c, &ak4458_regmap); in ak4458_i2c_probe()
750 if (IS_ERR(ak4458->regmap)) in ak4458_i2c_probe()
751 return PTR_ERR(ak4458->regmap); in ak4458_i2c_probe()
754 ak4458->dev = &i2c->dev; in ak4458_i2c_probe()
756 ak4458->drvdata = of_device_get_match_data(&i2c->dev); in ak4458_i2c_probe()
758 ak4458->reset = devm_reset_control_get_optional_shared(ak4458->dev, NULL); in ak4458_i2c_probe()
759 if (IS_ERR(ak4458->reset)) in ak4458_i2c_probe()
760 return PTR_ERR(ak4458->reset); in ak4458_i2c_probe()
762 ak4458->reset_gpiod = devm_gpiod_get_optional(ak4458->dev, "reset", in ak4458_i2c_probe()
764 if (IS_ERR(ak4458->reset_gpiod)) in ak4458_i2c_probe()
765 return PTR_ERR(ak4458->reset_gpiod); in ak4458_i2c_probe()
767 ak4458->mute_gpiod = devm_gpiod_get_optional(ak4458->dev, "mute", in ak4458_i2c_probe()
769 if (IS_ERR(ak4458->mute_gpiod)) in ak4458_i2c_probe()
770 return PTR_ERR(ak4458->mute_gpiod); in ak4458_i2c_probe()
773 of_property_read_u32(i2c->dev.of_node, "dsd-path", &ak4458->dsd_path); in ak4458_i2c_probe()
775 for (i = 0; i < ARRAY_SIZE(ak4458->supplies); i++) in ak4458_i2c_probe()
776 ak4458->supplies[i].supply = ak4458_supply_names[i]; in ak4458_i2c_probe()
778 ret = devm_regulator_bulk_get(ak4458->dev, ARRAY_SIZE(ak4458->supplies), in ak4458_i2c_probe()
779 ak4458->supplies); in ak4458_i2c_probe()
781 dev_err(ak4458->dev, "Failed to request supplies: %d\n", ret); in ak4458_i2c_probe()
785 ret = devm_snd_soc_register_component(ak4458->dev, in ak4458_i2c_probe()
786 ak4458->drvdata->comp_drv, in ak4458_i2c_probe()
787 ak4458->drvdata->dai_drv, 1); in ak4458_i2c_probe()
789 dev_err(ak4458->dev, "Failed to register CODEC: %d\n", ret); in ak4458_i2c_probe()
793 pm_runtime_enable(&i2c->dev); in ak4458_i2c_probe()
794 regcache_cache_only(ak4458->regmap, true); in ak4458_i2c_probe()
805 pm_runtime_disable(&i2c->dev); in ak4458_i2c_remove()
809 { .compatible = "asahi-kasei,ak4458", .data = &ak4458_drvdata},
810 { .compatible = "asahi-kasei,ak4497", .data = &ak4497_drvdata},
827 MODULE_AUTHOR("Junichi Wakasugi <wakasugi.jb@om.asahi-kasei.co.jp>");