diff options
author | Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> | 2023-05-15 10:10:35 +0300 |
---|---|---|
committer | Vinod Koul <vkoul@kernel.org> | 2023-05-27 13:36:46 +0300 |
commit | 6bac0d8d1b4c2dd0fc90b64451ffb88a206adda0 (patch) | |
tree | 6d09c615ec17142f0dc83ae1fb675b4a47f83d8c /drivers/soundwire/bus.c | |
parent | 7ba18639a9f00eab530b10e417fffccdbeb9418f (diff) | |
download | linux-6bac0d8d1b4c2dd0fc90b64451ffb88a206adda0.tar.xz |
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>
Diffstat (limited to 'drivers/soundwire/bus.c')
-rw-r--r-- | drivers/soundwire/bus.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/soundwire/bus.c b/drivers/soundwire/bus.c index 338f4f0b5d0c..b44f8d0affa6 100644 --- a/drivers/soundwire/bus.c +++ b/drivers/soundwire/bus.c @@ -769,6 +769,9 @@ static int sdw_assign_device_num(struct sdw_slave *slave) /* After xfer of msg, restore dev_num */ slave->dev_num = slave->dev_num_sticky; + if (bus->ops && bus->ops->new_peripheral_assigned) + bus->ops->new_peripheral_assigned(bus, dev_num); + return 0; } |