Lines Matching +full:e +full:- +full:book
1 // SPDX-License-Identifier: GPL-2.0
30 #include <sound/tas2781-dsp.h>
32 #include <sound/tas2781-tlv.h>
34 #include "tas2781-spi.h"
107 struct regmap *map = tas_priv->regmap; in tasdevice_spi_switch_book()
109 if (tas_priv->cur_book != TASDEVICE_BOOK_ID(reg)) { in tasdevice_spi_switch_book()
113 dev_err(tas_priv->dev, "Switch Book E=%d\n", ret); in tasdevice_spi_switch_book()
116 tas_priv->cur_book = TASDEVICE_BOOK_ID(reg); in tasdevice_spi_switch_book()
125 struct regmap *map = tas_priv->regmap; in tasdevice_spi_dev_read()
133 * In our TAS2781 SPI mode, if read from other book (not book 0), in tasdevice_spi_dev_read()
134 * or read from page number larger than 1 in book 0, one more byte in tasdevice_spi_dev_read()
147 dev_err(tas_priv->dev, "%s, E=%d\n", __func__, ret); in tasdevice_spi_dev_read()
156 struct regmap *map = tas_priv->regmap; in tasdevice_spi_dev_write()
165 dev_err(tas_priv->dev, "%s, E=%d\n", __func__, ret); in tasdevice_spi_dev_write()
175 struct regmap *map = tas_priv->regmap; in tasdevice_spi_dev_bulk_write()
184 dev_err(tas_priv->dev, "%s, E=%d\n", __func__, ret); in tasdevice_spi_dev_bulk_write()
194 struct regmap *map = tas_priv->regmap; in tasdevice_spi_dev_bulk_read()
204 * In our TAS2781 SPI mode, if read from other book (not book 0), in tasdevice_spi_dev_bulk_read()
205 * or read from page number larger than 1 in book 0, one more byte in tasdevice_spi_dev_bulk_read()
219 dev_err(tas_priv->dev, "%s, E=%d\n", __func__, ret); in tasdevice_spi_dev_bulk_read()
229 struct regmap *map = tas_priv->regmap; in tasdevice_spi_dev_update_bits()
238 dev_err(tas_priv->dev, "%s, E=%d\n", __func__, ret); in tasdevice_spi_dev_update_bits()
244 dev_err(tas_priv->dev, "%s, E=%d\n", __func__, ret); in tasdevice_spi_dev_update_bits()
253 if (tas_dev->reset) { in tas2781_spi_reset()
254 gpiod_set_value_cansleep(tas_dev->reset, 0); in tas2781_spi_reset()
256 gpiod_set_value_cansleep(tas_dev->reset, 1); in tas2781_spi_reset()
261 dev_err(tas_dev->dev, "dev sw-reset fail, %d\n", ret); in tas2781_spi_reset()
275 guard(mutex)(&tas_priv->codec_lock); in tascodec_spi_init()
277 scnprintf(tas_priv->rca_binaryname, in tascodec_spi_init()
278 sizeof(tas_priv->rca_binaryname), "%sRCA%d.bin", in tascodec_spi_init()
279 tas_priv->dev_name, tas_priv->index); in tascodec_spi_init()
280 crc8_populate_msb(tas_priv->crc8_lkp_tbl, TASDEVICE_CRC8_POLYNOMIAL); in tascodec_spi_init()
281 tas_priv->codec = codec; in tascodec_spi_init()
283 tas_priv->rca_binaryname, tas_priv->dev, GFP_KERNEL, tas_priv, in tascodec_spi_init()
286 dev_err(tas_priv->dev, "request_firmware_nowait err:0x%08x\n", in tascodec_spi_init()
294 tas_priv->cur_prog = -1; in tasdevice_spi_init()
295 tas_priv->cur_conf = -1; in tasdevice_spi_init()
297 tas_priv->cur_book = -1; in tasdevice_spi_init()
298 tas_priv->cur_prog = -1; in tasdevice_spi_init()
299 tas_priv->cur_conf = -1; in tasdevice_spi_init()
302 tas_priv->cali_reg_array[0] = TASDEVICE_REG(0, 0x17, 0x74); in tasdevice_spi_init()
303 tas_priv->cali_reg_array[1] = TASDEVICE_REG(0, 0x18, 0x0c); in tasdevice_spi_init()
304 tas_priv->cali_reg_array[2] = TASDEVICE_REG(0, 0x18, 0x14); in tasdevice_spi_init()
305 tas_priv->cali_reg_array[3] = TASDEVICE_REG(0, 0x13, 0x70); in tasdevice_spi_init()
306 tas_priv->cali_reg_array[4] = TASDEVICE_REG(0, 0x18, 0x7c); in tasdevice_spi_init()
308 mutex_init(&tas_priv->codec_lock); in tasdevice_spi_init()
315 unsigned int invert = mc->invert; in tasdevice_spi_amp_putvol()
317 int max = mc->max; in tasdevice_spi_amp_putvol()
321 mask <<= mc->shift; in tasdevice_spi_amp_putvol()
322 val = clamp(invert ? max - ucontrol->value.integer.value[0] : in tasdevice_spi_amp_putvol()
323 ucontrol->value.integer.value[0], 0, max); in tasdevice_spi_amp_putvol()
325 mc->reg, mask, (unsigned int)(val << mc->shift)); in tasdevice_spi_amp_putvol()
327 dev_err(tas_priv->dev, "set AMP vol error in dev %d\n", in tasdevice_spi_amp_putvol()
328 tas_priv->index); in tasdevice_spi_amp_putvol()
337 unsigned int invert = mc->invert; in tasdevice_spi_amp_getvol()
339 int max = mc->max; in tasdevice_spi_amp_getvol()
343 ret = tasdevice_spi_dev_read(tas_priv, mc->reg, &val); in tasdevice_spi_amp_getvol()
345 dev_err(tas_priv->dev, "%s, get AMP vol error\n", __func__); in tasdevice_spi_amp_getvol()
350 mask <<= mc->shift; in tasdevice_spi_amp_getvol()
351 val = (val & mask) >> mc->shift; in tasdevice_spi_amp_getvol()
352 val = clamp(invert ? max - val : val, 0, max); in tasdevice_spi_amp_getvol()
353 ucontrol->value.integer.value[0] = val; in tasdevice_spi_amp_getvol()
362 unsigned int invert = mc->invert; in tasdevice_spi_digital_putvol()
363 int max = mc->max; in tasdevice_spi_digital_putvol()
366 val = clamp(invert ? max - ucontrol->value.integer.value[0] : in tasdevice_spi_digital_putvol()
367 ucontrol->value.integer.value[0], 0, max); in tasdevice_spi_digital_putvol()
368 ret = tasdevice_spi_dev_write(tas_priv, mc->reg, (unsigned int)val); in tasdevice_spi_digital_putvol()
370 dev_err(tas_priv->dev, "set digital vol err in dev %d\n", in tasdevice_spi_digital_putvol()
371 tas_priv->index); in tasdevice_spi_digital_putvol()
380 unsigned int invert = mc->invert; in tasdevice_spi_digital_getvol()
381 int max = mc->max; in tasdevice_spi_digital_getvol()
385 ret = tasdevice_spi_dev_read(tas_priv, mc->reg, &val); in tasdevice_spi_digital_getvol()
387 dev_err(tas_priv->dev, "%s, get digital vol err\n", __func__); in tasdevice_spi_digital_getvol()
391 val = clamp(invert ? max - val : val, 0, max); in tasdevice_spi_digital_getvol()
392 ucontrol->value.integer.value[0] = val; in tasdevice_spi_digital_getvol()
401 struct tasdevice_priv *p = tas_hda->priv; in tas2781_read_acpi()
409 adev = acpi_dev_get_first_match_dev(hid, NULL, -1); in tas2781_read_acpi()
411 dev_err(p->dev, "Failed to find ACPI device: %s\n", hid); in tas2781_read_acpi()
412 return -ENODEV; in tas2781_read_acpi()
415 strscpy(p->dev_name, hid, sizeof(p->dev_name)); in tas2781_read_acpi()
416 tas_hda->dacpi = adev; in tas2781_read_acpi()
420 property = "ti,dev-index"; in tas2781_read_acpi()
423 ret = -EINVAL; in tas2781_read_acpi()
432 p->index = U8_MAX; in tas2781_read_acpi()
435 p->index = i; in tas2781_read_acpi()
439 if (p->index == U8_MAX) { in tas2781_read_acpi()
440 dev_dbg(p->dev, "No index found in %s\n", property); in tas2781_read_acpi()
441 ret = -ENODEV; in tas2781_read_acpi()
445 if (p->index == 0) { in tas2781_read_acpi()
447 p->reset = devm_gpiod_get_index_optional(physdev, "reset", in tas2781_read_acpi()
448 p->index, GPIOD_OUT_LOW); in tas2781_read_acpi()
449 if (IS_ERR(p->reset)) { in tas2781_read_acpi()
450 ret = PTR_ERR(p->reset); in tas2781_read_acpi()
451 dev_err_probe(p->dev, ret, "Failed on reset GPIO\n"); in tas2781_read_acpi()
459 dev_err(p->dev, "read acpi error, ret: %d\n", ret); in tas2781_read_acpi()
472 guard(mutex)(&tas_hda->priv->codec_lock); in tas2781_hda_playback_hook()
473 tasdevice_spi_tuning_switch(tas_hda->priv, 0); in tas2781_hda_playback_hook()
475 guard(mutex)(&tas_hda->priv->codec_lock); in tas2781_hda_playback_hook()
476 tasdevice_spi_tuning_switch(tas_hda->priv, 1); in tas2781_hda_playback_hook()
487 uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER; in tasdevice_info_profile()
488 uinfo->count = 1; in tasdevice_info_profile()
489 uinfo->value.integer.min = 0; in tasdevice_info_profile()
490 uinfo->value.integer.max = tas_priv->rcabin.ncfgs - 1; in tasdevice_info_profile()
500 ucontrol->value.integer.value[0] = tas_priv->rcabin.profile_cfg_id; in tasdevice_get_profile_id()
509 int max = tas_priv->rcabin.ncfgs - 1; in tasdevice_set_profile_id()
512 val = clamp(ucontrol->value.integer.value[0], 0, max); in tasdevice_set_profile_id()
513 if (tas_priv->rcabin.profile_cfg_id != val) { in tasdevice_set_profile_id()
514 tas_priv->rcabin.profile_cfg_id = val; in tasdevice_set_profile_id()
526 uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER; in tasdevice_info_programs()
527 uinfo->count = 1; in tasdevice_info_programs()
528 uinfo->value.integer.min = 0; in tasdevice_info_programs()
529 uinfo->value.integer.max = tas_priv->fmw->nr_programs - 1; in tasdevice_info_programs()
539 uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER; in tasdevice_info_config()
540 uinfo->count = 1; in tasdevice_info_config()
541 uinfo->value.integer.min = 0; in tasdevice_info_config()
542 uinfo->value.integer.max = tas_priv->fmw->nr_configurations - 1; in tasdevice_info_config()
552 ucontrol->value.integer.value[0] = tas_priv->cur_prog; in tasdevice_program_get()
561 int nr_program = ucontrol->value.integer.value[0]; in tasdevice_program_put()
562 int max = tas_priv->fmw->nr_programs - 1; in tasdevice_program_put()
567 if (tas_priv->cur_prog != val) { in tasdevice_program_put()
568 tas_priv->cur_prog = val; in tasdevice_program_put()
580 ucontrol->value.integer.value[0] = tas_priv->cur_conf; in tasdevice_config_get()
589 int max = tas_priv->fmw->nr_configurations - 1; in tasdevice_config_put()
592 val = clamp(ucontrol->value.integer.value[0], 0, max); in tasdevice_config_put()
594 if (tas_priv->cur_conf != val) { in tasdevice_config_put()
595 tas_priv->cur_conf = val; in tasdevice_config_put()
603 * tas2781_digital_getvol - get the volum control
609 * tas2781 contains book and page two-level register map, especially
610 * book switching will set the register BXXP00R7F, after switching to the
611 * correct book, then leverage the mechanism for paging to access the
621 (struct soc_mixer_control *)kcontrol->private_value; in tas2781_digital_getvol()
631 (struct soc_mixer_control *)kcontrol->private_value; in tas2781_amp_getvol()
641 (struct soc_mixer_control *)kcontrol->private_value; in tas2781_digital_putvol()
652 (struct soc_mixer_control *)kcontrol->private_value; in tas2781_amp_putvol()
663 ucontrol->value.integer.value[0] = (int)tas_priv->force_fwload_status; in tas2781_force_fwload_get()
664 dev_dbg(tas_priv->dev, "%s : Force FWload %s\n", __func__, in tas2781_force_fwload_get()
665 str_on_off(tas_priv->force_fwload_status)); in tas2781_force_fwload_get()
674 bool change, val = (bool)ucontrol->value.integer.value[0]; in tas2781_force_fwload_put()
676 if (tas_priv->force_fwload_status == val) { in tas2781_force_fwload_put()
680 tas_priv->force_fwload_status = val; in tas2781_force_fwload_put()
682 dev_dbg(tas_priv->dev, "%s : Force FWload %s\n", __func__, in tas2781_force_fwload_put()
683 str_on_off(tas_priv->force_fwload_status)); in tas2781_force_fwload_put()
709 .name = "Speaker Profile Id - 0",
716 .name = "Speaker Profile Id - 1",
766 if (tas_priv->cali_data[0] == 0) in tas2781_apply_calib()
772 * book 0, and page number in page_array[], offset was saved in in tas2781_apply_calib()
777 tas_priv->cali_reg_array[i], in tas2781_apply_calib()
778 (unsigned char *)&tas_priv->cali_data[i], 4); in tas2781_apply_calib()
780 dev_err(tas_priv->dev, in tas2781_apply_calib()
782 tas_priv->index, i, rc); in tas2781_apply_calib()
797 * manufactory, like HP: "{02f9af02-7734-4233-b43d-93fe5aa35db3}" in tas2781_save_calibration()
805 struct tm *tm = &tas_priv->tm; in tas2781_save_calibration()
809 tas_priv->cali_data[0] = 0; in tas2781_save_calibration()
813 return -ENOMEM; in tas2781_save_calibration()
829 * uniqie_id for multi-link solutions in tas2781_save_calibration()
834 * Device-Sum (4 bytes) in tas2781_save_calibration()
836 * for (i = 0; i < Device-Sum; i++) { in tas2781_save_calibration()
855 if (tmp_val[offset] == tas_priv->index) { in tas2781_save_calibration()
857 tas_priv->cali_data[i] = in tas2781_save_calibration()
863 tas_priv->cali_reg_array[i] = in tas2781_save_calibration()
868 tas_priv->apply_calibration(tas_priv); in tas2781_save_calibration()
887 tas_priv->cali_data[i] = in tas2781_save_calibration()
888 tmp_val[tas_priv->index * 5 + i]; in tas2781_save_calibration()
889 tas_priv->apply_calibration(tas_priv); in tas2781_save_calibration()
898 struct hda_codec *codec = tas_hda->priv->codec; in tas2781_hda_remove_controls()
900 snd_ctl_remove(codec->card, tas_hda->dsp_prog_ctl); in tas2781_hda_remove_controls()
902 snd_ctl_remove(codec->card, tas_hda->dsp_conf_ctl); in tas2781_hda_remove_controls()
904 for (int i = ARRAY_SIZE(tas_hda->snd_ctls) - 1; i >= 0; i--) in tas2781_hda_remove_controls()
905 snd_ctl_remove(codec->card, tas_hda->snd_ctls[i]); in tas2781_hda_remove_controls()
907 snd_ctl_remove(codec->card, tas_hda->prof_ctl); in tas2781_hda_remove_controls()
913 struct tas2781_hda *tas_hda = dev_get_drvdata(tas_priv->dev); in tasdev_fw_ready()
914 struct hda_codec *codec = tas_priv->codec; in tasdev_fw_ready()
917 pm_runtime_get_sync(tas_priv->dev); in tasdev_fw_ready()
918 guard(mutex)(&tas_priv->codec_lock); in tasdev_fw_ready()
925 tas_hda->prof_ctl = snd_ctl_new1(&tas2781_prof_ctrl[tas_priv->index], in tasdev_fw_ready()
927 ret = snd_ctl_add(codec->card, tas_hda->prof_ctl); in tasdev_fw_ready()
929 dev_err(tas_priv->dev, "Failed to add KControl %s = %d\n", in tasdev_fw_ready()
930 tas2781_prof_ctrl[tas_priv->index].name, ret); in tasdev_fw_ready()
933 j = tas_priv->index * ARRAY_SIZE(tas2781_snd_controls) / 2; in tasdev_fw_ready()
935 tas_hda->snd_ctls[i] = snd_ctl_new1(&tas2781_snd_controls[i+j], in tasdev_fw_ready()
937 ret = snd_ctl_add(codec->card, tas_hda->snd_ctls[i]); in tasdev_fw_ready()
939 dev_err(tas_priv->dev, in tasdev_fw_ready()
941 tas2781_snd_controls[i+tas_priv->index*3].name, in tasdev_fw_ready()
949 tas_priv->fw_state = TASDEVICE_DSP_FW_PENDING; in tasdev_fw_ready()
950 scnprintf(tas_priv->coef_binaryname, 64, "TAS2XXX%08X-%01d.bin", in tasdev_fw_ready()
951 codec->core.subsystem_id, tas_priv->index); in tasdev_fw_ready()
954 dev_err(tas_priv->dev, "dspfw load %s error\n", in tasdev_fw_ready()
955 tas_priv->coef_binaryname); in tasdev_fw_ready()
956 tas_priv->fw_state = TASDEVICE_DSP_FW_FAIL; in tasdev_fw_ready()
961 tas_hda->dsp_prog_ctl = in tasdev_fw_ready()
962 snd_ctl_new1(&tas2781_dsp_prog_ctrl[tas_priv->index], in tasdev_fw_ready()
964 ret = snd_ctl_add(codec->card, tas_hda->dsp_prog_ctl); in tasdev_fw_ready()
966 dev_err(tas_priv->dev, in tasdev_fw_ready()
968 tas2781_dsp_prog_ctrl[tas_priv->index].name, ret); in tasdev_fw_ready()
972 tas_hda->dsp_conf_ctl = in tasdev_fw_ready()
973 snd_ctl_new1(&tas2781_dsp_conf_ctrl[tas_priv->index], in tasdev_fw_ready()
975 ret = snd_ctl_add(codec->card, tas_hda->dsp_conf_ctl); in tasdev_fw_ready()
977 dev_err(tas_priv->dev, "Failed to add KControl %s = %d\n", in tasdev_fw_ready()
978 tas2781_dsp_conf_ctrl[tas_priv->index].name, ret); in tasdev_fw_ready()
983 tas_priv->rcabin.profile_cfg_id = TAS2781_PRE_POST_RESET_CFG; in tasdev_fw_ready()
985 tas_priv->rcabin.profile_cfg_id = 0; in tasdev_fw_ready()
987 tas_priv->fw_state = TASDEVICE_DSP_FW_ALL_OK; in tasdev_fw_ready()
995 dev_err(tas_priv->dev, "FW download failed = %d\n", ret); in tasdev_fw_ready()
998 if (tas_priv->fmw->nr_programs > 0) in tasdev_fw_ready()
999 tas_priv->cur_prog = 0; in tasdev_fw_ready()
1000 if (tas_priv->fmw->nr_configurations > 0) in tasdev_fw_ready()
1001 tas_priv->cur_conf = 0; in tasdev_fw_ready()
1011 pm_runtime_mark_last_busy(tas_hda->priv->dev); in tasdev_fw_ready()
1012 pm_runtime_put_autosuspend(tas_hda->priv->dev); in tasdev_fw_ready()
1024 comp = hda_component_from_index(parent, tas_hda->priv->index); in tas2781_hda_bind()
1026 return -EINVAL; in tas2781_hda_bind()
1028 if (comp->dev) in tas2781_hda_bind()
1029 return -EBUSY; in tas2781_hda_bind()
1031 codec = parent->codec; in tas2781_hda_bind()
1035 comp->dev = dev; in tas2781_hda_bind()
1037 strscpy(comp->name, dev_name(dev), sizeof(comp->name)); in tas2781_hda_bind()
1039 ret = tascodec_spi_init(tas_hda->priv, codec, THIS_MODULE, in tas2781_hda_bind()
1042 comp->playback_hook = tas2781_hda_playback_hook; in tas2781_hda_bind()
1057 comp = hda_component_from_index(parent, tas_hda->priv->index); in tas2781_hda_unbind()
1058 if (comp && (comp->dev == dev)) { in tas2781_hda_unbind()
1059 comp->dev = NULL; in tas2781_hda_unbind()
1060 memset(comp->name, 0, sizeof(comp->name)); in tas2781_hda_unbind()
1061 comp->playback_hook = NULL; in tas2781_hda_unbind()
1066 tasdevice_spi_config_info_remove(tas_hda->priv); in tas2781_hda_unbind()
1067 tasdevice_spi_dsp_remove(tas_hda->priv); in tas2781_hda_unbind()
1069 tas_hda->priv->fw_state = TASDEVICE_DSP_FW_PENDING; in tas2781_hda_unbind()
1081 component_del(tas_hda->priv->dev, &tas2781_hda_comp_ops); in tas2781_hda_remove()
1083 pm_runtime_get_sync(tas_hda->priv->dev); in tas2781_hda_remove()
1084 pm_runtime_disable(tas_hda->priv->dev); in tas2781_hda_remove()
1086 pm_runtime_put_noidle(tas_hda->priv->dev); in tas2781_hda_remove()
1088 mutex_destroy(&tas_hda->priv->codec_lock); in tas2781_hda_remove()
1098 tas_hda = devm_kzalloc(&spi->dev, sizeof(*tas_hda), GFP_KERNEL); in tas2781_hda_spi_probe()
1100 return -ENOMEM; in tas2781_hda_spi_probe()
1102 spi->max_speed_hz = TAS2781_SPI_MAX_FREQ; in tas2781_hda_spi_probe()
1104 tas_priv = devm_kzalloc(&spi->dev, sizeof(*tas_priv), GFP_KERNEL); in tas2781_hda_spi_probe()
1106 return -ENOMEM; in tas2781_hda_spi_probe()
1107 tas_priv->dev = &spi->dev; in tas2781_hda_spi_probe()
1108 tas_hda->priv = tas_priv; in tas2781_hda_spi_probe()
1109 tas_priv->regmap = devm_regmap_init_spi(spi, &tasdevice_regmap); in tas2781_hda_spi_probe()
1110 if (IS_ERR(tas_priv->regmap)) { in tas2781_hda_spi_probe()
1111 ret = PTR_ERR(tas_priv->regmap); in tas2781_hda_spi_probe()
1112 dev_err(tas_priv->dev, "Failed to allocate regmap: %d\n", in tas2781_hda_spi_probe()
1116 if (strstr(dev_name(&spi->dev), "TXNW2781")) { in tas2781_hda_spi_probe()
1118 tas_priv->save_calibration = tas2781_save_calibration; in tas2781_hda_spi_probe()
1119 tas_priv->apply_calibration = tas2781_apply_calib; in tas2781_hda_spi_probe()
1121 dev_err(tas_priv->dev, "Unmatched spi dev %s\n", in tas2781_hda_spi_probe()
1122 dev_name(&spi->dev)); in tas2781_hda_spi_probe()
1123 return -ENODEV; in tas2781_hda_spi_probe()
1126 tas_priv->irq = spi->irq; in tas2781_hda_spi_probe()
1127 dev_set_drvdata(&spi->dev, tas_hda); in tas2781_hda_spi_probe()
1131 return dev_err_probe(tas_priv->dev, ret, in tas2781_hda_spi_probe()
1136 ret = component_add(tas_priv->dev, &tas2781_hda_comp_ops); in tas2781_hda_spi_probe()
1138 dev_err(tas_priv->dev, "Register component fail: %d\n", ret); in tas2781_hda_spi_probe()
1142 pm_runtime_set_autosuspend_delay(tas_priv->dev, 3000); in tas2781_hda_spi_probe()
1143 pm_runtime_use_autosuspend(tas_priv->dev); in tas2781_hda_spi_probe()
1144 pm_runtime_mark_last_busy(tas_priv->dev); in tas2781_hda_spi_probe()
1145 pm_runtime_set_active(tas_priv->dev); in tas2781_hda_spi_probe()
1146 pm_runtime_get_noresume(tas_priv->dev); in tas2781_hda_spi_probe()
1147 pm_runtime_enable(tas_priv->dev); in tas2781_hda_spi_probe()
1149 pm_runtime_put_autosuspend(tas_priv->dev); in tas2781_hda_spi_probe()
1156 tas2781_hda_remove(&spi->dev); in tas2781_hda_spi_remove()
1163 guard(mutex)(&tas_hda->priv->codec_lock); in tas2781_runtime_suspend()
1165 if (tas_hda->priv->playback_started) in tas2781_runtime_suspend()
1166 tasdevice_spi_tuning_switch(tas_hda->priv, 1); in tas2781_runtime_suspend()
1168 tas_hda->priv->cur_book = -1; in tas2781_runtime_suspend()
1169 tas_hda->priv->cur_conf = -1; in tas2781_runtime_suspend()
1178 guard(mutex)(&tas_hda->priv->codec_lock); in tas2781_runtime_resume()
1180 if (tas_hda->priv->playback_started) in tas2781_runtime_resume()
1181 tasdevice_spi_tuning_switch(tas_hda->priv, 0); in tas2781_runtime_resume()
1196 if (tas_hda->priv->playback_started) in tas2781_system_suspend()
1197 tasdevice_spi_tuning_switch(tas_hda->priv, 1); in tas2781_system_suspend()
1211 guard(mutex)(&tas_hda->priv->codec_lock); in tas2781_system_resume()
1212 ret = tasdevice_spi_dev_read(tas_hda->priv, TAS2781_REG_CLK_CONFIG, in tas2781_system_resume()
1218 tas_hda->priv->cur_book = -1; in tas2781_system_resume()
1219 tas_hda->priv->cur_conf = -1; in tas2781_system_resume()
1220 tas_hda->priv->cur_prog = -1; in tas2781_system_resume()
1222 ret = tasdevice_spi_prmg_load(tas_hda->priv, 0); in tas2781_system_resume()
1224 dev_err(tas_hda->priv->dev, in tas2781_system_resume()
1229 if (tas_hda->priv->playback_started) in tas2781_system_resume()
1230 tasdevice_spi_tuning_switch(tas_hda->priv, 0); in tas2781_system_resume()
1242 { "tas2781-hda", },
1254 .name = "tas2781-hda",