Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp14747991ybl; Mon, 30 Dec 2019 16:32:35 -0800 (PST) X-Google-Smtp-Source: APXvYqxkHzpHVaCUN0UUSdSmTigSq1hIDQkUH17vJkOelbnJfmnbxwHfQHtHqd6TH5UkZOBCqOQd X-Received: by 2002:a9d:470a:: with SMTP id a10mr21361415otf.370.1577752355091; Mon, 30 Dec 2019 16:32:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1577752355; cv=none; d=google.com; s=arc-20160816; b=t1tKZni+49UgPHT0dAJKQK0oc+kBRo2xNXpnSWFZ08V+Gei6+2FH4w08++6TCvIguG zJTMS0UbeC4djMF6YuUYsZZoMC6/J2JuLlGxVkLVGGTI9HAonQPbKrJjsjukJxk4PsGV bOTbKqMx0j7CI+TGsp2fYT5K9kJ1fOEZUwBm7SF7ZVBx901zN5tVUYFO/YgfktwJZxnN GAKLG+qzlWj/IPRFMiMZT/tUfup9wS6B0GCKnM77XaxPaj9Wvh6nZqr/lkj6hMmgT5KJ wUIZA+gPo+/s+WvCOUenBwBQWDBQrjCKmUuZvzRw6PxFinyu0d9QSvYZFNemvy/L6BT4 +1aA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:date:message-id:in-reply-to:subject:cc:to :from:dkim-signature; bh=ZDYUnPr0Gg6JV6s6BlHlxJDwPuZjkA9HmH+afB8bAb8=; b=zeXF7uEy0cC1mr2BsBe1vCz4r3eRI7B2KVx3y48YYCXrre/5skBfiRAck9kUwqw1rh 0vcKGCFRT/lc5hquI/J2O73BHFZSCYOm6BT+q0pwf5KVQn1CWjflGrxWMHv+QKs5G+yK A4FR6Whr3EBL13o1a/fxgRJAV1ECrrdcs14zWfvFlcoScGUBotrs+6j6zOGYOp2/rnN0 gmiwhQb893KFeXlNOHkI3kQ8dwvHN7BRjz5VBmlJq0qLjzg21j2ARFdYPnmvZ15gxpXr 7NixFb1f8AC30PsMuyejJ11iFZDCOvWpVYAOmFMJRzsg5WDTaxKv5bQNt3ly6GEYujnM NAdg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@sirena.org.uk header.s=20170815-heliosphere header.b=Q1MXQgrl; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j70si22823410oib.219.2019.12.30.16.32.23; Mon, 30 Dec 2019 16:32:35 -0800 (PST) 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; dkim=fail header.i=@sirena.org.uk header.s=20170815-heliosphere header.b=Q1MXQgrl; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727821AbfLaAao (ORCPT + 99 others); Mon, 30 Dec 2019 19:30:44 -0500 Received: from heliosphere.sirena.org.uk ([172.104.155.198]:46254 "EHLO heliosphere.sirena.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727774AbfLaAan (ORCPT ); Mon, 30 Dec 2019 19:30:43 -0500 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=ZDYUnPr0Gg6JV6s6BlHlxJDwPuZjkA9HmH+afB8bAb8=; b=Q1MXQgrlm7ZA lRQvF+27T2PpetxzSLpnIspT0kSy627mcwv1ZDmf3a4+vtPJ79c6tEqZWBOKpLokdY5fDdB43qdJw hTxKnikyP2YOSzzsg8alsEyH/9RbFI/TD/qzXg/kcVUx+dFz3KeNHhFdCxfJI9yEP5QCm7Q48m0FV 7IObA=; Received: from cpc102320-sgyl38-2-0-cust46.18-2.cable.virginm.net ([82.37.168.47] helo=fitzroy.sirena.org.uk) by heliosphere.sirena.org.uk with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1im5Qg-0002nW-53; Tue, 31 Dec 2019 00:30:34 +0000 Received: by fitzroy.sirena.org.uk (Postfix, from userid 1000) id A4429D01A58; Tue, 31 Dec 2019 00:30:33 +0000 (GMT) From: Mark Brown To: Ravulapati Vishnu vardhan rao Cc: Alexander.Deucher@amd.com, alsa-devel@alsa-project.org, broonie@kernel.org, "Cc:"@sirena.org.uk, "Cc:"@sirena.org.uk, Dan Carpenter , djkurtz@google.com, Jaroslav Kysela , Liam@sirena.org.uk, Mark Brown , moderated@sirena.org.uk, open list , Takashi@sirena.org.uk Subject: Applied "ASoC: amd: add ACP3x TDM mode support" to the asoc tree In-Reply-To: <1577540460-21438-4-git-send-email-Vishnuvardhanrao.Ravulapati@amd.com> Message-Id: X-Patchwork-Hint: ignore Date: Tue, 31 Dec 2019 00:30:33 +0000 (GMT) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The patch ASoC: amd: add ACP3x TDM mode support has been applied to the asoc tree at https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-5.6 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 a43ea44ddda94bc6c4dbe257fcbdeecde8cb06f1 Mon Sep 17 00:00:00 2001 From: Ravulapati Vishnu vardhan rao Date: Sat, 28 Dec 2019 19:10:57 +0530 Subject: [PATCH] ASoC: amd: add ACP3x TDM mode support ACP3x I2S (CPU DAI) can act in normal I2S and TDM modes. Added support for TDM mode. Desired mode can be selected from ASoC machine driver. Signed-off-by: Ravulapati Vishnu vardhan rao Link: https://lore.kernel.org/r/1577540460-21438-4-git-send-email-Vishnuvardhanrao.Ravulapati@amd.com Signed-off-by: Mark Brown --- sound/soc/amd/raven/acp3x-i2s.c | 28 ++++++++++++++++++++++------ sound/soc/amd/raven/acp3x.h | 1 + 2 files changed, 23 insertions(+), 6 deletions(-) diff --git a/sound/soc/amd/raven/acp3x-i2s.c b/sound/soc/amd/raven/acp3x-i2s.c index 368e4c855268..d9b287b8396c 100644 --- a/sound/soc/amd/raven/acp3x-i2s.c +++ b/sound/soc/amd/raven/acp3x-i2s.c @@ -42,7 +42,7 @@ static int acp3x_i2s_set_tdm_slot(struct snd_soc_dai *cpu_dai, u32 tx_mask, u32 rx_mask, int slots, int slot_width) { struct i2s_dev_data *adata; - u32 val, reg_val, frmt_val, frm_len; + u32 val, reg_val, frmt_reg, frm_len; u16 slot_len; adata = snd_soc_dai_get_drvdata(cpu_dai); @@ -69,15 +69,31 @@ static int acp3x_i2s_set_tdm_slot(struct snd_soc_dai *cpu_dai, frm_len = FRM_LEN | (slots << 15) | (slot_len << 18); if (adata->substream_type == SNDRV_PCM_STREAM_PLAYBACK) { - reg_val = mmACP_BTTDM_ITER; - frmt_val = mmACP_BTTDM_TXFRMT; + switch (adata->i2s_instance) { + case I2S_BT_INSTANCE: + reg_val = mmACP_BTTDM_ITER; + frmt_reg = mmACP_BTTDM_TXFRMT; + break; + case I2S_SP_INSTANCE: + default: + reg_val = mmACP_I2STDM_ITER; + frmt_reg = mmACP_I2STDM_TXFRMT; + } } else { - reg_val = mmACP_BTTDM_IRER; - frmt_val = mmACP_BTTDM_RXFRMT; + switch (adata->i2s_instance) { + case I2S_BT_INSTANCE: + reg_val = mmACP_BTTDM_IRER; + frmt_reg = mmACP_BTTDM_RXFRMT; + break; + case I2S_SP_INSTANCE: + default: + reg_val = mmACP_I2STDM_IRER; + frmt_reg = mmACP_I2STDM_RXFRMT; + } } val = rv_readl(adata->acp3x_base + reg_val); rv_writel(val | 0x2, adata->acp3x_base + reg_val); - rv_writel(frm_len, adata->acp3x_base + frmt_val); + rv_writel(frm_len, adata->acp3x_base + frmt_reg); adata->tdm_fmt = frm_len; return 0; } diff --git a/sound/soc/amd/raven/acp3x.h b/sound/soc/amd/raven/acp3x.h index a1cdc4e768e2..43213aec7f59 100644 --- a/sound/soc/amd/raven/acp3x.h +++ b/sound/soc/amd/raven/acp3x.h @@ -78,6 +78,7 @@ struct acp3x_platform_info { struct i2s_dev_data { bool tdm_mode; unsigned int i2s_irq; + u16 i2s_instance; u32 tdm_fmt; u32 substream_type; void __iomem *acp3x_base; -- 2.20.1