]> www.infradead.org Git - users/hch/misc.git/commitdiff
ASoC: Intel: avs: Allow i2s test and non-test boards to coexist
authorCezary Rojewski <cezary.rojewski@intel.com>
Wed, 27 Aug 2025 14:22:29 +0000 (16:22 +0200)
committerMark Brown <broonie@kernel.org>
Thu, 28 Aug 2025 10:29:11 +0000 (12:29 +0200)
The i2s_test card serves debug purpose and is not probed by default.
Currently i2s_test and non-i2s_test sound cards exclude each other. To
increase the test coverage, allow both board types to be probed
simultaneously and share the available SSP port pool.

As 'i2s_test' module parameter is empty by default and requires manual
input from user to activate, there is no impact for standard production
scenarios.

Reviewed-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Message-ID: <20250827142229.869139-6-cezary.rojewski@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/intel/avs/board_selection.c

index 8539ad3d97c45c4ed1423ba4bde69d2ede909176..52e6266a7cb86f9f7b6fbd66b26a081357497661 100644 (file)
@@ -507,6 +507,9 @@ static int avs_register_i2s_test_boards(struct avs_dev *adev)
        unsigned long tdm_slots;
        u32 *array, num_elems;
 
+       if (!i2s_test)
+               return 0;
+
        ret = parse_int_array(i2s_test, strlen(i2s_test), (int **)&array);
        if (ret) {
                dev_err(adev->dev, "failed to parse i2s_test parameter\n");
@@ -560,9 +563,6 @@ static int avs_register_i2s_boards(struct avs_dev *adev)
                return 0;
        }
 
-       if (i2s_test)
-               return avs_register_i2s_test_boards(adev);
-
        machs = avs_get_i2s_machines(adev);
        if (!machs) {
                dev_dbg(adev->dev, "no I2S endpoints supported\n");
@@ -649,6 +649,10 @@ int avs_register_all_boards(struct avs_dev *adev)
                dev_warn(adev->dev, "enumerate DMIC endpoints failed: %d\n",
                         ret);
 
+       ret = avs_register_i2s_test_boards(adev);
+       if (ret)
+               dev_dbg(adev->dev, "enumerate I2S TEST endpoints failed: %d\n", ret);
+
        ret = avs_register_i2s_boards(adev);
        if (ret < 0)
                dev_warn(adev->dev, "enumerate I2S endpoints failed: %d\n",