Lines Matching full:codec

16 static int hda_codec_create_dais(struct hda_codec *codec, int pcm_count,  in hda_codec_create_dais()  argument
19 struct device *dev = &codec->core.dev; in hda_codec_create_dais()
28 pcm = list_first_entry(&codec->pcm_list_head, struct hda_pcm, list); in hda_codec_create_dais()
81 static int hda_codec_register_dais(struct hda_codec *codec, struct snd_soc_component *component) in hda_codec_register_dais() argument
88 if (list_empty(&codec->pcm_list_head)) in hda_codec_register_dais()
90 list_for_each_entry(pcm, &codec->pcm_list_head, list) in hda_codec_register_dais()
93 ret = hda_codec_create_dais(codec, pcm_count, &drvs); in hda_codec_register_dais()
99 list_for_each_entry(pcm, &codec->pcm_list_head, list) { in hda_codec_register_dais()
122 static void hda_codec_unregister_dais(struct hda_codec *codec, in hda_codec_unregister_dais() argument
131 list_for_each_entry(pcm, &codec->pcm_list_head, list) { in hda_codec_unregister_dais()
144 int hda_codec_probe_complete(struct hda_codec *codec) in hda_codec_probe_complete() argument
146 struct hdac_device *hdev = &codec->core; in hda_codec_probe_complete()
150 ret = snd_hda_codec_build_controls(codec); in hda_codec_probe_complete()
159 snd_hda_codec_set_power_save(codec, 2000); in hda_codec_probe_complete()
160 snd_hda_codec_register(codec); in hda_codec_probe_complete()
170 /* Expects codec with usage_count=1 and status=suspended */
173 struct hda_codec *codec = dev_to_hda_codec(component->dev); in hda_codec_probe() local
174 struct hdac_device *hdev = &codec->core; in hda_codec_probe()
192 if (hda_codec_is_display(codec)) in hda_codec_probe()
196 ret = snd_hda_codec_device_new(codec->bus, component->card->snd_card, hdev->addr, codec, in hda_codec_probe()
199 dev_err(&hdev->dev, "create hda codec failed: %d\n", ret); in hda_codec_probe()
203 ret = snd_hda_codec_set_name(codec, codec->preset->name); in hda_codec_probe()
205 dev_err(&hdev->dev, "name failed %s\n", codec->preset->name); in hda_codec_probe()
209 ret = snd_hdac_regmap_init(&codec->core); in hda_codec_probe()
215 patch = (hda_codec_patch_t)codec->preset->driver_data; in hda_codec_probe()
222 ret = patch(codec); in hda_codec_probe()
228 ret = snd_hda_codec_parse_pcms(codec); in hda_codec_probe()
234 ret = hda_codec_register_dais(codec, component); in hda_codec_probe()
240 if (!hda_codec_is_display(codec)) { in hda_codec_probe()
241 ret = hda_codec_probe_complete(codec); in hda_codec_probe()
246 codec->core.lazy_cache = true; in hda_codec_probe()
251 hda_codec_unregister_dais(codec, component); in hda_codec_probe()
253 if (codec->patch_ops.free) in hda_codec_probe()
254 codec->patch_ops.free(codec); in hda_codec_probe()
256 snd_hda_codec_cleanup_for_unbind(codec); in hda_codec_probe()
258 if (hda_codec_is_display(codec)) in hda_codec_probe()
268 /* Leaves codec with usage_count=1 and status=suspended */
271 struct hda_codec *codec = dev_to_hda_codec(component->dev); in hda_codec_remove() local
272 struct hdac_device *hdev = &codec->core; in hda_codec_remove()
275 bool was_registered = codec->core.registered; in hda_codec_remove()
280 hda_codec_unregister_dais(codec, component); in hda_codec_remove()
282 if (codec->patch_ops.free) in hda_codec_remove()
283 codec->patch_ops.free(codec); in hda_codec_remove()
285 snd_hda_codec_cleanup_for_unbind(codec); in hda_codec_remove()
290 if (hda_codec_is_display(codec)) in hda_codec_remove()
312 {"AIF1TX", NULL, "Codec Input Pin1"},
313 {"AIF2TX", NULL, "Codec Input Pin2"},
314 {"AIF3TX", NULL, "Codec Input Pin3"},
316 {"Codec Output Pin1", NULL, "AIF1RX"},
317 {"Codec Output Pin2", NULL, "AIF2RX"},
318 {"Codec Output Pin3", NULL, "AIF3RX"},
323 SND_SOC_DAPM_AIF_IN("AIF1RX", "Analog Codec Playback", 0, SND_SOC_NOPM, 0, 0),
324 SND_SOC_DAPM_AIF_IN("AIF2RX", "Digital Codec Playback", 0, SND_SOC_NOPM, 0, 0),
325 SND_SOC_DAPM_AIF_IN("AIF3RX", "Alt Analog Codec Playback", 0, SND_SOC_NOPM, 0, 0),
326 SND_SOC_DAPM_AIF_OUT("AIF1TX", "Analog Codec Capture", 0, SND_SOC_NOPM, 0, 0),
327 SND_SOC_DAPM_AIF_OUT("AIF2TX", "Digital Codec Capture", 0, SND_SOC_NOPM, 0, 0),
328 SND_SOC_DAPM_AIF_OUT("AIF3TX", "Alt Analog Codec Capture", 0, SND_SOC_NOPM, 0, 0),
331 SND_SOC_DAPM_INPUT("Codec Input Pin1"),
332 SND_SOC_DAPM_INPUT("Codec Input Pin2"),
333 SND_SOC_DAPM_INPUT("Codec Input Pin3"),
336 SND_SOC_DAPM_OUTPUT("Codec Output Pin1"),
337 SND_SOC_DAPM_OUTPUT("Codec Output Pin2"),
338 SND_SOC_DAPM_OUTPUT("Codec Output Pin3"),
343 .name = "codec-probing-DAI",
348 struct hda_codec *codec = dev_to_hda_codec(&hdev->dev); in hda_hdev_attach() local
357 * driver's lifetime is directly tied to hda codec one in hda_hdev_attach()
363 if (!hda_codec_is_display(codec)) { in hda_hdev_attach()
375 struct hda_codec *codec = dev_to_hda_codec(&hdev->dev); in hda_hdev_detach() local
377 if (codec->core.registered) in hda_hdev_detach()
378 cancel_delayed_work_sync(&codec->jackpoll_work); in hda_hdev_detach()
391 MODULE_DESCRIPTION("HD-Audio codec driver");