Lines Matching +full:asi +full:- +full:format
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) {
38 gpiod_set_value_cansleep(tas2770->reset_gpio, 0);
40 gpiod_set_value_cansleep(tas2770->reset_gpio, 1);
44 snd_soc_component_write(tas2770->component, TAS2770_SW_RST,
51 struct snd_soc_component *component = tas2770->component;
55 if (tas2770->dac_powered)
56 val = tas2770->unmuted ?
75 regcache_cache_only(tas2770->regmap, true);
76 regcache_mark_dirty(tas2770->regmap);
78 if (tas2770->sdz_gpio) {
79 gpiod_set_value_cansleep(tas2770->sdz_gpio, 0);
85 regcache_cache_only(tas2770->regmap, false);
86 regcache_sync(tas2770->regmap);
101 if (tas2770->sdz_gpio) {
102 gpiod_set_value_cansleep(tas2770->sdz_gpio, 1);
110 regcache_cache_only(tas2770->regmap, false);
112 return regcache_sync(tas2770->regmap);
134 snd_soc_dapm_to_component(w->dapm);
141 tas2770->dac_powered = 1;
145 tas2770->dac_powered = 0;
149 dev_err(tas2770->dev, "Not supported evevt\n");
150 return -EINVAL;
186 struct snd_soc_component *component = dai->component;
190 tas2770->unmuted = !mute;
197 struct snd_soc_component *component = tas2770->component;
204 tas2770->v_sense_slot = tas2770->i_sense_slot + 2;
210 tas2770->v_sense_slot = tas2770->i_sense_slot + 4;
216 tas2770->v_sense_slot = tas2770->i_sense_slot + 4;
220 return -EINVAL;
230 tas2770->v_sense_slot);
238 tas2770->i_sense_slot);
247 struct snd_soc_component *component = tas2770->component;
277 return -EINVAL;
294 struct snd_soc_component *component = dai->component;
308 struct snd_soc_component *component = dai->component;
318 dev_err(tas2770->dev, "ASI invalid DAI clocking\n");
319 return -EINVAL;
336 dev_err(tas2770->dev, "ASI format Inverse is not found\n");
337 return -EINVAL;
364 dev_err(tas2770->dev,
365 "DAI Format is not found, fmt=0x%x\n", fmt);
366 return -EINVAL;
391 struct snd_soc_component *component = dai->component;
396 return -EINVAL;
408 return -EINVAL;
442 ret = -EINVAL;
497 tas2770->component = component;
499 if (tas2770->sdz_gpio) {
500 gpiod_set_value_cansleep(tas2770->sdz_gpio, 1);
505 regmap_reinit_cache(tas2770->regmap, &tas2770_i2c_regmap);
511 static DECLARE_TLV_DB_SCALE(tas2770_playback_volume, -10050, 50, 0);
536 return devm_snd_soc_register_component(tas2770->dev,
628 rc = fwnode_property_read_u32(dev->fwnode, "ti,imon-slot-no",
629 &tas2770->i_sense_slot);
631 dev_info(tas2770->dev, "Property %s is missing setting default slot\n",
632 "ti,imon-slot-no");
634 tas2770->i_sense_slot = 0;
637 rc = fwnode_property_read_u32(dev->fwnode, "ti,vmon-slot-no",
638 &tas2770->v_sense_slot);
640 dev_info(tas2770->dev, "Property %s is missing setting default slot\n",
641 "ti,vmon-slot-no");
643 tas2770->v_sense_slot = 2;
646 tas2770->sdz_gpio = devm_gpiod_get_optional(dev, "shutdown", GPIOD_OUT_HIGH);
647 if (IS_ERR(tas2770->sdz_gpio)) {
648 if (PTR_ERR(tas2770->sdz_gpio) == -EPROBE_DEFER)
649 return -EPROBE_DEFER;
651 tas2770->sdz_gpio = NULL;
662 tas2770 = devm_kzalloc(&client->dev, sizeof(struct tas2770_priv),
665 return -ENOMEM;
667 tas2770->dev = &client->dev;
669 dev_set_drvdata(&client->dev, tas2770);
671 tas2770->regmap = devm_regmap_init_i2c(client, &tas2770_i2c_regmap);
672 if (IS_ERR(tas2770->regmap)) {
673 result = PTR_ERR(tas2770->regmap);
674 dev_err(&client->dev, "Failed to allocate register map: %d\n",
679 if (client->dev.of_node) {
680 result = tas2770_parse_dt(&client->dev, tas2770);
682 dev_err(tas2770->dev, "%s: Failed to parse devicetree\n",
688 tas2770->reset_gpio = devm_gpiod_get_optional(tas2770->dev, "reset",
690 if (IS_ERR(tas2770->reset_gpio)) {
691 if (PTR_ERR(tas2770->reset_gpio) == -EPROBE_DEFER) {
692 tas2770->reset_gpio = NULL;
693 return -EPROBE_DEFER;
699 dev_err(tas2770->dev, "Register codec failed.\n");