From patchwork Mon Nov 12 05:34:58 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vijendar Mukunda X-Patchwork-Id: 10678127 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 99F3A14BA for ; Mon, 12 Nov 2018 05:33:04 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8786429E28 for ; Mon, 12 Nov 2018 05:33:04 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 79C7D29E3A; Mon, 12 Nov 2018 05:33:04 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.7 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_INVALID,DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7A38D29E28 for ; Mon, 12 Nov 2018 05:33:03 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 5046D2679BF; Mon, 12 Nov 2018 06:33:02 +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 C465A267A67; Mon, 12 Nov 2018 06:33:00 +0100 (CET) Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-sn1nam02on0044.outbound.protection.outlook.com [104.47.36.44]) by alsa0.perex.cz (Postfix) with ESMTP id C07B92677E4 for ; Mon, 12 Nov 2018 06:32:58 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amdcloud.onmicrosoft.com; s=selector1-amd-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Zr/J4DlQESVu3gvUVbV04lhjVZtlgjS2VLwWFICoKFo=; b=Semk9Wi8axzUVoDIsy5gPIwj4MS8g4xte1XbIhgmXDmg3y3dM+SrIVbwTgEnVsOEF9ZRgnehzkWV9nZXVZM6ZQrLUgBoZDnsc55jR1XMm4a4/ecPCCmvfr5A0mylq5NwbXTwKg9tlOMRzyIHI3/THcts7J5CrEB1xHXJZaGuwCk= Received: from BN6PR12CA0026.namprd12.prod.outlook.com (2603:10b6:405:70::12) by DM3PR12MB0747.namprd12.prod.outlook.com (2a01:111:e400:5984::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1294.26; Mon, 12 Nov 2018 05:32:56 +0000 Received: from CO1NAM03FT004.eop-NAM03.prod.protection.outlook.com (2a01:111:f400:7e48::207) by BN6PR12CA0026.outlook.office365.com (2603:10b6:405:70::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1294.26 via Frontend Transport; Mon, 12 Nov 2018 05:32:55 +0000 Authentication-Results: spf=none (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; suse.com; dkim=none (message not signed) header.d=none;suse.com; dmarc=permerror action=none header.from=amd.com; Received-SPF: None (protection.outlook.com: amd.com does not designate permitted sender hosts) Received: from SATLEXCHOV01.amd.com (165.204.84.17) by CO1NAM03FT004.mail.protection.outlook.com (10.152.80.154) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1339.10 via Frontend Transport; Mon, 12 Nov 2018 05:32:54 +0000 Received: from LinuxHost.amd.com (10.34.1.3) by SATLEXCHOV01.amd.com (10.181.40.71) with Microsoft SMTP Server id 14.3.389.1; Sun, 11 Nov 2018 23:32:52 -0600 From: Vijendar Mukunda To: Date: Mon, 12 Nov 2018 11:04:58 +0530 Message-ID: <1542000903-19020-8-git-send-email-Vijendar.Mukunda@amd.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1542000903-19020-1-git-send-email-Vijendar.Mukunda@amd.com> References: <1542000903-19020-1-git-send-email-Vijendar.Mukunda@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:165.204.84.17; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(346002)(376002)(396003)(136003)(39860400002)(2980300002)(428003)(199004)(189003)(446003)(53416004)(305945005)(109986005)(50466002)(105586002)(106466001)(1671002)(36756003)(48376002)(54906003)(8676002)(14444005)(50226002)(8936002)(81156014)(81166006)(11346002)(16586007)(336012)(26005)(356004)(77096007)(53936002)(316002)(5660300001)(68736007)(4326008)(51416003)(426003)(39060400002)(7696005)(47776003)(104016004)(186003)(76176011)(86362001)(126002)(486006)(2906002)(2616005)(478600001)(476003)(72206003)(97736004)(42413003)(266003)(32563001); DIR:OUT; SFP:1101; SCL:1; SRVR:DM3PR12MB0747; H:SATLEXCHOV01.amd.com; FPR:; SPF:None; LANG:en; PTR:InfoDomainNonexistent; A:1; MX:1; X-Microsoft-Exchange-Diagnostics: 1; CO1NAM03FT004; 1:3h/ULVYuUXzWWkBMfCmHsPnRDMAahabhzTfH99fSWdLr6ql9KWJPFgVBCyTYf1EDaZTrXPmv/4hf0qbuqoP+MzkdOwd16oYrXEs4OMv4s8JaCrVhF5KofWBiLi7xwoZH X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 498ca6b4-a9ad-4e41-f547-08d648604be2 X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(2390040)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(2017052603328)(7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uu3/vUEwYqM+WvOcQ2alOVw67odedCQ=; 20:AKgN/WHBVnYsiG/B8XtGpMC13wq840A1uxJ484dQc/jMnXjcPU56yrPjRyjExJuOpt9wbClCvYY169HuDXyvsXcWMyhCW9Tgq4Iul5c4ulZF6w0EKFv+aZMNtG4VgwU/TKQTC7ManWmwF7ldm8NcRhCC2h9Zb4Kdr5387FrKf9mpFBoQeKm/sWMcGwp1I/KexVilHk770qpRMMmedz2xfGYY88yuw923ylyl22XiPW4CiyqQClcZ0PbrTHWYoqJGqXuBHULfgbHdpSVv7/aCA/kPCaSR0DEXvnTYSjd1PegZD5gba6XyOsB2nuNrlVpKgceNe/bXF07SKxSotMdrkvaapveQhr9RkWJ96WR4ePdlMmCBdjZPLvyYJr5ZpIQF51xg6Flgz4sR5nuYrVX8zATCTbhWPQAZMoKIrek4mowzycGFzuVmAHhOCg4LizLnniJVB28WimJH4ZT/ZTKDV1TgwXF4tFr/UGBWfsJjCFkRtx3P8+2L/16FiGDfmGgP X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(767451399110); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(3231382)(944501410)(52105112)(93006095)(93003095)(10201501046)(3002001)(6055026)(148016)(149066)(150057)(6041310)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(20161123558120)(20161123564045)(201708071742011)(7699051)(76991095); SRVR:DM3PR12MB0747; BCL:0; PCL:0; RULEID:; SRVR:DM3PR12MB0747; X-Microsoft-Exchange-Diagnostics: 1; DM3PR12MB0747; 4:d5WGLjk/kQFVK6YfEsaxIygHIZagBokOZmQ9KKPKAEjOv5J8WBPwPRHW9vXelSAwqKSd1mVqI3OACVitYNWEOlkWyXJxYRn7/iRhuu6yM0VEzWqsjJ3+Jt4o3jSMWUCA90jw2AxVjiHfFgBWjloQrxIzIkzVe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ukKlJAkPukElUDyAXR5GdX0m7kS8k6dL1U1ag9oVx0WXdO5TjiXk8lO+pXgpw7bTToYdcCj8mFEo/ZUCNeN1KZ9YHW1kKiRg4IxfNazmMXlbfvnulVLeKOu42+qbxNTOgBB7mo5SS+wUmfyiZxmniUthHk2QXEfMOM0e5WeU0jNL+sCoVSPpab1G0tgDyc4+VdaDLKwCUiVLF54zQcDkRuvG+mxFVbuY3XaKjrGq00ZC8p7cyJYrtN3+uZgy0mIeLrxMSv2b663GQ==; 5:/rdTqnR6dh0yu1luGpSysKwdwHHIDhbUcHoU7uXDIK5cWp/AyTQY+L2KthL3sWaaR+QktrI2ZO+0LdEnQdsiORJpFeDuiKnBSLMRAEXA+f3r5UU/8AOzJgs2KA8hvT0IYPxpZtV2WMAQ/Cj1bvaJlBvqQ/8Gr3y5HxGdipIaV38=; 7:+ZfU7rNzVO1yEn1nv3xQEiN+ZZrDapyaMmrsYTegmPTfL7efq5iJ1ELEEM0JpddxyuzsCA8QSBDrfyzdbotScrT4BHLeofxahBojvfONnJDma4Uum0UY8nop0276dumlqIXWKzenfo7YquGrDPnt/Q== SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; DM3PR12MB0747; 20:8PEcQkY3d4FoV5NEUZVyZSUSBsixdEKWwgqUCThl5HkvM514s0ej5U110PtAaz3NNdXN233KJjC3bqyRZGvtZtC1zMw1ZAdmv8MeRhIf5ipfFl1Sbb+06cs40Tm1g9+KDO0CUCYAKvVmBQaN5282OYEP4ue/2yFWwYSB3nW/NUQy9t38iWFmR/UpMuztgtNZS6nAIBpADHxqqjF7MMThjnQrgrze48Bz0Z8ywxNymFj3iXZsUg3TavPUaUEhH+9N X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Nov 2018 05:32:54.3447 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 498ca6b4-a9ad-4e41-f547-08d648604be2 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d; Ip=[165.204.84.17]; Helo=[SATLEXCHOV01.amd.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM3PR12MB0747 Cc: "moderated list:SOUND - SOC LAYER / DYNAMIC AUDIO POWER MANAGEM..." , Maruthi Bayyavarapu , open list , Takashi Iwai , Liam Girdwood , Vishnuvardhanrao.Ravulapati@amd.com, Mark Brown , Vijendar Mukunda , Alexander.Deucher@amd.com Subject: [alsa-devel] [PATCH 07/11] ASoC: amd: add acp3x i2s ops 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: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP ACP3x has a i2s controller block for playback and capture. This patch adds ACP3x i2s DAI operations. Signed-off-by: Maruthi Bayyavarapu Tested-by: Ravulapati Vishnu vardhan Rao Signed-off-by: Vijendar Mukunda --- sound/soc/amd/raven/acp3x-pcm-dma.c | 89 +++++++++++++++++++++++++++++++++++-- 1 file changed, 86 insertions(+), 3 deletions(-) diff --git a/sound/soc/amd/raven/acp3x-pcm-dma.c b/sound/soc/amd/raven/acp3x-pcm-dma.c index 06c1985..ed2c163 100644 --- a/sound/soc/amd/raven/acp3x-pcm-dma.c +++ b/sound/soc/amd/raven/acp3x-pcm-dma.c @@ -423,10 +423,93 @@ static struct snd_pcm_ops acp3x_dma_ops = { .mmap = acp3x_dma_mmap, }; +static int acp3x_dai_i2s_hwparams(struct snd_pcm_substream *substream, + struct snd_pcm_hw_params *params, + struct snd_soc_dai *dai) +{ + u32 val = 0; + struct i2s_stream_instance *rtd = substream->runtime->private_data; + + switch (params_format(params)) { + case SNDRV_PCM_FORMAT_U8: + case SNDRV_PCM_FORMAT_S8: + rtd->xfer_resolution = 0x0; + break; + case SNDRV_PCM_FORMAT_S16_LE: + rtd->xfer_resolution = 0x02; + break; + case SNDRV_PCM_FORMAT_S24_LE: + rtd->xfer_resolution = 0x04; + break; + case SNDRV_PCM_FORMAT_S32_LE: + rtd->xfer_resolution = 0x05; + break; + default: + return -EINVAL; + } + val = rv_readl(rtd->acp3x_base + mmACP_BTTDM_ITER); + val = val | (rtd->xfer_resolution << 3); + if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + rv_writel(val, rtd->acp3x_base + mmACP_BTTDM_ITER); + else + rv_writel(val, rtd->acp3x_base + mmACP_BTTDM_IRER); + + return 0; +} + +static int acp3x_dai_i2s_trigger(struct snd_pcm_substream *substream, + int cmd, struct snd_soc_dai *dai) +{ + int ret = 0; + struct i2s_stream_instance *rtd = substream->runtime->private_data; + u32 val, period_bytes; + + period_bytes = frames_to_bytes(substream->runtime, + substream->runtime->period_size); + switch (cmd) { + case SNDRV_PCM_TRIGGER_START: + case SNDRV_PCM_TRIGGER_RESUME: + case SNDRV_PCM_TRIGGER_PAUSE_RELEASE: + if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + rv_writel(period_bytes, rtd->acp3x_base + + mmACP_BT_TX_INTR_WATERMARK_SIZE); + val = rv_readl(rtd->acp3x_base + mmACP_BTTDM_ITER); + val = val | BIT(0); + rv_writel(val, rtd->acp3x_base + mmACP_BTTDM_ITER); + } else { + rv_writel(period_bytes, rtd->acp3x_base + + mmACP_BT_RX_INTR_WATERMARK_SIZE); + val = rv_readl(rtd->acp3x_base + mmACP_BTTDM_IRER); + val = val | BIT(0); + rv_writel(val, rtd->acp3x_base + mmACP_BTTDM_IRER); + } + rv_writel(1, rtd->acp3x_base + mmACP_BTTDM_IER); + break; + case SNDRV_PCM_TRIGGER_STOP: + case SNDRV_PCM_TRIGGER_SUSPEND: + case SNDRV_PCM_TRIGGER_PAUSE_PUSH: + if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + val = rv_readl(rtd->acp3x_base + mmACP_BTTDM_ITER); + val = val & ~BIT(0); + rv_writel(val, rtd->acp3x_base + mmACP_BTTDM_ITER); + } else { + val = rv_readl(rtd->acp3x_base + mmACP_BTTDM_IRER); + val = val & ~BIT(0); + rv_writel(val, rtd->acp3x_base + mmACP_BTTDM_IRER); + } + rv_writel(0, rtd->acp3x_base + mmACP_BTTDM_IER); + break; + default: + ret = -EINVAL; + break; + } + + return ret; +} + struct snd_soc_dai_ops acp3x_dai_i2s_ops = { - .hw_params = NULL, - .trigger = NULL, - .set_fmt = NULL, + .hw_params = acp3x_dai_i2s_hwparams, + .trigger = acp3x_dai_i2s_trigger, }; static struct snd_soc_dai_driver acp3x_i2s_dai_driver = {