diff options
author | Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> | 2019-10-22 18:54:46 -0500 |
---|---|---|
committer | Vinod Koul <vkoul@kernel.org> | 2019-10-24 17:22:01 +0530 |
commit | dfbe642d1ed9018271962a08602027aeb4f3f525 (patch) | |
tree | e5ce2964fcb008d3979fe4e973bcd35de2d4c774 /drivers | |
parent | 675d4c9aba86cf3345bc61880e2edfd6762ef4ae (diff) | |
download | linux-dfbe642d1ed9018271962a08602027aeb4f3f525.tar.bz2 |
soundwire: intel: add helper for initialization
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>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/soundwire/intel.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/drivers/soundwire/intel.c b/drivers/soundwire/intel.c index 7b5947840ee6..cf514cdf195f 100644 --- a/drivers/soundwire/intel.c +++ b/drivers/soundwire/intel.c @@ -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; |