Skip to content
  • Tvrtko Ursulin's avatar
    lib/igt_pm: Find HDA device when attempting to enable runtime PM · b29101e5
    Tvrtko Ursulin authored
    
    
    HDA audio device can be present at various PCI paths on different systems
    which the existing code did not account for.
    
    Furthermore the failure to enable runtime PM was silent leaving callers
    in the dark.
    
    Improve it by auto-locating the PCI path and logging a warning when
    something is not as expected.
    
    v2:
     * If there is no audio hw/driver there is no failure.
    
    v3:
     * Comment.
     * Skip non-symlinks.
     * Free path on failure and restore.
     * Simplify with asprintf. (Chris Wilson)
    
    v4:
     * Find snd_hda_intel instance tied with an Intel device.
    
    v5:
     * Fix memory leak and silence Valgrind warning.
    
    v6:
     * Fix error out logic.
    
    Signed-off-by: default avatarTvrtko Ursulin <tvrtko.ursulin@intel.com>
    Reviewed-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
    b29101e5