]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
soundwire: bus: Add internal slave ID and use for IRQs
authorCharles Keepax <ckeepax@opensource.cirrus.com>
Tue, 29 Apr 2025 10:18:08 +0000 (11:18 +0100)
committerVinod Koul <vkoul@kernel.org>
Wed, 14 May 2025 11:42:50 +0000 (12:42 +0100)
commitaab12022b076f0b385b7a9a78e1161bd2df5d1e3
treeba1bb1eae93e1443bd62966cb279ef686ec6208d
parent5b1a2927c4f63878d2c108cebad09358e69caa20
soundwire: bus: Add internal slave ID and use for IRQs

Currently the SoundWire IRQ code uses the dev_num to create an IRQ
mapping for each slave. However, there is an issue there, the dev_num
is only allocated when the slave enumerates on the bus and enumeration
may happen before or after probe of the slave driver. In the case
enumeration happens after probe of the slave driver then the IRQ
mapping will use dev_num before it is set. This could cause multiple
slaves to use zero as their IRQ mapping.

It is very desirable to have the IRQ mapped before the slave probe
is called, so drivers can do resource allocation in probe as normal. To
solve these issues add an internal ID created for each slave when it is
probed and use that for mapping the IRQ.

Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.dev>
Link: https://lore.kernel.org/r/20250429101808.348462-3-ckeepax@opensource.cirrus.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
drivers/soundwire/bus.c
drivers/soundwire/bus_type.c
drivers/soundwire/irq.c
include/linux/soundwire/sdw.h