Lines Matching refs:hcp

302 	struct hdmi_codec_priv *hcp = snd_soc_component_get_drvdata(component);  in hdmi_eld_ctl_get()  local
304 memcpy(ucontrol->value.bytes.data, hcp->eld, sizeof(hcp->eld)); in hdmi_eld_ctl_get()
326 static void hdmi_codec_eld_chmap(struct hdmi_codec_priv *hcp) in hdmi_codec_eld_chmap() argument
331 spk_alloc = drm_eld_get_spk_alloc(hcp->eld); in hdmi_codec_eld_chmap()
335 if ((spk_mask & ~(FL | FR)) && hcp->chmap_info->max_channels > 2) in hdmi_codec_eld_chmap()
336 hcp->chmap_info->chmap = hdmi_codec_8ch_chmaps; in hdmi_codec_eld_chmap()
338 hcp->chmap_info->chmap = hdmi_codec_stereo_chmaps; in hdmi_codec_eld_chmap()
341 static int hdmi_codec_get_ch_alloc_table_idx(struct hdmi_codec_priv *hcp, in hdmi_codec_get_ch_alloc_table_idx() argument
349 spk_alloc = drm_eld_get_spk_alloc(hcp->eld); in hdmi_codec_get_ch_alloc_table_idx()
371 struct hdmi_codec_priv *hcp = info->private_data; in hdmi_codec_chmap_ctl_get() local
373 map = info->chmap[hcp->chmap_idx].map; in hdmi_codec_chmap_ctl_get()
376 if (hcp->chmap_idx == HDMI_CODEC_CHMAP_IDX_UNKNOWN) in hdmi_codec_chmap_ctl_get()
397 struct hdmi_codec_priv *hcp = snd_soc_component_get_drvdata(component); in hdmi_codec_iec958_default_get() local
399 memcpy(ucontrol->value.iec958.status, hcp->iec_status, in hdmi_codec_iec958_default_get()
400 sizeof(hcp->iec_status)); in hdmi_codec_iec958_default_get()
409 struct hdmi_codec_priv *hcp = snd_soc_component_get_drvdata(component); in hdmi_codec_iec958_default_put() local
411 memcpy(hcp->iec_status, ucontrol->value.iec958.status, in hdmi_codec_iec958_default_put()
412 sizeof(hcp->iec_status)); in hdmi_codec_iec958_default_put()
429 struct hdmi_codec_priv *hcp = snd_soc_dai_get_drvdata(dai); in hdmi_codec_startup() local
431 bool has_capture = !hcp->hcd.no_i2s_capture; in hdmi_codec_startup()
432 bool has_playback = !hcp->hcd.no_i2s_playback; in hdmi_codec_startup()
438 mutex_lock(&hcp->lock); in hdmi_codec_startup()
439 if (hcp->busy) { in hdmi_codec_startup()
441 mutex_unlock(&hcp->lock); in hdmi_codec_startup()
445 if (hcp->hcd.ops->audio_startup) { in hdmi_codec_startup()
446 ret = hcp->hcd.ops->audio_startup(dai->dev->parent, hcp->hcd.data); in hdmi_codec_startup()
451 if (tx && hcp->hcd.ops->get_eld) { in hdmi_codec_startup()
452 ret = hcp->hcd.ops->get_eld(dai->dev->parent, hcp->hcd.data, in hdmi_codec_startup()
453 hcp->eld, sizeof(hcp->eld)); in hdmi_codec_startup()
457 ret = snd_pcm_hw_constraint_eld(substream->runtime, hcp->eld); in hdmi_codec_startup()
462 hdmi_codec_eld_chmap(hcp); in hdmi_codec_startup()
465 hcp->busy = true; in hdmi_codec_startup()
468 mutex_unlock(&hcp->lock); in hdmi_codec_startup()
475 struct hdmi_codec_priv *hcp = snd_soc_dai_get_drvdata(dai); in hdmi_codec_shutdown() local
477 bool has_capture = !hcp->hcd.no_i2s_capture; in hdmi_codec_shutdown()
478 bool has_playback = !hcp->hcd.no_i2s_playback; in hdmi_codec_shutdown()
483 hcp->chmap_idx = HDMI_CODEC_CHMAP_IDX_UNKNOWN; in hdmi_codec_shutdown()
484 hcp->hcd.ops->audio_shutdown(dai->dev->parent, hcp->hcd.data); in hdmi_codec_shutdown()
486 mutex_lock(&hcp->lock); in hdmi_codec_shutdown()
487 hcp->busy = false; in hdmi_codec_shutdown()
488 mutex_unlock(&hcp->lock); in hdmi_codec_shutdown()
497 struct hdmi_codec_priv *hcp = snd_soc_dai_get_drvdata(dai); in hdmi_codec_fill_codec_params() local
500 bool pcm_audio = !(hcp->iec_status[0] & IEC958_AES0_NONAUDIO); in hdmi_codec_fill_codec_params()
504 idx = hdmi_codec_get_ch_alloc_table_idx(hcp, channels); in hdmi_codec_fill_codec_params()
509 hcp->chmap_idx = HDMI_CODEC_CHMAP_IDX_UNKNOWN; in hdmi_codec_fill_codec_params()
535 hcp->chmap_idx = ca_id; in hdmi_codec_fill_codec_params()
537 hcp->chmap_idx = HDMI_CODEC_CHMAP_IDX_UNKNOWN; in hdmi_codec_fill_codec_params()
546 struct hdmi_codec_priv *hcp = snd_soc_dai_get_drvdata(dai); in hdmi_codec_hw_params() local
558 if (!hcp->hcd.ops->hw_params) in hdmi_codec_hw_params()
573 memcpy(hp.iec.status, hcp->iec_status, sizeof(hp.iec.status)); in hdmi_codec_hw_params()
583 return hcp->hcd.ops->hw_params(dai->dev->parent, hcp->hcd.data, in hdmi_codec_hw_params()
590 struct hdmi_codec_priv *hcp = snd_soc_dai_get_drvdata(dai); in hdmi_codec_prepare() local
599 if (!hcp->hcd.ops->prepare) in hdmi_codec_prepare()
609 memcpy(hp.iec.status, hcp->iec_status, sizeof(hp.iec.status)); in hdmi_codec_prepare()
619 return hcp->hcd.ops->prepare(dai->dev->parent, hcp->hcd.data, in hdmi_codec_prepare()
692 struct hdmi_codec_priv *hcp = snd_soc_dai_get_drvdata(dai); in hdmi_codec_mute() local
700 if (hcp->hcd.ops->mute_stream && in hdmi_codec_mute()
702 !hcp->hcd.ops->no_capture_mute)) in hdmi_codec_mute()
703 return hcp->hcd.ops->mute_stream(dai->dev->parent, in hdmi_codec_mute()
704 hcp->hcd.data, in hdmi_codec_mute()
778 struct hdmi_codec_priv *hcp = snd_soc_dai_get_drvdata(dai); in hdmi_codec_pcm_new() local
784 &hcp->chmap_info); in hdmi_codec_pcm_new()
789 hcp->chmap_info->private_data = hcp; in hdmi_codec_pcm_new()
790 hcp->chmap_info->kctl->get = hdmi_codec_chmap_ctl_get; in hdmi_codec_pcm_new()
793 hcp->chmap_info->chmap = hdmi_codec_stereo_chmaps; in hdmi_codec_pcm_new()
794 hcp->chmap_idx = HDMI_CODEC_CHMAP_IDX_UNKNOWN; in hdmi_codec_pcm_new()
850 static void hdmi_codec_jack_report(struct hdmi_codec_priv *hcp, in hdmi_codec_jack_report() argument
853 if (hcp->jack && jack_status != hcp->jack_status) { in hdmi_codec_jack_report()
854 snd_soc_jack_report(hcp->jack, jack_status, SND_JACK_LINEOUT); in hdmi_codec_jack_report()
855 hcp->jack_status = jack_status; in hdmi_codec_jack_report()
861 struct hdmi_codec_priv *hcp = dev_get_drvdata(dev); in plugged_cb() local
864 if (hcp->hcd.ops->get_eld) { in plugged_cb()
865 hcp->hcd.ops->get_eld(dev->parent, hcp->hcd.data, in plugged_cb()
866 hcp->eld, sizeof(hcp->eld)); in plugged_cb()
868 hdmi_codec_jack_report(hcp, SND_JACK_LINEOUT); in plugged_cb()
870 hdmi_codec_jack_report(hcp, 0); in plugged_cb()
871 memset(hcp->eld, 0, sizeof(hcp->eld)); in plugged_cb()
879 struct hdmi_codec_priv *hcp = snd_soc_component_get_drvdata(component); in hdmi_codec_set_jack() local
882 if (hcp->hcd.ops->hook_plugged_cb) { in hdmi_codec_set_jack()
883 hcp->jack = jack; in hdmi_codec_set_jack()
884 ret = hcp->hcd.ops->hook_plugged_cb(component->dev->parent, in hdmi_codec_set_jack()
885 hcp->hcd.data, in hdmi_codec_set_jack()
889 hcp->jack = NULL; in hdmi_codec_set_jack()
976 struct hdmi_codec_priv *hcp = snd_soc_component_get_drvdata(component); in hdmi_of_xlate_dai_id() local
979 if (hcp->hcd.ops->get_dai_id) in hdmi_of_xlate_dai_id()
980 ret = hcp->hcd.ops->get_dai_id(component, endpoint); in hdmi_of_xlate_dai_id()
987 struct hdmi_codec_priv *hcp = snd_soc_component_get_drvdata(component); in hdmi_remove() local
989 if (hcp->hcd.ops->hook_plugged_cb) in hdmi_remove()
990 hcp->hcd.ops->hook_plugged_cb(component->dev->parent, in hdmi_remove()
991 hcp->hcd.data, NULL, NULL); in hdmi_remove()
1010 struct hdmi_codec_priv *hcp; in hdmi_codec_probe() local
1027 hcp = devm_kzalloc(dev, sizeof(*hcp), GFP_KERNEL); in hdmi_codec_probe()
1028 if (!hcp) in hdmi_codec_probe()
1031 hcp->hcd = *hcd; in hdmi_codec_probe()
1032 mutex_init(&hcp->lock); in hdmi_codec_probe()
1034 ret = snd_pcm_create_iec958_consumer_default(hcp->iec_status, in hdmi_codec_probe()
1035 sizeof(hcp->iec_status)); in hdmi_codec_probe()
1065 dev_set_drvdata(dev, hcp); in hdmi_codec_probe()