Lines Matching +full:imon +full:- +full:slot +full:- +full:no
1 // SPDX-License-Identifier: GPL-2.0
69 latched[i] = snd_soc_component_read(tas2764->component, in tas2764_irq()
74 dev_crit_ratelimited(tas2764->dev, "%s\n", in tas2764_irq()
81 dev_err_ratelimited(tas2764->dev, "other context to the fault: %02x,%02x,%02x,%02x,%02x", in tas2764_irq()
83 snd_soc_component_update_bits(tas2764->component, in tas2764_irq()
94 if (tas2764->reset_gpio) { in tas2764_reset()
95 gpiod_set_value_cansleep(tas2764->reset_gpio, 0); in tas2764_reset()
97 gpiod_set_value_cansleep(tas2764->reset_gpio, 1); in tas2764_reset()
101 snd_soc_component_write(tas2764->component, TAS2764_SW_RST, in tas2764_reset()
108 struct snd_soc_component *component = tas2764->component; in tas2764_update_pwr_ctrl()
112 if (tas2764->dac_powered) in tas2764_update_pwr_ctrl()
113 val = tas2764->unmuted ? in tas2764_update_pwr_ctrl()
139 if (tas2764->sdz_gpio) in tas2764_codec_suspend()
140 gpiod_set_value_cansleep(tas2764->sdz_gpio, 0); in tas2764_codec_suspend()
142 regcache_cache_only(tas2764->regmap, true); in tas2764_codec_suspend()
143 regcache_mark_dirty(tas2764->regmap); in tas2764_codec_suspend()
153 if (tas2764->sdz_gpio) { in tas2764_codec_resume()
154 gpiod_set_value_cansleep(tas2764->sdz_gpio, 1); in tas2764_codec_resume()
163 regcache_cache_only(tas2764->regmap, false); in tas2764_codec_resume()
165 return regcache_sync(tas2764->regmap); in tas2764_codec_resume()
186 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in tas2764_dac_event()
192 tas2764->dac_powered = true; in tas2764_dac_event()
196 tas2764->dac_powered = false; in tas2764_dac_event()
200 dev_err(tas2764->dev, "Unsupported event\n"); in tas2764_dac_event()
201 return -EINVAL; in tas2764_dac_event()
226 SND_SOC_DAPM_SIGGEN("IMON")
236 {"ISENSE", "Switch", "IMON"},
243 snd_soc_component_get_drvdata(dai->component); in tas2764_mute()
245 tas2764->unmuted = !mute; in tas2764_mute()
251 struct snd_soc_component *component = tas2764->component; in tas2764_set_bitwidth()
277 return -EINVAL; in tas2764_set_bitwidth()
283 val = snd_soc_component_read(tas2764->component, TAS2764_PWR_CTRL); in tas2764_set_bitwidth()
292 ret = snd_soc_component_update_bits(tas2764->component, TAS2764_TDM_CFG5, in tas2764_set_bitwidth()
303 ret = snd_soc_component_update_bits(tas2764->component, TAS2764_TDM_CFG6, in tas2764_set_bitwidth()
314 struct snd_soc_component *component = tas2764->component; in tas2764_set_samplerate()
336 return -EINVAL; in tas2764_set_samplerate()
353 struct snd_soc_component *component = dai->component; in tas2764_hw_params()
366 struct snd_soc_component *component = dai->component; in tas2764_set_fmt()
404 dev_err(tas2764->dev, in tas2764_set_fmt()
406 return -EINVAL; in tas2764_set_fmt()
429 struct snd_soc_component *component = dai->component; in tas2764_set_dai_tdm_slot()
437 return -EINVAL; in tas2764_set_dai_tdm_slot()
449 return -EINVAL; in tas2764_set_dai_tdm_slot()
468 return -EINVAL; in tas2764_set_dai_tdm_slot()
479 tas2764->v_sense_slot); in tas2764_set_dai_tdm_slot()
485 tas2764->i_sense_slot); in tas2764_set_dai_tdm_slot()
534 tas2764->component = component; in tas2764_codec_probe()
536 if (tas2764->sdz_gpio) { in tas2764_codec_probe()
537 gpiod_set_value_cansleep(tas2764->sdz_gpio, 1); in tas2764_codec_probe()
543 if (tas2764->irq) { in tas2764_codec_probe()
544 ret = snd_soc_component_write(tas2764->component, TAS2764_INT_MASK0, 0xff); in tas2764_codec_probe()
548 ret = snd_soc_component_write(tas2764->component, TAS2764_INT_MASK1, 0xff); in tas2764_codec_probe()
552 ret = snd_soc_component_write(tas2764->component, TAS2764_INT_MASK2, 0xff); in tas2764_codec_probe()
556 ret = snd_soc_component_write(tas2764->component, TAS2764_INT_MASK3, 0xff); in tas2764_codec_probe()
560 ret = snd_soc_component_write(tas2764->component, TAS2764_INT_MASK4, 0xff); in tas2764_codec_probe()
564 ret = devm_request_threaded_irq(tas2764->dev, tas2764->irq, NULL, tas2764_irq, in tas2764_codec_probe()
568 dev_warn(tas2764->dev, "failed to request IRQ: %d\n", ret); in tas2764_codec_probe()
571 ret = snd_soc_component_update_bits(tas2764->component, TAS2764_TDM_CFG5, in tas2764_codec_probe()
576 ret = snd_soc_component_update_bits(tas2764->component, TAS2764_TDM_CFG6, in tas2764_codec_probe()
585 static DECLARE_TLV_DB_SCALE(tas2764_playback_volume, -10050, 50, 1);
670 tas2764->reset_gpio = devm_gpiod_get_optional(tas2764->dev, "reset", in tas2764_parse_dt()
672 if (IS_ERR(tas2764->reset_gpio)) { in tas2764_parse_dt()
673 if (PTR_ERR(tas2764->reset_gpio) == -EPROBE_DEFER) { in tas2764_parse_dt()
674 tas2764->reset_gpio = NULL; in tas2764_parse_dt()
675 return -EPROBE_DEFER; in tas2764_parse_dt()
679 tas2764->sdz_gpio = devm_gpiod_get_optional(dev, "shutdown", GPIOD_OUT_HIGH); in tas2764_parse_dt()
680 if (IS_ERR(tas2764->sdz_gpio)) { in tas2764_parse_dt()
681 if (PTR_ERR(tas2764->sdz_gpio) == -EPROBE_DEFER) in tas2764_parse_dt()
682 return -EPROBE_DEFER; in tas2764_parse_dt()
684 tas2764->sdz_gpio = NULL; in tas2764_parse_dt()
687 ret = fwnode_property_read_u32(dev->fwnode, "ti,imon-slot-no", in tas2764_parse_dt()
688 &tas2764->i_sense_slot); in tas2764_parse_dt()
690 tas2764->i_sense_slot = 0; in tas2764_parse_dt()
692 ret = fwnode_property_read_u32(dev->fwnode, "ti,vmon-slot-no", in tas2764_parse_dt()
693 &tas2764->v_sense_slot); in tas2764_parse_dt()
695 tas2764->v_sense_slot = 2; in tas2764_parse_dt()
705 tas2764 = devm_kzalloc(&client->dev, sizeof(struct tas2764_priv), in tas2764_i2c_probe()
708 return -ENOMEM; in tas2764_i2c_probe()
710 tas2764->dev = &client->dev; in tas2764_i2c_probe()
711 tas2764->irq = client->irq; in tas2764_i2c_probe()
713 dev_set_drvdata(&client->dev, tas2764); in tas2764_i2c_probe()
715 tas2764->regmap = devm_regmap_init_i2c(client, &tas2764_i2c_regmap); in tas2764_i2c_probe()
716 if (IS_ERR(tas2764->regmap)) { in tas2764_i2c_probe()
717 result = PTR_ERR(tas2764->regmap); in tas2764_i2c_probe()
718 dev_err(&client->dev, "Failed to allocate register map: %d\n", in tas2764_i2c_probe()
723 if (client->dev.of_node) { in tas2764_i2c_probe()
724 result = tas2764_parse_dt(&client->dev, tas2764); in tas2764_i2c_probe()
726 dev_err(tas2764->dev, "%s: Failed to parse devicetree\n", in tas2764_i2c_probe()
732 return devm_snd_soc_register_component(tas2764->dev, in tas2764_i2c_probe()