Lines Matching defs:codec

16 static int hda_codec_create_dais(struct hda_codec *codec, int pcm_count,
19 struct device *dev = &codec->core.dev;
28 pcm = list_first_entry(&codec->pcm_list_head, struct hda_pcm, list);
83 static int hda_codec_register_dais(struct hda_codec *codec, struct snd_soc_component *component)
90 if (list_empty(&codec->pcm_list_head))
92 list_for_each_entry(pcm, &codec->pcm_list_head, list)
95 ret = hda_codec_create_dais(codec, pcm_count, &drvs);
101 list_for_each_entry(pcm, &codec->pcm_list_head, list) {
124 static void hda_codec_unregister_dais(struct hda_codec *codec,
133 list_for_each_entry(pcm, &codec->pcm_list_head, list) {
146 int hda_codec_probe_complete(struct hda_codec *codec)
148 struct hdac_device *hdev = &codec->core;
152 ret = snd_hda_codec_build_controls(codec);
161 snd_hda_codec_set_power_save(codec, 2000);
162 snd_hda_codec_register(codec);
172 /* Expects codec with usage_count=1 and status=suspended */
175 struct hda_codec *codec = dev_to_hda_codec(component->dev);
176 struct hdac_device *hdev = &codec->core;
194 if (hda_codec_is_display(codec))
198 ret = snd_hda_codec_device_new(codec->bus, component->card->snd_card, hdev->addr, codec,
201 dev_err(&hdev->dev, "codec create failed: %d\n", ret);
205 ret = snd_hda_codec_set_name(codec, codec->preset->name);
207 dev_err(&hdev->dev, "set name: %s failed: %d\n", codec->preset->name, ret);
211 ret = snd_hdac_regmap_init(&codec->core);
217 patch = (hda_codec_patch_t)codec->preset->driver_data;
224 ret = patch(codec);
226 dev_err(&hdev->dev, "codec init failed: %d\n", ret);
230 ret = snd_hda_codec_parse_pcms(codec);
236 ret = hda_codec_register_dais(codec, component);
242 if (!hda_codec_is_display(codec)) {
243 ret = hda_codec_probe_complete(codec);
248 codec->core.lazy_cache = true;
253 hda_codec_unregister_dais(codec, component);
255 if (codec->patch_ops.free)
256 codec->patch_ops.free(codec);
258 snd_hda_codec_cleanup_for_unbind(codec);
260 if (hda_codec_is_display(codec))
270 /* Leaves codec with usage_count=1 and status=suspended */
273 struct hda_codec *codec = dev_to_hda_codec(component->dev);
274 struct hdac_device *hdev = &codec->core;
277 bool was_registered = codec->core.registered;
282 hda_codec_unregister_dais(codec, component);
284 if (codec->patch_ops.free)
285 codec->patch_ops.free(codec);
287 snd_hda_codec_cleanup_for_unbind(codec);
292 if (hda_codec_is_display(codec))
345 .name = "codec-probing-DAI",
350 struct hda_codec *codec = dev_to_hda_codec(&hdev->dev);
353 if (hda_codec_is_display(codec) && !hdev->bus->audio_component) {
364 * driver's lifetime is directly tied to hda codec one
370 if (!hda_codec_is_display(codec)) {
382 struct hda_codec *codec = dev_to_hda_codec(&hdev->dev);
384 if (codec->core.registered)
385 cancel_delayed_work_sync(&codec->jackpoll_work);
398 MODULE_DESCRIPTION("HD-Audio codec driver");