Lines Matching +full:current +full:- +full:limiter

1 // SPDX-License-Identifier: GPL-2.0
49 #include "tas2764-quirks.h"
53 "fault: over current",
55 "limiter active",
56 "fault: PVDD below limiter inflection point",
57 "fault: limiter max attenuation",
79 latched[i] = snd_soc_component_read(tas2764->component, in tas2764_irq()
84 dev_crit_ratelimited(tas2764->dev, "%s\n", in tas2764_irq()
91 dev_err_ratelimited(tas2764->dev, "other context to the fault: %02x,%02x,%02x,%02x,%02x", in tas2764_irq()
93 snd_soc_component_update_bits(tas2764->component, in tas2764_irq()
104 if (tas2764->reset_gpio) { in tas2764_reset()
105 gpiod_set_value_cansleep(tas2764->reset_gpio, 0); in tas2764_reset()
107 gpiod_set_value_cansleep(tas2764->reset_gpio, 1); in tas2764_reset()
111 snd_soc_component_write(tas2764->component, TAS2764_SW_RST, in tas2764_reset()
118 struct snd_soc_component *component = tas2764->component; in tas2764_update_pwr_ctrl()
122 if (tas2764->dac_powered) in tas2764_update_pwr_ctrl()
123 val = tas2764->unmuted ? in tas2764_update_pwr_ctrl()
152 if (tas2764->sdz_gpio) in tas2764_codec_suspend()
153 gpiod_set_value_cansleep(tas2764->sdz_gpio, 0); in tas2764_codec_suspend()
155 regcache_cache_only(tas2764->regmap, true); in tas2764_codec_suspend()
156 regcache_mark_dirty(tas2764->regmap); in tas2764_codec_suspend()
168 if (tas2764->sdz_gpio) { in tas2764_codec_resume()
169 gpiod_set_value_cansleep(tas2764->sdz_gpio, 1); in tas2764_codec_resume()
178 regcache_cache_only(tas2764->regmap, false); in tas2764_codec_resume()
180 return regcache_sync(tas2764->regmap); in tas2764_codec_resume()
230 snd_soc_component_get_drvdata(dai->component); in tas2764_mute()
234 tas2764->dac_powered = true; in tas2764_mute()
240 tas2764->unmuted = !mute; in tas2764_mute()
246 /* Wait for ramp-down */ in tas2764_mute()
249 tas2764->dac_powered = false; in tas2764_mute()
263 struct snd_soc_component *component = tas2764->component; in tas2764_set_bitwidth()
289 return -EINVAL; in tas2764_set_bitwidth()
295 val = snd_soc_component_read(tas2764->component, TAS2764_PWR_CTRL); in tas2764_set_bitwidth()
304 ret = snd_soc_component_update_bits(tas2764->component, TAS2764_TDM_CFG5, in tas2764_set_bitwidth()
315 ret = snd_soc_component_update_bits(tas2764->component, TAS2764_TDM_CFG6, in tas2764_set_bitwidth()
326 struct snd_soc_component *component = tas2764->component; in tas2764_set_samplerate()
348 return -EINVAL; in tas2764_set_samplerate()
365 struct snd_soc_component *component = dai->component; in tas2764_hw_params()
378 struct snd_soc_component *component = dai->component; in tas2764_set_fmt()
424 dev_err(tas2764->dev, in tas2764_set_fmt()
426 return -EINVAL; in tas2764_set_fmt()
449 struct snd_soc_component *component = dai->component; in tas2764_set_dai_tdm_slot()
457 return -EINVAL; in tas2764_set_dai_tdm_slot()
469 return -EINVAL; in tas2764_set_dai_tdm_slot()
488 return -EINVAL; in tas2764_set_dai_tdm_slot()
499 tas2764->v_sense_slot); in tas2764_set_dai_tdm_slot()
505 tas2764->i_sense_slot); in tas2764_set_dai_tdm_slot()
565 if (!init_seq->seq) in tas2764_apply_init_quirks()
571 ret = regmap_multi_reg_write(tas2764->regmap, init_seq->seq, in tas2764_apply_init_quirks()
572 init_seq->len); in tas2764_apply_init_quirks()
585 ret = regmap_read(tas2764->regmap, TAS2764_TEMP, &reg); in tas2764_read_die_temp()
600 *result = (reg - 93) * 1000; in tas2764_read_die_temp()
633 ret = -EOPNOTSUPP; in tas2764_hwmon_read()
660 tas2764->component = component; in tas2764_codec_probe()
662 if (tas2764->sdz_gpio) { in tas2764_codec_probe()
663 gpiod_set_value_cansleep(tas2764->sdz_gpio, 1); in tas2764_codec_probe()
668 regmap_reinit_cache(tas2764->regmap, &tas2764_i2c_regmap); in tas2764_codec_probe()
670 if (tas2764->irq) { in tas2764_codec_probe()
671 ret = snd_soc_component_write(tas2764->component, TAS2764_INT_MASK0, 0x00); in tas2764_codec_probe()
675 ret = snd_soc_component_write(tas2764->component, TAS2764_INT_MASK1, 0xff); in tas2764_codec_probe()
679 ret = snd_soc_component_write(tas2764->component, TAS2764_INT_MASK2, 0xff); in tas2764_codec_probe()
683 ret = snd_soc_component_write(tas2764->component, TAS2764_INT_MASK3, 0xff); in tas2764_codec_probe()
687 ret = snd_soc_component_write(tas2764->component, TAS2764_INT_MASK4, 0xff); in tas2764_codec_probe()
691 ret = devm_request_threaded_irq(tas2764->dev, tas2764->irq, NULL, tas2764_irq, in tas2764_codec_probe()
695 dev_warn(tas2764->dev, "failed to request IRQ: %d\n", ret); in tas2764_codec_probe()
698 ret = snd_soc_component_update_bits(tas2764->component, TAS2764_TDM_CFG5, in tas2764_codec_probe()
703 ret = snd_soc_component_update_bits(tas2764->component, TAS2764_TDM_CFG6, in tas2764_codec_probe()
708 switch (tas2764->devid) { in tas2764_codec_probe()
740 static DECLARE_TLV_DB_SCALE(tas2764_playback_volume, -10050, 50, 1);
839 tas2764->reset_gpio = devm_gpiod_get_optional(tas2764->dev, "reset", in tas2764_parse_dt()
841 if (IS_ERR(tas2764->reset_gpio)) { in tas2764_parse_dt()
842 if (PTR_ERR(tas2764->reset_gpio) == -EPROBE_DEFER) { in tas2764_parse_dt()
843 tas2764->reset_gpio = NULL; in tas2764_parse_dt()
844 return -EPROBE_DEFER; in tas2764_parse_dt()
848 tas2764->sdz_gpio = devm_gpiod_get_optional(dev, "shutdown", GPIOD_OUT_HIGH); in tas2764_parse_dt()
849 if (IS_ERR(tas2764->sdz_gpio)) { in tas2764_parse_dt()
850 if (PTR_ERR(tas2764->sdz_gpio) == -EPROBE_DEFER) in tas2764_parse_dt()
851 return -EPROBE_DEFER; in tas2764_parse_dt()
853 tas2764->sdz_gpio = NULL; in tas2764_parse_dt()
856 ret = fwnode_property_read_u32(dev->fwnode, "ti,imon-slot-no", in tas2764_parse_dt()
857 &tas2764->i_sense_slot); in tas2764_parse_dt()
859 tas2764->i_sense_slot = 0; in tas2764_parse_dt()
861 ret = fwnode_property_read_u32(dev->fwnode, "ti,vmon-slot-no", in tas2764_parse_dt()
862 &tas2764->v_sense_slot); in tas2764_parse_dt()
864 tas2764->v_sense_slot = 2; in tas2764_parse_dt()
874 tas2764 = devm_kzalloc(&client->dev, sizeof(struct tas2764_priv), in tas2764_i2c_probe()
877 return -ENOMEM; in tas2764_i2c_probe()
879 tas2764->devid = (kernel_ulong_t)of_device_get_match_data(&client->dev); in tas2764_i2c_probe()
881 tas2764->dev = &client->dev; in tas2764_i2c_probe()
882 tas2764->irq = client->irq; in tas2764_i2c_probe()
884 dev_set_drvdata(&client->dev, tas2764); in tas2764_i2c_probe()
886 tas2764->regmap = devm_regmap_init_i2c(client, &tas2764_i2c_regmap); in tas2764_i2c_probe()
887 if (IS_ERR(tas2764->regmap)) { in tas2764_i2c_probe()
888 result = PTR_ERR(tas2764->regmap); in tas2764_i2c_probe()
889 dev_err(&client->dev, "Failed to allocate register map: %d\n", in tas2764_i2c_probe()
894 if (client->dev.of_node) { in tas2764_i2c_probe()
895 result = tas2764_parse_dt(&client->dev, tas2764); in tas2764_i2c_probe()
897 dev_err(tas2764->dev, "%s: Failed to parse devicetree\n", in tas2764_i2c_probe()
906 hwmon = devm_hwmon_device_register_with_info(&client->dev, "tas2764", in tas2764_i2c_probe()
911 return dev_err_probe(&client->dev, PTR_ERR(hwmon), in tas2764_i2c_probe()
917 return devm_snd_soc_register_component(tas2764->dev, in tas2764_i2c_probe()