Lines Matching refs:tas2780
31 static void tas2780_reset(struct tas2780_priv *tas2780) in tas2780_reset() argument
35 if (tas2780->reset_gpio) { in tas2780_reset()
36 gpiod_set_value_cansleep(tas2780->reset_gpio, 0); in tas2780_reset()
38 gpiod_set_value_cansleep(tas2780->reset_gpio, 1); in tas2780_reset()
42 ret = snd_soc_component_write(tas2780->component, TAS2780_SW_RST, in tas2780_reset()
45 dev_err(tas2780->dev, "%s:errCode:0x%x Reset error!\n", in tas2780_reset()
52 struct tas2780_priv *tas2780 = in tas2780_codec_suspend() local
59 dev_err(tas2780->dev, "%s:errCode:0x%0x:power down error\n", in tas2780_codec_suspend()
64 regcache_cache_only(tas2780->regmap, true); in tas2780_codec_suspend()
65 regcache_mark_dirty(tas2780->regmap); in tas2780_codec_suspend()
72 struct tas2780_priv *tas2780 = in tas2780_codec_resume() local
80 dev_err(tas2780->dev, "%s:errCode:0x%0x:power down error\n", in tas2780_codec_resume()
85 regcache_cache_only(tas2780->regmap, false); in tas2780_codec_resume()
86 ret = regcache_sync(tas2780->regmap); in tas2780_codec_resume()
134 struct tas2780_priv *tas2780 = in tas2780_mute() local
142 dev_err(tas2780->dev, "%s: Failed to set powercontrol\n", in tas2780_mute()
151 static int tas2780_set_bitwidth(struct tas2780_priv *tas2780, int bitwidth) in tas2780_set_bitwidth() argument
153 struct snd_soc_component *component = tas2780->component; in tas2780_set_bitwidth()
187 dev_err(tas2780->dev, "%s:errCode:0x%x set bitwidth error\n", in tas2780_set_bitwidth()
195 dev_err(tas2780->dev, in tas2780_set_bitwidth()
201 val = snd_soc_component_read(tas2780->component, TAS2780_PWR_CTRL); in tas2780_set_bitwidth()
203 dev_err(tas2780->dev, "%s:errCode:0x%x read PWR_CTRL error\n", in tas2780_set_bitwidth()
214 ret = snd_soc_component_update_bits(tas2780->component, in tas2780_set_bitwidth()
217 dev_err(tas2780->dev, "%s:errCode:0x%x enable vSNS error\n", in tas2780_set_bitwidth()
227 ret = snd_soc_component_update_bits(tas2780->component, in tas2780_set_bitwidth()
230 dev_err(tas2780->dev, "%s:errCode:0x%x enable iSNS error\n", in tas2780_set_bitwidth()
240 struct tas2780_priv *tas2780, int samplerate) in tas2780_set_samplerate() argument
242 struct snd_soc_component *component = tas2780->component; in tas2780_set_samplerate()
270 dev_err(tas2780->dev, in tas2780_set_samplerate()
284 struct tas2780_priv *tas2780 = in tas2780_hw_params() local
288 ret = tas2780_set_bitwidth(tas2780, params_format(params)); in tas2780_hw_params()
292 return tas2780_set_samplerate(tas2780, params_rate(params)); in tas2780_hw_params()
298 struct tas2780_priv *tas2780 = in tas2780_set_fmt() local
312 dev_err(tas2780->dev, "ASI format Inverse is not found\n"); in tas2780_set_fmt()
319 dev_err(tas2780->dev, in tas2780_set_fmt()
338 dev_err(tas2780->dev, in tas2780_set_fmt()
349 dev_err(tas2780->dev, in tas2780_set_fmt()
358 dev_err(tas2780->dev, "%s:errCode:0x%x Failed to set iface\n", in tas2780_set_fmt()
373 struct tas2780_priv *tas2780 = in tas2780_set_dai_tdm_slot() local
398 dev_err(tas2780->dev, in tas2780_set_dai_tdm_slot()
422 dev_err(tas2780->dev, in tas2780_set_dai_tdm_slot()
429 TAS2780_TDM_CFG5_50_MASK, tas2780->v_sense_slot); in tas2780_set_dai_tdm_slot()
431 dev_err(tas2780->dev, in tas2780_set_dai_tdm_slot()
438 TAS2780_TDM_CFG6_50_MASK, tas2780->i_sense_slot); in tas2780_set_dai_tdm_slot()
440 dev_err(tas2780->dev, in tas2780_set_dai_tdm_slot()
489 struct tas2780_priv *tas2780 = in tas2780_codec_probe() local
493 tas2780->component = component; in tas2780_codec_probe()
495 tas2780_reset(tas2780); in tas2780_codec_probe()
500 dev_err(tas2780->dev, "%s:errCode:0x%0x\n", in tas2780_codec_probe()
568 static int tas2780_parse_dt(struct device *dev, struct tas2780_priv *tas2780) in tas2780_parse_dt() argument
572 tas2780->reset_gpio = devm_gpiod_get_optional(tas2780->dev, "reset", in tas2780_parse_dt()
574 if (IS_ERR(tas2780->reset_gpio)) { in tas2780_parse_dt()
575 if (PTR_ERR(tas2780->reset_gpio) == -EPROBE_DEFER) { in tas2780_parse_dt()
576 tas2780->reset_gpio = NULL; in tas2780_parse_dt()
582 &tas2780->i_sense_slot); in tas2780_parse_dt()
584 tas2780->i_sense_slot = 0; in tas2780_parse_dt()
587 &tas2780->v_sense_slot); in tas2780_parse_dt()
589 tas2780->v_sense_slot = 2; in tas2780_parse_dt()
596 struct tas2780_priv *tas2780; in tas2780_i2c_probe() local
599 tas2780 = devm_kzalloc(&client->dev, sizeof(struct tas2780_priv), in tas2780_i2c_probe()
601 if (!tas2780) in tas2780_i2c_probe()
603 tas2780->dev = &client->dev; in tas2780_i2c_probe()
604 i2c_set_clientdata(client, tas2780); in tas2780_i2c_probe()
605 dev_set_drvdata(&client->dev, tas2780); in tas2780_i2c_probe()
607 tas2780->regmap = devm_regmap_init_i2c(client, &tas2780_i2c_regmap); in tas2780_i2c_probe()
608 if (IS_ERR(tas2780->regmap)) { in tas2780_i2c_probe()
609 result = PTR_ERR(tas2780->regmap); in tas2780_i2c_probe()
616 result = tas2780_parse_dt(&client->dev, tas2780); in tas2780_i2c_probe()
618 dev_err(tas2780->dev, in tas2780_i2c_probe()
624 return devm_snd_soc_register_component(tas2780->dev, in tas2780_i2c_probe()