]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commitdiff
soundwire: intel: add helper for initialization
authorPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Tue, 22 Oct 2019 23:54:46 +0000 (18:54 -0500)
committerVinod Koul <vkoul@kernel.org>
Thu, 24 Oct 2019 11:52:01 +0000 (17:22 +0530)
Move code to helper for reuse in power management routines

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20191022235448.17586-4-pierre-louis.bossart@linux.intel.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
drivers/soundwire/intel.c

index 7b5947840ee614913f91a54fb56a37fac558c34e..cf514cdf195f9d4b7c5a0373cb781187f6ba7ee7 100644 (file)
@@ -897,6 +897,15 @@ static struct sdw_master_ops sdw_intel_ops = {
        .post_bank_switch = intel_post_bank_switch,
 };
 
+static int intel_init(struct sdw_intel *sdw)
+{
+       /* Initialize shim and controller */
+       intel_link_power_up(sdw);
+       intel_shim_init(sdw);
+
+       return sdw_cdns_init(&sdw->cdns);
+}
+
 /*
  * probe and init
  */
@@ -939,11 +948,8 @@ static int intel_probe(struct platform_device *pdev)
                return 0;
        }
 
-       /* Initialize shim and controller */
-       intel_link_power_up(sdw);
-       intel_shim_init(sdw);
-
-       ret = sdw_cdns_init(&sdw->cdns);
+       /* Initialize shim, controller and Cadence IP */
+       ret = intel_init(sdw);
        if (ret)
                goto err_init;