Received: by 2002:a25:b794:0:0:0:0:0 with SMTP id n20csp782581ybh; Sat, 3 Aug 2019 09:40:52 -0700 (PDT) X-Google-Smtp-Source: APXvYqxzsqP7LBiNql9WBlRI3/McdPZB5/yjy6e89jmWVXOYG43WbvG05qwUnvd9vx34Po75/sdH X-Received: by 2002:a17:902:110b:: with SMTP id d11mr142571510pla.213.1564850452076; Sat, 03 Aug 2019 09:40:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564850452; cv=none; d=google.com; s=arc-20160816; b=iZl/b0sCkf99XVVkGq98gvyLNu88Qi96G8GkQn+m2xCoBP4/BzR9EWwXbgmXSCoYqw xFX6lo01PqsWcHJDDL5EtcPNID5Nbgikj/CQUYHvgn3eWclelS6boXU0Izzih1Im78wr QQCbXJi/VT+uFUOKUeYiYFEZc/zdUWNQ0bZJS9mZ1w+vs2Uh29pPematVyFAug27clPU EiA6pRIQTnV4XVMyuCqIW2TIuT4EmlRum98xrx0M0Flqa9F9L/5H/AEhLpZ22QWdTx3N KlDh+rqMjeM1Y2XMKwC+Dc2AMw5scc5HpEAyyo7snLnCAP0pVus7bvzzOF+138asGpiR tM/Q== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=zRKZL7mYw8xQy7rHU0JJJOWlR/F1wopcXy1yFO9dK4M=; b=d2rKJDZM7ZzzuJuO0Ndi0a2XSCOnWU2qbmrqpSB8MPUzGES7VmG5DRj/N4Vd0G+CBv N/jDnGlW0wF1+PXwzyRmhPlf+ow34aPPNN/7Zqlse5bi817xqrDuALFd6RQo163X2snP ErLwUoZgBcMdB33t/WP/2q4XiGNIruw+BH9rWiB7n6aqbDrx6xeonYlz8A0TnjkWAlFg vOzMwMCXXC5aIO7yIXfzjkHdVctNxfS4NtqiVq0fIbkD+KC8HudPaF2fjV5PjMrS17Gr jT1YoTYMXfgeeykqvv6qyUZZZFjHXMt01E83P8n0AfW0EArkZnqDylWES+M+bHCrnrqV aCmw== 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 s189si39197837pgb.272.2019.08.03.09.40.37; Sat, 03 Aug 2019 09:40:52 -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 S2406162AbfHBRoy (ORCPT + 99 others); Fri, 2 Aug 2019 13:44:54 -0400 Received: from mga02.intel.com ([134.134.136.20]:22791 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2406087AbfHBRoy (ORCPT ); Fri, 2 Aug 2019 13:44:54 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 02 Aug 2019 10:44:53 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,339,1559545200"; d="scan'208";a="191893041" Received: from linux.intel.com ([10.54.29.200]) by fmsmga001.fm.intel.com with ESMTP; 02 Aug 2019 10:44:53 -0700 Received: from cwhanson-mobl.amr.corp.intel.com (unknown [10.252.133.191]) by linux.intel.com (Postfix) with ESMTP id 3CE915800BD; Fri, 2 Aug 2019 10:44:52 -0700 (PDT) Subject: Re: [RFC PATCH 35/40] soundwire: intel: export helper to exit reset To: Vinod Koul Cc: alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, tiwai@suse.de, broonie@kernel.org, gregkh@linuxfoundation.org, jank@cadence.com, srinivas.kandagatla@linaro.org, slawomir.blauciak@intel.com, Sanyog Kale References: <20190725234032.21152-1-pierre-louis.bossart@linux.intel.com> <20190725234032.21152-36-pierre-louis.bossart@linux.intel.com> <20190802173115.GE12733@vkoul-mobl.Dlink> From: Pierre-Louis Bossart Message-ID: <0d76e6ed-1ab3-6a9d-b33c-deb248d5cb9d@linux.intel.com> Date: Fri, 2 Aug 2019 12:44:51 -0500 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <20190802173115.GE12733@vkoul-mobl.Dlink> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 8/2/19 12:31 PM, Vinod Koul wrote: > On 25-07-19, 18:40, Pierre-Louis Bossart wrote: > > Here as well I squashed this with earlier patches to fix the init sequence in one shot > >> 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 >