Lines Matching refs:hcp
312 struct hdmi_codec_priv *hcp = snd_soc_component_get_drvdata(component); in hdmi_eld_ctl_get() local
314 memcpy(ucontrol->value.bytes.data, hcp->eld, sizeof(hcp->eld)); in hdmi_eld_ctl_get()
336 static void hdmi_codec_eld_chmap(struct hdmi_codec_priv *hcp) in hdmi_codec_eld_chmap() argument
341 spk_alloc = drm_eld_get_spk_alloc(hcp->eld); in hdmi_codec_eld_chmap()
345 if ((spk_mask & ~(FL | FR)) && hcp->chmap_info->max_channels > 2) in hdmi_codec_eld_chmap()
346 hcp->chmap_info->chmap = hdmi_codec_8ch_chmaps; in hdmi_codec_eld_chmap()
348 hcp->chmap_info->chmap = hdmi_codec_stereo_chmaps; in hdmi_codec_eld_chmap()
351 static int hdmi_codec_get_ch_alloc_table_idx(struct hdmi_codec_priv *hcp, in hdmi_codec_get_ch_alloc_table_idx() argument
359 spk_alloc = drm_eld_get_spk_alloc(hcp->eld); in hdmi_codec_get_ch_alloc_table_idx()
381 struct hdmi_codec_priv *hcp = info->private_data; in hdmi_codec_chmap_ctl_get() local
383 map = info->chmap[hcp->chmap_idx].map; in hdmi_codec_chmap_ctl_get()
386 if (hcp->chmap_idx == HDMI_CODEC_CHMAP_IDX_UNKNOWN) in hdmi_codec_chmap_ctl_get()
398 struct hdmi_codec_priv *hcp = snd_soc_dai_get_drvdata(dai); in hdmi_codec_new_stream() local
401 mutex_lock(&hcp->current_stream_lock); in hdmi_codec_new_stream()
402 if (!hcp->current_stream) { in hdmi_codec_new_stream()
403 hcp->current_stream = substream; in hdmi_codec_new_stream()
404 } else if (hcp->current_stream != substream) { in hdmi_codec_new_stream()
408 mutex_unlock(&hcp->current_stream_lock); in hdmi_codec_new_stream()
416 struct hdmi_codec_priv *hcp = snd_soc_dai_get_drvdata(dai); in hdmi_codec_startup() local
425 if (hcp->hcd.ops->audio_startup) { in hdmi_codec_startup()
426 ret = hcp->hcd.ops->audio_startup(dai->dev->parent, hcp->hcd.data); in hdmi_codec_startup()
428 mutex_lock(&hcp->current_stream_lock); in hdmi_codec_startup()
429 hcp->current_stream = NULL; in hdmi_codec_startup()
430 mutex_unlock(&hcp->current_stream_lock); in hdmi_codec_startup()
435 if (hcp->hcd.ops->get_eld) { in hdmi_codec_startup()
436 ret = hcp->hcd.ops->get_eld(dai->dev->parent, hcp->hcd.data, in hdmi_codec_startup()
437 hcp->eld, sizeof(hcp->eld)); in hdmi_codec_startup()
441 hcp->eld); in hdmi_codec_startup()
446 hdmi_codec_eld_chmap(hcp); in hdmi_codec_startup()
454 struct hdmi_codec_priv *hcp = snd_soc_dai_get_drvdata(dai); in hdmi_codec_shutdown() local
458 WARN_ON(hcp->current_stream != substream); in hdmi_codec_shutdown()
460 hcp->chmap_idx = HDMI_CODEC_CHMAP_IDX_UNKNOWN; in hdmi_codec_shutdown()
461 hcp->hcd.ops->audio_shutdown(dai->dev->parent, hcp->hcd.data); in hdmi_codec_shutdown()
463 mutex_lock(&hcp->current_stream_lock); in hdmi_codec_shutdown()
464 hcp->current_stream = NULL; in hdmi_codec_shutdown()
465 mutex_unlock(&hcp->current_stream_lock); in hdmi_codec_shutdown()
472 struct hdmi_codec_priv *hcp = snd_soc_dai_get_drvdata(dai); in hdmi_codec_hw_params() local
509 idx = hdmi_codec_get_ch_alloc_table_idx(hcp, hp.cea.channels); in hdmi_codec_hw_params()
513 hcp->chmap_idx = HDMI_CODEC_CHMAP_IDX_UNKNOWN; in hdmi_codec_hw_params()
517 hcp->chmap_idx = hdmi_codec_channel_alloc[idx].ca_id; in hdmi_codec_hw_params()
523 return hcp->hcd.ops->hw_params(dai->dev->parent, hcp->hcd.data, in hdmi_codec_hw_params()
524 &hcp->daifmt[dai->id], &hp); in hdmi_codec_hw_params()
530 struct hdmi_codec_priv *hcp = snd_soc_dai_get_drvdata(dai); in hdmi_codec_set_fmt() local
596 hcp->daifmt[dai->id] = cf; in hdmi_codec_set_fmt()
603 struct hdmi_codec_priv *hcp = snd_soc_dai_get_drvdata(dai); in hdmi_codec_digital_mute() local
607 if (hcp->hcd.ops->digital_mute) in hdmi_codec_digital_mute()
608 return hcp->hcd.ops->digital_mute(dai->dev->parent, in hdmi_codec_digital_mute()
609 hcp->hcd.data, mute); in hdmi_codec_digital_mute()
651 struct hdmi_codec_priv *hcp = snd_soc_dai_get_drvdata(dai); in hdmi_codec_pcm_new() local
668 &hcp->chmap_info); in hdmi_codec_pcm_new()
673 hcp->chmap_info->private_data = hcp; in hdmi_codec_pcm_new()
674 hcp->chmap_info->kctl->get = hdmi_codec_chmap_ctl_get; in hdmi_codec_pcm_new()
677 hcp->chmap_info->chmap = hdmi_codec_stereo_chmaps; in hdmi_codec_pcm_new()
678 hcp->chmap_idx = HDMI_CODEC_CHMAP_IDX_UNKNOWN; in hdmi_codec_pcm_new()
735 struct hdmi_codec_priv *hcp = snd_soc_component_get_drvdata(component); in hdmi_of_xlate_dai_id() local
738 if (hcp->hcd.ops->get_dai_id) in hdmi_of_xlate_dai_id()
739 ret = hcp->hcd.ops->get_dai_id(component, endpoint); in hdmi_of_xlate_dai_id()
758 struct hdmi_codec_priv *hcp; in hdmi_codec_probe() local
776 hcp = devm_kzalloc(dev, sizeof(*hcp), GFP_KERNEL); in hdmi_codec_probe()
777 if (!hcp) in hdmi_codec_probe()
780 hcp->hcd = *hcd; in hdmi_codec_probe()
781 mutex_init(&hcp->current_stream_lock); in hdmi_codec_probe()
783 hcp->daidrv = devm_kcalloc(dev, dai_count, sizeof(*hcp->daidrv), in hdmi_codec_probe()
785 if (!hcp->daidrv) in hdmi_codec_probe()
789 hcp->daidrv[i] = hdmi_i2s_dai; in hdmi_codec_probe()
790 hcp->daidrv[i].playback.channels_max = in hdmi_codec_probe()
796 hcp->daidrv[i] = hdmi_spdif_dai; in hdmi_codec_probe()
798 ret = devm_snd_soc_register_component(dev, &hdmi_driver, hcp->daidrv, in hdmi_codec_probe()
806 dev_set_drvdata(dev, hcp); in hdmi_codec_probe()