soundwire: intel: move DAI registration and debugfs init earlier
authorPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Mon, 19 Sep 2022 17:57:13 +0000 (01:57 +0800)
committerVinod Koul <vkoul@kernel.org>
Tue, 20 Sep 2022 05:09:23 +0000 (10:39 +0530)
These two steps can and should be done before starting up the clock
and the bus operation. This is a first step before re-grouping
functionality in well-defined callbacks.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://lore.kernel.org/r/20220919175721.354679-4-yung-chuan.liao@linux.intel.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
drivers/soundwire/intel.c

index a6fe91f2d964fb3f61d183fb60a88a5a63f300c6..d7852cc7dd967b4e2ca4b1bf3286d1c56aab9fba 100644 (file)
@@ -1393,6 +1393,15 @@ int intel_link_startup(struct auxiliary_device *auxdev)
 
        intel_pdi_ch_update(sdw);
 
+       /* Register DAIs */
+       ret = intel_register_dai(sdw);
+       if (ret) {
+               dev_err(dev, "DAI registration failed: %d\n", ret);
+               goto err_init;
+       }
+
+       intel_debugfs_init(sdw);
+
        ret = sdw_cdns_enable_interrupt(cdns, true);
        if (ret < 0) {
                dev_err(dev, "cannot enable interrupts\n");
@@ -1428,15 +1437,6 @@ int intel_link_startup(struct auxiliary_device *auxdev)
        sdw_cdns_check_self_clearing_bits(cdns, __func__,
                                          true, INTEL_MASTER_RESET_ITERATIONS);
 
-       /* Register DAIs */
-       ret = intel_register_dai(sdw);
-       if (ret) {
-               dev_err(dev, "DAI registration failed: %d\n", ret);
-               goto err_interrupt;
-       }
-
-       intel_debugfs_init(sdw);
-
        /* Enable runtime PM */
        if (!(link_flags & SDW_INTEL_MASTER_DISABLE_PM_RUNTIME)) {
                pm_runtime_set_autosuspend_delay(dev,