diff options
author | Sanyog Kale <sanyog.r.kale@intel.com> | 2018-07-27 14:44:13 +0530 |
---|---|---|
committer | Vinod Koul <vkoul@kernel.org> | 2018-08-27 09:49:48 +0530 |
commit | 0c4a1049cf298721eaec4553d3d5039798086e12 (patch) | |
tree | dba58261d1daf9e002055aa6388b09cd1fdec9e1 /include/linux/soundwire | |
parent | a306a0e4a5326269b6c78d136407f08433ab5ece (diff) | |
download | linux-0c4a1049cf298721eaec4553d3d5039798086e12.tar.gz linux-0c4a1049cf298721eaec4553d3d5039798086e12.tar.bz2 linux-0c4a1049cf298721eaec4553d3d5039798086e12.zip |
soundwire: Add support to lock across bus instances
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: Sanyog Kale <sanyog.r.kale@intel.com>
Signed-off-by: Shreyas NC <shreyas.nc@intel.com>
Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Diffstat (limited to 'include/linux/soundwire')
-rw-r--r-- | include/linux/soundwire/sdw.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/include/linux/soundwire/sdw.h b/include/linux/soundwire/sdw.h index 962971e6a9c7..ccd8dcdf06ab 100644 --- a/include/linux/soundwire/sdw.h +++ b/include/linux/soundwire/sdw.h @@ -769,6 +769,9 @@ struct sdw_stream_params { * @state: Current state of the stream * @type: Stream type PCM or PDM * @m_rt: Master runtime + * @master_list: List of Master runtime(s) in this stream. + * master_list can contain only one m_rt per Master instance + * for a stream */ struct sdw_stream_runtime { char *name; @@ -776,6 +779,7 @@ struct sdw_stream_runtime { enum sdw_stream_state state; enum sdw_stream_type type; struct sdw_master_runtime *m_rt; + struct list_head master_list; }; struct sdw_stream_runtime *sdw_alloc_stream(char *stream_name); |