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

1 // SPDX-License-Identifier: GPL-2.0
3 // ALSA SoC Texas Instruments TAS2770 20-W Digital Input Mono Class-D
6 // Copyright (C) 2016-2017 Texas Instruments Incorporated - https://www.ti.com/
7 // Author: Tracy Yi <tracy-yi@ti.com>
37 if (tas2770->reset_gpio) { in tas2770_reset()
38 gpiod_set_value_cansleep(tas2770->reset_gpio, 0); in tas2770_reset()
40 gpiod_set_value_cansleep(tas2770->reset_gpio, 1); in tas2770_reset()
43 snd_soc_component_write(tas2770->component, TAS2770_SW_RST, in tas2770_reset()
72 dev_err(tas2770->dev, "wrong power level setting %d\n", level); in tas2770_set_bias_level()
73 return -EINVAL; in tas2770_set_bias_level()
85 regcache_cache_only(tas2770->regmap, true); in tas2770_codec_suspend()
86 regcache_mark_dirty(tas2770->regmap); in tas2770_codec_suspend()
88 if (tas2770->sdz_gpio) { in tas2770_codec_suspend()
89 gpiod_set_value_cansleep(tas2770->sdz_gpio, 0); in tas2770_codec_suspend()
95 regcache_cache_only(tas2770->regmap, false); in tas2770_codec_suspend()
96 regcache_sync(tas2770->regmap); in tas2770_codec_suspend()
111 if (tas2770->sdz_gpio) { in tas2770_codec_resume()
112 gpiod_set_value_cansleep(tas2770->sdz_gpio, 1); in tas2770_codec_resume()
121 regcache_cache_only(tas2770->regmap, false); in tas2770_codec_resume()
123 return regcache_sync(tas2770->regmap); in tas2770_codec_resume()
145 snd_soc_dapm_to_component(w->dapm); in tas2770_dac_event()
162 dev_err(tas2770->dev, "Not supported evevt\n"); in tas2770_dac_event()
163 return -EINVAL; in tas2770_dac_event()
185 SND_SOC_DAPM_SIGGEN("VMON"),
197 {"VSENSE", "Switch", "VMON"},
202 struct snd_soc_component *component = dai->component; in tas2770_mute()
223 struct snd_soc_component *component = tas2770->component; in tas2770_set_bitwidth()
230 tas2770->v_sense_slot = tas2770->i_sense_slot + 2; in tas2770_set_bitwidth()
236 tas2770->v_sense_slot = tas2770->i_sense_slot + 4; in tas2770_set_bitwidth()
242 tas2770->v_sense_slot = tas2770->i_sense_slot + 4; in tas2770_set_bitwidth()
246 return -EINVAL; in tas2770_set_bitwidth()
256 tas2770->v_sense_slot); in tas2770_set_bitwidth()
264 tas2770->i_sense_slot); in tas2770_set_bitwidth()
273 struct snd_soc_component *component = tas2770->component; in tas2770_set_samplerate()
303 return -EINVAL; in tas2770_set_samplerate()
320 struct snd_soc_component *component = dai->component; in tas2770_hw_params()
334 struct snd_soc_component *component = dai->component; in tas2770_set_fmt()
344 dev_err(tas2770->dev, "ASI format master is not found\n"); in tas2770_set_fmt()
345 return -EINVAL; in tas2770_set_fmt()
356 dev_err(tas2770->dev, "ASI format Inverse is not found\n"); in tas2770_set_fmt()
357 return -EINVAL; in tas2770_set_fmt()
380 dev_err(tas2770->dev, in tas2770_set_fmt()
382 return -EINVAL; in tas2770_set_fmt()
399 struct snd_soc_component *component = dai->component; in tas2770_set_dai_tdm_slot()
404 return -EINVAL; in tas2770_set_dai_tdm_slot()
408 return -EINVAL; in tas2770_set_dai_tdm_slot()
424 return -EINVAL; in tas2770_set_dai_tdm_slot()
454 /* Do not change slot width */ in tas2770_set_dai_tdm_slot()
458 ret = -EINVAL; in tas2770_set_dai_tdm_slot()
511 tas2770->component = component; in tas2770_codec_probe()
513 if (tas2770->sdz_gpio) in tas2770_codec_probe()
514 gpiod_set_value_cansleep(tas2770->sdz_gpio, 1); in tas2770_codec_probe()
522 static DECLARE_TLV_DB_SCALE(tas2770_playback_volume, -12750, 50, 0);
549 return devm_snd_soc_register_component(tas2770->dev, in tas2770_register_codec()
641 rc = fwnode_property_read_u32(dev->fwnode, "ti,imon-slot-no", in tas2770_parse_dt()
642 &tas2770->i_sense_slot); in tas2770_parse_dt()
644 dev_info(tas2770->dev, "Property %s is missing setting default slot\n", in tas2770_parse_dt()
645 "ti,imon-slot-no"); in tas2770_parse_dt()
647 tas2770->i_sense_slot = 0; in tas2770_parse_dt()
650 rc = fwnode_property_read_u32(dev->fwnode, "ti,vmon-slot-no", in tas2770_parse_dt()
651 &tas2770->v_sense_slot); in tas2770_parse_dt()
653 dev_info(tas2770->dev, "Property %s is missing setting default slot\n", in tas2770_parse_dt()
654 "ti,vmon-slot-no"); in tas2770_parse_dt()
656 tas2770->v_sense_slot = 2; in tas2770_parse_dt()
659 tas2770->sdz_gpio = devm_gpiod_get_optional(dev, "shutdown", GPIOD_OUT_HIGH); in tas2770_parse_dt()
660 if (IS_ERR(tas2770->sdz_gpio)) { in tas2770_parse_dt()
661 if (PTR_ERR(tas2770->sdz_gpio) == -EPROBE_DEFER) in tas2770_parse_dt()
662 return -EPROBE_DEFER; in tas2770_parse_dt()
664 tas2770->sdz_gpio = NULL; in tas2770_parse_dt()
676 tas2770 = devm_kzalloc(&client->dev, sizeof(struct tas2770_priv), in tas2770_i2c_probe()
679 return -ENOMEM; in tas2770_i2c_probe()
681 tas2770->dev = &client->dev; in tas2770_i2c_probe()
683 dev_set_drvdata(&client->dev, tas2770); in tas2770_i2c_probe()
685 tas2770->regmap = devm_regmap_init_i2c(client, &tas2770_i2c_regmap); in tas2770_i2c_probe()
686 if (IS_ERR(tas2770->regmap)) { in tas2770_i2c_probe()
687 result = PTR_ERR(tas2770->regmap); in tas2770_i2c_probe()
688 dev_err(&client->dev, "Failed to allocate register map: %d\n", in tas2770_i2c_probe()
693 if (client->dev.of_node) { in tas2770_i2c_probe()
694 result = tas2770_parse_dt(&client->dev, tas2770); in tas2770_i2c_probe()
696 dev_err(tas2770->dev, "%s: Failed to parse devicetree\n", in tas2770_i2c_probe()
702 tas2770->reset_gpio = devm_gpiod_get_optional(tas2770->dev, "reset", in tas2770_i2c_probe()
704 if (IS_ERR(tas2770->reset_gpio)) { in tas2770_i2c_probe()
705 if (PTR_ERR(tas2770->reset_gpio) == -EPROBE_DEFER) { in tas2770_i2c_probe()
706 tas2770->reset_gpio = NULL; in tas2770_i2c_probe()
707 return -EPROBE_DEFER; in tas2770_i2c_probe()
713 dev_err(tas2770->dev, "Register codec failed.\n"); in tas2770_i2c_probe()