From patchwork Tue Aug 21 06:55:05 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Akshu Agrawal X-Patchwork-Id: 10571101 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 07B84920 for ; Tue, 21 Aug 2018 06:56:10 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E93C529B2B for ; Tue, 21 Aug 2018 06:56:09 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DCC7A29B9D; Tue, 21 Aug 2018 06:56:09 +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.8 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE,T_DKIM_INVALID 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 2CBE429B2B for ; Tue, 21 Aug 2018 06:56:09 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 759882676C9; Tue, 21 Aug 2018 08:56:07 +0200 (CEST) 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 7B99D26773B; Tue, 21 Aug 2018 08:56:04 +0200 (CEST) Received: from NAM03-BY2-obe.outbound.protection.outlook.com (mail-by2nam03on0049.outbound.protection.outlook.com [104.47.42.49]) by alsa0.perex.cz (Postfix) with ESMTP id 9402F2676C7 for ; Tue, 21 Aug 2018 08:55:59 +0200 (CEST) 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=XyVw4K8lX6Mw2y77c9+aXdblgLrcWBCeuDmQreHFPXo=; b=mx3v9r5cfjKvQ5hrOIuL+ABFa8hOxzUe12w45X4K3ycOjhkmD7xftjseEjnYEI54TXv3qn0NRZv2xV3xBNoPrsBDPbEf13E3MX/wQoMA3bws6g/RWDszrOljVU1IAy9IKZLYhEVVBBlSAj9JWFnWMnDimoyiN1EyGUn/i4c6KdM= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Akshu.Agrawal@amd.com; Received: from akshu-HP-EliteBook-745-G2.amd.com (202.56.249.162) by SN1PR12MB2366.namprd12.prod.outlook.com (2603:10b6:802:25::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1059.21; Tue, 21 Aug 2018 06:55:52 +0000 From: Akshu Agrawal To: Date: Tue, 21 Aug 2018 12:25:05 +0530 Message-Id: <1534834520-18397-1-git-send-email-akshu.agrawal@amd.com> X-Mailer: git-send-email 1.9.1 MIME-Version: 1.0 X-Originating-IP: [202.56.249.162] X-ClientProxiedBy: BM1PR01CA0112.INDPRD01.PROD.OUTLOOK.COM (2603:1096:b00::28) To SN1PR12MB2366.namprd12.prod.outlook.com (2603:10b6:802:25::19) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 1540c9e7-5351-42ac-791a-08d6073324e4 X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989137)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(4618075)(2017052603328)(7153060)(7193020); SRVR:SN1PR12MB2366; X-Microsoft-Exchange-Diagnostics: 1; SN1PR12MB2366; 3:OI5OWHk0VrT7rEZ1iSA6X/7pDvp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poBkt+ZXr90pJ18vPwvzdUE0mQGeRisa2PGl38UFowkiFYxLGkOxuZZ66HRrQOB22BipZugaVu2kElprX/nRNNkH613Ksja7Wo4FvZcDd2x6z+8GZhTJ0AhXItpwGlaxS3nvnJGyQJSbsx2RCjVspukXS/tHRL5OSDewo2XcNxrBYomNAE6labn7d2yT01chN8a3zGf3CTPcLfQoKXbT/e4X0j3DnMNkwR1YuJTLrYiIrdeGWuMLUEBer1BEkFwWq8+TgEPYgiycOi2lyGybzH5gbTUCpazetmyrblwxuq/J6mKBTHXvC0mwhD1DElT51FH06n; 4:OGRbtZuaMyaAeF6EjI5ttvhAHoBz5MewcX+BFEAnUanoH48iiGeH2vTos6J9jAhg9PIA/9pFcEkKosdwVN7SWizsQSTud24/0l33pVe2QeKt3cXddx1GjXmIYzRul+90enn61HPbJaqClfzrAXEOjuW0vx/LSDzUl4slEEMrXj00bhoa1ODeRc4Rwm2sEf4NV6BeOC8keqCdmMKK90gg/HYBovYX4ZFMMWTYc4TdZoVOdH/KusNWrMiSo4S/Jh0ypIL5lMLqrKKTJOKBTTEqP1aMUPiX2oWZ/9wMHB2xpVfejO6pgkyND5/rsznwMYbU 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)(8121501046)(5005006)(3231311)(944501410)(52105095)(10201501046)(93006095)(93001095)(3002001)(6055026)(149027)(150027)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(20161123558120)(20161123564045)(20161123560045)(201708071742011)(7699016); SRVR:SN1PR12MB2366; BCL:0; PCL:0; RULEID:; SRVR:SN1PR12MB2366; X-Forefront-PRVS: 0771670921 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(346002)(366004)(39860400002)(136003)(396003)(376002)(199004)(189003)(81156014)(8936002)(386003)(109986005)(81166006)(44832011)(2616005)(7736002)(53936002)(1857600001)(36756003)(25786009)(26005)(486006)(2906002)(39060400002)(6666003)(52116002)(956004)(8676002)(51416003)(3846002)(7696005)(50226002)(305945005)(6116002)(4326008)(105586002)(1671002)(53416004)(106356001)(316002)(5660300001)(97736004)(47776003)(66066001)(68736007)(86362001)(476003)(478600001)(54906003)(16586007)(16526019)(50466002)(48376002)(186003)(6486002)(72206003)(266003); DIR:OUT; SFP:1101; SCL:1; SRVR:SN1PR12MB2366; H:akshu-HP-EliteBook-745-G2.amd.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; Received-SPF: None (protection.outlook.com: amd.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; SN1PR12MB2366; 23:Mm0urb0y1VnWtSDcle6d0YB+INOcIjk8X+xBezIqq?= XwfiAOKNJPFLYf55dMipvVQiPN8bwe7JmRsSPqiA/XwC49dsfekPSc6SXU/IinHEVg9Eo1iHcNMKrx4fvwCMhb7ZLqdsbOwFg+JQhf/SsPRkSwEVGMSpA8dV8eYKhDCvuh6wKJppagRbA8H9jC/bdxOWj+PyJAlSFXcbQC3FbeT2EG44weepulfnbtrnbAkm3L58ytDKAaQ9PccXWB28r8+4bILHrD3roPFS5CgZ3qqdm8wokCB7zzmrkd7X356hafMDROQi+rLyLFWt09eTxdkT/0HLToDFvHsTdXWQcYcb1SKdfWjOh8N53FF9+vr5TwheMwu8uUOL/W3c6FULrH736y6667jlSccpovTlQX6L+Q0AjCFUNf1w/Jtl2RXzYOdIBeujx0jT289lqvUGKRJa3irsoQEU0cpWghygV5dzHup0kreL6nwya4pqd5qJueezVPqZRBQ731ZMTBkbz+AKtNv4pAback4Z1PIaiu1txBOtpzYDKTAGSz46qtBeJsiEdbLMv1wZq7qYAx3w3KDAEoPL9aT4r8KZQf6OFTIKRHenE7XS6mUByHbPCzxgCSwDm52o79ns9+sVpZb5N1w1zlRtGRUqknAk2pIYY1TR+APGSc52WyIy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sA7jtKWqhWHYAxPLTYCHsA1QQBEwqXeUTFr0jpQpWMB6QOBilR+D99Kv12hb1x8WOf4IFj3VtXCrRP28j4chFIv1jFLy1z9GJN2mBFlFJM7KvyPY X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Aug 2018 06:55:52.2736 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 1540c9e7-5351-42ac-791a-08d6073324e4 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN1PR12MB2366 Cc: "moderated list:SOUND - SOC LAYER / DYNAMIC AUDIO POWER MANAGEM..." , Kuninori Morimoto , open list , Takashi Iwai , Liam Girdwood , djkurtz@chromium.org, Mark Brown , Wei Yongjun , "Mukunda, Vijendar" , Alexander.Deucher@amd.com, akshu.agrawal@amd.com Subject: [alsa-devel] [PATCH] ASoC: AMD: Set constraints for DMIC and MAX98357a codec 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 We support dual channel, 48Khz. This constraint was set only for da7219. It is being extended to DMIC and MAX98357a. Signed-off-by: Akshu Agrawal Reviewed-by: Daniel Kurtz --- sound/soc/amd/acp-da7219-max98357a.c | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/sound/soc/amd/acp-da7219-max98357a.c b/sound/soc/amd/acp-da7219-max98357a.c index 066d5489..cf2f648 100644 --- a/sound/soc/amd/acp-da7219-max98357a.c +++ b/sound/soc/amd/acp-da7219-max98357a.c @@ -162,10 +162,21 @@ static void cz_da7219_shutdown(struct snd_pcm_substream *substream) static int cz_max_startup(struct snd_pcm_substream *substream) { + struct snd_pcm_runtime *runtime = substream->runtime; struct snd_soc_pcm_runtime *rtd = substream->private_data; struct snd_soc_card *card = rtd->card; struct acp_platform_info *machine = snd_soc_card_get_drvdata(card); + /* + * On this platform for PCM device we support stereo + */ + + runtime->hw.channels_max = DUAL_CHANNEL; + snd_pcm_hw_constraint_list(runtime, 0, SNDRV_PCM_HW_PARAM_CHANNELS, + &constraints_channels); + snd_pcm_hw_constraint_list(runtime, 0, SNDRV_PCM_HW_PARAM_RATE, + &constraints_rates); + machine->i2s_instance = I2S_BT_INSTANCE; return da7219_clk_enable(substream); } @@ -177,20 +188,42 @@ static void cz_max_shutdown(struct snd_pcm_substream *substream) static int cz_dmic0_startup(struct snd_pcm_substream *substream) { + struct snd_pcm_runtime *runtime = substream->runtime; struct snd_soc_pcm_runtime *rtd = substream->private_data; struct snd_soc_card *card = rtd->card; struct acp_platform_info *machine = snd_soc_card_get_drvdata(card); + /* + * On this platform for PCM device we support stereo + */ + + runtime->hw.channels_max = DUAL_CHANNEL; + snd_pcm_hw_constraint_list(runtime, 0, SNDRV_PCM_HW_PARAM_CHANNELS, + &constraints_channels); + snd_pcm_hw_constraint_list(runtime, 0, SNDRV_PCM_HW_PARAM_RATE, + &constraints_rates); + machine->i2s_instance = I2S_BT_INSTANCE; return da7219_clk_enable(substream); } static int cz_dmic1_startup(struct snd_pcm_substream *substream) { + struct snd_pcm_runtime *runtime = substream->runtime; struct snd_soc_pcm_runtime *rtd = substream->private_data; struct snd_soc_card *card = rtd->card; struct acp_platform_info *machine = snd_soc_card_get_drvdata(card); + /* + * On this platform for PCM device we support stereo + */ + + runtime->hw.channels_max = DUAL_CHANNEL; + snd_pcm_hw_constraint_list(runtime, 0, SNDRV_PCM_HW_PARAM_CHANNELS, + &constraints_channels); + snd_pcm_hw_constraint_list(runtime, 0, SNDRV_PCM_HW_PARAM_RATE, + &constraints_rates); + machine->i2s_instance = I2S_SP_INSTANCE; machine->capture_channel = CAP_CHANNEL0; return da7219_clk_enable(substream);