Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp11445636ybi; Thu, 25 Jul 2019 16:44:53 -0700 (PDT) X-Google-Smtp-Source: APXvYqxklUqfDcmCIikj+TAF8tjnwKPZpxl71zKn7HAGT3OkDOQbfVIh82DNKX29FNe5GxQD+Ro0 X-Received: by 2002:a17:90a:7787:: with SMTP id v7mr95369993pjk.143.1564098293445; Thu, 25 Jul 2019 16:44:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564098293; cv=none; d=google.com; s=arc-20160816; b=GDB8PhjjoXCOjH3fc2RkCE6JGTq5uO8vCXhqiIMGK62UW3orf9Ik8urLm1qKtpSknV h6d2RK+QRSLAPOvSqmNTrNJw6kPjTEEpCw3g9nSTfSYtILbBmLIF5wdYrDdjVTuplMsu eB2556Weq1RGGtisVA4PZm+ui0Cte9C1L5BQCWuL1lp7qjjnHAZ+LsSrgrxRCxtMhBtG NbKq8mGnqKZOfEGRg2sE9xD5Wsz5peU/MPQ3cezqjEjBdAM42pQZlJmesSc95nwssnud Nowmeow6lzecjx2xyCyn3d48YoJWFz1Lq5JBQusBHpXa90axb1bC8E484ZGEVoOisrsz O3Ww== 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=5XOrmnqwDnUIJbZ7gDlrfbF1gK7tjJCBrtm5oF31n+U=; b=EyCidraYqxYTyle1HEgBwfCBpkRv4a2pZL9F0G5t03+xvHaUdYjFu/eg5oeS2BwqO9 /OCtYq96AJZ5Esd0OEEyOosibdhqeTM83fu0JZbNIoiOFKOYQmeqG9Rlra5bRANCl7o7 0CuDQpkHKyt1364dw9wRV1NEOYVexupoUFLLlaR/uIcQJYAaaTddeU06yKAPVAxhutB7 vdLYsfQticX+Megnq1lUXcj7qhD2RZPuM2NsSactEeUlsu6THAdrZXj0VmQpgH0WdEMq AzCcg7z3rgOroMiQvNJ5W/1GlQaCVzO7MTffJQJ0qDjsQu9emDSroHQX5pwlxUAZWSgx IxBw== 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 y22si16728212plp.192.2019.07.25.16.44.38; Thu, 25 Jul 2019 16:44:53 -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 S1727598AbfGYXl5 (ORCPT + 99 others); Thu, 25 Jul 2019 19:41:57 -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 S1727579AbfGYXlz (ORCPT ); Thu, 25 Jul 2019 19:41:55 -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:55 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,308,1559545200"; d="scan'208";a="369874850" 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:53 -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 35/40] soundwire: intel: export helper to exit reset Date: Thu, 25 Jul 2019 18:40:27 -0500 Message-Id: <20190725234032.21152-36-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 Signed-off-by: Pierre-Louis Bossart --- drivers/soundwire/cadence_master.c | 9 +++++++-- drivers/soundwire/cadence_master.h | 1 + drivers/soundwire/intel.c | 4 ++++ 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/drivers/soundwire/cadence_master.c b/drivers/soundwire/cadence_master.c index 4a189e487830..f486fe15fb46 100644 --- a/drivers/soundwire/cadence_master.c +++ b/drivers/soundwire/cadence_master.c @@ -780,7 +780,11 @@ EXPORT_SYMBOL(sdw_cdns_thread); * init routines */ -static int do_reset(struct sdw_cdns *cdns) +/** + * sdw_cdns_exit_reset() - Program reset parameters and start bus operations + * @cdns: Cadence instance + */ +int sdw_cdns_exit_reset(struct sdw_cdns *cdns) { int ret; @@ -804,6 +808,7 @@ static int do_reset(struct sdw_cdns *cdns) return ret; } +EXPORT_SYMBOL(sdw_cdns_exit_reset); /** * sdw_cdns_enable_interrupt() - Enable SDW interrupts and update config @@ -839,7 +844,7 @@ int sdw_cdns_enable_interrupt(struct sdw_cdns *cdns) cdns_writel(cdns, CDNS_MCP_INTMASK, mask); - return do_reset(cdns); + return 0; } EXPORT_SYMBOL(sdw_cdns_enable_interrupt); diff --git a/drivers/soundwire/cadence_master.h b/drivers/soundwire/cadence_master.h index de97bc22acb7..2b551f9226f3 100644 --- a/drivers/soundwire/cadence_master.h +++ b/drivers/soundwire/cadence_master.h @@ -161,6 +161,7 @@ irqreturn_t sdw_cdns_thread(int irq, void *dev_id); int sdw_cdns_init(struct sdw_cdns *cdns); int sdw_cdns_pdi_init(struct sdw_cdns *cdns, struct sdw_cdns_stream_config config); +int sdw_cdns_exit_reset(struct sdw_cdns *cdns); int sdw_cdns_enable_interrupt(struct sdw_cdns *cdns); void sdw_cdns_debugfs_init(struct sdw_cdns *cdns, struct dentry *root); diff --git a/drivers/soundwire/intel.c b/drivers/soundwire/intel.c index a976480d6f36..9ebe38e4d979 100644 --- a/drivers/soundwire/intel.c +++ b/drivers/soundwire/intel.c @@ -1112,6 +1112,8 @@ static int intel_probe(struct platform_device *pdev) ret = sdw_cdns_enable_interrupt(&sdw->cdns); + ret = sdw_cdns_exit_reset(&sdw->cdns); + /* Register DAIs */ ret = intel_register_dai(sdw); if (ret) { @@ -1199,6 +1201,8 @@ static int intel_resume(struct device *dev) sdw_cdns_enable_interrupt(&sdw->cdns); + ret = sdw_cdns_exit_reset(&sdw->cdns); + return ret; } -- 2.20.1