From patchwork Fri Mar 9 15:43:02 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Mukunda,Vijendar" X-Patchwork-Id: 10271011 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 10B7E60236 for ; Fri, 9 Mar 2018 15:40:46 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F184229E8A for ; Fri, 9 Mar 2018 15:40:45 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EEB3129E88; Fri, 9 Mar 2018 15:40:45 +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 EB0BB29E91 for ; Fri, 9 Mar 2018 15:40:44 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 3CA34267510; Fri, 9 Mar 2018 16:40:43 +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 0EBF02675DF; Fri, 9 Mar 2018 16:40:41 +0100 (CET) Received: from NAM03-DM3-obe.outbound.protection.outlook.com (mail-dm3nam03on0087.outbound.protection.outlook.com [104.47.41.87]) by alsa0.perex.cz (Postfix) with ESMTP id 160B0266E78 for ; Fri, 9 Mar 2018 16:40: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=/16Aama0QKb/pJ4L528YLEwN2XAe3D2OAX3Sr6X9xlg=; b=Cob0Y4SV28HwJBrRDiCVx46gUSvlQxx8fxXpfuJo4W2uz1v1qbfyLNHhAmtor7sSQQmLUPsdG5XcAPdk16ZT+18KSpakGw4uXDdltljMv8gGteydo3lzR8AKhCWLhvRpFaHd+yo9RLcQRjhu05zz3MT7AzeubATtP7W8GtOWiIU= Received: from BN6PR1201CA0018.namprd12.prod.outlook.com (2603:10b6:405:4c::28) by BN1PR12MB0020.namprd12.prod.outlook.com (2a01:111:e400:52::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.567.14; Fri, 9 Mar 2018 15:40:35 +0000 Received: from CO1NAM03FT019.eop-NAM03.prod.protection.outlook.com (2a01:111:f400:7e48::204) by BN6PR1201CA0018.outlook.office365.com (2603:10b6:405:4c::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.464.11 via Frontend Transport; Fri, 9 Mar 2018 15:40:34 +0000 Authentication-Results: spf=none (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; gmail.com; dkim=none (message not signed) header.d=none; gmail.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 SATLEXCHOV02.amd.com (165.204.84.17) by CO1NAM03FT019.mail.protection.outlook.com (10.152.80.176) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.527.18 via Frontend Transport; Fri, 9 Mar 2018 15:40:34 +0000 Received: from LinuxHost.amd.com (10.34.1.3) by SATLEXCHOV02.amd.com (10.181.40.72) with Microsoft SMTP Server id 14.3.382.0; Fri, 9 Mar 2018 09:40:33 -0600 From: Vijendar Mukunda To: , , Date: Fri, 9 Mar 2018 21:13:02 +0530 Message-ID: <1520610182-13122-1-git-send-email-Vijendar.Mukunda@amd.com> X-Mailer: git-send-email 2.7.4 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)(39860400002)(39380400002)(396003)(376002)(2980300002)(428003)(199004)(189003)(1857600001)(6666003)(86362001)(47776003)(53936002)(106466001)(53416004)(2201001)(186003)(51416003)(105586002)(336012)(26005)(7696005)(77096007)(68736007)(16586007)(305945005)(50226002)(39060400002)(81156014)(97736004)(36756003)(2906002)(316002)(54906003)(48376002)(478600001)(356003)(81166006)(8676002)(50466002)(104016004)(5660300001)(4326008)(72206003)(8936002)(110136005); DIR:OUT; SFP:1101; SCL:1; SRVR:BN1PR12MB0020; H:SATLEXCHOV02.amd.com; FPR:; SPF:None; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; CO1NAM03FT019; 1:noNIoVb5oefKiQ85UDabCaN2+bEjRbJ5kaB8Fv5WUsJwynbk3OIeqMMZj4QUj5xZOYOiUiAkT0XTjB8sb8VZgRwG6w8Ej/wV7MmsPwq6Z48bXqSb2vXx8aSX+YZ2t8vH X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 7a3555a4-14a7-4da2-965b-08d585d4191d X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(5600026)(4604075)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7153060); SRVR:BN1PR12MB0020; X-Microsoft-Exchange-Diagnostics: 1; BN1PR12MB0020; 3:XVJPGxcGrpRLDpHVdESBlBLipSxWtMtNigiWQwJ1arOVWUIH//DO57ZDWumCETENJsLzabvC9Q0OYsyv+4sxNPTG6kjoMi4eqf8Q+tj8s7agPtOBX1t4ytf8Gf2f83AVbAoEY13jhaSUabD678cm26yhwE5eEbGgeKiFEDzWjBY1f++/HkHDWENPCg5/kmK27WhbU7psrvkVYYLZ9fMQm+QeHVF6m0EQ2DxWa18AXFLdfDpCPFjGMf0h6jZqSCevHgyojgue3Y8l45z2ZW5YbFcilISz7G4Y2DLeU3l6ECTvuGvlVghRExtFGRX7F181HZPUtxfYrO9okoJJyumhrx+3zBnV1vBF9FsZ0B252Zg=; 25:YsNz/V9dslqx8Ic1tGUN94JYz5SmR3kHaC63F4d4TIfjxctpJGOihCT3jHzPGSATVM0UbCF/qRu6tej8yO4116whWq1WsIfsxaG5y6QWU8jWER62F/aiRYw3QvS+UtS0DlhXgg0fZrtGiDeN7AONsev9OLDCRY9/+ziHEzx1nYgnPueChlZbaLlpIOpLXCWy5BpqkHpMpZ/qul0ZmhmlQH4v4oeiyKspZ08o+tsz7IXhYFABxIeinYGdv2kNWm5h82uH2ESP/j8sve/4uptOJY0RGgrrSUauUSi/B37lHn4WwHpeIkzcVmJ8bPRa8gDRDUxAzMTdaLpovO9rk17Gig== X-MS-TrafficTypeDiagnostic: BN1PR12MB0020: X-Microsoft-Exchange-Diagnostics: 1; BN1PR12MB0020; 31:WYRiioVLBNFbAF/fib9/5g3yI5I5uIZnfjRsiMDb5GD5IltTHyNye6mknYTrlUKbz996tnstYuwk5nnRc8/znomphf7JsoIrtPioMQ7avKFC1b11v3gDZax4/QmEi2o6POPeIE4Flk6uhPVI8BIRuhlSHyz5V/7guByfE+MWLZm/GwaoME/UX6U1DITcwP1bUwCOXIDdYlPpyPO2g1Gop5JRO2GSYU6E63DDn5DXEHU=; 20:pvFzm8qyXI8LN2bwHhbpBTdfBumqP2uMvTuu/wI2+6/5ou/GTYLu6OYxaHSSDKu8+/VzIAFCw7/LIj0keVj0Alvz1XcWLJeftnDYGXGRcbArh/gaKFcG1WidlI0QrfVirstrkUEhN0ePU/eu883dESArcB2s/Wtc9sCOBGcld/jeYpwz50CtRuCbEB0YLSdHLImLadHZAv5+iZU6eN6G7JYkoHK4qGQsdu46h+BO28Xw1jbLaNlVc88lxFBNu1mBjQIRwc6l2hQltFSZG9wOIiLSCdXGJeHwaKAHNTSinyU5CLPBIEwckysFVACKeurd+LEbivXPyGqWdiWhfpwyuAPaJn41BAYhzFmP5vgTT10SvaWeSuOOAQ2GgJFJpzKjcZbje8Y/kP4S9i0A/6QRH56sh2dvk8L5nJcGddPchdlCzv0dNTPQkESCEVOIiq+wh3nJ9QlIPtDEn1sTjeYwMiUEajwCVkkJbakCh9DLp5ITGLFcYKGPzwmAKpCyDITC X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(767451399110); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(93006095)(93003095)(10201501046)(3231220)(944501244)(52105095)(3002001)(6055026)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123562045)(20161123564045)(20161123560045)(6072148)(201708071742011); SRVR:BN1PR12MB0020; BCL:0; PCL:0; RULEID:; SRVR:BN1PR12MB0020; X-Microsoft-Exchange-Diagnostics: 1; BN1PR12MB0020; 4:RsW6HxBqI+6lvlsO+ougzwty7mRLZygGqvJqHpPLAAi0qddlCMqzsb/p1tEZFeiUHfTKq3Czo1o+jSSdqixPFeitbDUMifSjVIYQBK7/Sepz4N4WYhx0VOGaRtRBxcPBnz1ZkHloc0CUc/iAcEUPnjXWy+UCiI1Xj7OrfTwseoV67xrCDGyEYyF1EPeKHUwLcmeDRTIYISE7DVaPgy58ay75N2pDylUhFUEw9UTnG64tX3ynERzuOuIe8gURVcV4tOhCOIMo87fBg9WJHb2i9l8w8A6ryZnMtOyfKtKkBhCqSwGpIkZBSxnF8wUy2UVG X-Forefront-PRVS: 0606BBEB39 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BN1PR12MB0020; 23:04FnbMDpKeWyeb+qp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nssjQgcGJU0oN9pYz8b5hG5OiATToGxA+BQwdsDnehE1wn+OIrBx?= =?us-ascii?Q?Qm5XsoJHgeJ6JWbRPgvvHZNAtZoobzJLurobwPyAVkLpN1mG8EFWCLD09mQc?= =?us-ascii?Q?pCAyMgZ52xPCjDfL1dReEICu8Bc3ZmYTNweY/gNONl3mte85sAaFVa9Nzwqc?= =?us-ascii?Q?XSb1nsYEn0oIm78CDlWq70NOygNufGh/whXdWwlRKS1gP0RAA=3D=3D?= X-Microsoft-Antispam-Message-Info: sEG0V3QVmwtsEtzX6/fLHtxLI6zSKZNCTKP4J4/7AIVL6xYg02tqpzgxwA+WY/RrHcwJywKxdkwEWT84+4V+8jo9wMwouOVa8NZVNcJYszl2n0Pbe+mcXQKxEcWbpKfn6f+d08hI2GgYmklb4Ocb8cmUIl2ulwUKSpRmXGwpg6/rOaQb2nNpnqbTHua6VEPT X-Microsoft-Exchange-Diagnostics: 1; BN1PR12MB0020; 6:McXpXmNoRPWkV4tdh0ttWe6PKGusI572PQU+vG+sqr4LdvJVDhBffitC5WZy5G4TThDRSkX7IrjlVGrB41ikppJGw8ivwSiyQnvOIVOuk9q2YxciYQJFgU61JCz92pPUIN2BBcobrQIoFeMtyXIXr2ax/oCFYIGx2B37qqNJ11pHt9jaIWWqFYC2etJlpMjps44kdEPKRBss8yuYAGam4PgUlo2gOFMM3rd6w5lNO/aaB9nUgv+DlFma0bxErpmv3AsK9R39CGSgKnLvXG97C7uAnzMJThuYyrZf49n+ZYZ+dHWnBIOvQH59MDYONE+9jvkD8lVF92G2JU1uewIhjMcdUPIttT6QNze0JAJ5g2k=; 5:SimaRtVfG/Mvox+6Rh3OBhRTmjsrvQ0ev2bBV/uscSDfsP2sYzaNwxGPRdYage4eQqtNNJIHKnQLlqQ4jphD2qKyQyqRLdGH8LODRDjyIgmLiYLshGSSYRjM27tbP0GMw1o7fs3xpmgfFEn/YQDWYX4L92oFN7Lz6Hf77TclMLI=; 24:LLQllvK9HTMT772bFE1adyHo1x5xl3dW8hmoXczDjb9nmv/0beF8s+cYOl3X3HqbhDFpG+6Y7oaI3xbRFrv8hrgZivhQP32KlKqcNQSa/nM=; 7:Vm+6CsncAtePjiaLDBA3nzCQJY4qjCSiXtradepkuf/sruEBkQJH3I6eqGH7L6Um2VRseDL89ayg2qqULhBzMbbsjMVhuzYbWL2P95Hw2IPjODcgkG3I2wY2EyVk4bF7LsKJH5YDHl4Y4flKGCoc1BXfpUUfJF3OI2EYAf0Y+Qh9TTPNitoqsUgd62h/AvWm05mBfBdhp5+2zFTM+mG9Z+sJokjAfHojC06Mcldw8cGZSFaYmTCPJpIPawydZ9ZR SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BN1PR12MB0020; 20:VJIabswMby+poUnpMIFIiPBJZh21obVMFfpvr74jXGQGgzHUAkWSPMYzIcPlZr53LVW9OTJPg1tS8Rsjh8qhSK+HqVBSIkcsrgvZF8Z5skAQ5Dxnv8aNl9NR5O8d1Z2REXzYLSYjTLS53LCHamj5LdVNdG+NjAyGQ8vStVAKdNKruZCzsLuDpytMaYpgM8jy/lmKZ4MJL99WLVBnCZoOKUwnU4z76u/4EYlAfoOkYCwZALVDhGQS1XxB0qGJwRBt X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Mar 2018 15:40:34.0754 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 7a3555a4-14a7-4da2-965b-08d585d4191d 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: BN1PR12MB0020 Cc: tiwai@suse.de, Alexander.Deucher@amd.com, Vijendar Mukunda , lgirdwood@gmail.com, Akshu.Agrawal@amd.com Subject: [alsa-devel] [PATCH] ASoC: amd: 16bit resolution support for i2s sp 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 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 --- sound/soc/amd/acp-pcm-dma.c | 16 +++++++++------- sound/soc/amd/acp.h | 2 ++ 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/sound/soc/amd/acp-pcm-dma.c b/sound/soc/amd/acp-pcm-dma.c index 9d7ab01..540088d 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; @@ -787,6 +781,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 27803b2..ba01510 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,