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);
81 static int hda_codec_register_dais(struct hda_codec *codec, struct snd_soc_component *component)
88 if (list_empty(&codec->pcm_list_head))
90 list_for_each_entry(pcm, &codec->pcm_list_head, list)
93 ret = hda_codec_create_dais(codec, pcm_count, &drvs);
99 list_for_each_entry(pcm, &codec->pcm_list_head, list) {
122 static void hda_codec_unregister_dais(struct hda_codec *codec,
131 list_for_each_entry(pcm, &codec->pcm_list_head, list) {
144 int hda_codec_probe_complete(struct hda_codec *codec)
146 struct hdac_device *hdev = &codec->core;
150 ret = snd_hda_codec_build_controls(codec);
159 snd_hda_codec_set_power_save(codec, 2000);
160 snd_hda_codec_register(codec);
170 /* Expects codec with usage_count=1 and status=suspended */
173 struct hda_codec *codec = dev_to_hda_codec(component->dev);
174 struct hdac_device *hdev = &codec->core;
192 if (hda_codec_is_display(codec))
196 ret = snd_hda_codec_device_new(codec->bus, component->card->snd_card, hdev->addr, codec,
199 dev_err(&hdev->dev, "create hda codec failed: %d\n", ret);
203 ret = snd_hda_codec_set_name(codec, codec->preset->name);
205 dev_err(&hdev->dev, "name failed %s\n", codec->preset->name);
209 ret = snd_hdac_regmap_init(&codec->core);
215 patch = (hda_codec_patch_t)codec->preset->driver_data;
222 ret = patch(codec);
228 ret = snd_hda_codec_parse_pcms(codec);
234 ret = hda_codec_register_dais(codec, component);
240 if (!hda_codec_is_display(codec)) {
241 ret = hda_codec_probe_complete(codec);
246 codec->core.lazy_cache = true;
251 hda_codec_unregister_dais(codec, component);
253 if (codec->patch_ops.free)
254 codec->patch_ops.free(codec);
256 snd_hda_codec_cleanup_for_unbind(codec);
258 if (hda_codec_is_display(codec))
268 /* Leaves codec with usage_count=1 and status=suspended */
271 struct hda_codec *codec = dev_to_hda_codec(component->dev);
272 struct hdac_device *hdev = &codec->core;
275 bool was_registered = codec->core.registered;
280 hda_codec_unregister_dais(codec, component);
282 if (codec->patch_ops.free)
283 codec->patch_ops.free(codec);
285 snd_hda_codec_cleanup_for_unbind(codec);
290 if (hda_codec_is_display(codec))
343 .name = "codec-probing-DAI",
348 struct hda_codec *codec = dev_to_hda_codec(&hdev->dev);
357 * driver's lifetime is directly tied to hda codec one
363 if (!hda_codec_is_display(codec)) {
375 struct hda_codec *codec = dev_to_hda_codec(&hdev->dev);
377 if (codec->core.registered)
378 cancel_delayed_work_sync(&codec->jackpoll_work);
391 MODULE_DESCRIPTION("HD-Audio codec driver");