soundwire: stream: sdw_stream_add_ functions can be called multiple times
authorPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Wed, 26 Jan 2022 01:17:14 +0000 (09:17 +0800)
committerVinod Koul <vkoul@kernel.org>
Fri, 11 Feb 2022 06:47:55 +0000 (12:17 +0530)
commitf3016b891c8c6f11434eab5b92a0bbc21c1dfb6e
tree1b027964c30d19ad2e7c88d07c675ef035e1d1c8
parent5e1df5431f5b68f178c016e7015fb244e9510370
soundwire: stream: sdw_stream_add_ functions can be called multiple times

The sdw_stream_add_slave/master() functions are called from the
.hw_params stage. We need to make sure the functions can be called
multiple times.

In this version, we assume that only 'audio' parameters provide in the
hw_params() can change. If the number of ports could change
dynamically depending on the stream configuration (number of channels,
etc), we would need to free-up all the stream resources and reallocate
them.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://lore.kernel.org/r/20220126011715.28204-19-yung-chuan.liao@linux.intel.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
drivers/soundwire/stream.c