Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp11444993ybi; Thu, 25 Jul 2019 16:43:59 -0700 (PDT) X-Google-Smtp-Source: APXvYqxgG9+zc3lrbI/TImroO0QKW4/14UlRD8ujVNdWHc6M9XnVSpp5qULOoBAbBm+FC5NT2s0P X-Received: by 2002:aa7:84d4:: with SMTP id x20mr18937558pfn.60.1564098239417; Thu, 25 Jul 2019 16:43:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564098239; cv=none; d=google.com; s=arc-20160816; b=BSUbqzpgbfsGBgJOXvudqRnL+0ZMeUJ7xxATPiyxnSQ9jNAqB8oqmcq+QtWpbg3Jve fjNs0DQSDBvkqxSLPIu1IKK6k3Svx0wBDJhfJRK7qHcQvmoa+Ti+KB5y7nm6V20HMRen ZR15oyOx1/UL1NSo+8eq9utJ0K1IVItgVtx4x2gqwhsLWeYBi4PCcEr8v0CP5C4XUszw wt5Gqa+8vW5DINA2ByiXfBB/q+mCTrKHygTDt105/CGl2Rknkhqk18qv+EyaMD8Oif5w 5xzL9b0CHsM0Ma/HNa6OC2QzyKF5Rs1WS9yJBA8dtYNsLF+ywhxhdYZxhHon9owkSG7q wRxA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=FF8HkJItA5mpFYNkUhxdBJk/JecRq6V9KwUQFakZxDg=; b=Fw+Kzq7CmeYG2mUF13xJZVeF8HHVfFt1dJTvzv8Oksg1qrGJrM1a9bYaFGm2PIh0SV cPtyDpZd6+H8fWfEEmYqfIlb8tWSwbPd1bm61FCvw5ZQptg0iiFdHyQNJY6P31r9/L13 1EvUqj5sXrKKdvd9R+dGFQ+DcDPUJrDPT2ZXsqDPDhXX985GMngsc/4MfqahecZA4Y0n laQuSEFbEA2s227ZgIcusxwOJzJLuNz3JsoUtDlUo3oYMbM820uRE3kt4wRanjWnUw9p B+djCFQrh9ZKQTiX8jh1UESZfvup6f3G9/mCWpDX2Z35oh0q77V1OwKy+HVWYHn7LIZw c5EQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s24si21446821pgm.327.2019.07.25.16.43.44; Thu, 25 Jul 2019 16:43:59 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727088AbfGYXmf (ORCPT + 99 others); Thu, 25 Jul 2019 19:42:35 -0400 Received: from mga06.intel.com ([134.134.136.31]:51850 "EHLO mga06.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727548AbfGYXlu (ORCPT ); Thu, 25 Jul 2019 19:41:50 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 25 Jul 2019 16:41:50 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,308,1559545200"; d="scan'208";a="369874829" Received: from amrutaku-mobl1.amr.corp.intel.com (HELO pbossart-mobl3.intel.com) ([10.255.230.75]) by fmsmga006.fm.intel.com with ESMTP; 25 Jul 2019 16:41:49 -0700 From: Pierre-Louis Bossart To: alsa-devel@alsa-project.org Cc: linux-kernel@vger.kernel.org, tiwai@suse.de, broonie@kernel.org, vkoul@kernel.org, gregkh@linuxfoundation.org, jank@cadence.com, srinivas.kandagatla@linaro.org, slawomir.blauciak@intel.com, Pierre-Louis Bossart , Sanyog Kale Subject: [RFC PATCH 32/40] soundwire: intel: add helper for initialization Date: Thu, 25 Jul 2019 18:40:24 -0500 Message-Id: <20190725234032.21152-33-pierre-louis.bossart@linux.intel.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190725234032.21152-1-pierre-louis.bossart@linux.intel.com> References: <20190725234032.21152-1-pierre-louis.bossart@linux.intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Move code to helper for reuse in power management routines Signed-off-by: Pierre-Louis Bossart --- drivers/soundwire/intel.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/drivers/soundwire/intel.c b/drivers/soundwire/intel.c index c40ab443e723..215dc81cdf73 100644 --- a/drivers/soundwire/intel.c +++ b/drivers/soundwire/intel.c @@ -984,6 +984,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 */ @@ -1026,11 +1035,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; -- 2.20.1