• Sanyog Kale's avatar
    soundwire: Add support to lock across bus instances · 0c4a1049
    Sanyog Kale authored
    Currently, the stream concept is limited to single Master and one
    or more Codecs.
    
    This patch extends the concept to support multiple Master(s)
    sharing the same reference clock and synchronized in the hardware.
    Modify sdw_stream_runtime to support a list of sdw_master_runtime
    for the same. The existing reference to a single m_rt is removed
    in the next patch.
    
    Typically to lock, one would acquire a global lock and then lock
    bus instances. In this case, the caller framework(ASoC DPCM)
    guarantees that stream operations on a card are always serialized.
    So, there is no race condition and hence no need for global lock.
    
    Bus lock(s) are acquired to reconfigure the bus while the stream
    is set-up.
    So, we add sdw_acquire_bus_lock()/sdw_release_bus_lock() APIs which
    are used only to reconfigure the bus.
    Signed-off-by: default avatarSanyog Kale <sanyog.r.kale@intel.com>
    Signed-off-by: default avatarShreyas NC <shreyas.nc@intel.com>
    Acked-by: default avatarPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
    Signed-off-by: default avatarVinod Koul <vkoul@kernel.org>
    0c4a1049
bus.h 3.68 KB