ASoC: cs35l56: KUnit tests for reading speaker ID from host GPIOs
Add test cases for the spk-id-gpios property used to read an integer
speaker ID value from a set of GPIO inputs.
There is a single parameterized test function,
cs35l56_shared_test_get_speaker_id_from_host_gpio() that does
the following:
- Create a mock GPIO driver to simulate real GPIO inputs.
- Create an array of struct software_node_ref_args to provide the
content of the spk-id-gpios property. Each entry is a reference to
a GPIO on the mock GPIO driver. The GPIO indexes are taken from test
case parameterization.
- Create a software node containing the spk-id-gpios property and set
this as the node of the pseudo codec driver device.
- Call cs35l56_get_speaker_id() and assert that the returned value
matches the expected value defined in the test case parameterization.
Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Link: https://patch.msgid.link/20260304162402.1714759-4-rf@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>