Lines Matching +full:vmon +full:- +full:slot +full:- +full:no

1 // SPDX-License-Identifier: GPL-2.0
41 if (tas2764->reset_gpio) { in tas2764_reset()
42 gpiod_set_value_cansleep(tas2764->reset_gpio, 0); in tas2764_reset()
44 gpiod_set_value_cansleep(tas2764->reset_gpio, 1); in tas2764_reset()
47 snd_soc_component_write(tas2764->component, TAS2764_SW_RST, in tas2764_reset()
75 dev_err(tas2764->dev, in tas2764_set_bias_level()
77 return -EINVAL; in tas2764_set_bias_level()
96 if (tas2764->sdz_gpio) in tas2764_codec_suspend()
97 gpiod_set_value_cansleep(tas2764->sdz_gpio, 0); in tas2764_codec_suspend()
99 regcache_cache_only(tas2764->regmap, true); in tas2764_codec_suspend()
100 regcache_mark_dirty(tas2764->regmap); in tas2764_codec_suspend()
110 if (tas2764->sdz_gpio) in tas2764_codec_resume()
111 gpiod_set_value_cansleep(tas2764->sdz_gpio, 1); in tas2764_codec_resume()
120 regcache_cache_only(tas2764->regmap, false); in tas2764_codec_resume()
122 return regcache_sync(tas2764->regmap); in tas2764_codec_resume()
142 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in tas2764_dac_event()
158 dev_err(tas2764->dev, "Unsupported event\n"); in tas2764_dac_event()
159 return -EINVAL; in tas2764_dac_event()
183 SND_SOC_DAPM_SIGGEN("VMON"),
195 {"VSENSE", "Switch", "VMON"},
200 struct snd_soc_component *component = dai->component; in tas2764_mute()
215 struct snd_soc_component *component = tas2764->component; in tas2764_set_bitwidth()
241 return -EINVAL; in tas2764_set_bitwidth()
247 val = snd_soc_component_read(tas2764->component, TAS2764_PWR_CTRL); in tas2764_set_bitwidth()
256 ret = snd_soc_component_update_bits(tas2764->component, TAS2764_TDM_CFG5, in tas2764_set_bitwidth()
267 ret = snd_soc_component_update_bits(tas2764->component, TAS2764_TDM_CFG6, in tas2764_set_bitwidth()
278 struct snd_soc_component *component = tas2764->component; in tas2764_set_samplerate()
300 return -EINVAL; in tas2764_set_samplerate()
317 struct snd_soc_component *component = dai->component; in tas2764_hw_params()
330 struct snd_soc_component *component = dai->component; in tas2764_set_fmt()
344 dev_err(tas2764->dev, "ASI format Inverse is not found\n"); in tas2764_set_fmt()
345 return -EINVAL; in tas2764_set_fmt()
366 dev_err(tas2764->dev, in tas2764_set_fmt()
368 return -EINVAL; in tas2764_set_fmt()
390 struct snd_soc_component *component = dai->component; in tas2764_set_dai_tdm_slot()
398 return -EINVAL; in tas2764_set_dai_tdm_slot()
402 return -EINVAL; in tas2764_set_dai_tdm_slot()
417 return -EINVAL; in tas2764_set_dai_tdm_slot()
436 return -EINVAL; in tas2764_set_dai_tdm_slot()
447 tas2764->v_sense_slot); in tas2764_set_dai_tdm_slot()
453 tas2764->i_sense_slot); in tas2764_set_dai_tdm_slot()
502 tas2764->component = component; in tas2764_codec_probe()
504 if (tas2764->sdz_gpio) in tas2764_codec_probe()
505 gpiod_set_value_cansleep(tas2764->sdz_gpio, 1); in tas2764_codec_probe()
509 ret = snd_soc_component_update_bits(tas2764->component, TAS2764_TDM_CFG5, in tas2764_codec_probe()
514 ret = snd_soc_component_update_bits(tas2764->component, TAS2764_TDM_CFG6, in tas2764_codec_probe()
529 static DECLARE_TLV_DB_SCALE(tas2764_playback_volume, -10000, 50, 0);
594 tas2764->reset_gpio = devm_gpiod_get_optional(tas2764->dev, "reset", in tas2764_parse_dt()
596 if (IS_ERR(tas2764->reset_gpio)) { in tas2764_parse_dt()
597 if (PTR_ERR(tas2764->reset_gpio) == -EPROBE_DEFER) { in tas2764_parse_dt()
598 tas2764->reset_gpio = NULL; in tas2764_parse_dt()
599 return -EPROBE_DEFER; in tas2764_parse_dt()
603 tas2764->sdz_gpio = devm_gpiod_get_optional(dev, "shutdown", GPIOD_OUT_HIGH); in tas2764_parse_dt()
604 if (IS_ERR(tas2764->sdz_gpio)) { in tas2764_parse_dt()
605 if (PTR_ERR(tas2764->sdz_gpio) == -EPROBE_DEFER) in tas2764_parse_dt()
606 return -EPROBE_DEFER; in tas2764_parse_dt()
608 tas2764->sdz_gpio = NULL; in tas2764_parse_dt()
611 ret = fwnode_property_read_u32(dev->fwnode, "ti,imon-slot-no", in tas2764_parse_dt()
612 &tas2764->i_sense_slot); in tas2764_parse_dt()
614 tas2764->i_sense_slot = 0; in tas2764_parse_dt()
616 ret = fwnode_property_read_u32(dev->fwnode, "ti,vmon-slot-no", in tas2764_parse_dt()
617 &tas2764->v_sense_slot); in tas2764_parse_dt()
619 tas2764->v_sense_slot = 2; in tas2764_parse_dt()
630 tas2764 = devm_kzalloc(&client->dev, sizeof(struct tas2764_priv), in tas2764_i2c_probe()
633 return -ENOMEM; in tas2764_i2c_probe()
635 tas2764->dev = &client->dev; in tas2764_i2c_probe()
637 dev_set_drvdata(&client->dev, tas2764); in tas2764_i2c_probe()
639 tas2764->regmap = devm_regmap_init_i2c(client, &tas2764_i2c_regmap); in tas2764_i2c_probe()
640 if (IS_ERR(tas2764->regmap)) { in tas2764_i2c_probe()
641 result = PTR_ERR(tas2764->regmap); in tas2764_i2c_probe()
642 dev_err(&client->dev, "Failed to allocate register map: %d\n", in tas2764_i2c_probe()
647 if (client->dev.of_node) { in tas2764_i2c_probe()
648 result = tas2764_parse_dt(&client->dev, tas2764); in tas2764_i2c_probe()
650 dev_err(tas2764->dev, "%s: Failed to parse devicetree\n", in tas2764_i2c_probe()
656 return devm_snd_soc_register_component(tas2764->dev, in tas2764_i2c_probe()