Lines Matching +full:de +full:- +full:emphasis
1 // SPDX-License-Identifier: GPL-2.0
20 #include <sound/soc-dapm.h>
84 * from -127 to 0 dB in 0.5 dB steps (mute instead of -127.5 dB)
86 static DECLARE_TLV_DB_SCALE(dac_tlv, -12750, 50, 1);
101 * 0, 0, 0 : Sharp Roll-Off Filter
102 * 0, 0, 1 : Slow Roll-Off Filter
103 * 0, 1, 0 : Short delay Sharp Roll-Off Filter
104 * 0, 1, 1 : Short delay Slow Roll-Off Filter
105 * 1, *, * : Super Slow Roll-Off Filter
108 "Sharp Roll-Off Filter",
109 "Slow Roll-Off Filter",
110 "Short delay Sharp Roll-Off Filter",
111 "Short delay Slow Roll-Off Filter",
112 "Super Slow Roll-Off Filter"
123 * SC1-0 bits: Sound Mode Setting
133 /* FIR2-0 bits: FIR Filter Mode Setting */
139 /* ATS1-0 bits Attenuation Speed */
193 ucontrol->value.enumerated.item[0] = ak4458->digfil; in get_digfil()
205 num = ucontrol->value.enumerated.item[0]; in set_digfil()
207 return -EINVAL; in set_digfil()
209 ak4458->digfil = num; in set_digfil()
214 ((ak4458->digfil & 0x02) << 4)); in set_digfil()
219 (ak4458->digfil & 0x01)); in set_digfil()
224 ((ak4458->digfil & 0x04) >> 2)); in set_digfil()
238 SOC_ENUM("AK4458 De-emphasis Response DAC1", ak4458_dac1_dem_enum),
239 SOC_ENUM("AK4458 De-emphasis Response DAC2", ak4458_dac2_dem_enum),
240 SOC_ENUM("AK4458 De-emphasis Response DAC3", ak4458_dac3_dem_enum),
241 SOC_ENUM("AK4458 De-emphasis Response DAC4", ak4458_dac4_dem_enum),
286 SOC_ENUM("AK4497 De-emphasis Response DAC", ak4458_dac1_dem_enum),
333 struct snd_soc_component *component = dai->component; in ak4458_hw_params()
335 int pcm_width = max(params_physical_width(params), ak4458->slot_width); in ak4458_hw_params()
340 ak4458->fs = nfs1; in ak4458_hw_params()
364 if (ak4458->drvdata->type == AK4497) { in ak4458_hw_params()
368 dev_err(dai->dev, "DSD512 not supported.\n"); in ak4458_hw_params()
369 return -EINVAL; in ak4458_hw_params()
373 dev_err(dai->dev, "Unsupported dsd bclk.\n"); in ak4458_hw_params()
374 return -EINVAL; in ak4458_hw_params()
389 if (ak4458->fmt == SND_SOC_DAIFMT_I2S) in ak4458_hw_params()
395 switch (ak4458->fmt) { in ak4458_hw_params()
412 return -EINVAL; in ak4458_hw_params()
416 return -EINVAL; in ak4458_hw_params()
430 struct snd_soc_component *component = dai->component; in ak4458_set_dai_fmt()
440 dev_err(component->dev, "Master mode unsupported\n"); in ak4458_set_dai_fmt()
441 return -EINVAL; in ak4458_set_dai_fmt()
450 ak4458->fmt = fmt & SND_SOC_DAIFMT_FORMAT_MASK; in ak4458_set_dai_fmt()
453 dev_err(component->dev, "Audio format 0x%02X unsupported\n", in ak4458_set_dai_fmt()
455 return -EINVAL; in ak4458_set_dai_fmt()
461 ak4458->fmt == SND_SOC_DAIFMT_PDM ? in ak4458_set_dai_fmt()
474 struct snd_soc_component *component = dai->component; in ak4458_set_dai_mute()
479 nfs = ak4458->fs; in ak4458_set_dai_mute()
489 if (ak4458->mute_gpiod) in ak4458_set_dai_mute()
490 gpiod_set_value_cansleep(ak4458->mute_gpiod, 1); in ak4458_set_dai_mute()
492 if (ak4458->mute_gpiod) in ak4458_set_dai_mute()
493 gpiod_set_value_cansleep(ak4458->mute_gpiod, 0); in ak4458_set_dai_mute()
504 struct snd_soc_component *component = dai->component; in ak4458_set_tdm_slot()
508 ak4458->slots = slots; in ak4458_set_tdm_slot()
509 ak4458->slot_width = slot_width; in ak4458_set_tdm_slot()
558 ret = snd_pcm_hw_constraint_list(substream->runtime, 0, in ak4458_startup()
575 .name = "ak4458-aif",
587 .name = "ak4497-aif",
600 if (ak4458->reset_gpiod) { in ak4458_reset()
601 gpiod_set_value_cansleep(ak4458->reset_gpiod, active); in ak4458_reset()
612 if (ak4458->mute_gpiod) in ak4458_init()
613 gpiod_set_value_cansleep(ak4458->mute_gpiod, 1); in ak4458_init()
622 if (ak4458->drvdata->type == AK4497) { in ak4458_init()
624 0x4, (ak4458->dsd_path << 2)); in ak4458_init()
636 ak4458->fs = 48000; in ak4458_probe()
653 regcache_cache_only(ak4458->regmap, true); in ak4458_runtime_suspend()
657 if (ak4458->mute_gpiod) in ak4458_runtime_suspend()
658 gpiod_set_value_cansleep(ak4458->mute_gpiod, 0); in ak4458_runtime_suspend()
660 regulator_bulk_disable(ARRAY_SIZE(ak4458->supplies), in ak4458_runtime_suspend()
661 ak4458->supplies); in ak4458_runtime_suspend()
670 ret = regulator_bulk_enable(ARRAY_SIZE(ak4458->supplies), in ak4458_runtime_resume()
671 ak4458->supplies); in ak4458_runtime_resume()
673 dev_err(ak4458->dev, "Failed to enable supplies: %d\n", ret); in ak4458_runtime_resume()
677 if (ak4458->mute_gpiod) in ak4458_runtime_resume()
678 gpiod_set_value_cansleep(ak4458->mute_gpiod, 1); in ak4458_runtime_resume()
683 regcache_cache_only(ak4458->regmap, false); in ak4458_runtime_resume()
684 regcache_mark_dirty(ak4458->regmap); in ak4458_runtime_resume()
686 return regcache_sync(ak4458->regmap); in ak4458_runtime_resume()
753 ak4458 = devm_kzalloc(&i2c->dev, sizeof(*ak4458), GFP_KERNEL); in ak4458_i2c_probe()
755 return -ENOMEM; in ak4458_i2c_probe()
757 ak4458->regmap = devm_regmap_init_i2c(i2c, &ak4458_regmap); in ak4458_i2c_probe()
758 if (IS_ERR(ak4458->regmap)) in ak4458_i2c_probe()
759 return PTR_ERR(ak4458->regmap); in ak4458_i2c_probe()
762 ak4458->dev = &i2c->dev; in ak4458_i2c_probe()
764 ak4458->drvdata = of_device_get_match_data(&i2c->dev); in ak4458_i2c_probe()
766 ak4458->reset_gpiod = devm_gpiod_get_optional(ak4458->dev, "reset", in ak4458_i2c_probe()
768 if (IS_ERR(ak4458->reset_gpiod)) in ak4458_i2c_probe()
769 return PTR_ERR(ak4458->reset_gpiod); in ak4458_i2c_probe()
771 ak4458->mute_gpiod = devm_gpiod_get_optional(ak4458->dev, "mute", in ak4458_i2c_probe()
773 if (IS_ERR(ak4458->mute_gpiod)) in ak4458_i2c_probe()
774 return PTR_ERR(ak4458->mute_gpiod); in ak4458_i2c_probe()
777 of_property_read_u32(i2c->dev.of_node, "dsd-path", &ak4458->dsd_path); in ak4458_i2c_probe()
779 for (i = 0; i < ARRAY_SIZE(ak4458->supplies); i++) in ak4458_i2c_probe()
780 ak4458->supplies[i].supply = ak4458_supply_names[i]; in ak4458_i2c_probe()
782 ret = devm_regulator_bulk_get(ak4458->dev, ARRAY_SIZE(ak4458->supplies), in ak4458_i2c_probe()
783 ak4458->supplies); in ak4458_i2c_probe()
785 dev_err(ak4458->dev, "Failed to request supplies: %d\n", ret); in ak4458_i2c_probe()
789 ret = devm_snd_soc_register_component(ak4458->dev, in ak4458_i2c_probe()
790 ak4458->drvdata->comp_drv, in ak4458_i2c_probe()
791 ak4458->drvdata->dai_drv, 1); in ak4458_i2c_probe()
793 dev_err(ak4458->dev, "Failed to register CODEC: %d\n", ret); in ak4458_i2c_probe()
797 pm_runtime_enable(&i2c->dev); in ak4458_i2c_probe()
798 regcache_cache_only(ak4458->regmap, true); in ak4458_i2c_probe()
805 pm_runtime_disable(&i2c->dev); in ak4458_i2c_remove()
811 { .compatible = "asahi-kasei,ak4458", .data = &ak4458_drvdata},
812 { .compatible = "asahi-kasei,ak4497", .data = &ak4497_drvdata},
829 MODULE_AUTHOR("Junichi Wakasugi <wakasugi.jb@om.asahi-kasei.co.jp>");