From patchwork Fri Jan 12 00:50:12 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 10158951 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 8AE3B602D8 for ; Fri, 12 Jan 2018 00:53:22 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 770D028801 for ; Fri, 12 Jan 2018 00:53:22 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 75D9A288C4; Fri, 12 Jan 2018 00:53:22 +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 3C062288D1 for ; Fri, 12 Jan 2018 00:52:45 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 5D3CC267969; Fri, 12 Jan 2018 01:52:44 +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 1A409267974; Fri, 12 Jan 2018 01:52:43 +0100 (CET) Received: from relmlie3.idc.renesas.com (relmlor4.renesas.com [210.160.252.174]) by alsa0.perex.cz (Postfix) with ESMTP id 43BC2267AA6 for ; Fri, 12 Jan 2018 01:50:15 +0100 (CET) Received: from unknown (HELO relmlir3.idc.renesas.com) ([10.200.68.153]) by relmlie3.idc.renesas.com with ESMTP; 12 Jan 2018 09:50:14 +0900 Received: from relmlii2.idc.renesas.com (relmlii2.idc.renesas.com [10.200.68.66]) by relmlir3.idc.renesas.com (Postfix) with ESMTP id 972154B9C3; Fri, 12 Jan 2018 09:50:14 +0900 (JST) X-IronPort-AV: E=Sophos;i="5.46,346,1511794800"; d="scan'208";a="269303998" Received: from mail-sg2apc01lp0240.outbound.protection.outlook.com (HELO APC01-SG2-obe.outbound.protection.outlook.com) ([65.55.88.240]) by relmlii2.idc.renesas.com with ESMTP/TLS/AES256-SHA256; 12 Jan 2018 09:50:13 +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=rFiFsG60llwG/6+EpXYtLFB5/TMslOWoisob99S9pxY=; b=El6u4fn1+8D2Pmv9t7svG1aZqY98NeZ/ieFkntNbfiBQ6dYB2PPvcWR5Hvc5ek+bMU3aVwJ5BZQY22O6ud+UCOLArQMSPmjUTvMvECanz7KakaDt3ezFnDuFquhSf8NoCY671Oi/9iWFj5UlVQJXmlT4vakF9BC9TnRXq2rdbxM= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=kuninori.morimoto.gx@renesas.com; Received: from morimoto-PC.renesas.com (211.11.155.138) by HK2PR0601MB1876.apcprd06.prod.outlook.com (2603:1096:202:a::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.386.5; Fri, 12 Jan 2018 00:50:12 +0000 Message-ID: <871sivgav2.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: <87vag7gb9o.wl%kuninori.morimoto.gx@renesas.com> References: <87vag7gb9o.wl%kuninori.morimoto.gx@renesas.com> MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Date: Fri, 12 Jan 2018 00:50:12 +0000 X-Originating-IP: [211.11.155.138] X-ClientProxiedBy: OS2PR01CA0100.jpnprd01.prod.outlook.com (2603:1096:602:1::18) To HK2PR0601MB1876.apcprd06.prod.outlook.com (2603:1096:202:a::20) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: d5b0f858-4e89-40e4-780e-08d559567014 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020074)(4652020)(48565401081)(5600026)(4604075)(2017052603307)(7153060)(7193020); SRVR:HK2PR0601MB1876; X-Microsoft-Exchange-Diagnostics: 1; HK2PR0601MB1876; 3:ICoVzb/p2hdsxh5L9SqfLz99991qIHvrm7l16L34mOxheSVguLm51Hrw8La/4iRJXzg4t+sNFv2W+0V5WbZcfuEKlueCciyaEzwSW+oW68YYUslW2Hc0w3Fz4pn2OykHBUxztCfZSIjWjAGCKaetvX4oPeW1wBbicKLJIgXK2hxPq69mrNT5DV8NdKEviI9xbKdevSM27ELFidOdUbYkJ2m3y/JMkxvQ3uKP/Oo4pOEkqEgH4caPIuEkH44Be0ex; 25:I/dH6I27kJb+xnUJeT344vT6v1A7XLh+jbhL/oerUsTEOpvFuNdOMfflEY06ENQbqNz2zgl6MlmLRWP0XMxue1I4LvlOcV0FNKHhJeblUxLUIaNEhjH6/5RpqoPh4RR1WBAh8BkHVos6FQUGeDk8j0RfjU/U5HuJBip5I2kxXQJJBuwXTraeysD580QGc+pV4xAqBv2hHAhfrIUo4O2HfXpUD7bJFbGL1V8DJg2NNetgVfJLGSE9NpyFzbSs++rsSsjoIq32km1zQ59ZgiQG+WdTUDL0V2FuDcruk39spOctFuN1JhjLpgL1Q44q613ln/6dftCOADIy4XrK6S6WqQ==; 31:0ZUecYsVXHXmR+bq1b+5qH0RJMNjnT4QguNfq5vopFlSmHGo+69VbXfyExEmdFMTJOEl9+FtvQzOJO286IYeBfGbsNSEk2M8hLe5lVIkwlaCNMFDnNlwJiLXI4hqOvhNgizxPOJEku8Ebs1q/ECL09joZpq1p/nTvMNQUYBZkIReKQ6s2GmcW8B91srhFzekI+jxkyn4en3X+ZyNii7ToNuOi47Bh6wSdIhnI/7JhBU= X-MS-TrafficTypeDiagnostic: HK2PR0601MB1876: X-Microsoft-Exchange-Diagnostics: 1; HK2PR0601MB1876; 20:FZJ7rWFe8F0ARBTmj/qm88//Cb4UbvWT6CbU/bq4GlBSmr49grQ4ZnaIkt9wy+vyiJEsDhNYCH1c36Pa1DUL4+MiB6DA6GCKXfdMUrxBsEu1wzoPkBqkan3iGf/Nzxos33dhcRPL7swii2Funq82twWbjqofVHXBO5ds+SmWS9GYnBU8HXUTDJR9IfTzK0JBQ9VPhNvxgYf/uJb25xqDS6K0jdHe+r/r0hb3Ee6GDL+IRbrRitLyqa6srIPI/iohP5fg2xlTvk2z5f8Iv6Hu72FccuHYOVeAoFwxW1QfSZ7npmDZbzewsVQhuX5ODf5VstbsBoIeJOo/7V+GpcFT9amvQzaVZQc14+kDe3Ud0APozcvKIUBP1bFgVH3nA+BFs+ajgVMT8t+PHvdr1KozLqUpBU5gIWK4WvW8Mu9oHwIZjGDsni4CgDmWTEeH9Ya+wPkGrIvs4Kz3YzdagBmaJSA5YNEebF5+Xgge5DxkLg/0nBjZ7Vl1ehCRr/nDJsoR; 4:dRbRnehUFJTOyLlK7mxDxclkUfcjzVBbjM8pNC4oRxZFcMpeQMopm+57o81dpXFxI90sC3tzG0SdrnSymGN3F6tQcXtagYrOeKDt83nyyXRLoCh733RNOK1ajZlJVQPvQdx3j8nL0DSnp55i23VOjm06ch22jnF/wuj1riTQpgVxqDNjkxMUbHYivKmgqotM4JVoQ6JIu2FwgwLuMHoZbd0leopAywcJ/6O2d9tUmalOEFl7Ea/V1qgT9ck3yBbuoljrb+Rf69crUx98NUXtibq63w5yWDHwvf8PV72632bH49L73SHktLNqNEjj0DsK X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(788757137089); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(2401047)(5005006)(8121501046)(3002001)(93006095)(93001095)(3231023)(944501137)(10201501046)(6055026)(6041268)(201703131423095)(201703061421075)(20161123564045)(20161123562045)(20161123558120)(20161123560045)(6072148)(6042181)(201708071742011); SRVR:HK2PR0601MB1876; BCL:0; PCL:0; RULEID:(100000803101)(100110400095); SRVR:HK2PR0601MB1876; X-Forefront-PRVS: 0550778858 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(366004)(189003)(199004)(386003)(6916009)(6486002)(2950100002)(69596002)(4326008)(36756003)(106356001)(8936002)(508600001)(97736004)(105586002)(76176011)(305945005)(50466002)(6116002)(53416004)(8676002)(7736002)(52116002)(25786009)(83506002)(81156014)(5660300001)(81166006)(16586007)(3846002)(47776003)(68736007)(86362001)(7696005)(23726003)(66066001)(16526018)(2906002)(53936002)(58126008)(54906003)(16060500001); DIR:OUT; SFP:1102; SCL:1; SRVR:HK2PR0601MB1876; 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; HK2PR0601MB1876; 23:I3FOWX1qRzWzDas9tGe/ITnhTa9l794gh7Xf96d?= =?us-ascii?Q?g8qJrbOVh92Q/06yCFgEKPTzxCzJaMcviCD3PFq2e+4SHUYopAHOzOA8D2RG?= =?us-ascii?Q?cQOh8Ii+zmwKpMzcHuL/qwhUj+1GnF3/U6LKw5ieuDYWt3BkRCsyLKB95EpO?= =?us-ascii?Q?l4VvuNXowmIKxoG6kxmBJ+0eL353oECAvY2JjZKqS3EBnUou2V5Xp3K1J1cs?= =?us-ascii?Q?UE97+X9cx2NKUSsNH6H3yMWyDr9kKQPiGdeGVBvuT2s1kxHpt7d4dvq+/Y/9?= =?us-ascii?Q?D6VN9H0tndEgA1KAHVN14DBGAhYlBsNZ/k0j5scSW0AIcUsVLu9aFWoKha02?= =?us-ascii?Q?tQrzQ0sYLb6V4C0EMusAtW0C1mOu6TrtvFF1s6LBZKOwfBhy6cv1HVT/X/98?= =?us-ascii?Q?0/67S15AYynZyD+fs9Pak6tefPl0pJqPLlxzNIQyRVHMZZZeUO89sLej9Aep?= =?us-ascii?Q?cXBNh/fHf7NTaEcPvqZQsF724t3FLfo8ZZVPT+ZitSG72cCc0m+Iu6BgVbOW?= =?us-ascii?Q?5RduGbVFFprUGPqCfk2VYAvWgwJo1V33akgHXAyaAZRguwzichlgqXRacp5V?= =?us-ascii?Q?tUh1l6a5J+1x5a6/aGSBFsS0dlvfnx4dp8yksIF3NShw2L2KrX+R3K+bX5Lv?= =?us-ascii?Q?kagEGgjgMB1TBwfQmD63FutOV1M2jkH7R8P56s7pmEnucfwI2cys2GOJFtXm?= =?us-ascii?Q?5paRad775CpWWRbUoHfeneVqujxekwNxZeCNUM3DjEEf1eVKsjyamPd2Xb/q?= =?us-ascii?Q?Ew8qle4wtIv1VJz49l4ZGslfz7mk7auvwGfJnw5vvFEHw7J46rjYqiFq2REg?= =?us-ascii?Q?h7VhcYQPu+/wevL0VAcv/kuhGNUK4U495KafKH471YCmgUDdWnHh9jDrAqJ5?= =?us-ascii?Q?xow5n6wbK9aFiOczVzqEQEI5WTSSwHfQvSnxCiEbi5Ro28GKC3ZTO8WzmFmx?= =?us-ascii?Q?d/iw4LHDdtkbNHEzO1tUKQSrORQk19T35JvPsJ/jWqmM2bz3szI2tXDLqhbM?= =?us-ascii?Q?YDnkiF6JJsHEo9DuoVAPMvqJy?= X-Microsoft-Exchange-Diagnostics: 1; HK2PR0601MB1876; 6:q40ZoY3ZdvEm+CREt3iSkuwdiv1MezNX9/PwurARfziWKjiY+ztl/f92K5OiQV4e5E+bt1Grw0Obtg/CtjOmxF/QMOilK8P9BoeqVe7kvZzLpgrrbjgelQHYckjzb87WhB6AUKWXCPMrXu53cRwDIPyQNRiF9DB1ws7U7qr4azrCI8FZvGmJXe6usgwfR1uhuPpOdDT/v3zJKPvkqa42icTQ+XnTYDLcQualxGTHiNjtp800FQmXbnTuL0b+vDCGhw6yYObwT/ktq8CcV7GtvdOGfuY5I1cbA8fttITk4kNNtwXT9xWmU35NOFu/uDiE79HCLUbCbFflZX3aZE1sn3bRtTXnZXVNcDZ2OX5mmMU=; 5:+WIQ0q3yP38y/NRJw0WEu0H9S7FQKq3fkoEAOl0G2/O9W1h9hll0K4y38ARwSi3Jam0QutaGTVGL1sCEg89j2ix4W/XM8q3nRqCb5oWTAmOHTiZD8cN8iDKACgGmY3EOpTQlVcnUa5xAs3rE9YZ9ZKVwnAVYRvHcNcz0cBT3Xcc=; 24:2IkzUrzxph2TZT2ltbcCc3tSTK06RPUvEZTShzJIovN7+Ja+HlmkHqVVo6YZR3tZHOCRq4A0PMdfNSsQ7hvJ5gFyBWsEkqGZqpp256d2bvA=; 7:WZuxbxuPYYJtFCOqIoxm9h3w1xjM1A8xMBalb4V1yR46VAPdHY57mKP86A8daJvUKUx9EXT5LcdVu+BdhAZ4ZRCbIW9yRSsXjHsyhL2cM7vCpz20BXgT1cnywODVluTXaf9sJQCeUVhh0vQzPYhVK3PLcDUUDGrJz8dEQ8/KzVVgGcX3H8x11Ur1ROl/Jqodo4qSWGUzZFOCRJSJKBcx7+To75onJ/wIj2ig2IYUPhoijvqTbSpBImsNVuHkYsDJ SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; HK2PR0601MB1876; 20:oqBTeOU4Ik4ePwHWKGR6OV2WdWjZMnmnq0n6JXigD0BjP2UoSerTlhgt0NIHkygYlSpZUUPEBew+HfHKn/FE1yW2Wyc+6K5oFUKy3fMWCY3Su3/fXMQL1Hacm/6T6WiNhUh5olagpebi2NfqCEoy5T7bw6OUzLruaQ/BTtzCrx0= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Jan 2018 00:50:12.1179 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: d5b0f858-4e89-40e4-780e-08d559567014 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 53d82571-da19-47e4-9cb4-625a166a4a2a X-MS-Exchange-Transport-CrossTenantHeadersStamped: HK2PR0601MB1876 Cc: Linux-ALSA , Simon Subject: [alsa-devel] [PATCH 21/38] ASoC: fsl: asrc: replace platform to component 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 From: Kuninori Morimoto Now platform can be replaced to component, let's do it. Signed-off-by: Kuninori Morimoto Tested-by: Nicolin Chen --- sound/soc/fsl/fsl_asrc.c | 10 ---------- sound/soc/fsl/fsl_asrc.h | 3 ++- sound/soc/fsl/fsl_asrc_dma.c | 14 +++++++++----- 3 files changed, 11 insertions(+), 16 deletions(-) diff --git a/sound/soc/fsl/fsl_asrc.c b/sound/soc/fsl/fsl_asrc.c index 806d399..adfb813 100644 --- a/sound/soc/fsl/fsl_asrc.c +++ b/sound/soc/fsl/fsl_asrc.c @@ -582,10 +582,6 @@ static int fsl_asrc_dai_probe(struct snd_soc_dai *dai) .ops = &fsl_asrc_dai_ops, }; -static const struct snd_soc_component_driver fsl_asrc_component = { - .name = "fsl-asrc-dai", -}; - static bool fsl_asrc_readable_reg(struct device *dev, unsigned int reg) { switch (reg) { @@ -927,12 +923,6 @@ static int fsl_asrc_probe(struct platform_device *pdev) return ret; } - ret = devm_snd_soc_register_platform(&pdev->dev, &fsl_asrc_platform); - if (ret) { - dev_err(&pdev->dev, "failed to register ASoC platform\n"); - return ret; - } - return 0; } diff --git a/sound/soc/fsl/fsl_asrc.h b/sound/soc/fsl/fsl_asrc.h index 2c5856a..d558dd5 100644 --- a/sound/soc/fsl/fsl_asrc.h +++ b/sound/soc/fsl/fsl_asrc.h @@ -462,6 +462,7 @@ struct fsl_asrc { u32 regcache_cfg; }; -extern struct snd_soc_platform_driver fsl_asrc_platform; +#define DRV_NAME "fsl-asrc-dai" +extern struct snd_soc_component_driver fsl_asrc_component; struct dma_chan *fsl_asrc_get_dma_channel(struct fsl_asrc_pair *pair, bool dir); #endif /* _FSL_ASRC_H */ diff --git a/sound/soc/fsl/fsl_asrc_dma.c b/sound/soc/fsl/fsl_asrc_dma.c index e1b97e5..565e16d8 100644 --- a/sound/soc/fsl/fsl_asrc_dma.c +++ b/sound/soc/fsl/fsl_asrc_dma.c @@ -64,7 +64,8 @@ static int fsl_asrc_dma_prepare_and_submit(struct snd_pcm_substream *substream) struct snd_soc_pcm_runtime *rtd = substream->private_data; struct snd_pcm_runtime *runtime = substream->runtime; struct fsl_asrc_pair *pair = runtime->private_data; - struct device *dev = rtd->platform->dev; + struct snd_soc_component *component = snd_soc_rtdcom_lookup(rtd, DRV_NAME); + struct device *dev = component->dev; unsigned long flags = DMA_CTRL_ACK; /* Prepare and submit Front-End DMA channel */ @@ -137,12 +138,13 @@ static int fsl_asrc_dma_hw_params(struct snd_pcm_substream *substream, bool tx = substream->stream == SNDRV_PCM_STREAM_PLAYBACK; struct snd_dmaengine_dai_dma_data *dma_params_fe = NULL; struct snd_dmaengine_dai_dma_data *dma_params_be = NULL; + struct snd_soc_component *component = snd_soc_rtdcom_lookup(rtd, DRV_NAME); struct snd_pcm_runtime *runtime = substream->runtime; struct fsl_asrc_pair *pair = runtime->private_data; struct fsl_asrc *asrc_priv = pair->asrc_priv; struct dma_slave_config config_fe, config_be; enum asrc_pair_index index = pair->index; - struct device *dev = rtd->platform->dev; + struct device *dev = component->dev; int stream = substream->stream; struct imx_dma_data *tmp_data; struct snd_soc_dpcm *dpcm; @@ -274,7 +276,8 @@ static int fsl_asrc_dma_startup(struct snd_pcm_substream *substream) { struct snd_soc_pcm_runtime *rtd = substream->private_data; struct snd_pcm_runtime *runtime = substream->runtime; - struct device *dev = rtd->platform->dev; + struct snd_soc_component *component = snd_soc_rtdcom_lookup(rtd, DRV_NAME); + struct device *dev = component->dev; struct fsl_asrc *asrc_priv = dev_get_drvdata(dev); struct fsl_asrc_pair *pair; @@ -381,9 +384,10 @@ static void fsl_asrc_dma_pcm_free(struct snd_pcm *pcm) } } -struct snd_soc_platform_driver fsl_asrc_platform = { +struct snd_soc_component_driver fsl_asrc_component = { + .name = DRV_NAME, .ops = &fsl_asrc_dma_pcm_ops, .pcm_new = fsl_asrc_dma_pcm_new, .pcm_free = fsl_asrc_dma_pcm_free, }; -EXPORT_SYMBOL_GPL(fsl_asrc_platform); +EXPORT_SYMBOL_GPL(fsl_asrc_component);