Lines Matching +full:calib +full:- +full:gpios

1 // SPDX-License-Identifier: GPL-2.0
5 // Copyright 2023 - 2024 Texas Instruments, Inc.
7 // Author: Shenghao Ding <shenghao-ding@ti.com>
26 #include <sound/tas2781-tlv.h>
104 if (tas_priv->ndev < TASDEVICE_MAX_CHANNELS && in tas2781_get_i2c_res()
105 sb->slave_address != tas_priv->global_addr) { in tas2781_get_i2c_res()
106 tas_priv->tasdevice[tas_priv->ndev].dev_addr = in tas2781_get_i2c_res()
107 (unsigned int)sb->slave_address; in tas2781_get_i2c_res()
108 tas_priv->ndev++; in tas2781_get_i2c_res()
117 { "speakerid-gpios", &speakerid_gpios, 1 },
130 adev = acpi_dev_get_first_match_dev(hid, NULL, -1); in tas2781_read_acpi()
132 dev_err(p->dev, in tas2781_read_acpi()
134 return -ENODEV; in tas2781_read_acpi()
140 dev_err(p->dev, "Failed to get ACPI resource.\n"); in tas2781_read_acpi()
148 dev_err(p->dev, "Failed to get SUBSYS ID.\n"); in tas2781_read_acpi()
155 ret = devm_acpi_dev_add_driver_gpios(p->dev, in tas2781_read_acpi()
158 dev_err(p->dev, "Failed to add driver gpio %d.\n", in tas2781_read_acpi()
160 p->speaker_id = devm_gpiod_get(p->dev, "speakerid", GPIOD_IN); in tas2781_read_acpi()
161 if (IS_ERR(p->speaker_id)) { in tas2781_read_acpi()
162 dev_err(p->dev, "Failed to get Speaker id.\n"); in tas2781_read_acpi()
163 ret = PTR_ERR(p->speaker_id); in tas2781_read_acpi()
167 p->speaker_id = NULL; in tas2781_read_acpi()
172 strscpy(p->dev_name, hid, sizeof(p->dev_name)); in tas2781_read_acpi()
179 dev_err(p->dev, "read acpi error, ret: %d\n", ret); in tas2781_read_acpi()
190 dev_dbg(tas_hda->dev, "%s: action = %d\n", __func__, action); in tas2781_hda_playback_hook()
194 mutex_lock(&tas_hda->priv->codec_lock); in tas2781_hda_playback_hook()
195 tasdevice_tuning_switch(tas_hda->priv, 0); in tas2781_hda_playback_hook()
196 tas_hda->priv->playback_started = true; in tas2781_hda_playback_hook()
197 mutex_unlock(&tas_hda->priv->codec_lock); in tas2781_hda_playback_hook()
200 mutex_lock(&tas_hda->priv->codec_lock); in tas2781_hda_playback_hook()
201 tasdevice_tuning_switch(tas_hda->priv, 1); in tas2781_hda_playback_hook()
202 tas_hda->priv->playback_started = false; in tas2781_hda_playback_hook()
203 mutex_unlock(&tas_hda->priv->codec_lock); in tas2781_hda_playback_hook()
218 uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER; in tasdevice_info_profile()
219 uinfo->count = 1; in tasdevice_info_profile()
220 uinfo->value.integer.min = 0; in tasdevice_info_profile()
221 uinfo->value.integer.max = tas_priv->rcabin.ncfgs - 1; in tasdevice_info_profile()
231 mutex_lock(&tas_priv->codec_lock); in tasdevice_get_profile_id()
233 ucontrol->value.integer.value[0] = tas_priv->rcabin.profile_cfg_id; in tasdevice_get_profile_id()
235 dev_dbg(tas_priv->dev, "%s: kcontrol %s: %d\n", in tasdevice_get_profile_id()
236 __func__, kcontrol->id.name, tas_priv->rcabin.profile_cfg_id); in tasdevice_get_profile_id()
238 mutex_unlock(&tas_priv->codec_lock); in tasdevice_get_profile_id()
247 int nr_profile = ucontrol->value.integer.value[0]; in tasdevice_set_profile_id()
248 int max = tas_priv->rcabin.ncfgs - 1; in tasdevice_set_profile_id()
253 mutex_lock(&tas_priv->codec_lock); in tasdevice_set_profile_id()
255 dev_dbg(tas_priv->dev, "%s: kcontrol %s: %d -> %d\n", in tasdevice_set_profile_id()
256 __func__, kcontrol->id.name, in tasdevice_set_profile_id()
257 tas_priv->rcabin.profile_cfg_id, val); in tasdevice_set_profile_id()
259 if (tas_priv->rcabin.profile_cfg_id != val) { in tasdevice_set_profile_id()
260 tas_priv->rcabin.profile_cfg_id = val; in tasdevice_set_profile_id()
264 mutex_unlock(&tas_priv->codec_lock); in tasdevice_set_profile_id()
273 struct tasdevice_fw *tas_fw = tas_priv->fmw; in tasdevice_info_programs()
275 uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER; in tasdevice_info_programs()
276 uinfo->count = 1; in tasdevice_info_programs()
277 uinfo->value.integer.min = 0; in tasdevice_info_programs()
278 uinfo->value.integer.max = tas_fw->nr_programs - 1; in tasdevice_info_programs()
287 struct tasdevice_fw *tas_fw = tas_priv->fmw; in tasdevice_info_config()
289 uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER; in tasdevice_info_config()
290 uinfo->count = 1; in tasdevice_info_config()
291 uinfo->value.integer.min = 0; in tasdevice_info_config()
292 uinfo->value.integer.max = tas_fw->nr_configurations - 1; in tasdevice_info_config()
302 mutex_lock(&tas_priv->codec_lock); in tasdevice_program_get()
304 ucontrol->value.integer.value[0] = tas_priv->cur_prog; in tasdevice_program_get()
306 dev_dbg(tas_priv->dev, "%s: kcontrol %s: %d\n", in tasdevice_program_get()
307 __func__, kcontrol->id.name, tas_priv->cur_prog); in tasdevice_program_get()
309 mutex_unlock(&tas_priv->codec_lock); in tasdevice_program_get()
318 struct tasdevice_fw *tas_fw = tas_priv->fmw; in tasdevice_program_put()
319 int nr_program = ucontrol->value.integer.value[0]; in tasdevice_program_put()
320 int max = tas_fw->nr_programs - 1; in tasdevice_program_put()
325 mutex_lock(&tas_priv->codec_lock); in tasdevice_program_put()
327 dev_dbg(tas_priv->dev, "%s: kcontrol %s: %d -> %d\n", in tasdevice_program_put()
328 __func__, kcontrol->id.name, tas_priv->cur_prog, val); in tasdevice_program_put()
330 if (tas_priv->cur_prog != val) { in tasdevice_program_put()
331 tas_priv->cur_prog = val; in tasdevice_program_put()
335 mutex_unlock(&tas_priv->codec_lock); in tasdevice_program_put()
345 mutex_lock(&tas_priv->codec_lock); in tasdevice_config_get()
347 ucontrol->value.integer.value[0] = tas_priv->cur_conf; in tasdevice_config_get()
349 dev_dbg(tas_priv->dev, "%s: kcontrol %s: %d\n", in tasdevice_config_get()
350 __func__, kcontrol->id.name, tas_priv->cur_conf); in tasdevice_config_get()
352 mutex_unlock(&tas_priv->codec_lock); in tasdevice_config_get()
361 struct tasdevice_fw *tas_fw = tas_priv->fmw; in tasdevice_config_put()
362 int nr_config = ucontrol->value.integer.value[0]; in tasdevice_config_put()
363 int max = tas_fw->nr_configurations - 1; in tasdevice_config_put()
368 mutex_lock(&tas_priv->codec_lock); in tasdevice_config_put()
370 dev_dbg(tas_priv->dev, "%s: kcontrol %s: %d -> %d\n", in tasdevice_config_put()
371 __func__, kcontrol->id.name, tas_priv->cur_conf, val); in tasdevice_config_put()
373 if (tas_priv->cur_conf != val) { in tasdevice_config_put()
374 tas_priv->cur_conf = val; in tasdevice_config_put()
378 mutex_unlock(&tas_priv->codec_lock); in tasdevice_config_put()
388 (struct soc_mixer_control *)kcontrol->private_value; in tas2781_amp_getvol()
391 mutex_lock(&tas_priv->codec_lock); in tas2781_amp_getvol()
395 dev_dbg(tas_priv->dev, "%s: kcontrol %s: %ld\n", in tas2781_amp_getvol()
396 __func__, kcontrol->id.name, ucontrol->value.integer.value[0]); in tas2781_amp_getvol()
398 mutex_unlock(&tas_priv->codec_lock); in tas2781_amp_getvol()
408 (struct soc_mixer_control *)kcontrol->private_value; in tas2781_amp_putvol()
411 mutex_lock(&tas_priv->codec_lock); in tas2781_amp_putvol()
413 dev_dbg(tas_priv->dev, "%s: kcontrol %s: -> %ld\n", in tas2781_amp_putvol()
414 __func__, kcontrol->id.name, ucontrol->value.integer.value[0]); in tas2781_amp_putvol()
419 mutex_unlock(&tas_priv->codec_lock); in tas2781_amp_putvol()
429 mutex_lock(&tas_priv->codec_lock); in tas2781_force_fwload_get()
431 ucontrol->value.integer.value[0] = (int)tas_priv->force_fwload_status; in tas2781_force_fwload_get()
432 dev_dbg(tas_priv->dev, "%s: kcontrol %s: %d\n", in tas2781_force_fwload_get()
433 __func__, kcontrol->id.name, tas_priv->force_fwload_status); in tas2781_force_fwload_get()
435 mutex_unlock(&tas_priv->codec_lock); in tas2781_force_fwload_get()
444 bool change, val = (bool)ucontrol->value.integer.value[0]; in tas2781_force_fwload_put()
446 mutex_lock(&tas_priv->codec_lock); in tas2781_force_fwload_put()
448 dev_dbg(tas_priv->dev, "%s: kcontrol %s: %d -> %d\n", in tas2781_force_fwload_put()
449 __func__, kcontrol->id.name, in tas2781_force_fwload_put()
450 tas_priv->force_fwload_status, val); in tas2781_force_fwload_put()
452 if (tas_priv->force_fwload_status == val) in tas2781_force_fwload_put()
456 tas_priv->force_fwload_status = val; in tas2781_force_fwload_put()
459 mutex_unlock(&tas_priv->codec_lock); in tas2781_force_fwload_put()
502 for (int i = 0; i < tas_priv->ndev; i++) { in tas2563_apply_calib()
505 *(uint32_t *)&tas_priv->cali_data.data[offset]); in tas2563_apply_calib()
509 dev_err(tas_priv->dev, in tas2563_apply_calib()
510 "Error writing calib regs\n"); in tas2563_apply_calib()
533 tas_priv->cali_data.data = devm_kzalloc(tas_priv->dev, in tas2563_save_calibration()
535 if (!tas_priv->cali_data.data) in tas2563_save_calibration()
536 return -ENOMEM; in tas2563_save_calibration()
538 for (int i = 0; i < tas_priv->ndev; ++i) { in tas2563_save_calibration()
542 &tas_priv->cali_data.data[offset]); in tas2563_save_calibration()
545 dev_warn(tas_priv->dev, in tas2563_save_calibration()
547 return -EINVAL; in tas2563_save_calibration()
553 tas_priv->cali_data.total_sz = offset; in tas2563_save_calibration()
561 struct calidata *cali_data = &tas_priv->cali_data; in tas2781_apply_calib()
562 struct cali_reg *r = &cali_data->cali_reg_array; in tas2781_apply_calib()
574 if (tas_priv->dspbin_typ != TASDEV_BASIC) { in tas2781_apply_calib()
575 cali_reg[0] = r->r0_reg; in tas2781_apply_calib()
576 cali_reg[1] = r->invr0_reg; in tas2781_apply_calib()
577 cali_reg[2] = r->r0_low_reg; in tas2781_apply_calib()
578 cali_reg[3] = r->pow_reg; in tas2781_apply_calib()
579 cali_reg[4] = r->tlimit_reg; in tas2781_apply_calib()
582 for (i = 0; i < tas_priv->ndev; i++) { in tas2781_apply_calib()
585 *(uint32_t *)&tas_priv->cali_data.data[oft]); in tas2781_apply_calib()
589 dev_err(tas_priv->dev, in tas2781_apply_calib()
590 "chn %d calib %d bulk_wr err = %d\n", in tas2781_apply_calib()
612 if (tas_priv->catlog_id == LENOVO) in tas2781_save_calibration()
616 tas_priv->cali_data.total_sz = 0; in tas2781_save_calibration()
619 &tas_priv->cali_data.total_sz, tas_priv->cali_data.data); in tas2781_save_calibration()
622 tas_priv->cali_data.data = devm_kzalloc(tas_priv->dev, in tas2781_save_calibration()
623 tas_priv->cali_data.total_sz, GFP_KERNEL); in tas2781_save_calibration()
624 if (!tas_priv->cali_data.data) in tas2781_save_calibration()
625 return -ENOMEM; in tas2781_save_calibration()
628 &tas_priv->cali_data.total_sz, in tas2781_save_calibration()
629 tas_priv->cali_data.data); in tas2781_save_calibration()
632 return -EINVAL; in tas2781_save_calibration()
634 tmp_val = (unsigned int *)tas_priv->cali_data.data; in tas2781_save_calibration()
636 crc = crc32(~0, tas_priv->cali_data.data, 84) ^ ~0; in tas2781_save_calibration()
637 dev_dbg(tas_priv->dev, "cali crc 0x%08x PK tmp_val 0x%08x\n", in tas2781_save_calibration()
643 dev_dbg(tas_priv->dev, "%ptTsr\n", &seconds); in tas2781_save_calibration()
646 tas_priv->cali_data.total_sz = 0; in tas2781_save_calibration()
653 struct hda_codec *codec = tas_hda->priv->codec; in tas2781_hda_remove_controls()
655 snd_ctl_remove(codec->card, tas_hda->dsp_prog_ctl); in tas2781_hda_remove_controls()
656 snd_ctl_remove(codec->card, tas_hda->dsp_conf_ctl); in tas2781_hda_remove_controls()
658 for (int i = ARRAY_SIZE(tas_hda->snd_ctls) - 1; i >= 0; i--) in tas2781_hda_remove_controls()
659 snd_ctl_remove(codec->card, tas_hda->snd_ctls[i]); in tas2781_hda_remove_controls()
661 snd_ctl_remove(codec->card, tas_hda->prof_ctl); in tas2781_hda_remove_controls()
667 struct tas2781_hda *tas_hda = dev_get_drvdata(tas_priv->dev); in tasdev_fw_ready()
668 struct hda_codec *codec = tas_priv->codec; in tasdev_fw_ready()
671 pm_runtime_get_sync(tas_priv->dev); in tasdev_fw_ready()
672 mutex_lock(&tas_priv->codec_lock); in tasdev_fw_ready()
678 tas_hda->prof_ctl = snd_ctl_new1(&tas2781_prof_ctrl, tas_priv); in tasdev_fw_ready()
679 ret = snd_ctl_add(codec->card, tas_hda->prof_ctl); in tasdev_fw_ready()
681 dev_err(tas_priv->dev, in tasdev_fw_ready()
688 tas_hda->snd_ctls[i] = snd_ctl_new1(&tas2781_snd_controls[i], in tasdev_fw_ready()
690 ret = snd_ctl_add(codec->card, tas_hda->snd_ctls[i]); in tasdev_fw_ready()
692 dev_err(tas_priv->dev, in tasdev_fw_ready()
701 tas_priv->fw_state = TASDEVICE_DSP_FW_PENDING; in tasdev_fw_ready()
702 if (tas_priv->speaker_id != NULL) { in tasdev_fw_ready()
704 spk_id = gpiod_get_value(tas_priv->speaker_id); in tasdev_fw_ready()
707 dev_dbg(tas_priv->dev, "Wrong spk_id = %d\n", spk_id); in tasdev_fw_ready()
710 snprintf(tas_priv->coef_binaryname, in tasdev_fw_ready()
711 sizeof(tas_priv->coef_binaryname), in tasdev_fw_ready()
713 lower_16_bits(codec->core.subsystem_id), in tasdev_fw_ready()
716 snprintf(tas_priv->coef_binaryname, in tasdev_fw_ready()
717 sizeof(tas_priv->coef_binaryname), in tasdev_fw_ready()
719 lower_16_bits(codec->core.subsystem_id)); in tasdev_fw_ready()
723 dev_err(tas_priv->dev, "dspfw load %s error\n", in tasdev_fw_ready()
724 tas_priv->coef_binaryname); in tasdev_fw_ready()
725 tas_priv->fw_state = TASDEVICE_DSP_FW_FAIL; in tasdev_fw_ready()
729 tas_hda->dsp_prog_ctl = snd_ctl_new1(&tas2781_dsp_prog_ctrl, in tasdev_fw_ready()
731 ret = snd_ctl_add(codec->card, tas_hda->dsp_prog_ctl); in tasdev_fw_ready()
733 dev_err(tas_priv->dev, in tasdev_fw_ready()
739 tas_hda->dsp_conf_ctl = snd_ctl_new1(&tas2781_dsp_conf_ctrl, in tasdev_fw_ready()
741 ret = snd_ctl_add(codec->card, tas_hda->dsp_conf_ctl); in tasdev_fw_ready()
743 dev_err(tas_priv->dev, in tasdev_fw_ready()
749 tas_priv->fw_state = TASDEVICE_DSP_FW_ALL_OK; in tasdev_fw_ready()
751 if (tas_priv->fmw->nr_programs > 0) in tasdev_fw_ready()
752 tas_priv->cur_prog = 0; in tasdev_fw_ready()
753 if (tas_priv->fmw->nr_configurations > 0) in tasdev_fw_ready()
754 tas_priv->cur_conf = 0; in tasdev_fw_ready()
761 tasdevice_tuning_switch(tas_hda->priv, 0); in tasdev_fw_ready()
762 tas_hda->priv->playback_started = true; in tasdev_fw_ready()
765 mutex_unlock(&tas_hda->priv->codec_lock); in tasdev_fw_ready()
767 pm_runtime_mark_last_busy(tas_hda->dev); in tasdev_fw_ready()
768 pm_runtime_put_autosuspend(tas_hda->dev); in tasdev_fw_ready()
781 comp = hda_component_from_index(parent, tas_hda->priv->index); in tas2781_hda_bind()
783 return -EINVAL; in tas2781_hda_bind()
785 if (comp->dev) in tas2781_hda_bind()
786 return -EBUSY; in tas2781_hda_bind()
788 codec = parent->codec; in tas2781_hda_bind()
789 subid = codec->core.subsystem_id >> 16; in tas2781_hda_bind()
793 tas_hda->priv->catlog_id = LENOVO; in tas2781_hda_bind()
796 tas_hda->priv->catlog_id = OTHERS; in tas2781_hda_bind()
802 comp->dev = dev; in tas2781_hda_bind()
804 strscpy(comp->name, dev_name(dev), sizeof(comp->name)); in tas2781_hda_bind()
806 ret = tascodec_init(tas_hda->priv, codec, THIS_MODULE, tasdev_fw_ready); in tas2781_hda_bind()
808 comp->playback_hook = tas2781_hda_playback_hook; in tas2781_hda_bind()
823 comp = hda_component_from_index(parent, tas_hda->priv->index); in tas2781_hda_unbind()
824 if (comp && (comp->dev == dev)) { in tas2781_hda_unbind()
825 comp->dev = NULL; in tas2781_hda_unbind()
826 memset(comp->name, 0, sizeof(comp->name)); in tas2781_hda_unbind()
827 comp->playback_hook = NULL; in tas2781_hda_unbind()
832 tasdevice_config_info_remove(tas_hda->priv); in tas2781_hda_unbind()
833 tasdevice_dsp_remove(tas_hda->priv); in tas2781_hda_unbind()
835 tas_hda->priv->fw_state = TASDEVICE_DSP_FW_PENDING; in tas2781_hda_unbind()
847 component_del(tas_hda->dev, &tas2781_hda_comp_ops); in tas2781_hda_remove()
849 pm_runtime_get_sync(tas_hda->dev); in tas2781_hda_remove()
850 pm_runtime_disable(tas_hda->dev); in tas2781_hda_remove()
852 pm_runtime_put_noidle(tas_hda->dev); in tas2781_hda_remove()
854 tasdevice_remove(tas_hda->priv); in tas2781_hda_remove()
864 tas_hda = devm_kzalloc(&clt->dev, sizeof(*tas_hda), GFP_KERNEL); in tas2781_hda_i2c_probe()
866 return -ENOMEM; in tas2781_hda_i2c_probe()
868 dev_set_drvdata(&clt->dev, tas_hda); in tas2781_hda_i2c_probe()
869 tas_hda->dev = &clt->dev; in tas2781_hda_i2c_probe()
871 tas_hda->priv = tasdevice_kzalloc(clt); in tas2781_hda_i2c_probe()
872 if (!tas_hda->priv) in tas2781_hda_i2c_probe()
873 return -ENOMEM; in tas2781_hda_i2c_probe()
875 if (strstr(dev_name(&clt->dev), "TIAS2781")) { in tas2781_hda_i2c_probe()
877 tas_hda->priv->save_calibration = tas2781_save_calibration; in tas2781_hda_i2c_probe()
878 tas_hda->priv->apply_calibration = tas2781_apply_calib; in tas2781_hda_i2c_probe()
879 tas_hda->priv->global_addr = TAS2781_GLOBAL_ADDR; in tas2781_hda_i2c_probe()
880 } else if (strstr(dev_name(&clt->dev), "INT8866")) { in tas2781_hda_i2c_probe()
882 tas_hda->priv->save_calibration = tas2563_save_calibration; in tas2781_hda_i2c_probe()
883 tas_hda->priv->apply_calibration = tas2563_apply_calib; in tas2781_hda_i2c_probe()
884 tas_hda->priv->global_addr = TAS2563_GLOBAL_ADDR; in tas2781_hda_i2c_probe()
886 return -ENODEV; in tas2781_hda_i2c_probe()
888 tas_hda->priv->irq = clt->irq; in tas2781_hda_i2c_probe()
889 ret = tas2781_read_acpi(tas_hda->priv, device_name); in tas2781_hda_i2c_probe()
891 return dev_err_probe(tas_hda->dev, ret, in tas2781_hda_i2c_probe()
894 ret = tasdevice_init(tas_hda->priv); in tas2781_hda_i2c_probe()
898 pm_runtime_set_autosuspend_delay(tas_hda->dev, 3000); in tas2781_hda_i2c_probe()
899 pm_runtime_use_autosuspend(tas_hda->dev); in tas2781_hda_i2c_probe()
900 pm_runtime_mark_last_busy(tas_hda->dev); in tas2781_hda_i2c_probe()
901 pm_runtime_set_active(tas_hda->dev); in tas2781_hda_i2c_probe()
902 pm_runtime_enable(tas_hda->dev); in tas2781_hda_i2c_probe()
904 tasdevice_reset(tas_hda->priv); in tas2781_hda_i2c_probe()
906 ret = component_add(tas_hda->dev, &tas2781_hda_comp_ops); in tas2781_hda_i2c_probe()
908 dev_err(tas_hda->dev, "Register component failed: %d\n", ret); in tas2781_hda_i2c_probe()
909 pm_runtime_disable(tas_hda->dev); in tas2781_hda_i2c_probe()
914 tas2781_hda_remove(&clt->dev); in tas2781_hda_i2c_probe()
920 tas2781_hda_remove(&clt->dev); in tas2781_hda_i2c_remove()
927 dev_dbg(tas_hda->dev, "Runtime Suspend\n"); in tas2781_runtime_suspend()
929 mutex_lock(&tas_hda->priv->codec_lock); in tas2781_runtime_suspend()
934 if (tas_hda->priv->playback_started) { in tas2781_runtime_suspend()
935 tasdevice_tuning_switch(tas_hda->priv, 1); in tas2781_runtime_suspend()
936 tas_hda->priv->playback_started = false; in tas2781_runtime_suspend()
939 mutex_unlock(&tas_hda->priv->codec_lock); in tas2781_runtime_suspend()
948 dev_dbg(tas_hda->dev, "Runtime Resume\n"); in tas2781_runtime_resume()
950 mutex_lock(&tas_hda->priv->codec_lock); in tas2781_runtime_resume()
952 tasdevice_prmg_load(tas_hda->priv, tas_hda->priv->cur_prog); in tas2781_runtime_resume()
957 tasdevice_apply_calibration(tas_hda->priv); in tas2781_runtime_resume()
959 mutex_unlock(&tas_hda->priv->codec_lock); in tas2781_runtime_resume()
968 dev_dbg(tas_hda->priv->dev, "System Suspend\n"); in tas2781_system_suspend()
970 mutex_lock(&tas_hda->priv->codec_lock); in tas2781_system_suspend()
973 if (tas_hda->priv->playback_started) in tas2781_system_suspend()
974 tasdevice_tuning_switch(tas_hda->priv, 1); in tas2781_system_suspend()
976 mutex_unlock(&tas_hda->priv->codec_lock); in tas2781_system_suspend()
990 dev_dbg(tas_hda->priv->dev, "System Resume\n"); in tas2781_system_resume()
992 mutex_lock(&tas_hda->priv->codec_lock); in tas2781_system_resume()
994 for (i = 0; i < tas_hda->priv->ndev; i++) { in tas2781_system_resume()
995 tas_hda->priv->tasdevice[i].cur_book = -1; in tas2781_system_resume()
996 tas_hda->priv->tasdevice[i].cur_prog = -1; in tas2781_system_resume()
997 tas_hda->priv->tasdevice[i].cur_conf = -1; in tas2781_system_resume()
999 tasdevice_reset(tas_hda->priv); in tas2781_system_resume()
1000 tasdevice_prmg_load(tas_hda->priv, tas_hda->priv->cur_prog); in tas2781_system_resume()
1005 tasdevice_apply_calibration(tas_hda->priv); in tas2781_system_resume()
1007 if (tas_hda->priv->playback_started) in tas2781_system_resume()
1008 tasdevice_tuning_switch(tas_hda->priv, 0); in tas2781_system_resume()
1010 mutex_unlock(&tas_hda->priv->codec_lock); in tas2781_system_resume()
1021 { "tas2781-hda" },
1034 .name = "tas2781-hda",
1045 MODULE_AUTHOR("Shenghao Ding, TI, <shenghao-ding@ti.com>");