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);
171 /* Expects codec with usage_count=1 and status=suspended */
174 struct hda_codec *codec = dev_to_hda_codec(component->dev);
175 struct hda_codec_driver *driver = hda_codec_to_driver(codec);
176 struct hdac_device *hdev = &codec->core;
193 if (hda_codec_is_display(codec))
197 ret = snd_hda_codec_device_new(codec->bus, component->card->snd_card, hdev->addr, codec,
200 dev_err(&hdev->dev, "codec create failed: %d\n", ret);
204 ret = snd_hda_codec_set_name(codec, codec->preset->name);
206 dev_err(&hdev->dev, "set name: %s failed: %d\n", codec->preset->name, ret);
210 ret = snd_hdac_regmap_init(&codec->core);
221 ret = driver->ops->probe(codec, codec->preset);
223 dev_err(&hdev->dev, "codec init failed: %d\n", ret);
227 ret = snd_hda_codec_parse_pcms(codec);
233 ret = hda_codec_register_dais(codec, component);
239 if (!hda_codec_is_display(codec)) {
240 ret = hda_codec_probe_complete(codec);
245 codec->core.lazy_cache = true;
250 hda_codec_unregister_dais(codec, component);
253 driver->ops->remove(codec);
255 snd_hda_codec_cleanup_for_unbind(codec);
257 if (hda_codec_is_display(codec))
266 /* Leaves codec with usage_count=1 and status=suspended */
269 struct hda_codec *codec = dev_to_hda_codec(component->dev);
270 struct hda_codec_driver *driver = hda_codec_to_driver(codec);
271 struct hdac_device *hdev = &codec->core;
274 bool was_registered = codec->core.registered;
279 hda_codec_unregister_dais(codec, component);
282 driver->ops->remove(codec);
284 snd_hda_codec_cleanup_for_unbind(codec);
289 if (hda_codec_is_display(codec))
341 .name = "codec-probing-DAI",
346 struct hda_codec *codec = dev_to_hda_codec(&hdev->dev);
349 if (hda_codec_is_display(codec) && !hdev->bus->audio_component) {
360 * driver's lifetime is directly tied to hda codec one
366 if (!hda_codec_is_display(codec)) {
378 struct hda_codec *codec = dev_to_hda_codec(&hdev->dev);
380 if (codec->core.registered)
381 cancel_delayed_work_sync(&codec->jackpoll_work);
394 MODULE_DESCRIPTION("HD-Audio codec driver");