dir = SNDRV_PCM_STREAM_PLAYBACK;
stream = &drvs[i].playback; if (!pcm->stream[dir].substreams) {
dev_info(dev, "skipping playback dai for %s\n", pcm->name); goto capture_dais;
}
capture_dais:
dir = SNDRV_PCM_STREAM_CAPTURE;
stream = &drvs[i].capture; if (!pcm->stream[dir].substreams) {
dev_info(dev, "skipping capture dai for %s\n", pcm->name); continue;
}
int hda_codec_probe_complete(struct hda_codec *codec)
{ struct hdac_device *hdev = &codec->core; struct hdac_bus *bus = hdev->bus; int ret;
ret = snd_hda_codec_build_controls(codec); if (ret < 0) {
dev_err(&hdev->dev, "unable to create controls %d\n", ret); return ret;
}
/* Bus suspended codecs as it does not manage their pm */
pm_runtime_set_active(&hdev->dev); /* rpm was forbidden in snd_hda_codec_device_new() */
snd_hda_codec_set_power_save(codec, 2000);
snd_hda_codec_register(codec);
/* Complement pm_runtime_get_sync(bus) in probe */
pm_runtime_put_autosuspend(bus->dev);
/* Don't allow any more runtime suspends */
pm_runtime_forbid(&hdev->dev);
hda_codec_unregister_dais(codec, component);
if (driver->ops->remove)
driver->ops->remove(codec);
snd_hda_codec_cleanup_for_unbind(codec);
pm_runtime_put_noidle(&hdev->dev); /* snd_hdac_device_exit() is only called on bus remove */
pm_runtime_set_suspended(&hdev->dev);
if (hda_codec_is_display(codec))
snd_hdac_display_power(bus, hdev->addr, false);
hlink = snd_hdac_ext_bus_get_hlink_by_addr(bus, hdev->addr); if (hlink)
snd_hdac_ext_bus_link_put(bus, hlink); /* * HDMI card's hda_codec_probe_complete() (see late_probe()) may * not be called due to early error, leaving bus uc unbalanced
*/ if (!was_registered) {
pm_runtime_put_autosuspend(bus->dev);
}
if (hda_codec_is_display(codec) && !hdev->bus->audio_component) {
dev_dbg(&hdev->dev, "no i915, skip registration for 0x%08x\n", hdev->vendor_id); return -ENODEV;
}
comp_drv = devm_kzalloc(&hdev->dev, sizeof(*comp_drv), GFP_KERNEL); if (!comp_drv) return -ENOMEM;
/* * It's save to rely on dev_name() rather than a copy as component * driver's lifetime is directly tied to hda codec one
*/
comp_drv->name = dev_name(&hdev->dev);
comp_drv->probe = hda_codec_probe;
comp_drv->remove = hda_codec_remove;
comp_drv->idle_bias_on = false; if (!hda_codec_is_display(codec)) {
comp_drv->dapm_widgets = hda_dapm_widgets;
comp_drv->num_dapm_widgets = ARRAY_SIZE(hda_dapm_widgets);
comp_drv->dapm_routes = hda_dapm_routes;
comp_drv->num_dapm_routes = ARRAY_SIZE(hda_dapm_routes);
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.