From patchwork Thu May 28 13:45:14 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Fitzgerald X-Patchwork-Id: 6498791 Return-Path: X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 1E680C0020 for ; Thu, 28 May 2015 13:47:34 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 251D32043C for ; Thu, 28 May 2015 13:47:33 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id 8901220627 for ; Thu, 28 May 2015 13:47:30 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id DDA0326607D; Thu, 28 May 2015 15:47:28 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,NO_DNS_FOR_FROM, UNPARSEABLE_RELAY autolearn=no version=3.3.1 Received: from alsa0.perex.cz (localhost [IPv6:::1]) by alsa0.perex.cz (Postfix) with ESMTP id C2B6A265FED; Thu, 28 May 2015 15:47:20 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id 90565265E06; Thu, 28 May 2015 15:47:19 +0200 (CEST) Received: from opensource.wolfsonmicro.com (opensource.wolfsonmicro.com [80.75.67.52]) by alsa0.perex.cz (Postfix) with ESMTP id 7123B265E06 for ; Thu, 28 May 2015 15:47:12 +0200 (CEST) Received: from localhost.localdomain (unknown [87.246.78.26]) by opensource.wolfsonmicro.com (Postfix) with ESMTPSA id C9B313B40FD; Thu, 28 May 2015 14:47:11 +0100 (BST) From: Richard Fitzgerald To: broonie@kernel.org Date: Thu, 28 May 2015 14:45:14 +0100 Message-Id: <1432820714-31850-1-git-send-email-rf@opensource.wolfsonmicro.com> X-Mailer: git-send-email 1.7.2.5 Cc: alsa-devel@alsa-project.org, patches@opensource.wolfsonmicro.com, linux-kernel@vger.kernel.org Subject: [alsa-devel] [PATCH] ASoC: wm_adsp: Dump DSP_SCRATCH1 on DSP shutdown X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP The DSP_SCRATCH1 register is used by firmwares to hold diagnostic information. Include this in the shutdown message - it can be useful for debugging. Signed-off-by: Richard Fitzgerald --- sound/soc/codecs/wm_adsp.c | 14 +++++++++++++- 1 files changed, 13 insertions(+), 1 deletions(-) diff --git a/sound/soc/codecs/wm_adsp.c b/sound/soc/codecs/wm_adsp.c index f6642c1..9b7c03c 100644 --- a/sound/soc/codecs/wm_adsp.c +++ b/sound/soc/codecs/wm_adsp.c @@ -121,6 +121,11 @@ #define ADSP2_WDMA_CONFIG_2 0x31 #define ADSP2_RDMA_CONFIG_1 0x34 +#define ADSP2_SCRATCH0 0x40 +#define ADSP2_SCRATCH1 0x41 +#define ADSP2_SCRATCH2 0x42 +#define ADSP2_SCRATCH3 0x43 + /* * ADSP2 Control */ @@ -1880,6 +1885,7 @@ int wm_adsp2_event(struct snd_soc_dapm_widget *w, struct wm_adsp *dsp = &dsps[w->shift]; struct wm_adsp_alg_region *alg_region; struct wm_coeff_ctl *ctl; + unsigned int scratch1 = 0xFFFFFFFF; int ret; switch (event) { @@ -1898,6 +1904,12 @@ int wm_adsp2_event(struct snd_soc_dapm_widget *w, break; case SND_SOC_DAPM_PRE_PMD: + /* Capture DSP_SCRATCH1, it can be useful for analysis */ + ret = regmap_read(dsp->regmap, dsp->base + ADSP2_SCRATCH1, + &scratch1); + if (ret) + adsp_err(dsp, "Failed to read SCRATCH1 %d\n", ret); + dsp->running = false; regmap_update_bits(dsp->regmap, dsp->base + ADSP2_CONTROL, @@ -1935,7 +1947,7 @@ int wm_adsp2_event(struct snd_soc_dapm_widget *w, kfree(alg_region); } - adsp_dbg(dsp, "Shutdown complete\n"); + adsp_info(dsp, "Shutdown complete (SCRATCH1:0x%x)\n", scratch1); break; default: