Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp11445372ybi; Thu, 25 Jul 2019 16:44:34 -0700 (PDT) X-Google-Smtp-Source: APXvYqyMplUv1YmD23t84sF6jjhkX3dEfyPN987gJLbeIuNK6r3njNuNQHkG1G8M5EfIuA4LY/2D X-Received: by 2002:a17:902:7687:: with SMTP id m7mr39501086pll.310.1564098274100; Thu, 25 Jul 2019 16:44:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564098274; cv=none; d=google.com; s=arc-20160816; b=MctVNWdhszJF2GrS74RtySbpqbZU0mhUpOuSeaO7thNjijXSB79jWTz5sKqf2k3obK 5e5/4oEAW7fvDFnkrJvbQMhaSR6kuvIsBrT9+Z2dYvxATYAnr1VZWOl3mDxOgGkBd9Mj HnrKvp4hWKFWTzWVM21pWZ2Apls2Q/CaQIL1Q8Bt4r/71IaobDJpNGQQal9alcq0zsVZ I8EyS+VTnz5XH9efmjdt6afKQVxni+h3H+7of5VzLvZXlwfoGWv7vKQ6OiySlKdzhB2A 13VSak163DsmTu2lLxWPpSn2YvLcbFuv2U4MaCNEaT0bk97P25W3Jn2NgzSivk1tCHM7 LXvQ== 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=8XSge6W/K7M7ZurW1WN3K93cSTOn8UkJ2fxPI3vbMeg=; b=woCS3tIEf6DjMw5vK6uGoLbogZN5Gbp8RqqCJqyFZ+NpH3ZrFr06BWo9O2ABXObTU1 O9GKkVF+FcoZ81asEH1zkXw4+ySxD3awRQn8v/Qy33cmKECL9J7psd1e0QsjfJuIiGX5 f5q5wd3birM7DJSvXAbbwT6pTrel4n918oZF20HQ27LYandv9xATHediBdUPBLfXAaU1 Ts8vlMGGS775dqEpTXSde4NJeKtBTJXPQUW9bixXPxHCkVBrATFeW+APdyiKnOya3pRv gnJsFX/K2ytyyt+bOCLh0a7snzRM7BW5QrSS4NX6kJBcM/2WsDCNvxrUkCffWJz1BEA7 M37A== 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 f7si9176183pgs.210.2019.07.25.16.44.17; Thu, 25 Jul 2019 16:44:34 -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 S1727686AbfGYXmF (ORCPT + 99 others); Thu, 25 Jul 2019 19:42:05 -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 S1727620AbfGYXmA (ORCPT ); Thu, 25 Jul 2019 19:42:00 -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:59 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,308,1559545200"; d="scan'208";a="369874864" 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:58 -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 38/40] soundwire: cadence_master: make clock stop exit configurable on init Date: Thu, 25 Jul 2019 18:40:30 -0500 Message-Id: <20190725234032.21152-39-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 The use of clock stop is not a requirement, the IP can e.g. be completely power gated and not detect any wakes while in s2idle/deep sleep. Signed-off-by: Pierre-Louis Bossart --- drivers/soundwire/cadence_master.c | 15 ++++++++------- drivers/soundwire/cadence_master.h | 2 +- drivers/soundwire/intel.c | 2 +- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/drivers/soundwire/cadence_master.c b/drivers/soundwire/cadence_master.c index 53278aa2436f..4ab6f70d7705 100644 --- a/drivers/soundwire/cadence_master.c +++ b/drivers/soundwire/cadence_master.c @@ -1010,7 +1010,7 @@ static u32 cdns_set_default_frame_shape(int n_rows, int n_cols) * sdw_cdns_init() - Cadence initialization * @cdns: Cadence instance */ -int sdw_cdns_init(struct sdw_cdns *cdns) +int sdw_cdns_init(struct sdw_cdns *cdns, bool clock_stop_exit) { struct sdw_bus *bus = &cdns->bus; struct sdw_master_prop *prop = &bus->prop; @@ -1018,12 +1018,13 @@ int sdw_cdns_init(struct sdw_cdns *cdns) int divider; int ret; - /* Exit clock stop */ - ret = cdns_clear_bit(cdns, CDNS_MCP_CONTROL, - CDNS_MCP_CONTROL_CLK_STOP_CLR); - if (ret < 0) { - dev_err(cdns->dev, "Couldn't exit from clock stop\n"); - return ret; + if (clock_stop_exit) { + ret = cdns_clear_bit(cdns, CDNS_MCP_CONTROL, + CDNS_MCP_CONTROL_CLK_STOP_CLR); + if (ret < 0) { + dev_err(cdns->dev, "Couldn't exit from clock stop\n"); + return ret; + } } /* Set clock divider */ diff --git a/drivers/soundwire/cadence_master.h b/drivers/soundwire/cadence_master.h index 1a0ba36dd78f..091b771b570d 100644 --- a/drivers/soundwire/cadence_master.h +++ b/drivers/soundwire/cadence_master.h @@ -158,7 +158,7 @@ extern struct sdw_master_ops sdw_cdns_master_ops; irqreturn_t sdw_cdns_irq(int irq, void *dev_id); irqreturn_t sdw_cdns_thread(int irq, void *dev_id); -int sdw_cdns_init(struct sdw_cdns *cdns); +int sdw_cdns_init(struct sdw_cdns *cdns, bool clock_stop_exit); int sdw_cdns_pdi_init(struct sdw_cdns *cdns, struct sdw_cdns_stream_config config); int sdw_cdns_exit_reset(struct sdw_cdns *cdns); diff --git a/drivers/soundwire/intel.c b/drivers/soundwire/intel.c index 1192d5775484..db7bf2912767 100644 --- a/drivers/soundwire/intel.c +++ b/drivers/soundwire/intel.c @@ -1043,7 +1043,7 @@ static int intel_init(struct sdw_intel *sdw) intel_link_power_up(sdw); intel_shim_init(sdw); - return sdw_cdns_init(&sdw->cdns); + return sdw_cdns_init(&sdw->cdns, false); } /* -- 2.20.1