Lines Matching +full:int +full:- +full:map +full:- +full:mask

1 // SPDX-License-Identifier: GPL-2.0-only
4 * Copyright (C) 2015 Texas Instruments Incorporated - https://www.ti.com/
16 #include <sound/hdmi-codec.h>
22 #define HDMI_CODEC_CHMAP_IDX_UNKNOWN -1
53 const int ca_id;
54 unsigned int n_ch;
55 unsigned long mask; member
61 .map = { SNDRV_CHMAP_FL, SNDRV_CHMAP_FR } },
65 /* Channel maps for multi-channel playbacks, up to 8 n_ch */
68 .map = { SNDRV_CHMAP_FL, SNDRV_CHMAP_FR } },
70 .map = { SNDRV_CHMAP_FL, SNDRV_CHMAP_FR, SNDRV_CHMAP_LFE,
73 .map = { SNDRV_CHMAP_FL, SNDRV_CHMAP_FR, SNDRV_CHMAP_NA,
76 .map = { SNDRV_CHMAP_FL, SNDRV_CHMAP_FR, SNDRV_CHMAP_LFE,
79 .map = { SNDRV_CHMAP_FL, SNDRV_CHMAP_FR, SNDRV_CHMAP_NA,
82 .map = { SNDRV_CHMAP_FL, SNDRV_CHMAP_FR, SNDRV_CHMAP_LFE,
85 .map = { SNDRV_CHMAP_FL, SNDRV_CHMAP_FR, SNDRV_CHMAP_NA,
88 .map = { SNDRV_CHMAP_FL, SNDRV_CHMAP_FR, SNDRV_CHMAP_LFE,
91 .map = { SNDRV_CHMAP_FL, SNDRV_CHMAP_FR, SNDRV_CHMAP_NA,
94 .map = { SNDRV_CHMAP_FL, SNDRV_CHMAP_FR, SNDRV_CHMAP_LFE,
97 .map = { SNDRV_CHMAP_FL, SNDRV_CHMAP_FR, SNDRV_CHMAP_NA,
100 .map = { SNDRV_CHMAP_FL, SNDRV_CHMAP_FR, SNDRV_CHMAP_LFE,
103 .map = { SNDRV_CHMAP_FL, SNDRV_CHMAP_FR, SNDRV_CHMAP_NA,
107 .map = { SNDRV_CHMAP_FL, SNDRV_CHMAP_FR, SNDRV_CHMAP_LFE,
111 .map = { SNDRV_CHMAP_FL, SNDRV_CHMAP_FR, SNDRV_CHMAP_NA,
115 .map = { SNDRV_CHMAP_FL, SNDRV_CHMAP_FR, SNDRV_CHMAP_LFE,
119 .map = { SNDRV_CHMAP_FL, SNDRV_CHMAP_FR, SNDRV_CHMAP_NA,
123 .map = { SNDRV_CHMAP_FL, SNDRV_CHMAP_FR, SNDRV_CHMAP_LFE,
127 .map = { SNDRV_CHMAP_FL, SNDRV_CHMAP_FR, SNDRV_CHMAP_NA,
131 .map = { SNDRV_CHMAP_FL, SNDRV_CHMAP_FR, SNDRV_CHMAP_LFE,
135 .map = { SNDRV_CHMAP_FL, SNDRV_CHMAP_FR, SNDRV_CHMAP_NA,
139 .map = { SNDRV_CHMAP_FL, SNDRV_CHMAP_FR, SNDRV_CHMAP_LFE,
143 .map = { SNDRV_CHMAP_FL, SNDRV_CHMAP_FR, SNDRV_CHMAP_NA,
147 .map = { SNDRV_CHMAP_FL, SNDRV_CHMAP_FR, SNDRV_CHMAP_LFE,
151 .map = { SNDRV_CHMAP_FL, SNDRV_CHMAP_FR, SNDRV_CHMAP_NA,
155 .map = { SNDRV_CHMAP_FL, SNDRV_CHMAP_FR, SNDRV_CHMAP_LFE,
159 .map = { SNDRV_CHMAP_FL, SNDRV_CHMAP_FR, SNDRV_CHMAP_NA,
163 .map = { SNDRV_CHMAP_FL, SNDRV_CHMAP_FR, SNDRV_CHMAP_LFE,
167 .map = { SNDRV_CHMAP_FL, SNDRV_CHMAP_FR, SNDRV_CHMAP_NA,
171 .map = { SNDRV_CHMAP_FL, SNDRV_CHMAP_FR, SNDRV_CHMAP_LFE,
175 .map = { SNDRV_CHMAP_FL, SNDRV_CHMAP_FR, SNDRV_CHMAP_NA,
179 .map = { SNDRV_CHMAP_FL, SNDRV_CHMAP_FR, SNDRV_CHMAP_LFE,
194 .mask = FL | FR},
197 .mask = FL | FR | LFE},
200 .mask = FL | FR | FC },
203 .mask = FL | FR | LFE | FC | RL | RR},
206 .mask = FL | FR | RL | RR },
209 .mask = FL | FR | LFE | RL | RR },
212 .mask = FL | FR | FC | RL | RR },
215 .mask = FL | FR | LFE | FC | RL | RR | RC },
218 .mask = FL | FR | LFE | FC | RL | RR | RLC | RRC },
221 .mask = FL | FR | LFE | FC },
223 .mask = FL | FR | RC},
225 .mask = FL | FR | LFE | RC },
227 .mask = FL | FR | FC | RC },
229 .mask = FL | FR | LFE | FC | RC },
231 .mask = FL | FR | RC | RL | RR },
233 .mask = FL | FR | LFE | RL | RR | RC },
235 .mask = FL | FR | FC | RL | RR | RC },
237 .mask = FL | FR | RL | RR | RLC | RRC },
239 .mask = FL | FR | LFE | RL | RR | RLC | RRC },
241 .mask = FL | FR | FC | RL | RR | RLC | RRC },
243 .mask = FL | FR | FLC | FRC },
245 .mask = FL | FR | LFE | FLC | FRC },
247 .mask = FL | FR | FC | FLC | FRC },
249 .mask = FL | FR | LFE | FC | FLC | FRC },
251 .mask = FL | FR | RC | FLC | FRC },
253 .mask = FL | FR | LFE | RC | FLC | FRC },
255 .mask = FL | FR | RC | FC | FLC | FRC },
257 .mask = FL | FR | LFE | RC | FC | FLC | FRC },
259 .mask = FL | FR | RL | RR | FLC | FRC },
261 .mask = FL | FR | LFE | RL | RR | FLC | FRC },
263 .mask = FL | FR | FC | RL | RR | FLC | FRC },
265 .mask = FL | FR | LFE | FC | RL | RR | FLC | FRC },
272 unsigned int chmap_idx;
276 unsigned int jack_status;
290 static int hdmi_eld_ctl_info(struct snd_kcontrol *kcontrol, in hdmi_eld_ctl_info()
293 uinfo->type = SNDRV_CTL_ELEM_TYPE_BYTES; in hdmi_eld_ctl_info()
294 uinfo->count = sizeof_field(struct hdmi_codec_priv, eld); in hdmi_eld_ctl_info()
299 static int hdmi_eld_ctl_get(struct snd_kcontrol *kcontrol, in hdmi_eld_ctl_get()
305 memcpy(ucontrol->value.bytes.data, hcp->eld, sizeof(hcp->eld)); in hdmi_eld_ctl_get()
310 static unsigned long hdmi_codec_spk_mask_from_alloc(int spk_alloc) in hdmi_codec_spk_mask_from_alloc()
312 int i; in hdmi_codec_spk_mask_from_alloc()
332 spk_alloc = drm_eld_get_spk_alloc(hcp->eld); in hdmi_codec_eld_chmap()
336 if ((spk_mask & ~(FL | FR)) && hcp->chmap_info->max_channels > 2) in hdmi_codec_eld_chmap()
337 hcp->chmap_info->chmap = hdmi_codec_8ch_chmaps; in hdmi_codec_eld_chmap()
339 hcp->chmap_info->chmap = hdmi_codec_stereo_chmaps; in hdmi_codec_eld_chmap()
342 static int hdmi_codec_get_ch_alloc_table_idx(struct hdmi_codec_priv *hcp, in hdmi_codec_get_ch_alloc_table_idx()
345 int i; in hdmi_codec_get_ch_alloc_table_idx()
350 spk_alloc = drm_eld_get_spk_alloc(hcp->eld); in hdmi_codec_get_ch_alloc_table_idx()
355 if (!spk_alloc && cap->ca_id == 0) in hdmi_codec_get_ch_alloc_table_idx()
357 if (cap->n_ch != channels) in hdmi_codec_get_ch_alloc_table_idx()
359 if (!(cap->mask == (spk_mask & cap->mask))) in hdmi_codec_get_ch_alloc_table_idx()
364 return -EINVAL; in hdmi_codec_get_ch_alloc_table_idx()
366 static int hdmi_codec_chmap_ctl_get(struct snd_kcontrol *kcontrol, in hdmi_codec_chmap_ctl_get()
369 unsigned const char *map; in hdmi_codec_chmap_ctl_get() local
370 unsigned int i; in hdmi_codec_chmap_ctl_get()
372 struct hdmi_codec_priv *hcp = info->private_data; in hdmi_codec_chmap_ctl_get()
374 map = info->chmap[hcp->chmap_idx].map; in hdmi_codec_chmap_ctl_get()
376 for (i = 0; i < info->max_channels; i++) { in hdmi_codec_chmap_ctl_get()
377 if (hcp->chmap_idx == HDMI_CODEC_CHMAP_IDX_UNKNOWN) in hdmi_codec_chmap_ctl_get()
378 ucontrol->value.integer.value[i] = 0; in hdmi_codec_chmap_ctl_get()
380 ucontrol->value.integer.value[i] = map[i]; in hdmi_codec_chmap_ctl_get()
386 static int hdmi_codec_iec958_info(struct snd_kcontrol *kcontrol, in hdmi_codec_iec958_info()
389 uinfo->type = SNDRV_CTL_ELEM_TYPE_IEC958; in hdmi_codec_iec958_info()
390 uinfo->count = 1; in hdmi_codec_iec958_info()
394 static int hdmi_codec_iec958_default_get(struct snd_kcontrol *kcontrol, in hdmi_codec_iec958_default_get()
400 memcpy(ucontrol->value.iec958.status, hcp->iec_status, in hdmi_codec_iec958_default_get()
401 sizeof(hcp->iec_status)); in hdmi_codec_iec958_default_get()
406 static int hdmi_codec_iec958_default_put(struct snd_kcontrol *kcontrol, in hdmi_codec_iec958_default_put()
412 memcpy(hcp->iec_status, ucontrol->value.iec958.status, in hdmi_codec_iec958_default_put()
413 sizeof(hcp->iec_status)); in hdmi_codec_iec958_default_put()
418 static int hdmi_codec_iec958_mask_get(struct snd_kcontrol *kcontrol, in hdmi_codec_iec958_mask_get()
421 memset(ucontrol->value.iec958.status, 0xff, in hdmi_codec_iec958_mask_get()
427 static int hdmi_codec_startup(struct snd_pcm_substream *substream, in hdmi_codec_startup()
431 bool tx = substream->stream == SNDRV_PCM_STREAM_PLAYBACK; in hdmi_codec_startup()
432 bool has_capture = !hcp->hcd.no_i2s_capture; in hdmi_codec_startup()
433 bool has_playback = !hcp->hcd.no_i2s_playback; in hdmi_codec_startup()
434 int ret = 0; in hdmi_codec_startup()
439 mutex_lock(&hcp->lock); in hdmi_codec_startup()
440 if (hcp->busy) { in hdmi_codec_startup()
441 dev_err(dai->dev, "Only one simultaneous stream supported!\n"); in hdmi_codec_startup()
442 mutex_unlock(&hcp->lock); in hdmi_codec_startup()
443 return -EINVAL; in hdmi_codec_startup()
446 if (hcp->hcd.ops->audio_startup) { in hdmi_codec_startup()
447 ret = hcp->hcd.ops->audio_startup(dai->dev->parent, hcp->hcd.data); in hdmi_codec_startup()
452 if (tx && hcp->hcd.ops->get_eld) { in hdmi_codec_startup()
453 ret = hcp->hcd.ops->get_eld(dai->dev->parent, hcp->hcd.data, in hdmi_codec_startup()
454 hcp->eld, sizeof(hcp->eld)); in hdmi_codec_startup()
458 ret = snd_pcm_hw_constraint_eld(substream->runtime, hcp->eld); in hdmi_codec_startup()
466 hcp->busy = true; in hdmi_codec_startup()
469 mutex_unlock(&hcp->lock); in hdmi_codec_startup()
477 bool tx = substream->stream == SNDRV_PCM_STREAM_PLAYBACK; in hdmi_codec_shutdown()
478 bool has_capture = !hcp->hcd.no_i2s_capture; in hdmi_codec_shutdown()
479 bool has_playback = !hcp->hcd.no_i2s_playback; in hdmi_codec_shutdown()
484 hcp->chmap_idx = HDMI_CODEC_CHMAP_IDX_UNKNOWN; in hdmi_codec_shutdown()
485 hcp->hcd.ops->audio_shutdown(dai->dev->parent, hcp->hcd.data); in hdmi_codec_shutdown()
487 mutex_lock(&hcp->lock); in hdmi_codec_shutdown()
488 hcp->busy = false; in hdmi_codec_shutdown()
489 mutex_unlock(&hcp->lock); in hdmi_codec_shutdown()
492 static int hdmi_codec_fill_codec_params(struct snd_soc_dai *dai, in hdmi_codec_fill_codec_params()
493 unsigned int sample_width, in hdmi_codec_fill_codec_params()
494 unsigned int sample_rate, in hdmi_codec_fill_codec_params()
495 unsigned int channels, in hdmi_codec_fill_codec_params()
499 int idx = HDMI_CODEC_CHMAP_IDX_UNKNOWN; in hdmi_codec_fill_codec_params()
501 bool pcm_audio = !(hcp->iec_status[0] & IEC958_AES0_NONAUDIO); in hdmi_codec_fill_codec_params()
508 dev_err(dai->dev, "Not able to map channels to speakers (%d)\n", in hdmi_codec_fill_codec_params()
510 hcp->chmap_idx = HDMI_CODEC_CHMAP_IDX_UNKNOWN; in hdmi_codec_fill_codec_params()
519 hdmi_audio_infoframe_init(&hp->cea); in hdmi_codec_fill_codec_params()
522 hp->cea.channels = channels; in hdmi_codec_fill_codec_params()
524 hp->cea.channels = 0; in hdmi_codec_fill_codec_params()
526 hp->cea.coding_type = HDMI_AUDIO_CODING_TYPE_STREAM; in hdmi_codec_fill_codec_params()
527 hp->cea.sample_size = HDMI_AUDIO_SAMPLE_SIZE_STREAM; in hdmi_codec_fill_codec_params()
528 hp->cea.sample_frequency = HDMI_AUDIO_SAMPLE_FREQUENCY_STREAM; in hdmi_codec_fill_codec_params()
529 hp->cea.channel_allocation = ca_id; in hdmi_codec_fill_codec_params()
531 hp->sample_width = sample_width; in hdmi_codec_fill_codec_params()
532 hp->sample_rate = sample_rate; in hdmi_codec_fill_codec_params()
533 hp->channels = channels; in hdmi_codec_fill_codec_params()
536 hcp->chmap_idx = ca_id; in hdmi_codec_fill_codec_params()
538 hcp->chmap_idx = HDMI_CODEC_CHMAP_IDX_UNKNOWN; in hdmi_codec_fill_codec_params()
543 static int hdmi_codec_hw_params(struct snd_pcm_substream *substream, in hdmi_codec_hw_params()
557 int ret; in hdmi_codec_hw_params()
559 if (!hcp->hcd.ops->hw_params) in hdmi_codec_hw_params()
562 dev_dbg(dai->dev, "%s() width %d rate %d channels %d\n", __func__, in hdmi_codec_hw_params()
574 memcpy(hp.iec.status, hcp->iec_status, sizeof(hp.iec.status)); in hdmi_codec_hw_params()
578 dev_err(dai->dev, "Creating IEC958 channel status failed %d\n", in hdmi_codec_hw_params()
583 cf->bit_fmt = params_format(params); in hdmi_codec_hw_params()
584 return hcp->hcd.ops->hw_params(dai->dev->parent, hcp->hcd.data, in hdmi_codec_hw_params()
588 static int hdmi_codec_prepare(struct snd_pcm_substream *substream, in hdmi_codec_prepare()
593 struct snd_pcm_runtime *runtime = substream->runtime; in hdmi_codec_prepare()
594 unsigned int channels = runtime->channels; in hdmi_codec_prepare()
595 unsigned int width = snd_pcm_format_width(runtime->format); in hdmi_codec_prepare()
596 unsigned int rate = runtime->rate; in hdmi_codec_prepare()
598 int ret; in hdmi_codec_prepare()
600 if (!hcp->hcd.ops->prepare) in hdmi_codec_prepare()
603 dev_dbg(dai->dev, "%s() width %d rate %d channels %d\n", __func__, in hdmi_codec_prepare()
610 memcpy(hp.iec.status, hcp->iec_status, sizeof(hp.iec.status)); in hdmi_codec_prepare()
614 dev_err(dai->dev, "Creating IEC958 channel status failed %d\n", in hdmi_codec_prepare()
619 cf->bit_fmt = runtime->format; in hdmi_codec_prepare()
620 return hcp->hcd.ops->prepare(dai->dev->parent, hcp->hcd.data, in hdmi_codec_prepare()
624 static int hdmi_codec_i2s_set_fmt(struct snd_soc_dai *dai, in hdmi_codec_i2s_set_fmt()
625 unsigned int fmt) in hdmi_codec_i2s_set_fmt()
634 cf->bit_clk_provider = 1; in hdmi_codec_i2s_set_fmt()
635 cf->frame_clk_provider = 1; in hdmi_codec_i2s_set_fmt()
638 cf->frame_clk_provider = 1; in hdmi_codec_i2s_set_fmt()
641 cf->bit_clk_provider = 1; in hdmi_codec_i2s_set_fmt()
646 return -EINVAL; in hdmi_codec_i2s_set_fmt()
653 cf->frame_clk_inv = 1; in hdmi_codec_i2s_set_fmt()
656 cf->bit_clk_inv = 1; in hdmi_codec_i2s_set_fmt()
659 cf->frame_clk_inv = 1; in hdmi_codec_i2s_set_fmt()
660 cf->bit_clk_inv = 1; in hdmi_codec_i2s_set_fmt()
666 cf->fmt = HDMI_I2S; in hdmi_codec_i2s_set_fmt()
669 cf->fmt = HDMI_DSP_A; in hdmi_codec_i2s_set_fmt()
672 cf->fmt = HDMI_DSP_B; in hdmi_codec_i2s_set_fmt()
675 cf->fmt = HDMI_RIGHT_J; in hdmi_codec_i2s_set_fmt()
678 cf->fmt = HDMI_LEFT_J; in hdmi_codec_i2s_set_fmt()
681 cf->fmt = HDMI_AC97; in hdmi_codec_i2s_set_fmt()
684 dev_err(dai->dev, "Invalid DAI interface format\n"); in hdmi_codec_i2s_set_fmt()
685 return -EINVAL; in hdmi_codec_i2s_set_fmt()
691 static int hdmi_codec_mute(struct snd_soc_dai *dai, int mute, int direction) in hdmi_codec_mute()
701 if (hcp->hcd.ops->mute_stream && in hdmi_codec_mute()
703 !hcp->hcd.ops->no_capture_mute)) in hdmi_codec_mute()
704 return hcp->hcd.ops->mute_stream(dai->dev->parent, in hdmi_codec_mute()
705 hcp->hcd.data, in hdmi_codec_mute()
708 return -ENOTSUPP; in hdmi_codec_mute()
716 * ${LINUX}/drivers/gpu/drm/bridge/synopsys/dw-hdmi-i2s-audio.c
741 * instance allowing the 32-bit formats enables 24-precision with CPU
742 * DAIs that do not support 24-bit formats. If the extra formats cause
754 .name = SNDRV_CTL_NAME_IEC958("", PLAYBACK, MASK),
775 static int hdmi_codec_pcm_new(struct snd_soc_pcm_runtime *rtd, in hdmi_codec_pcm_new()
778 struct snd_soc_dai_driver *drv = dai->driver; in hdmi_codec_pcm_new()
780 unsigned int i; in hdmi_codec_pcm_new()
781 int ret; in hdmi_codec_pcm_new()
783 ret = snd_pcm_add_chmap_ctls(rtd->pcm, SNDRV_PCM_STREAM_PLAYBACK, in hdmi_codec_pcm_new()
784 NULL, drv->playback.channels_max, 0, in hdmi_codec_pcm_new()
785 &hcp->chmap_info); in hdmi_codec_pcm_new()
790 hcp->chmap_info->private_data = hcp; in hdmi_codec_pcm_new()
791 hcp->chmap_info->kctl->get = hdmi_codec_chmap_ctl_get; in hdmi_codec_pcm_new()
794 hcp->chmap_info->chmap = hdmi_codec_stereo_chmaps; in hdmi_codec_pcm_new()
795 hcp->chmap_idx = HDMI_CODEC_CHMAP_IDX_UNKNOWN; in hdmi_codec_pcm_new()
801 kctl = snd_ctl_new1(&hdmi_codec_controls[i], dai->component); in hdmi_codec_pcm_new()
803 return -ENOMEM; in hdmi_codec_pcm_new()
805 kctl->id.device = rtd->pcm->device; in hdmi_codec_pcm_new()
806 ret = snd_ctl_add(rtd->card->snd_card, kctl); in hdmi_codec_pcm_new()
814 static int hdmi_dai_probe(struct snd_soc_dai *dai) in hdmi_dai_probe()
821 .source = dai->driver->playback.stream_name, in hdmi_dai_probe()
824 .sink = dai->driver->capture.stream_name, in hdmi_dai_probe()
828 int ret, i; in hdmi_dai_probe()
830 dapm = snd_soc_component_get_dapm(dai->component); in hdmi_dai_probe()
842 daifmt = devm_kzalloc(dai->dev, sizeof(*daifmt), GFP_KERNEL); in hdmi_dai_probe()
844 return -ENOMEM; in hdmi_dai_probe()
852 unsigned int jack_status) in hdmi_codec_jack_report()
854 if (jack_status != hcp->jack_status) { in hdmi_codec_jack_report()
855 if (hcp->jack) in hdmi_codec_jack_report()
856 snd_soc_jack_report(hcp->jack, jack_status, SND_JACK_LINEOUT); in hdmi_codec_jack_report()
857 hcp->jack_status = jack_status; in hdmi_codec_jack_report()
866 if (hcp->hcd.ops->get_eld) { in plugged_cb()
867 hcp->hcd.ops->get_eld(dev->parent, hcp->hcd.data, in plugged_cb()
868 hcp->eld, sizeof(hcp->eld)); in plugged_cb()
873 memset(hcp->eld, 0, sizeof(hcp->eld)); in plugged_cb()
877 static int hdmi_codec_set_jack(struct snd_soc_component *component, in hdmi_codec_set_jack()
883 if (hcp->hcd.ops->hook_plugged_cb) { in hdmi_codec_set_jack()
884 hcp->jack = jack; in hdmi_codec_set_jack()
890 snd_soc_jack_report(jack, hcp->jack_status, SND_JACK_LINEOUT); in hdmi_codec_set_jack()
895 return -ENOTSUPP; in hdmi_codec_set_jack()
898 static int hdmi_dai_spdif_probe(struct snd_soc_dai *dai) in hdmi_dai_spdif_probe()
901 int ret; in hdmi_dai_spdif_probe()
908 cf->fmt = HDMI_SPDIF; in hdmi_dai_spdif_probe()
936 .name = "i2s-hifi",
958 .name = "spdif-hifi",
977 static int hdmi_of_xlate_dai_id(struct snd_soc_component *component, in hdmi_of_xlate_dai_id()
981 int ret = -ENOTSUPP; /* see snd_soc_get_dai_id() */ in hdmi_of_xlate_dai_id()
983 if (hcp->hcd.ops->get_dai_id) in hdmi_of_xlate_dai_id()
984 ret = hcp->hcd.ops->get_dai_id(component, endpoint); in hdmi_of_xlate_dai_id()
989 static int hdmi_probe(struct snd_soc_component *component) in hdmi_probe()
992 int ret = 0; in hdmi_probe()
994 if (hcp->hcd.ops->hook_plugged_cb) { in hdmi_probe()
995 ret = hcp->hcd.ops->hook_plugged_cb(component->dev->parent, in hdmi_probe()
996 hcp->hcd.data, in hdmi_probe()
998 component->dev); in hdmi_probe()
1008 if (hcp->hcd.ops->hook_plugged_cb) in hdmi_remove()
1009 hcp->hcd.ops->hook_plugged_cb(component->dev->parent, in hdmi_remove()
1010 hcp->hcd.data, NULL, NULL); in hdmi_remove()
1025 static int hdmi_codec_probe(struct platform_device *pdev) in hdmi_codec_probe()
1027 struct hdmi_codec_pdata *hcd = pdev->dev.platform_data; in hdmi_codec_probe()
1029 struct device *dev = &pdev->dev; in hdmi_codec_probe()
1031 int dai_count, i = 0; in hdmi_codec_probe()
1032 int ret; in hdmi_codec_probe()
1036 return -EINVAL; in hdmi_codec_probe()
1039 dai_count = hcd->i2s + hcd->spdif; in hdmi_codec_probe()
1040 if (dai_count < 1 || !hcd->ops || in hdmi_codec_probe()
1041 (!hcd->ops->hw_params && !hcd->ops->prepare) || in hdmi_codec_probe()
1042 !hcd->ops->audio_shutdown) { in hdmi_codec_probe()
1044 return -EINVAL; in hdmi_codec_probe()
1049 return -ENOMEM; in hdmi_codec_probe()
1051 hcp->hcd = *hcd; in hdmi_codec_probe()
1052 mutex_init(&hcp->lock); in hdmi_codec_probe()
1054 ret = snd_pcm_create_iec958_consumer_default(hcp->iec_status, in hdmi_codec_probe()
1055 sizeof(hcp->iec_status)); in hdmi_codec_probe()
1061 return -ENOMEM; in hdmi_codec_probe()
1063 if (hcd->i2s) { in hdmi_codec_probe()
1065 daidrv[i].playback.channels_max = hcd->max_i2s_channels; in hdmi_codec_probe()
1066 if (hcd->no_i2s_playback) in hdmi_codec_probe()
1069 if (hcd->no_i2s_capture) in hdmi_codec_probe()
1075 if (hcd->spdif) { in hdmi_codec_probe()
1077 if (hcd->no_spdif_playback) in hdmi_codec_probe()
1080 if (hcd->no_spdif_capture) in hdmi_codec_probe()