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-[email protected]>
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()
571 for (i = 0; i < tas_priv->ndev; i++) { in tas2781_apply_calib()
574 *(uint32_t *)&tas_priv->cali_data.data[offset]); in tas2781_apply_calib()
579 dev_err(tas_priv->dev, in tas2781_apply_calib()
580 "chn %d calib %d bulk_wr err = %d\n", in tas2781_apply_calib()
597 struct tm *tm = &tas_priv->tm; in tas2781_save_calibration()
603 if (tas_priv->catlog_id == LENOVO) in tas2781_save_calibration()
607 tas_priv->cali_data.total_sz = 0; in tas2781_save_calibration()
610 &tas_priv->cali_data.total_sz, tas_priv->cali_data.data); in tas2781_save_calibration()
613 tas_priv->cali_data.data = devm_kzalloc(tas_priv->dev, in tas2781_save_calibration()
614 tas_priv->cali_data.total_sz, GFP_KERNEL); in tas2781_save_calibration()
615 if (!tas_priv->cali_data.data) in tas2781_save_calibration()
616 return -ENOMEM; in tas2781_save_calibration()
619 &tas_priv->cali_data.total_sz, in tas2781_save_calibration()
620 tas_priv->cali_data.data); in tas2781_save_calibration()
623 return -EINVAL; in tas2781_save_calibration()
625 tmp_val = (unsigned int *)tas_priv->cali_data.data; in tas2781_save_calibration()
627 crc = crc32(~0, tas_priv->cali_data.data, 84) ^ ~0; in tas2781_save_calibration()
628 dev_dbg(tas_priv->dev, "cali crc 0x%08x PK tmp_val 0x%08x\n", in tas2781_save_calibration()
633 dev_dbg(tas_priv->dev, "%4ld-%2d-%2d, %2d:%2d:%2d\n", in tas2781_save_calibration()
634 tm->tm_year, tm->tm_mon, tm->tm_mday, in tas2781_save_calibration()
635 tm->tm_hour, tm->tm_min, tm->tm_sec); in tas2781_save_calibration()
638 tas_priv->cali_data.total_sz = 0; in tas2781_save_calibration()
645 struct hda_codec *codec = tas_hda->priv->codec; in tas2781_hda_remove_controls()
647 snd_ctl_remove(codec->card, tas_hda->dsp_prog_ctl); in tas2781_hda_remove_controls()
648 snd_ctl_remove(codec->card, tas_hda->dsp_conf_ctl); in tas2781_hda_remove_controls()
650 for (int i = ARRAY_SIZE(tas_hda->snd_ctls) - 1; i >= 0; i--) in tas2781_hda_remove_controls()
651 snd_ctl_remove(codec->card, tas_hda->snd_ctls[i]); in tas2781_hda_remove_controls()
653 snd_ctl_remove(codec->card, tas_hda->prof_ctl); in tas2781_hda_remove_controls()
659 struct tas2781_hda *tas_hda = dev_get_drvdata(tas_priv->dev); in tasdev_fw_ready()
660 struct hda_codec *codec = tas_priv->codec; in tasdev_fw_ready()
663 pm_runtime_get_sync(tas_priv->dev); in tasdev_fw_ready()
664 mutex_lock(&tas_priv->codec_lock); in tasdev_fw_ready()
670 tas_hda->prof_ctl = snd_ctl_new1(&tas2781_prof_ctrl, tas_priv); in tasdev_fw_ready()
671 ret = snd_ctl_add(codec->card, tas_hda->prof_ctl); in tasdev_fw_ready()
673 dev_err(tas_priv->dev, in tasdev_fw_ready()
680 tas_hda->snd_ctls[i] = snd_ctl_new1(&tas2781_snd_controls[i], in tasdev_fw_ready()
682 ret = snd_ctl_add(codec->card, tas_hda->snd_ctls[i]); in tasdev_fw_ready()
684 dev_err(tas_priv->dev, in tasdev_fw_ready()
693 tas_priv->fw_state = TASDEVICE_DSP_FW_PENDING; in tasdev_fw_ready()
694 if (tas_priv->speaker_id != NULL) { in tasdev_fw_ready()
696 spk_id = gpiod_get_value(tas_priv->speaker_id); in tasdev_fw_ready()
699 dev_dbg(tas_priv->dev, "Wrong spk_id = %d\n", spk_id); in tasdev_fw_ready()
702 snprintf(tas_priv->coef_binaryname, in tasdev_fw_ready()
703 sizeof(tas_priv->coef_binaryname), in tasdev_fw_ready()
705 lower_16_bits(codec->core.subsystem_id), in tasdev_fw_ready()
708 snprintf(tas_priv->coef_binaryname, in tasdev_fw_ready()
709 sizeof(tas_priv->coef_binaryname), in tasdev_fw_ready()
711 lower_16_bits(codec->core.subsystem_id)); in tasdev_fw_ready()
715 dev_err(tas_priv->dev, "dspfw load %s error\n", in tasdev_fw_ready()
716 tas_priv->coef_binaryname); in tasdev_fw_ready()
717 tas_priv->fw_state = TASDEVICE_DSP_FW_FAIL; in tasdev_fw_ready()
721 tas_hda->dsp_prog_ctl = snd_ctl_new1(&tas2781_dsp_prog_ctrl, in tasdev_fw_ready()
723 ret = snd_ctl_add(codec->card, tas_hda->dsp_prog_ctl); in tasdev_fw_ready()
725 dev_err(tas_priv->dev, in tasdev_fw_ready()
731 tas_hda->dsp_conf_ctl = snd_ctl_new1(&tas2781_dsp_conf_ctrl, in tasdev_fw_ready()
733 ret = snd_ctl_add(codec->card, tas_hda->dsp_conf_ctl); in tasdev_fw_ready()
735 dev_err(tas_priv->dev, in tasdev_fw_ready()
741 tas_priv->fw_state = TASDEVICE_DSP_FW_ALL_OK; in tasdev_fw_ready()
743 if (tas_priv->fmw->nr_programs > 0) in tasdev_fw_ready()
744 tas_priv->cur_prog = 0; in tasdev_fw_ready()
745 if (tas_priv->fmw->nr_configurations > 0) in tasdev_fw_ready()
746 tas_priv->cur_conf = 0; in tasdev_fw_ready()
753 tasdevice_tuning_switch(tas_hda->priv, 0); in tasdev_fw_ready()
754 tas_hda->priv->playback_started = true; in tasdev_fw_ready()
757 mutex_unlock(&tas_hda->priv->codec_lock); in tasdev_fw_ready()
760 pm_runtime_mark_last_busy(tas_hda->dev); in tasdev_fw_ready()
761 pm_runtime_put_autosuspend(tas_hda->dev); in tasdev_fw_ready()
774 comp = hda_component_from_index(parent, tas_hda->priv->index); in tas2781_hda_bind()
776 return -EINVAL; in tas2781_hda_bind()
778 if (comp->dev) in tas2781_hda_bind()
779 return -EBUSY; in tas2781_hda_bind()
781 codec = parent->codec; in tas2781_hda_bind()
782 subid = codec->core.subsystem_id >> 16; in tas2781_hda_bind()
786 tas_hda->priv->catlog_id = LENOVO; in tas2781_hda_bind()
789 tas_hda->priv->catlog_id = OTHERS; in tas2781_hda_bind()
795 comp->dev = dev; in tas2781_hda_bind()
797 strscpy(comp->name, dev_name(dev), sizeof(comp->name)); in tas2781_hda_bind()
799 ret = tascodec_init(tas_hda->priv, codec, THIS_MODULE, tasdev_fw_ready); in tas2781_hda_bind()
801 comp->playback_hook = tas2781_hda_playback_hook; in tas2781_hda_bind()
816 comp = hda_component_from_index(parent, tas_hda->priv->index); in tas2781_hda_unbind()
817 if (comp && (comp->dev == dev)) { in tas2781_hda_unbind()
818 comp->dev = NULL; in tas2781_hda_unbind()
819 memset(comp->name, 0, sizeof(comp->name)); in tas2781_hda_unbind()
820 comp->playback_hook = NULL; in tas2781_hda_unbind()
825 tasdevice_config_info_remove(tas_hda->priv); in tas2781_hda_unbind()
826 tasdevice_dsp_remove(tas_hda->priv); in tas2781_hda_unbind()
828 tas_hda->priv->fw_state = TASDEVICE_DSP_FW_PENDING; in tas2781_hda_unbind()
840 component_del(tas_hda->dev, &tas2781_hda_comp_ops); in tas2781_hda_remove()
842 pm_runtime_get_sync(tas_hda->dev); in tas2781_hda_remove()
843 pm_runtime_disable(tas_hda->dev); in tas2781_hda_remove()
845 pm_runtime_put_noidle(tas_hda->dev); in tas2781_hda_remove()
847 tasdevice_remove(tas_hda->priv); in tas2781_hda_remove()
857 tas_hda = devm_kzalloc(&clt->dev, sizeof(*tas_hda), GFP_KERNEL); in tas2781_hda_i2c_probe()
859 return -ENOMEM; in tas2781_hda_i2c_probe()
861 dev_set_drvdata(&clt->dev, tas_hda); in tas2781_hda_i2c_probe()
862 tas_hda->dev = &clt->dev; in tas2781_hda_i2c_probe()
864 tas_hda->priv = tasdevice_kzalloc(clt); in tas2781_hda_i2c_probe()
865 if (!tas_hda->priv) in tas2781_hda_i2c_probe()
866 return -ENOMEM; in tas2781_hda_i2c_probe()
868 if (strstr(dev_name(&clt->dev), "TIAS2781")) { in tas2781_hda_i2c_probe()
870 tas_hda->priv->save_calibration = tas2781_save_calibration; in tas2781_hda_i2c_probe()
871 tas_hda->priv->apply_calibration = tas2781_apply_calib; in tas2781_hda_i2c_probe()
872 tas_hda->priv->global_addr = TAS2781_GLOBAL_ADDR; in tas2781_hda_i2c_probe()
873 } else if (strstr(dev_name(&clt->dev), "INT8866")) { in tas2781_hda_i2c_probe()
875 tas_hda->priv->save_calibration = tas2563_save_calibration; in tas2781_hda_i2c_probe()
876 tas_hda->priv->apply_calibration = tas2563_apply_calib; in tas2781_hda_i2c_probe()
877 tas_hda->priv->global_addr = TAS2563_GLOBAL_ADDR; in tas2781_hda_i2c_probe()
879 return -ENODEV; in tas2781_hda_i2c_probe()
881 tas_hda->priv->irq = clt->irq; in tas2781_hda_i2c_probe()
882 ret = tas2781_read_acpi(tas_hda->priv, device_name); in tas2781_hda_i2c_probe()
884 return dev_err_probe(tas_hda->dev, ret, in tas2781_hda_i2c_probe()
887 ret = tasdevice_init(tas_hda->priv); in tas2781_hda_i2c_probe()
891 pm_runtime_set_autosuspend_delay(tas_hda->dev, 3000); in tas2781_hda_i2c_probe()
892 pm_runtime_use_autosuspend(tas_hda->dev); in tas2781_hda_i2c_probe()
893 pm_runtime_mark_last_busy(tas_hda->dev); in tas2781_hda_i2c_probe()
894 pm_runtime_set_active(tas_hda->dev); in tas2781_hda_i2c_probe()
895 pm_runtime_enable(tas_hda->dev); in tas2781_hda_i2c_probe()
897 tasdevice_reset(tas_hda->priv); in tas2781_hda_i2c_probe()
899 ret = component_add(tas_hda->dev, &tas2781_hda_comp_ops); in tas2781_hda_i2c_probe()
901 dev_err(tas_hda->dev, "Register component failed: %d\n", ret); in tas2781_hda_i2c_probe()
902 pm_runtime_disable(tas_hda->dev); in tas2781_hda_i2c_probe()
907 tas2781_hda_remove(&clt->dev); in tas2781_hda_i2c_probe()
913 tas2781_hda_remove(&clt->dev); in tas2781_hda_i2c_remove()
920 dev_dbg(tas_hda->dev, "Runtime Suspend\n"); in tas2781_runtime_suspend()
922 mutex_lock(&tas_hda->priv->codec_lock); in tas2781_runtime_suspend()
927 if (tas_hda->priv->playback_started) { in tas2781_runtime_suspend()
928 tasdevice_tuning_switch(tas_hda->priv, 1); in tas2781_runtime_suspend()
929 tas_hda->priv->playback_started = false; in tas2781_runtime_suspend()
932 mutex_unlock(&tas_hda->priv->codec_lock); in tas2781_runtime_suspend()
941 dev_dbg(tas_hda->dev, "Runtime Resume\n"); in tas2781_runtime_resume()
943 mutex_lock(&tas_hda->priv->codec_lock); in tas2781_runtime_resume()
945 tasdevice_prmg_load(tas_hda->priv, tas_hda->priv->cur_prog); in tas2781_runtime_resume()
950 tasdevice_apply_calibration(tas_hda->priv); in tas2781_runtime_resume()
952 mutex_unlock(&tas_hda->priv->codec_lock); in tas2781_runtime_resume()
961 dev_dbg(tas_hda->priv->dev, "System Suspend\n"); in tas2781_system_suspend()
963 mutex_lock(&tas_hda->priv->codec_lock); in tas2781_system_suspend()
966 if (tas_hda->priv->playback_started) in tas2781_system_suspend()
967 tasdevice_tuning_switch(tas_hda->priv, 1); in tas2781_system_suspend()
969 mutex_unlock(&tas_hda->priv->codec_lock); in tas2781_system_suspend()
983 dev_dbg(tas_hda->priv->dev, "System Resume\n"); in tas2781_system_resume()
985 mutex_lock(&tas_hda->priv->codec_lock); in tas2781_system_resume()
987 for (i = 0; i < tas_hda->priv->ndev; i++) { in tas2781_system_resume()
988 tas_hda->priv->tasdevice[i].cur_book = -1; in tas2781_system_resume()
989 tas_hda->priv->tasdevice[i].cur_prog = -1; in tas2781_system_resume()
990 tas_hda->priv->tasdevice[i].cur_conf = -1; in tas2781_system_resume()
992 tasdevice_reset(tas_hda->priv); in tas2781_system_resume()
993 tasdevice_prmg_load(tas_hda->priv, tas_hda->priv->cur_prog); in tas2781_system_resume()
998 tasdevice_apply_calibration(tas_hda->priv); in tas2781_system_resume()
1000 if (tas_hda->priv->playback_started) in tas2781_system_resume()
1001 tasdevice_tuning_switch(tas_hda->priv, 0); in tas2781_system_resume()
1003 mutex_unlock(&tas_hda->priv->codec_lock); in tas2781_system_resume()
1014 { "tas2781-hda" },
1027 .name = "tas2781-hda",
1038 MODULE_AUTHOR("Shenghao Ding, TI, <shenghao-[email protected]>");