soundwire: bus: add new manager callback to deal with peripheral enumeration
authorPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Mon, 15 May 2023 07:10:35 +0000 (15:10 +0800)
committerVinod Koul <vkoul@kernel.org>
Sat, 27 May 2023 10:36:46 +0000 (16:06 +0530)
commit6bac0d8d1b4c2dd0fc90b64451ffb88a206adda0
tree6d09c615ec17142f0dc83ae1fb675b4a47f83d8c
parent7ba18639a9f00eab530b10e417fffccdbeb9418f
soundwire: bus: add new manager callback to deal with peripheral enumeration

When a peripheral reports as ATTACHED, the manager may need to follow
a programming sequence, e.g. to assign DMA resources and/or assign a
command queue for that peripheral.

This patch adds an optional callback, which will be invoked every time
the peripheral attaches. This might be overkill in some scenarios, and
one could argue that this should be invoked only on the first
attachment. The bus does not however track this first attachment with
any existing state-mirroring variable, and using dev_num_sticky would
not work across suspend-resume cycles.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://lore.kernel.org/r/20230515071042.2038-20-yung-chuan.liao@linux.intel.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
drivers/soundwire/bus.c
include/linux/soundwire/sdw.h