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

1 // SPDX-License-Identifier: GPL-2.0
44 if (tas2764->reset_gpio) { in tas2764_reset()
45 gpiod_set_value_cansleep(tas2764->reset_gpio, 0); in tas2764_reset()
47 gpiod_set_value_cansleep(tas2764->reset_gpio, 1); in tas2764_reset()
51 snd_soc_component_write(tas2764->component, TAS2764_SW_RST, in tas2764_reset()
58 struct snd_soc_component *component = tas2764->component; in tas2764_update_pwr_ctrl()
62 if (tas2764->dac_powered) in tas2764_update_pwr_ctrl()
63 val = tas2764->unmuted ? in tas2764_update_pwr_ctrl()
89 if (tas2764->sdz_gpio) in tas2764_codec_suspend()
90 gpiod_set_value_cansleep(tas2764->sdz_gpio, 0); in tas2764_codec_suspend()
92 regcache_cache_only(tas2764->regmap, true); in tas2764_codec_suspend()
93 regcache_mark_dirty(tas2764->regmap); in tas2764_codec_suspend()
103 if (tas2764->sdz_gpio) { in tas2764_codec_resume()
104 gpiod_set_value_cansleep(tas2764->sdz_gpio, 1); in tas2764_codec_resume()
113 regcache_cache_only(tas2764->regmap, false); in tas2764_codec_resume()
115 return regcache_sync(tas2764->regmap); in tas2764_codec_resume()
136 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in tas2764_dac_event()
142 tas2764->dac_powered = true; in tas2764_dac_event()
146 tas2764->dac_powered = false; in tas2764_dac_event()
150 dev_err(tas2764->dev, "Unsupported event\n"); in tas2764_dac_event()
151 return -EINVAL; in tas2764_dac_event()
175 SND_SOC_DAPM_SIGGEN("VMON"),
187 {"VSENSE", "Switch", "VMON"},
193 snd_soc_component_get_drvdata(dai->component); in tas2764_mute()
195 tas2764->unmuted = !mute; in tas2764_mute()
201 struct snd_soc_component *component = tas2764->component; in tas2764_set_bitwidth()
227 return -EINVAL; in tas2764_set_bitwidth()
233 val = snd_soc_component_read(tas2764->component, TAS2764_PWR_CTRL); in tas2764_set_bitwidth()
242 ret = snd_soc_component_update_bits(tas2764->component, TAS2764_TDM_CFG5, in tas2764_set_bitwidth()
253 ret = snd_soc_component_update_bits(tas2764->component, TAS2764_TDM_CFG6, in tas2764_set_bitwidth()
264 struct snd_soc_component *component = tas2764->component; in tas2764_set_samplerate()
286 return -EINVAL; in tas2764_set_samplerate()
303 struct snd_soc_component *component = dai->component; in tas2764_hw_params()
316 struct snd_soc_component *component = dai->component; in tas2764_set_fmt()
354 dev_err(tas2764->dev, in tas2764_set_fmt()
356 return -EINVAL; in tas2764_set_fmt()
379 struct snd_soc_component *component = dai->component; in tas2764_set_dai_tdm_slot()
387 return -EINVAL; in tas2764_set_dai_tdm_slot()
399 return -EINVAL; in tas2764_set_dai_tdm_slot()
418 return -EINVAL; in tas2764_set_dai_tdm_slot()
429 tas2764->v_sense_slot); in tas2764_set_dai_tdm_slot()
435 tas2764->i_sense_slot); in tas2764_set_dai_tdm_slot()
484 tas2764->component = component; in tas2764_codec_probe()
486 if (tas2764->sdz_gpio) { in tas2764_codec_probe()
487 gpiod_set_value_cansleep(tas2764->sdz_gpio, 1); in tas2764_codec_probe()
493 ret = snd_soc_component_update_bits(tas2764->component, TAS2764_TDM_CFG5, in tas2764_codec_probe()
498 ret = snd_soc_component_update_bits(tas2764->component, TAS2764_TDM_CFG6, in tas2764_codec_probe()
507 static DECLARE_TLV_DB_SCALE(tas2764_playback_volume, -10050, 50, 1);
571 tas2764->reset_gpio = devm_gpiod_get_optional(tas2764->dev, "reset", in tas2764_parse_dt()
573 if (IS_ERR(tas2764->reset_gpio)) { in tas2764_parse_dt()
574 if (PTR_ERR(tas2764->reset_gpio) == -EPROBE_DEFER) { in tas2764_parse_dt()
575 tas2764->reset_gpio = NULL; in tas2764_parse_dt()
576 return -EPROBE_DEFER; in tas2764_parse_dt()
580 tas2764->sdz_gpio = devm_gpiod_get_optional(dev, "shutdown", GPIOD_OUT_HIGH); in tas2764_parse_dt()
581 if (IS_ERR(tas2764->sdz_gpio)) { in tas2764_parse_dt()
582 if (PTR_ERR(tas2764->sdz_gpio) == -EPROBE_DEFER) in tas2764_parse_dt()
583 return -EPROBE_DEFER; in tas2764_parse_dt()
585 tas2764->sdz_gpio = NULL; in tas2764_parse_dt()
588 ret = fwnode_property_read_u32(dev->fwnode, "ti,imon-slot-no", in tas2764_parse_dt()
589 &tas2764->i_sense_slot); in tas2764_parse_dt()
591 tas2764->i_sense_slot = 0; in tas2764_parse_dt()
593 ret = fwnode_property_read_u32(dev->fwnode, "ti,vmon-slot-no", in tas2764_parse_dt()
594 &tas2764->v_sense_slot); in tas2764_parse_dt()
596 tas2764->v_sense_slot = 2; in tas2764_parse_dt()
607 tas2764 = devm_kzalloc(&client->dev, sizeof(struct tas2764_priv), in tas2764_i2c_probe()
610 return -ENOMEM; in tas2764_i2c_probe()
612 tas2764->dev = &client->dev; in tas2764_i2c_probe()
614 dev_set_drvdata(&client->dev, tas2764); in tas2764_i2c_probe()
616 tas2764->regmap = devm_regmap_init_i2c(client, &tas2764_i2c_regmap); in tas2764_i2c_probe()
617 if (IS_ERR(tas2764->regmap)) { in tas2764_i2c_probe()
618 result = PTR_ERR(tas2764->regmap); in tas2764_i2c_probe()
619 dev_err(&client->dev, "Failed to allocate register map: %d\n", in tas2764_i2c_probe()
624 if (client->dev.of_node) { in tas2764_i2c_probe()
625 result = tas2764_parse_dt(&client->dev, tas2764); in tas2764_i2c_probe()
627 dev_err(tas2764->dev, "%s: Failed to parse devicetree\n", in tas2764_i2c_probe()
633 return devm_snd_soc_register_component(tas2764->dev, in tas2764_i2c_probe()