diff options
| author | Srinivas Kandagatla <srinivas.kandagatla@oss.qualcomm.com> | 2026-09-25 17:10:44 +0100 |
|---|---|---|
| committer | Mark Brown <broonie@kernel.org> | 2026-09-29 12:50:03 +0100 |
| commit | a60f1ac41fe0a2ea83f57ce252caf6f08ae48d62 (patch) | |
| tree | 246ff1a5dbba23c63e010c99b3f4cd88fb70f2c3 /include | |
| parent | 0985313a2a9d2e84d6a6b1041c88b5c57ee46dfa (diff) | |
| download | linux-a60f1ac41fe0a2ea83f57ce252caf6f08ae48d62.tar.gz linux-a60f1ac41fe0a2ea83f57ce252caf6f08ae48d62.zip | |
ASoC: SDCA: expose class SoundWire probe/remove as library
Split the internal class_sdw_probe/class_sdw_remove functions into
caller-friendly library helpers:
sdca_class_probe(sdw, drv)
sdca_class_remove(drv)
The class_sdw_probe/class_sdw_remove callbacks of the built-in
class_sdw_driver are now thin wrappers that allocate a bare
sdca_class_drv, stash it in drvdata, and defer to the exported
helpers.
The exported sdca_class_probe() takes a caller-owned struct
sdca_class_drv * so codec-specific SoundWire drivers can embed the
class state in their own priv struct, own dev_set_drvdata() themselves,
and avoid a second allocation. No functional change for the built-in
driver.
This lays the groundwork for codec-specific SDCA SoundWire drivers
that want to compose the class-side probe with their own quirks; the
next patches add the class_ops mechanism on top.
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@oss.qualcomm.com>
Reviewed-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://patch.msgid.link/20260925161049.758913-4-srinivas.kandagatla@oss.qualcomm.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'include')
| -rw-r--r-- | include/sound/sdca_class.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/include/sound/sdca_class.h b/include/sound/sdca_class.h index 8a6a34a8dd4c..890c2dbd88a2 100644 --- a/include/sound/sdca_class.h +++ b/include/sound/sdca_class.h @@ -32,6 +32,10 @@ struct sdca_class_drv { struct work_struct boot_work; }; +/* Library helpers used by codec-specific SDCA SoundWire drivers. */ +int sdca_class_probe(struct sdw_slave *sdw, struct sdca_class_drv *drv); +void sdca_class_remove(struct sdca_class_drv *drv); + /* * PM helpers. Codec drivers embed sdca_class_drv in their own priv, * own dev_set_drvdata(), and compose these into their own dev_pm_ops: |
