Lines Matching +full:vmon +full:- +full:slot +full:- +full:no
1 // SPDX-License-Identifier: GPL-2.0
21 #include <sound/soc-dapm.h>
91 dev_err(tas2562->dev, in tas2562_set_bias_level()
93 return -EINVAL; in tas2562_set_bias_level()
162 dev_info(tas2562->dev, "%s, unsupported sample rate, %d\n", in tas2562_set_samplerate()
164 return -EINVAL; in tas2562_set_samplerate()
167 snd_soc_component_update_bits(tas2562->component, TAS2562_TDM_CFG0, in tas2562_set_samplerate()
169 snd_soc_component_update_bits(tas2562->component, TAS2562_TDM_CFG0, in tas2562_set_samplerate()
179 struct snd_soc_component *component = dai->component; in tas2562_set_dai_tdm_slot()
186 dev_err(component->dev, "tx masks must not be 0\n"); in tas2562_set_dai_tdm_slot()
187 return -EINVAL; in tas2562_set_dai_tdm_slot()
192 return -EINVAL; in tas2562_set_dai_tdm_slot()
234 /* Do not change slot width */ in tas2562_set_dai_tdm_slot()
237 dev_err(tas2562->dev, "slot width not supported"); in tas2562_set_dai_tdm_slot()
238 ret = -EINVAL; in tas2562_set_dai_tdm_slot()
246 tas2562->v_sense_slot); in tas2562_set_dai_tdm_slot()
252 tas2562->i_sense_slot); in tas2562_set_dai_tdm_slot()
267 snd_soc_component_update_bits(tas2562->component, in tas2562_set_bitwidth()
273 snd_soc_component_update_bits(tas2562->component, in tas2562_set_bitwidth()
279 snd_soc_component_update_bits(tas2562->component, in tas2562_set_bitwidth()
286 dev_info(tas2562->dev, "Unsupported bitwidth format\n"); in tas2562_set_bitwidth()
287 return -EINVAL; in tas2562_set_bitwidth()
290 val = snd_soc_component_read(tas2562->component, TAS2562_PWR_CTRL); in tas2562_set_bitwidth()
299 ret = snd_soc_component_update_bits(tas2562->component, TAS2562_TDM_CFG5, in tas2562_set_bitwidth()
309 ret = snd_soc_component_update_bits(tas2562->component, TAS2562_TDM_CFG6, in tas2562_set_bitwidth()
321 struct snd_soc_component *component = dai->component; in tas2562_hw_params()
327 dev_err(tas2562->dev, "set bitwidth failed, %d\n", ret); in tas2562_hw_params()
333 dev_err(tas2562->dev, "set sample rate failed, %d\n", ret); in tas2562_hw_params()
340 struct snd_soc_component *component = dai->component; in tas2562_set_dai_fmt()
354 dev_err(tas2562->dev, "ASI format Inverse is not found\n"); in tas2562_set_dai_fmt()
355 return -EINVAL; in tas2562_set_dai_fmt()
362 dev_err(tas2562->dev, "Failed to set RX edge\n"); in tas2562_set_dai_fmt()
375 dev_err(tas2562->dev, in tas2562_set_dai_fmt()
377 return -EINVAL; in tas2562_set_dai_fmt()
390 struct snd_soc_component *component = dai->component; in tas2562_mute()
402 tas2562->component = component; in tas2562_codec_probe()
404 if (tas2562->sdz_gpio) in tas2562_codec_probe()
405 gpiod_set_value_cansleep(tas2562->sdz_gpio, 1); in tas2562_codec_probe()
420 regcache_cache_only(tas2562->regmap, true); in tas2562_suspend()
421 regcache_mark_dirty(tas2562->regmap); in tas2562_suspend()
423 if (tas2562->sdz_gpio) in tas2562_suspend()
424 gpiod_set_value_cansleep(tas2562->sdz_gpio, 0); in tas2562_suspend()
433 if (tas2562->sdz_gpio) in tas2562_resume()
434 gpiod_set_value_cansleep(tas2562->sdz_gpio, 1); in tas2562_resume()
436 regcache_cache_only(tas2562->regmap, false); in tas2562_resume()
438 return regcache_sync(tas2562->regmap); in tas2562_resume()
459 snd_soc_dapm_to_component(w->dapm); in tas2562_dac_event()
481 dev_err(tas2562->dev, "Not supported evevt\n"); in tas2562_dac_event()
482 return -EINVAL; in tas2562_dac_event()
498 ucontrol->value.integer.value[0] = tas2562->volume_lvl; in tas2562_volume_control_get()
510 reg_val = float_vol_db_lookup[ucontrol->value.integer.value[0]/2]; in tas2562_volume_control_put()
528 tas2562->volume_lvl = ucontrol->value.integer.value[0]; in tas2562_volume_control_put()
533 /* Digital Volume Control. From 0 dB to -110 dB in 1 dB steps */
534 static const DECLARE_TLV_DB_SCALE(dvc_tlv, -11000, 100, 0);
603 SND_SOC_DAPM_SIGGEN("VMON"),
616 {"VSENSE", "Switch", "VMON"},
646 .name = "tas2562-amplifier",
705 struct device *dev = tas2562->dev; in tas2562_parse_dt()
708 tas2562->sdz_gpio = devm_gpiod_get_optional(dev, "shutdown", GPIOD_OUT_HIGH); in tas2562_parse_dt()
709 if (IS_ERR(tas2562->sdz_gpio)) { in tas2562_parse_dt()
710 if (PTR_ERR(tas2562->sdz_gpio) == -EPROBE_DEFER) in tas2562_parse_dt()
711 return -EPROBE_DEFER; in tas2562_parse_dt()
713 tas2562->sdz_gpio = NULL; in tas2562_parse_dt()
717 * The shut-down property is deprecated but needs to be checked for in tas2562_parse_dt()
720 if (tas2562->sdz_gpio == NULL) { in tas2562_parse_dt()
721 tas2562->sdz_gpio = devm_gpiod_get_optional(dev, "shut-down", in tas2562_parse_dt()
723 if (IS_ERR(tas2562->sdz_gpio)) in tas2562_parse_dt()
724 if (PTR_ERR(tas2562->sdz_gpio) == -EPROBE_DEFER) in tas2562_parse_dt()
725 return -EPROBE_DEFER; in tas2562_parse_dt()
727 tas2562->sdz_gpio = NULL; in tas2562_parse_dt()
730 if (tas2562->model_id == TAS2110) in tas2562_parse_dt()
733 ret = fwnode_property_read_u32(dev->fwnode, "ti,imon-slot-no", in tas2562_parse_dt()
734 &tas2562->i_sense_slot); in tas2562_parse_dt()
736 dev_err(dev, "Property %s is missing setting default slot\n", in tas2562_parse_dt()
737 "ti,imon-slot-no"); in tas2562_parse_dt()
738 tas2562->i_sense_slot = 0; in tas2562_parse_dt()
742 ret = fwnode_property_read_u32(dev->fwnode, "ti,vmon-slot-no", in tas2562_parse_dt()
743 &tas2562->v_sense_slot); in tas2562_parse_dt()
745 dev_info(dev, "Property %s is missing setting default slot\n", in tas2562_parse_dt()
746 "ti,vmon-slot-no"); in tas2562_parse_dt()
747 tas2562->v_sense_slot = 2; in tas2562_parse_dt()
750 if (tas2562->v_sense_slot < tas2562->i_sense_slot) { in tas2562_parse_dt()
751 dev_err(dev, "Vsense slot must be greater than Isense slot\n"); in tas2562_parse_dt()
752 return -EINVAL; in tas2562_parse_dt()
761 struct device *dev = &client->dev; in tas2562_probe()
767 return -ENOMEM; in tas2562_probe()
769 data->client = client; in tas2562_probe()
770 data->dev = &client->dev; in tas2562_probe()
771 data->model_id = id->driver_data; in tas2562_probe()
775 data->regmap = devm_regmap_init_i2c(client, &tas2562_regmap_config); in tas2562_probe()
776 if (IS_ERR(data->regmap)) { in tas2562_probe()
777 ret = PTR_ERR(data->regmap); in tas2562_probe()
782 dev_set_drvdata(&client->dev, data); in tas2562_probe()
784 if (data->model_id == TAS2110) in tas2562_probe()