From patchwork Fri Mar 9 18:03:43 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Brown X-Patchwork-Id: 131198 Delivered-To: patch@linaro.org Received: by 10.46.66.2 with SMTP id p2csp1285795lja; Fri, 9 Mar 2018 10:04:08 -0800 (PST) X-Google-Smtp-Source: AG47ELtuam3b31VSyJ42tAeDKU5gGvfJUSlzDSM+pbir6bhLRCyoPzb74a79cPbvw3J2K+75jXyf X-Received: by 10.28.69.29 with SMTP id s29mr2577576wma.152.1520618648804; Fri, 09 Mar 2018 10:04:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520618648; cv=none; d=google.com; s=arc-20160816; b=ZgI5slEpp/8Fhtz9LjcC027cDC9FmG4b0MqAhm1fLQ1z1EZmCkhG+uDaBGc0opv8is bySfzQAOLhdNU7a61MY5fHuQJ+9T4vSTMrL2ryGr/Ukc1Wi28U5xPJJNAXRW5y4Dti5C acDq5zLTZNEaCRP44OWzOkQHO6zTHm/2PN2tRzTs4GEt7mg8xbX3693WMpmZCWA0DriZ sfocpjP2+yrWDo2FT8ZFvg7dh5JZBuByo+sLA35RB6deFHCwLzlKXmk+f3WOdN5mmLDs kF281dYsbT2ywCbO3a+7BwRQgurpfr+wEVJGD7WqBHOHvJiQyEX0GIEmx40R+TS91lp9 yGug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:cc:date:message-id:in-reply-to:to:from :dkim-signature:delivered-to:arc-authentication-results; bh=JVCVr24YhGaNFf3Js3AIw4xuBMyEEqXKH1EvsIbX0pc=; b=BF9BZhNvWiJxy7Ej660Q3fEPDkyiN8wkxkOFueZJVH6oSCv8rRiyL95nfZdW9SiwRQ 9fGT3jW7bdnP5uGxLCQEQq2TkaHXWA6yNymmS+1UvG91yeZa/IrvFJHHf2Iz18edlEf3 t3ovmbvwHppA1x41PLr1fu+taZ992shdFjoTo/oMF5QZiRy2DVo2/ipQltg58ME0l5Pn xdMtkQStsaaSDlaH2dp78Mm3kpXmeQ1WX2njIkeO4QKIhFoYyOUP9PKG/WvXT7sM81ha PKtdSMoHYcETCdVsSvmSwuHewL/0RFjS6REOSgWmIRshUQz5t8G8qLxDAf/gpzaGb2lb ckxg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@sirena.org.uk header.s=20170815-heliosphere header.b=dAbgOeZf; spf=pass (google.com: domain of alsa-devel-bounces@alsa-project.org designates 77.48.224.243 as permitted sender) smtp.mailfrom=alsa-devel-bounces@alsa-project.org Return-Path: Received: from alsa0.perex.cz (alsa0.perex.cz. [77.48.224.243]) by mx.google.com with ESMTP id k33si758268wrf.11.2018.03.09.10.04.08; Fri, 09 Mar 2018 10:04:08 -0800 (PST) Received-SPF: pass (google.com: domain of alsa-devel-bounces@alsa-project.org designates 77.48.224.243 as permitted sender) client-ip=77.48.224.243; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@sirena.org.uk header.s=20170815-heliosphere header.b=dAbgOeZf; spf=pass (google.com: domain of alsa-devel-bounces@alsa-project.org designates 77.48.224.243 as permitted sender) smtp.mailfrom=alsa-devel-bounces@alsa-project.org Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id AB80C267650; Fri, 9 Mar 2018 19:03:52 +0100 (CET) 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 C7A4F267615; Fri, 9 Mar 2018 19:03:49 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mail1.perex.cz X-Spam-Level: X-Spam-Status: No, score=0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, SPF_PASS, T_RP_MATCHES_RCVD autolearn=disabled version=3.4.0 Received: from heliosphere.sirena.org.uk (heliosphere.sirena.org.uk [172.104.155.198]) by alsa0.perex.cz (Postfix) with ESMTP id 07EB426763C for ; Fri, 9 Mar 2018 19:03:47 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sirena.org.uk; s=20170815-heliosphere; h=Date:Message-Id:In-Reply-To: Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:References: List-Id:List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner: List-Archive; bh=gtz4dM8gX1aLNe3GnVMgmRBf2TRL0iHY1cBb4Bxp7Vo=; b=dAbgOeZfC1NV GsttJCRd+hgaB97WApGHNUR5kmcMLwDJALFd8RpRLqLl+CgQ+giiDmI/DfzBrg4GjF9mhBrQPsgqp MUk2YjQWdp4LNQffnW1qLMTsQWuZvjbvRRVWKXpjqKXlCIWOglxieM/y2Lw8Niz26yI9UPdp6XzKn +UJtQ=; Received: from debutante.sirena.org.uk ([2001:470:1f1d:6b5::3] helo=debutante) by heliosphere.sirena.org.uk with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1euMMq-0008KW-6Q; Fri, 09 Mar 2018 18:03:44 +0000 Received: from broonie by debutante with local (Exim 4.90_1) (envelope-from ) id 1euMMp-00021T-Ld; Fri, 09 Mar 2018 18:03:43 +0000 From: Mark Brown To: Vijendar Mukunda In-Reply-To: <1520610182-13122-1-git-send-email-Vijendar.Mukunda@amd.com> Message-Id: Date: Fri, 09 Mar 2018 18:03:43 +0000 Cc: alsa-devel@alsa-project.org, tiwai@suse.de, lgirdwood@gmail.com, broonie@kernel.org, Alexander.Deucher@amd.com, Akshu.Agrawal@amd.com Subject: [alsa-devel] Applied "ASoC: amd: 16bit resolution support for i2s sp instance" to the asoc tree 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 The patch ASoC: amd: 16bit resolution support for i2s sp instance has been applied to the asoc tree at https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted. You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed. If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced. Please add any relevant lists and maintainers to the CCs when replying to this mail. Thanks, Mark >From a37d48e32303d535bdfd554c57952ce31f428b3a Mon Sep 17 00:00:00 2001 From: Vijendar Mukunda Date: Fri, 9 Mar 2018 21:13:02 +0530 Subject: [PATCH] ASoC: amd: 16bit resolution support for i2s sp instance Moved 16bit resolution condition check for stoney platform to acp_hw_params.Depending upon substream required register value need to be programmed rather than enabling 16bit resolution support all time in acp init. Signed-off-by: Vijendar Mukunda Signed-off-by: Mark Brown --- sound/soc/amd/acp-pcm-dma.c | 16 +++++++++------- sound/soc/amd/acp.h | 2 ++ 2 files changed, 11 insertions(+), 7 deletions(-) -- 2.16.2 _______________________________________________ Alsa-devel mailing list Alsa-devel@alsa-project.org http://mailman.alsa-project.org/mailman/listinfo/alsa-devel diff --git a/sound/soc/amd/acp-pcm-dma.c b/sound/soc/amd/acp-pcm-dma.c index c33a512283a4..9fb356db3ab2 100644 --- a/sound/soc/amd/acp-pcm-dma.c +++ b/sound/soc/amd/acp-pcm-dma.c @@ -579,13 +579,6 @@ static int acp_init(void __iomem *acp_mmio, u32 asic_type) for (bank = 1; bank < 48; bank++) acp_set_sram_bank_state(acp_mmio, bank, false); } - - /* Stoney supports 16bit resolution */ - if (asic_type == CHIP_STONEY) { - val = acp_reg_read(acp_mmio, mmACP_I2S_16BIT_RESOLUTION_EN); - val |= 0x03; - acp_reg_write(val, acp_mmio, mmACP_I2S_16BIT_RESOLUTION_EN); - } return 0; } @@ -774,6 +767,7 @@ static int acp_dma_hw_params(struct snd_pcm_substream *substream, { int status; uint64_t size; + u32 val = 0; struct page *pg; struct snd_pcm_runtime *runtime; struct audio_substream_data *rtd; @@ -786,6 +780,14 @@ static int acp_dma_hw_params(struct snd_pcm_substream *substream, if (WARN_ON(!rtd)) return -EINVAL; + if (adata->asic_type == CHIP_STONEY) { + val = acp_reg_read(adata->acp_mmio, mmACP_I2S_16BIT_RESOLUTION_EN); + if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + val |= ACP_I2S_SP_16BIT_RESOLUTION_EN; + else + val |= ACP_I2S_MIC_16BIT_RESOLUTION_EN; + acp_reg_write(val, adata->acp_mmio, mmACP_I2S_16BIT_RESOLUTION_EN); + } size = params_buffer_bytes(params); status = snd_pcm_lib_malloc_pages(substream, size); if (status < 0) diff --git a/sound/soc/amd/acp.h b/sound/soc/amd/acp.h index ecb458935d1e..9293f179f272 100644 --- a/sound/soc/amd/acp.h +++ b/sound/soc/amd/acp.h @@ -70,6 +70,8 @@ #define CAPTURE_END_DMA_DESCR_CH15 7 #define mmACP_I2S_16BIT_RESOLUTION_EN 0x5209 +#define ACP_I2S_MIC_16BIT_RESOLUTION_EN 0x01 +#define ACP_I2S_SP_16BIT_RESOLUTION_EN 0x02 enum acp_dma_priority_level { /* 0x0 Specifies the DMA channel is given normal priority */ ACP_DMA_PRIORITY_LEVEL_NORMAL = 0x0,