• Pierre-Louis Bossart's avatar
    soundwire: intel: add pm_runtime support · ebf878ed
    Pierre-Louis Bossart authored
    Add basic hooks in DAI .startup and .shutdown callbacks.
    
    The SoundWire IP should be powered between those two calls. The power
    dependencies between SoundWire and DSP are handled with the
    parent/child relationship, before the SoundWire master device becomes
    active the parent device will become active and power-up the shared
    rails.
    
    For now the strategy is to rely on complete enumeration when the
    device becomes active, so the code is a copy/paste of the sequence for
    system suspend/resume. In future patches, the strategy will optionally
    be to rely on clock stop if the enumeration time is prohibitive or
    when the devices connected to a link can signal a wake.
    
    A module parameter is added to make integration of new Slave devices
    easier, to e.g. keep the device active or prevent clock-stop.
    
    Note that we need to we have to disable runtime pm before device
    unregister, otherwise we will see "Failed to power up link: -11" error
    on module remove test.
    Signed-off-by: default avatarPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
    Signed-off-by: default avatarBard Liao <yung-chuan.liao@linux.intel.com>
    Link: https://lore.kernel.org/r/20200817152923.3259-2-yung-chuan.liao@linux.intel.comSigned-off-by: default avatarVinod Koul <vkoul@kernel.org>
    ebf878ed
intel.c 38.3 KB