From patchwork Fri Sep 1 06:30:38 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 9933551 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 DBAEF6016C for ; Fri, 1 Sep 2017 06:31:14 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CC2C42853F for ; Fri, 1 Sep 2017 06:31:14 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C138428545; Fri, 1 Sep 2017 06:31:14 +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 B3E8E2853F for ; Fri, 1 Sep 2017 06:31:13 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 5FB67267640; Fri, 1 Sep 2017 08:31: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 9F458267640; Fri, 1 Sep 2017 08:31:06 +0200 (CEST) Received: from relmlie3.idc.renesas.com (relmlor4.renesas.com [210.160.252.174]) by alsa0.perex.cz (Postfix) with ESMTP id 379E2267614 for ; Fri, 1 Sep 2017 08:30:44 +0200 (CEST) Received: from unknown (HELO relmlir3.idc.renesas.com) ([10.200.68.153]) by relmlie3.idc.renesas.com with ESMTP; 01 Sep 2017 15:30:43 +0900 Received: from relmlii2.idc.renesas.com (relmlii2.idc.renesas.com [10.200.68.66]) by relmlir3.idc.renesas.com (Postfix) with ESMTP id 47D0B6C3DF; Fri, 1 Sep 2017 15:30:43 +0900 (JST) X-IronPort-AV: E=Sophos;i="5.41,456,1498489200"; d="scan'208";a="256613315" Received: from mail-sg2apc01lp0241.outbound.protection.outlook.com (HELO APC01-SG2-obe.outbound.protection.outlook.com) ([65.55.88.241]) by relmlii2.idc.renesas.com with ESMTP/TLS/AES256-SHA256; 01 Sep 2017 15:30:42 +0900 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=renesasgroup.onmicrosoft.com; s=selector1-renesas-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=MhA/dG0ZZUsTYrXylk+7fZHBWkblYGAB1ja+bugse8o=; b=jQMzkbdFK7hG3T24cK0ARdvxmbtTGV0uHm1AjiA3AAIdTEITsq7aDbzPiLtI8Eivd8jrgY0dMbTKE5KYHJHv5WrXGxmT/EoNjz9YOWmI4+lh3s7Y9qSZueJGgqyYwcVSxs7xVYuKjU/Yjxj7coy5uIqxDQMUllHdT/wQ+SdA5+w= Received: from morimoto-PC.renesas.com (211.11.155.138) by PS1PR0601MB1883.apcprd06.prod.outlook.com (2603:1096:803:8::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.13.10; Fri, 1 Sep 2017 06:30:38 +0000 Message-ID: <87tw0nj5sr.wl%kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto User-Agent: Wanderlust/2.15.9 Emacs/24.3 Mule/6.0 To: Mark Brown In-Reply-To: <873787kki4.wl%kuninori.morimoto.gx@renesas.com> References: <873787ngjb.wl%kuninori.morimoto.gx@renesas.com> <873787kki4.wl%kuninori.morimoto.gx@renesas.com> MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Date: Fri, 1 Sep 2017 06:30:38 +0000 X-Originating-IP: [211.11.155.138] X-ClientProxiedBy: KL1PR0601CA0024.apcprd06.prod.outlook.com (2603:1096:802:1::34) To PS1PR0601MB1883.apcprd06.prod.outlook.com (2603:1096:803:8::21) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 450996e5-e54b-4911-1eac-08d4f102f6c9 X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(22001)(300000502095)(300135100095)(2017030254152)(48565401081)(300000503095)(300135400095)(201703131423075)(201703031133081)(201702281549075)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095); SRVR:PS1PR0601MB1883; X-Microsoft-Exchange-Diagnostics: 1; PS1PR0601MB1883; 3:5r44r+m2/rMhzxrel4ZRVPG2imyMgD0hleW3I4yHiV3+0IE9jFPhWyqT2mR5amoMmue8gRxMLhpKJRkvsZm2NvPmzPVRngbhFeMutU7Uhr2fGvgawYTMvQZCYNhzoRD8Jx7qv8v/HjEeUVRAuS8G7drwe3TO6IQy/hjiuwWKoBvx2aC04Y6l92Fml3YYTZ/W0mdTUJuj1Lv3L2MlkcKuWwq3hojKZJaLmscA1wgjwU6ClpCu0HpTWTi5HJMZkGki; 25:V/wxeWQoOXeIX3zGjH8/+YkTi9RRS1TEYXU12r4awliAH3KT3wIvSu9gI8zlqW6tff0JbcWZX5tBj3v0uptppFfD+4F6qhhnyhjBiecaKQeIcwvhMny3oxGkbzaNXVeTug+fZzkrbPDWTYFZj9NX9WC+K56ri/AvKP3dZx+y+QsUkCJeL2CcznAPSuPoxX0JiEQrI7W+Og8gzYcU9Xb9APeyEf2ayzD+yRvks5OLifVte1hNcXwYPTQ4wEK5WVlJhQBpRCgGkJ63iufiklOa6Inh7HmHZhys8Elzwl4XvIQq56uUTAmV1iwg8f3qLMFdx26UzkLhasvGuiRhWvEQlA==; 31:MZdzx4Cu++COXb8NhFl+ov/WCppuvfRPRa5Av2kWEJoM/ARgS5FjcbKbqN0xz1xXkuclwL4fG93/obziWztdBMxlYW1p2MLxp1JYSzn5FkdY/oeesQFcMX6KxZtIggxCdSZXFITeS/ftNH/VUGKBwCYdxrgX+gsCX4oB6p1Si5heKQyDDTT9HZn7vGs64A+RzROxLZ3+94FbhiSKuD19xV6cj4ehsi4H2jnhdZhkX0w= X-MS-TrafficTypeDiagnostic: PS1PR0601MB1883: Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=kuninori.morimoto.gx@renesas.com; X-Microsoft-Exchange-Diagnostics: 1; PS1PR0601MB1883; 20:voROYDGK9Il8DuPAL5mxclhxweZLDolMnT4dMTmtMG2y+zlxLV3qg5Q+mGFKBrkMh5TnjF9fOUIqVqGM38yonlZZRYmmfYzJOyPzKHFODdarm/oH1cRO5PkxjOjFYk0/k1seIpug78YBtmjJ9RAkMOWA9bCESjLZStOxZqI+kkIrWTY6e0uQWLC9/3if6sggPywEbLLXc1dw4jdxXpcC6Ta+i27AhMNr27f64sqpdeVED3mQS2P2k2oD2i0j1Y5xRisQ98yG5NooRIgGJ5+ujjTx9PGYiPNmUz2OdahNlXVdIKigyfNOYQvUSRgM54OHkL79WrxybxNtA+6+FWGinhAIYT1/Cw8H7Am7bJ36GbTWcYoIcFXsJCx9rJImPvgyMjCTiptIyXo23mcGCJF63MctNjA2boQv5EYNoj1hqNTvaGRendLm3up72IqTVlcXoK3HCiB2vnwG5ly8Dns2nBdNOYz1X0ubkUs/p1R1r8o6h/Ya4G/FcoCjjIkYVC0F; 4:dhNrEt0hI56K5325SMEmrCjUEWTfI6w+PwK6RUigqVFq63+tih3/1b9IiCO75rC82hPD7oTmD7s3kN3ugHYtEis6uZ9a7Zf1tIvVWAAJ63Zl6x5V8Nca2W6/lSmCr9oGVPSMTd4ssbv0qAROZRdH1WOIhx5DL3w9EUSE7QeihSR2Asc+TLOIPfxXu8j8aR3xOGIcUBk+wT+XqupzayD3f9e6Oo0OqVTV4muP5rus9x2Pi9FVkW1prM9fg3j3f9rbz4Oy6uvW41lC0TPfAcMvmi4XGSqg5FMJFLqVHqoRK6Q= X-Exchange-Antispam-Report-Test: UriScan:(788757137089); X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(601004)(2401047)(5005006)(8121501046)(10201501046)(3002001)(93006095)(93001095)(100000703101)(100105400095)(6055026)(6041248)(20161123558100)(20161123555025)(20161123560025)(20161123562025)(20161123564025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:PS1PR0601MB1883; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:PS1PR0601MB1883; X-Forefront-PRVS: 0417A3FFD2 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(4630300001)(7370300001)(6009001)(39860400002)(189002)(199003)(66066001)(83506001)(5660300001)(47776003)(68736007)(50466002)(101416001)(2906002)(6486002)(7736002)(69596002)(4001350100001)(97736004)(6916009)(2950100002)(7350300001)(305945005)(33646002)(3846002)(6116002)(4326008)(53416004)(42186005)(54356999)(50986999)(76176999)(23726003)(81156014)(81166006)(478600001)(8676002)(110136004)(189998001)(36756003)(105586002)(53936002)(86362001)(25786009)(54906002)(106356001)(16060500001); DIR:OUT; SFP:1102; SCL:1; SRVR:PS1PR0601MB1883; H:morimoto-PC.renesas.com; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; Received-SPF: None (protection.outlook.com: renesas.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; PS1PR0601MB1883; 23:Aa+j2tNng3sFg7X5PxIEz9oOIbnbkB+NT8ie0cI?= =?us-ascii?Q?Pk0x9mAmoRo7gQr6739M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Y2D3pke9DCzGEknJ4RwYncXaoWfbCPI1QdFpsuI7x+31wpoydzIUjbEFanLpYbasa/KO28WqruOTH8dfj+MUwkwPIpCQc6J1X3mCPJ2BsACqpA= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; PS1PR0601MB1883; 20:Z2YdDpmA0WdzCEMrjUcWFmma3FkUeLO6pMVqjCSmeGg+e1jBq07zkDmLGv2ewEWSBmDAwjODxKlTgQ9iW+ji6rNqtGxdC0aF1mn1j1Iq/b7/rMDl/uXAl5rlO0I+WLA4HTSfHWbbKEfPouD6lfZDElBLe6JZr7+wtrXmlZqqomE= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Sep 2017 06:30:38.9624 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: PS1PR0601MB1883 Cc: Linux-ALSA , Lars-Peter Subject: [alsa-devel] [SAMPLE 6/6] ASoC: replace platform to component on amd/acp 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 Now platform can be replaced to component, let's do it. Signed-off-by: Kuninori Morimoto --- sound/soc/amd/acp-pcm-dma.c | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/sound/soc/amd/acp-pcm-dma.c b/sound/soc/amd/acp-pcm-dma.c index 08b1399..19d8821 100644 --- a/sound/soc/amd/acp-pcm-dma.c +++ b/sound/soc/amd/acp-pcm-dma.c @@ -23,6 +23,8 @@ #include "acp.h" +#define DRV_NAME "acp_audio_dma" + #define PLAYBACK_MIN_NUM_PERIODS 2 #define PLAYBACK_MAX_NUM_PERIODS 2 #define PLAYBACK_MAX_PERIOD_SIZE 16384 @@ -619,8 +621,8 @@ static int acp_dma_open(struct snd_pcm_substream *substream) int ret = 0; struct snd_pcm_runtime *runtime = substream->runtime; struct snd_soc_pcm_runtime *prtd = substream->private_data; - struct audio_drv_data *intr_data = dev_get_drvdata(prtd->platform->dev); - + struct snd_soc_component *component = snd_soc_rtdcom_lookup(prtd, DRV_NAME); + struct audio_drv_data *intr_data = dev_get_drvdata(component->dev); struct audio_substream_data *adata = kzalloc(sizeof(struct audio_substream_data), GFP_KERNEL); if (adata == NULL) @@ -634,7 +636,7 @@ static int acp_dma_open(struct snd_pcm_substream *substream) ret = snd_pcm_hw_constraint_integer(runtime, SNDRV_PCM_HW_PARAM_PERIODS); if (ret < 0) { - dev_err(prtd->platform->dev, "set integer constraint failed\n"); + dev_err(component->dev, "set integer constraint failed\n"); kfree(adata); return ret; } @@ -804,6 +806,7 @@ static int acp_dma_trigger(struct snd_pcm_substream *substream, int cmd) struct snd_pcm_runtime *runtime = substream->runtime; struct snd_soc_pcm_runtime *prtd = substream->private_data; struct audio_substream_data *rtd = runtime->private_data; + struct snd_soc_component *component = snd_soc_rtdcom_lookup(prtd, DRV_NAME); if (!rtd) return -EINVAL; @@ -817,7 +820,7 @@ static int acp_dma_trigger(struct snd_pcm_substream *substream, int cmd) while (acp_reg_read(rtd->acp_mmio, mmACP_DMA_CH_STS) & BIT(SYSRAM_TO_ACP_CH_NUM)) { if (!loops--) { - dev_err(prtd->platform->dev, + dev_err(component->dev, "acp dma start timeout\n"); return -ETIMEDOUT; } @@ -869,7 +872,8 @@ static int acp_dma_close(struct snd_pcm_substream *substream) struct snd_pcm_runtime *runtime = substream->runtime; struct audio_substream_data *rtd = runtime->private_data; struct snd_soc_pcm_runtime *prtd = substream->private_data; - struct audio_drv_data *adata = dev_get_drvdata(prtd->platform->dev); + struct snd_soc_component *component = snd_soc_rtdcom_lookup(prtd, DRV_NAME); + struct audio_drv_data *adata = dev_get_drvdata(component->dev); kfree(rtd); @@ -906,7 +910,8 @@ static int acp_dma_close(struct snd_pcm_substream *substream) .prepare = acp_dma_prepare, }; -static struct snd_soc_platform_driver acp_asoc_platform = { +static struct snd_soc_component_driver acp_asoc_platform = { + .name = DRV_NAME, .ops = &acp_dma_ops, .pcm_new = acp_dma_new, }; @@ -951,7 +956,8 @@ static int acp_audio_probe(struct platform_device *pdev) /* Initialize the ACP */ acp_init(audio_drv_data->acp_mmio); - status = snd_soc_register_platform(&pdev->dev, &acp_asoc_platform); + status = devm_snd_soc_register_component(&pdev->dev, + &acp_asoc_platform, NULL, 0); if (status != 0) { dev_err(&pdev->dev, "Fail to register ALSA platform device\n"); return status; @@ -969,7 +975,6 @@ static int acp_audio_remove(struct platform_device *pdev) struct audio_drv_data *adata = dev_get_drvdata(&pdev->dev); acp_deinit(adata->acp_mmio); - snd_soc_unregister_platform(&pdev->dev); pm_runtime_disable(&pdev->dev); return 0;