Lines Matching +full:i2c +full:- +full:topology

1 // SPDX-License-Identifier: GPL-2.0-only
2 // Copyright(c) 2018-2020 Intel Corporation.
10 #include <linux/i2c.h>
20 #include <sound/soc-acpi.h>
22 #include "../common/soc-intel-quirks.h"
55 sof_pcm512x_quirk = (unsigned long)id->driver_data; in sof_pcm512x_quirk_cb()
64 DMI_MATCH(DMI_PRODUCT_NAME, "UP-CHT01"),
73 struct sof_card_private *ctx = snd_soc_card_get_drvdata(rtd->card); in sof_hdmi_init()
77 pcm = devm_kzalloc(rtd->card->dev, sizeof(*pcm), GFP_KERNEL); in sof_hdmi_init()
79 return -ENOMEM; in sof_hdmi_init()
82 pcm->device = rtd->dai_link->id; in sof_hdmi_init()
83 pcm->codec_dai = dai; in sof_hdmi_init()
85 list_add_tail(&pcm->head, &ctx->hdmi_pcm_list); in sof_hdmi_init()
92 struct snd_soc_component *codec = asoc_rtd_to_codec(rtd, 0)->component; in sof_pcm512x_codec_init()
105 struct snd_soc_component *codec = asoc_rtd_to_codec(rtd, 0)->component; in aif1_startup()
116 struct snd_soc_component *codec = asoc_rtd_to_codec(rtd, 0)->component; in aif1_shutdown()
143 if (list_empty(&ctx->hdmi_pcm_list)) in sof_card_late_probe()
144 return -EINVAL; in sof_card_late_probe()
146 if (!ctx->idisp_codec) in sof_card_late_probe()
149 pcm = list_first_entry(&ctx->hdmi_pcm_list, struct sof_hdmi_pcm, head); in sof_card_late_probe()
151 return hda_dsp_hdmi_build_controls(card, pcm->codec_dai->component); in sof_card_late_probe()
179 struct snd_soc_card *card = rtd->card; in dmic_init()
182 ret = snd_soc_dapm_new_controls(&card->dapm, dmic_widgets, in dmic_init()
185 dev_err(card->dev, "DMic widget addition failed: %d\n", ret); in dmic_init()
190 ret = snd_soc_dapm_add_routes(&card->dapm, dmic_map, in dmic_init()
194 dev_err(card->dev, "DMic map addition failed: %d\n", ret); in dmic_init()
214 DAILINK_COMP_ARRAY(COMP_CODEC("i2c-104C5122:00", "pcm512x-hifi")));
216 DAILINK_COMP_ARRAY(COMP_CODEC("dmic-codec", "dmic-hifi")));
238 "SSP%d-Codec", ssp_codec); in sof_card_dai_links_create()
259 links[id].cpus->dai_name = devm_kasprintf(dev, GFP_KERNEL, in sof_card_dai_links_create()
260 "ssp%d-port", in sof_card_dai_links_create()
262 if (!links[id].cpus->dai_name) in sof_card_dai_links_create()
265 links[id].cpus->dai_name = devm_kasprintf(dev, GFP_KERNEL, in sof_card_dai_links_create()
268 if (!links[id].cpus->dai_name) in sof_card_dai_links_create()
278 links[id].cpus->dai_name = "DMIC01 Pin"; in sof_card_dai_links_create()
284 links[id + 1].cpus->dai_name = "DMIC16k Pin"; in sof_card_dai_links_create()
319 links[id].cpus->dai_name = devm_kasprintf(dev, GFP_KERNEL, in sof_card_dai_links_create()
321 if (!links[id].cpus->dai_name) in sof_card_dai_links_create()
325 * topology cannot be loaded if codec is missing, so in sof_card_dai_links_create()
329 idisp_components[i - 1].name = "ehdaudio0D2"; in sof_card_dai_links_create()
330 idisp_components[i - 1].dai_name = in sof_card_dai_links_create()
332 "intel-hdmi-hifi%d", i); in sof_card_dai_links_create()
334 idisp_components[i - 1].name = "snd-soc-dummy"; in sof_card_dai_links_create()
335 idisp_components[i - 1].dai_name = "snd-soc-dummy-dai"; in sof_card_dai_links_create()
337 if (!idisp_components[i - 1].dai_name) in sof_card_dai_links_create()
340 links[id].codecs = &idisp_components[i - 1]; in sof_card_dai_links_create()
357 struct snd_soc_acpi_mach *mach = pdev->dev.platform_data; in sof_audio_probe()
363 ctx = devm_kzalloc(&pdev->dev, sizeof(*ctx), GFP_KERNEL); in sof_audio_probe()
365 return -ENOMEM; in sof_audio_probe()
375 if (mach->mach_params.common_hdmi_codec_drv && in sof_audio_probe()
376 (mach->mach_params.codec_mask & IDISP_CODEC_MASK)) in sof_audio_probe()
377 ctx->idisp_codec = true; in sof_audio_probe()
379 /* links are always present in topology */ in sof_audio_probe()
385 dev_dbg(&pdev->dev, "sof_pcm512x_quirk = %lx\n", sof_pcm512x_quirk); in sof_audio_probe()
395 dai_links = sof_card_dai_links_create(&pdev->dev, ssp_codec, in sof_audio_probe()
397 ctx->idisp_codec); in sof_audio_probe()
399 return -ENOMEM; in sof_audio_probe()
403 INIT_LIST_HEAD(&ctx->hdmi_pcm_list); in sof_audio_probe()
405 sof_audio_card_pcm512x.dev = &pdev->dev; in sof_audio_probe()
409 mach->mach_params.platform); in sof_audio_probe()
415 return devm_snd_soc_register_card(&pdev->dev, in sof_audio_probe()
425 if (!strcmp(component->name, pcm512x_component[0].name)) { in sof_pcm512x_remove()
445 MODULE_AUTHOR("Pierre-Louis Bossart");