From patchwork Fri Feb 16 07:33:53 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Mukunda,Vijendar" X-Patchwork-Id: 10224129 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 42777603EE for ; Fri, 16 Feb 2018 07:33:52 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 335A029095 for ; Fri, 16 Feb 2018 07:33:52 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 264D6290B3; Fri, 16 Feb 2018 07:33:52 +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=-1.8 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED, RCVD_IN_DNSWL_NONE, T_DKIM_INVALID autolearn=no 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 56D6029095 for ; Fri, 16 Feb 2018 07:33:51 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id AC414267D9C; Fri, 16 Feb 2018 08:32:41 +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 68C05267DB0; Fri, 16 Feb 2018 08:32:40 +0100 (CET) Received: from NAM02-CY1-obe.outbound.protection.outlook.com (mail-cys01nam02on0043.outbound.protection.outlook.com [104.47.37.43]) by alsa0.perex.cz (Postfix) with ESMTP id 54362267D5E for ; Fri, 16 Feb 2018 08:32:37 +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; bh=zNgw51q/GNGdfWupbEAgsoZkiZXby55B9r2pH9/bw2g=; b=hOoTfOX0vmKz+bkzvsnqdVDVfX5ZlKRwgqezIHCjKp+MhHwx1iq4Kb7GxRliPCu72Q4gYoFBXCDEkjwCyQyn/ayHzCkSZ/jBpUemQMOP0Fl4FDbPqT2qV21cPhJy1mKDc0pXdygyjSJcTM4eC7Y9ZTky1/5T/OTS4kFFpun0HQ0= Received: from CY4PR12CA0032.namprd12.prod.outlook.com (2603:10b6:903:129::18) by DM2PR12MB0265.namprd12.prod.outlook.com (2a01:111:e400:50d0::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.485.10; Fri, 16 Feb 2018 07:32:32 +0000 Received: from BY2NAM03FT031.eop-NAM03.prod.protection.outlook.com (2a01:111:f400:7e4a::204) by CY4PR12CA0032.outlook.office365.com (2603:10b6:903:129::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.506.18 via Frontend Transport; Fri, 16 Feb 2018 07:32:32 +0000 Authentication-Results: spf=none (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; kernel.org; dkim=none (message not signed) header.d=none; kernel.org; dmarc=permerror action=none header.from=amd.com; Received-SPF: None (protection.outlook.com: amd.com does not designate permitted sender hosts) Received: from SATLEXCHOV02.amd.com (165.204.84.17) by BY2NAM03FT031.mail.protection.outlook.com (10.152.84.216) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.506.19 via Frontend Transport; Fri, 16 Feb 2018 07:32:31 +0000 Received: from SCYBEXDAG03.amd.com (10.34.11.13) by SATLEXCHOV02.amd.com (10.181.40.72) with Microsoft SMTP Server (TLS) id 14.3.382.0; Fri, 16 Feb 2018 01:32:31 -0600 Received: from LinuxHost.amd.com (10.129.12.246) by SCYBEXDAG03.amd.com (10.34.11.13) with Microsoft SMTP Server id 14.3.382.0; Fri, 16 Feb 2018 15:32:27 +0800 From: Vijendar Mukunda To: , , Date: Fri, 16 Feb 2018 13:03:53 +0530 Message-ID: <1518766434-7911-9-git-send-email-Vijendar.Mukunda@amd.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1518766434-7911-1-git-send-email-Vijendar.Mukunda@amd.com> References: <1518766434-7911-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)(39860400002)(376002)(346002)(396003)(39380400002)(2980300002)(428003)(189003)(199004)(186003)(6666003)(4326008)(8936002)(5660300001)(39060400002)(81156014)(105586002)(8676002)(68736007)(81166006)(26005)(50226002)(336011)(53416004)(106466001)(77096007)(356003)(53936002)(2950100002)(7696005)(47776003)(2906002)(2201001)(97736004)(36756003)(54906003)(110136005)(316002)(16586007)(76176011)(305945005)(51416003)(48376002)(72206003)(50466002)(86362001)(478600001); DIR:OUT; SFP:1101; SCL:1; SRVR:DM2PR12MB0265; H:SATLEXCHOV02.amd.com; FPR:; SPF:None; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BY2NAM03FT031; 1:bjkqz600IRySI47bFw8YiuLn0vkkhf7TxJZr9TFfUyPYcVpcKyrnD1pQZ8PoiR8iolA4ViXowbgl/MhMOerGYtutxXXxKJMfjNHhbsWKzq1dTr2u5yPtxYUIGHHZxP+/ X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: f5982475-95e9-49bc-221a-08d5750f70cc X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(4534165)(4627221)(201703031133081)(201702281549075)(5600026)(4604075)(2017052603307)(7153060); SRVR:DM2PR12MB0265; X-Microsoft-Exchange-Diagnostics: 1; DM2PR12MB0265; 3:UTbOoICJFLOO3H8eAlkjAyMbO1J+Ki8kJfNxCOAqHOUHkBfgdP4XA+GHdYVWjmunu2psYpsxoOEORbcBy7Y66EDhLoWjBGd9VZYthguXINQaFnpzRRs54yBknO2M6suo1ka0iaAp7wGkrDcVu8PjASkZSyViP/YaEhomRj0mRQtEt2b18hi6q8ZQoo3rgcbfcGWikC0ZKzervby0JT5sPHE++awwjiwaCmGl6/+5YLS382pS5HWtDfNCK5GmOp3PCYnqCXVj5FCHLEWl6cZRk+u5vsYC3z8fYyy40OEwzUUGnF2Imko7dzjW+Q+djMICuHOa9d1/BTY7mEVN5myRGUgZvRhtxAP86oCUNbZAU8U=; 25:mZv+1eiOiRD3NYkfrkgpg4G+P+f0XtGz80jTimNb2L0s4VJdjVR/Pn8DjPN4Ux4dAXlttlT8WIeZs4HNOY81G6GIADn1OfZqd4uDHwcYaowhdqHaHOKslCMloyhgrl97Own+qnLpoJ/wpuO7sBjufMoQD01+QDfak7y71Ochokp3BvmsXucFM7/J7lyMX4Le6hM2zoA4bY3c83lNCKtfo5rKLBxUzHVXppJ1I7R4ijxeI6CaC1WZ3uPZ8JwLZVt7VsHZc2hwq7WB5k4Kf4k6KKyrMOoVIpvb74ZtK9hCAz9yJakxqpJqTEYY/4SSIKwbYPgezgnF0Kiq3I/K4Zamgw== X-MS-TrafficTypeDiagnostic: DM2PR12MB0265: X-Microsoft-Exchange-Diagnostics: 1; DM2PR12MB0265; 31:NKYdlPwYSMynu5x3/FeC/MVRgZBmDcd/DmqMH/3MmPSKfjLhqLCigzwiX6ZSoNsI83CrwAFxduucp7abNtZeQn7zfMgXn5yhIbllVc7IA6i3EYk69iTDK9AYiJdxE9WZ8fQdO0pkImgCXcoF63Z/fSITLE4POGCPr2HjpregF050ArZ8Ecbct6DuJycpBc4UEz0+azvPmFCQUpiB0uH7EHu4PAmTnMOYIciLg/EJRNA=; 20:2MNlP/1aUIKQoCv5eUmC9eerO9p96IzJgi8YIVYOOaPuCh9K9La9oivnuZBaWjlgFDvoc+ruYrqBNI3X5DDaa3/EKTIzJ28zSAHwsB23O7a/5U7nUWGVbjprvqpEpC6TblC4FAJUPXnQDFIZWtDD16g8wzMltv3WhZdTDIcBSShvDlS4tjkOYpMcuMsKlVkqz7FM2fLhynASl4los5FQlX2eYFC5z6ti1ni9DCjwORGG9U6sQkghaxVldqXfqUfRds7i8PHnMSQNqkufwHZ7cB6INpG3l4Uv0Ui1eH8QqkQXoBvSQb5X5LAzA66Dkbq5TpnkrMfrKOyu7fc7/tNKs3i5/eEiYvGVtRcb84g49esuwhEgeF84j9lZyN7Q7U0VYvhVxVMGx9G7acKuXvuTqbZQHcI5682ouWR4auN1/nwivIb0OQ/xM/Cn8gQ0502QArBS3ggRz8qRgURUNe4RBsAaD8ywAkceEaUxgfiL0ft8fGoPg+IXd/ebiAV4tav3 X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(767451399110); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040501)(2401047)(8121501046)(5005006)(3002001)(3231101)(944501161)(10201501046)(93006095)(93003095)(6055026)(6041288)(20161123558120)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123562045)(6072148)(201708071742011); SRVR:DM2PR12MB0265; BCL:0; PCL:0; RULEID:; SRVR:DM2PR12MB0265; X-Microsoft-Exchange-Diagnostics: 1; DM2PR12MB0265; 4:PnirmpF0U06ilzGOz1fQhanMcQ1Y52L0vwWJS9g+8kANbYS02BaMLb3zFaj6Sv2yHek0Jr46liU8KGMpNXVoxOX2aSYKznE/S9d9MDVvq/WCYu3mtGLkFWt6m3zZrBkv6Ol1U6aeoiXiyzypPpWEe2LGrePa4z2je3h67JH05XZQjJMzkCDAAEjxc2cWGq5o1z5CWbRK3Fa3rMJ8crNvsFk3DDmwQ1/+r6POBwYEmgmTpZHnpOSbe91TAPc4jOX2OPpiiBcoB+5wfzCSsv54A3Fh66ywF6syUFECsL/fKTz6pvJOiMyF0hxLVcltEqPU X-Forefront-PRVS: 0585417D7B X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DM2PR12MB0265; 23:PFjuLfl9GDWqwD6a38qaKWcf78Z7EialqcAD3bmnh?= =?us-ascii?Q?Vwnd4Cp9mdUMZcoZfITCp+ZajT+oDlJZddVgiyuPv1vxZHimtkU+U7PULbFi?= =?us-ascii?Q?yRprH2vO8Aiw/HktqioSfsd0Zp92xHqwLACWIAYMCaqkPWOQUpiTp7+i2nsJ?= =?us-ascii?Q?0SdyziloYdoikm7oTK139BjdPT//L3kBgiDB575ZVHyfCem+cS1vONaIgI1s?= =?us-ascii?Q?OfOrJzblfbTg8ijdhI6bLMZQboe04iUjGO4/5KN59OUxb/wCAYcif71Dkq6U?= =?us-ascii?Q?6g/kfaD1QjVJudVPOz6l7E0d37mu2BrYf2n4WCel5TgB5DZSp+5PrXyaaeL+?= =?us-ascii?Q?uJi1IDPHyQehWMNyeR8LhvWMMrRDexSBu458Y6HQCPW470Fq9KDp+xaNEuck?= =?us-ascii?Q?HARShnc7nmAB7J0WJVFaRMbh+D4xKN3Aruq3T9j1tK9FcG2t7PD77ZcPh9ja?= =?us-ascii?Q?lAqqa7RKv/6wK4HEu8QIwrkvzkNny7SZawOzqXS4IDOcrdkmTTKP+ZdzSjJw?= =?us-ascii?Q?QG/XxZvwqoEGXiPa7vjhACVytZ090gFsKJDqD7N5rOLAvDnGvUtWhLN0ae9Y?= =?us-ascii?Q?H6CiauLlJCWbk6O+ND/RMjkMlLjL9tmHGv8FjVq+YIjLuDgttyBsTh4gNGYf?= =?us-ascii?Q?n5ZXnq8EbJ8kPskjvwCtbUPub/VDrC6XoOxZ3iabRR4W1ryk63qhpkbBaQrh?= =?us-ascii?Q?cggkeyb0jTbja2Kt40wwQY4H3uTZqw+nakY29MNN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V+VW421gRpDDN6PMYrebmXHW4mRELoi+KVlhYx7WV9NwaWimAAP6pW1DN+eLkQ/Oqj9r3eEqfB8U=; 7:PQ7wa3J4GWScQgFUGbNGhnXAZslGwxmRvvq/ECNg+hbsWBrxIGGghKNqs6W9s7y+5Z24dpDwgRUrpDG6g3s15ykKSkBxe5gPSGjKnBWAR23kFC80pEfa6n2BEjjzzQVOKXDAtxoo7GBsQMArHYoyeXCpWBM2SjvmtX0WVi4PEiP6n3m3gmQUiKcKTp8REMTn0Loxyn23bpOdd8gjYEjl4Ue1TsMMjjELXCCaapwUcW4uCo40XvjUWse+87qe6Gzv SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; DM2PR12MB0265; 20:qyV77BEofafkbyDkYBJofxQJVnWQzYGB74UhoLY6tzUx0ZDfvVIy0A5PxW+xLHnpXSdjOL7riRS1K7pkXIjDc+wa9j1CNbaDEKxfP/wlK3KtjsrxEc5Biu95853bCbu7DoPmvCpo5swpUmaO9PmR83rW5/7CWQSpfRx6bChbIBqCxkDMISpMhh6LtSSMbIjMtVTk+EZxSHYkSMitDZe/allrL9iNbbII3yOZz2fGG2lXncNX5TC8rnBCA3kq/TW9 X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Feb 2018 07:32:31.8772 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: f5982475-95e9-49bc-221a-08d5750f70cc 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=[SATLEXCHOV02.amd.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM2PR12MB0265 Cc: tiwai@suse.de, Alexander.Deucher@amd.com, lgirdwood@gmail.com, Vijendar Mukunda Subject: [alsa-devel] [PATCH 8/9] ASoC: amd: 16bit resolution support for bt i2s instance 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 Added 16bit resolution support for BT I2S controller instance. Moved 16bit resolution condition check to acp_hw_params. During stream initalization ,depending upon substream only required register value need to be programmed rather than enabling 16bit resolution support all time in acp init. Signed-off-by: Vijendar Mukunda Reviewed-by: Alex Deucher --- sound/soc/amd/acp-pcm-dma.c | 31 ++++++++++++++++++++++++------- sound/soc/amd/acp.h | 3 +++ 2 files changed, 27 insertions(+), 7 deletions(-) diff --git a/sound/soc/amd/acp-pcm-dma.c b/sound/soc/amd/acp-pcm-dma.c index a16e2bb..e8310ce 100644 --- a/sound/soc/amd/acp-pcm-dma.c +++ b/sound/soc/amd/acp-pcm-dma.c @@ -639,13 +639,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; } @@ -901,6 +894,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; @@ -914,6 +908,29 @@ static int acp_dma_hw_params(struct snd_pcm_substream *substream, if (WARN_ON(!rtd)) return -EINVAL; + if (adata->asic_type == CHIP_STONEY) { + acp_reg_read(adata->acp_mmio, mmACP_I2S_16BIT_RESOLUTION_EN); + if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + switch (rtd->i2s_play_instance) { + case I2S_BT_INSTANCE: + val |= ACP_I2S_BT_16BIT_RESOLUTION_EN; + break; + case I2S_SP_INSTANCE: + default: + val |= ACP_I2S_SP_16BIT_RESOLUTION_EN; + } + } else { + switch (rtd->i2s_capture_instance) { + case I2S_BT_INSTANCE: + val |= ACP_I2S_BT_16BIT_RESOLUTION_EN; + break; + case I2S_SP_INSTANCE: + default: + 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 0292433..cd83a03 100644 --- a/sound/soc/amd/acp.h +++ b/sound/soc/amd/acp.h @@ -103,6 +103,9 @@ #define CAPTURE_END_DMA_DESCR_CH11 15 #define mmACP_I2S_16BIT_RESOLUTION_EN 0x5209 +#define ACP_I2S_MIC_16BIT_RESOLUTION_EN 0x01 +#define ACP_I2S_SP_16BIT_RESOLUTION_EN 0x02 +#define ACP_I2S_BT_16BIT_RESOLUTION_EN 0x04 #define I2S_SP_INSTANCE 1 #define I2S_BT_INSTANCE 3 enum acp_dma_priority_level {