Lines Matching refs:tas_hda
188 struct tas2781_hda *tas_hda = dev_get_drvdata(dev); in tas2781_hda_playback_hook() local
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()
643 static void tas2781_hda_remove_controls(struct tas2781_hda *tas_hda) in tas2781_hda_remove_controls() argument
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() local
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()
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()
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()
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()
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()
767 struct tas2781_hda *tas_hda = dev_get_drvdata(dev); in tas2781_hda_bind() local
774 comp = hda_component_from_index(parent, tas_hda->priv->index); 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()
799 ret = tascodec_init(tas_hda->priv, codec, THIS_MODULE, tasdev_fw_ready); in tas2781_hda_bind()
812 struct tas2781_hda *tas_hda = dev_get_drvdata(dev); in tas2781_hda_unbind() local
816 comp = hda_component_from_index(parent, tas_hda->priv->index); in tas2781_hda_unbind()
823 tas2781_hda_remove_controls(tas_hda); 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()
838 struct tas2781_hda *tas_hda = dev_get_drvdata(dev); in tas2781_hda_remove() local
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()
852 struct tas2781_hda *tas_hda; in tas2781_hda_i2c_probe() local
857 tas_hda = devm_kzalloc(&clt->dev, sizeof(*tas_hda), GFP_KERNEL); in tas2781_hda_i2c_probe()
858 if (!tas_hda) 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()
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()
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()
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()
918 struct tas2781_hda *tas_hda = dev_get_drvdata(dev); in tas2781_runtime_suspend() local
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()
939 struct tas2781_hda *tas_hda = dev_get_drvdata(dev); in tas2781_runtime_resume() local
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()
959 struct tas2781_hda *tas_hda = dev_get_drvdata(dev); in tas2781_system_suspend() local
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()
980 struct tas2781_hda *tas_hda = dev_get_drvdata(dev); in tas2781_system_resume() local
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()