Lines Matching +full:startup +full:- +full:time +full:- +full:ms
1 // SPDX-License-Identifier: GPL-2.0-only
6 * Author: Lars-Peter Clausen <lars@metafoo.de>
141 static const DECLARE_TLV_DB_MINMAX_MUTE(ssm2518_vol_tlv, -7125, 2400);
142 static const DECLARE_TLV_DB_SCALE(ssm2518_compressor_tlv, -3400, 200, 0);
143 static const DECLARE_TLV_DB_SCALE(ssm2518_expander_tlv, -8100, 300, 0);
144 static const DECLARE_TLV_DB_SCALE(ssm2518_noise_gate_tlv, -9600, 300, 0);
145 static const DECLARE_TLV_DB_SCALE(ssm2518_post_drc_tlv, -2400, 300, 0);
148 0, 7, TLV_DB_SCALE_ITEM(-2200, 200, 0),
149 7, 15, TLV_DB_SCALE_ITEM(-800, 100, 0),
153 "0 ms", "0.1 ms", "0.19 ms", "0.37 ms", "0.75 ms", "1.5 ms", "3 ms",
154 "6 ms", "12 ms", "24 ms", "48 ms", "96 ms", "192 ms", "384 ms",
155 "768 ms", "1536 ms",
159 "0 ms", "1.5 ms", "3 ms", "6 ms", "12 ms", "24 ms", "48 ms", "96 ms",
160 "192 ms", "384 ms", "768 ms", "1536 ms", "3072 ms", "6144 ms",
161 "12288 ms", "24576 ms"
165 "0 ms", "0.67 ms", "1.33 ms", "2.67 ms", "5.33 ms", "10.66 ms",
166 "21.32 ms", "42.64 ms", "85.28 ms", "170.56 ms", "341.12 ms",
167 "682.24 ms", "1364 ms",
186 SOC_SINGLE("Playback De-emphasis Switch", SSM2518_REG_MUTE_CTRL,
216 SOC_ENUM("DRC Peak Detector Attack Time",
218 SOC_ENUM("DRC Peak Detector Release Time",
220 SOC_ENUM("DRC Attack Time", ssm2518_drc_attack_time_enum),
221 SOC_ENUM("DRC Decay Time", ssm2518_drc_decay_time_enum),
222 SOC_ENUM("DRC Hold Time", ssm2518_drc_hold_time_enum),
223 SOC_ENUM("DRC Noise Gate Hold Time",
225 SOC_ENUM("DRC RMS Averaging Time", ssm2518_drc_rms_averaging_time_enum),
324 return -EINVAL; in ssm2518_lookup_mcs()
327 if (sysclks[i] == ssm2518->sysclk) in ssm2518_lookup_mcs()
331 return -EINVAL; in ssm2518_lookup_mcs()
337 struct snd_soc_component *component = dai->component; in ssm2518_hw_params()
359 return -EINVAL; in ssm2518_hw_params()
361 if (ssm2518->right_j) { in ssm2518_hw_params()
370 return -EINVAL; in ssm2518_hw_params()
376 ret = regmap_update_bits(ssm2518->regmap, SSM2518_REG_CLOCK, in ssm2518_hw_params()
381 ret = regmap_update_bits(ssm2518->regmap, SSM2518_REG_SAI_CTRL1, in ssm2518_hw_params()
386 return regmap_update_bits(ssm2518->regmap, SSM2518_REG_POWER1, in ssm2518_hw_params()
392 struct ssm2518 *ssm2518 = snd_soc_component_get_drvdata(dai->component); in ssm2518_mute()
400 return regmap_update_bits(ssm2518->regmap, SSM2518_REG_MUTE_CTRL, in ssm2518_mute()
406 struct ssm2518 *ssm2518 = snd_soc_component_get_drvdata(dai->component); in ssm2518_set_dai_fmt()
415 return -EINVAL; in ssm2518_set_dai_fmt()
434 return -EINVAL; in ssm2518_set_dai_fmt()
437 ssm2518->right_j = false; in ssm2518_set_dai_fmt()
448 ssm2518->right_j = true; in ssm2518_set_dai_fmt()
462 return -EINVAL; in ssm2518_set_dai_fmt()
468 ret = regmap_write(ssm2518->regmap, SSM2518_REG_SAI_CTRL1, ctrl1); in ssm2518_set_dai_fmt()
472 return regmap_write(ssm2518->regmap, SSM2518_REG_SAI_CTRL2, ctrl2); in ssm2518_set_dai_fmt()
480 ret = regmap_update_bits(ssm2518->regmap, SSM2518_REG_POWER1, in ssm2518_set_power()
482 regcache_mark_dirty(ssm2518->regmap); in ssm2518_set_power()
485 if (ssm2518->enable_gpio) in ssm2518_set_power()
486 gpiod_set_value_cansleep(ssm2518->enable_gpio, enable); in ssm2518_set_power()
488 regcache_cache_only(ssm2518->regmap, !enable); in ssm2518_set_power()
491 ret = regmap_update_bits(ssm2518->regmap, SSM2518_REG_POWER1, in ssm2518_set_power()
493 regcache_sync(ssm2518->regmap); in ssm2518_set_power()
525 struct ssm2518 *ssm2518 = snd_soc_component_get_drvdata(dai->component); in ssm2518_set_tdm_slot()
531 return regmap_update_bits(ssm2518->regmap, in ssm2518_set_tdm_slot()
536 return -EINVAL; in ssm2518_set_tdm_slot()
540 return -EINVAL; in ssm2518_set_tdm_slot()
556 return -EINVAL; in ssm2518_set_tdm_slot()
569 return -EINVAL; in ssm2518_set_tdm_slot()
589 return -EINVAL; in ssm2518_set_tdm_slot()
592 ret = regmap_write(ssm2518->regmap, SSM2518_REG_CHAN_MAP, in ssm2518_set_tdm_slot()
598 ret = regmap_update_bits(ssm2518->regmap, SSM2518_REG_SAI_CTRL1, in ssm2518_set_tdm_slot()
603 return regmap_update_bits(ssm2518->regmap, SSM2518_REG_SAI_CTRL2, in ssm2518_set_tdm_slot()
610 struct ssm2518 *ssm2518 = snd_soc_component_get_drvdata(dai->component); in ssm2518_startup()
612 if (ssm2518->constraints) in ssm2518_startup()
613 snd_pcm_hw_constraint_list(substream->runtime, 0, in ssm2518_startup()
614 SNDRV_PCM_HW_PARAM_RATE, ssm2518->constraints); in ssm2518_startup()
623 .startup = ssm2518_startup,
632 .name = "ssm2518-hifi",
650 return -EINVAL; in ssm2518_set_sysclk()
663 return -EINVAL; in ssm2518_set_sysclk()
668 ssm2518->constraints = NULL; in ssm2518_set_sysclk()
676 ssm2518->constraints = &ssm2518_constraints_2048000; in ssm2518_set_sysclk()
687 ssm2518->constraints = &ssm2518_constraints_2822000; in ssm2518_set_sysclk()
695 ssm2518->constraints = &ssm2518_constraints_3072000; in ssm2518_set_sysclk()
700 ssm2518->constraints = &ssm2518_constraints_12288000; in ssm2518_set_sysclk()
703 return -EINVAL; in ssm2518_set_sysclk()
706 ssm2518->sysclk = freq; in ssm2518_set_sysclk()
708 return regmap_update_bits(ssm2518->regmap, SSM2518_REG_POWER1, in ssm2518_set_sysclk()
741 ssm2518 = devm_kzalloc(&i2c->dev, sizeof(*ssm2518), GFP_KERNEL); in ssm2518_i2c_probe()
743 return -ENOMEM; in ssm2518_i2c_probe()
746 ssm2518->enable_gpio = devm_gpiod_get_optional(&i2c->dev, NULL, in ssm2518_i2c_probe()
748 ret = PTR_ERR_OR_ZERO(ssm2518->enable_gpio); in ssm2518_i2c_probe()
752 gpiod_set_consumer_name(ssm2518->enable_gpio, "SSM2518 nSD"); in ssm2518_i2c_probe()
756 ssm2518->regmap = devm_regmap_init_i2c(i2c, &ssm2518_regmap_config); in ssm2518_i2c_probe()
757 if (IS_ERR(ssm2518->regmap)) in ssm2518_i2c_probe()
758 return PTR_ERR(ssm2518->regmap); in ssm2518_i2c_probe()
766 regcache_cache_bypass(ssm2518->regmap, true); in ssm2518_i2c_probe()
767 ret = regmap_write(ssm2518->regmap, SSM2518_REG_POWER1, in ssm2518_i2c_probe()
769 regcache_cache_bypass(ssm2518->regmap, false); in ssm2518_i2c_probe()
773 ret = regmap_update_bits(ssm2518->regmap, SSM2518_REG_POWER2, in ssm2518_i2c_probe()
782 return devm_snd_soc_register_component(&i2c->dev, in ssm2518_i2c_probe()
812 MODULE_AUTHOR("Lars-Peter Clausen <lars@metafoo.de>");