From patchwork Fri Jan 12 00:47:47 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 10158927 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 8DA8B602A7 for ; Fri, 12 Jan 2018 00:49:10 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 78EDA288DE for ; Fri, 12 Jan 2018 00:49:10 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6AB1828914; Fri, 12 Jan 2018 00:49:10 +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 5CA93288DE for ; Fri, 12 Jan 2018 00:49:09 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id E8F3C267A14; Fri, 12 Jan 2018 01:49:01 +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 E8675267A4E; Fri, 12 Jan 2018 01:49:00 +0100 (CET) Received: from relmlie3.idc.renesas.com (relmlor4.renesas.com [210.160.252.174]) by alsa0.perex.cz (Postfix) with ESMTP id 96062267A14 for ; Fri, 12 Jan 2018 01:47:51 +0100 (CET) Received: from unknown (HELO relmlir4.idc.renesas.com) ([10.200.68.154]) by relmlie3.idc.renesas.com with ESMTP; 12 Jan 2018 09:47:50 +0900 Received: from relmlii2.idc.renesas.com (relmlii2.idc.renesas.com [10.200.68.66]) by relmlir4.idc.renesas.com (Postfix) with ESMTP id 1E61962B85; Fri, 12 Jan 2018 09:47:50 +0900 (JST) X-IronPort-AV: E=Sophos;i="5.46,346,1511794800"; d="scan'208";a="269303715" Received: from mail-hk2apc01lp0208.outbound.protection.outlook.com (HELO APC01-HK2-obe.outbound.protection.outlook.com) ([65.55.88.208]) by relmlii2.idc.renesas.com with ESMTP/TLS/AES256-SHA256; 12 Jan 2018 09:47:49 +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=JQpxFXSPdpWeN660lfwELREgh3d2KCMDBzbRhImdXRM=; b=Xsxj7e9qhh8A+BYhJrjKg0dQrl6wp7dVMeq9nHxEx1zNr0Syth71vD8dgXLQvcnXpBrhLI3+cnfW9GWDnk8kBmhhTx1WSyE+ms9pbYZ/Pnbia6CkPL4pMybEvy/4UW/hA+M5S5mdKet11ODuhY1E4yaeDqDreGPefnNVjeGFxFg= Received: from morimoto-PC.renesas.com (211.11.155.138) by KL1PR0601MB1880.apcprd06.prod.outlook.com (2603:1096:802:8::16) 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:47:47 +0000 Message-ID: <877esngaz4.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:47:47 +0000 X-Originating-IP: [211.11.155.138] X-ClientProxiedBy: TY1PR01CA0184.jpnprd01.prod.outlook.com (2603:1096:403::14) To KL1PR0601MB1880.apcprd06.prod.outlook.com (2603:1096:802:8::16) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: b0bfb3d0-8119-47da-fb99-08d5595619d1 X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020074)(4652020)(5600026)(4604075)(48565401081)(2017052603307)(7153060)(7193020); SRVR:KL1PR0601MB1880; X-Microsoft-Exchange-Diagnostics: 1; KL1PR0601MB1880; 3:LGVseIQ6oMXgDVBln/zZ/jbl1MIkiXbtttKW8Ik+nlj4Z8J9lbAwB2CHKxm9/D8phTgESGfXugSFwfHmOic+bnouoiSlYzBw3/TIJewNWcPJopGFURpCgHdQRf4STjQGUw/SUA8fO68cjIAFhJOw1+OxC21LQhnmaz2t+6CPxrP0ilRaOipTeJKxxGpN2buH+cALcX53WA1oLrX9bDY/SWgYA1Euv6qU9/o+BHxCv5rmHKn+8DyuaBvbgKGlf/yL; 25:bWugjodr2bza+zCCQIvG2eu6uzCYrmxbBujOR5fLXLqtL3ocG3ZlT9xsRkbmo4KpMpwRG4Fdtx2O6S47sbuNQj7B0GDX7sRCFn1+iROfB0rRSA9DACck6R3hYPUmoIO1gwKGrASjSBtIw9GUmwlAfW1LgpBtVKCrTJWX4xkLORfWmhCWo+08eaXgQYkrxsLQh+62wVzMLIEp8/ncvVNvbSv4OCgwZDeeUEZkh2ij5iDOm6U/+LSIP0SpbHvrH39rcHwgA9rrDL5R/J9awhW84pABK6ytXJT+ys4y+ngpCk0myn2rUflxL9zRqzqKEw68KFK+TtXjeZcHifzMG335RQ==; 31:bT3O+9i75+kk0stiW2ueOUfYFIFCym76+Trdjwp2LJoZBmY7UAIyQKdwmc859XjwqK60GZHf0u0R7RPWATCw6GyP1jFVVgjl1mElsxiPqRWga4Ts6GRPvvbmZDf2enwxDx7S6XFjxFnKPOA6c93JZtpBiyzoM1evvkc3Z4VFmqT4hGtKKrInIWGrEaS30PHbsPtDjb1fFlWHTy0xKUjx2W9vsmMlLbwJTXoHA7uihB0= X-MS-TrafficTypeDiagnostic: KL1PR0601MB1880: Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=kuninori.morimoto.gx@renesas.com; X-Microsoft-Exchange-Diagnostics: 1; KL1PR0601MB1880; 20:J9F9d6i2DWGwTbAe5be0u0Lvi5n6cfw36rkSpwHRHM4PeHLLhmMUOKLm9WeFps9iLpXZY/cND9bEClyVMzi6JbxVPFL1WVx+7/4nVS3ouKo2VYkCirFPwUYY64M1Ppx0Z9A/AMNIeSUqtmWudVLeKJ4jPCSLaJrALGK1sWxGeM3azCgFrlWrvKhRdy5JMoJFmmm3EK0GwT4JZBF4xmvdZrUlsAHO6NHKR3hvsoSnPW4Bt3BUO/gWGRwi0Ny6JO77svIxVU+FM4UEEaWNfNE/FWOWNhoRoXOUgRor5vuf1CAwruL5KzpbZWmlsOWJ1ov7545/hInVZrYsE3ZPlULqbm7wna8wLAMnSX7AmpH0JT16j/udWZvhmsnRqAyW2pPT3ibqTv6u9N9qDID+UaQoT8ryfFW2Zb+SgSsI16z0wKf99cemy59ENIV6HrlI+1XuC10Ncotwch1h2qYXBG0n2sKcO/H+LAcTMeXxbOwsgtq8NnRQ/NXt0AuR9ykyMC1K; 4:3epD9oCwFD1Y4wqn3HcGftkr0Bdu9y3HZ6btquh5GFGQNpwo+ophGzj14h2i5dGg7Z1GJbCDaysFMO2bFzE7gIwpyWNlFD8LT0D8cbKumFUFxecdsYPQryRiMx4AfYptcCP01ZH8k8ZJVFTt5y3a0QMk0eUblJZQHgKC+9fXhNhb0dHpgYKFbPWNcXzfuZmsee9sWV9VTGbdZvhQbQGTW5wYBpAiloHIVI82czEFEheMlC7dIdlaeXEEDOkggsh8rFtT9ojgixbxhy3SD7eWO9ysqzL/gJkheTSBCyDw/AOlWDToxyjuQtCSpYC7pBE3 X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(788757137089); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040470)(2401047)(5005006)(8121501046)(3231023)(944501137)(93006095)(93001095)(10201501046)(3002001)(6055026)(6041268)(20161123560045)(20161123564045)(20161123558120)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011); SRVR:KL1PR0601MB1880; BCL:0; PCL:0; RULEID:(100000803101)(100110400095); SRVR:KL1PR0601MB1880; X-Forefront-PRVS: 0550778858 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(39380400002)(396003)(346002)(39860400002)(366004)(376002)(199004)(189003)(106356001)(6116002)(5660300001)(3846002)(81166006)(8936002)(47776003)(81156014)(68736007)(23726003)(36756003)(6916009)(2950100002)(8676002)(53936002)(76176011)(66066001)(53416004)(4326008)(25786009)(6486002)(58126008)(386003)(16586007)(50466002)(54906003)(97736004)(16526018)(105586002)(83506002)(52116002)(2906002)(575784001)(316002)(7696005)(7736002)(305945005)(478600001)(86362001)(69596002)(16060500001); DIR:OUT; SFP:1102; SCL:1; SRVR:KL1PR0601MB1880; H:morimoto-PC.renesas.com; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX: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; KL1PR0601MB1880; 23:noqbr+CdgfNdHqKAO9bWBZePNUhtb0ag9dnWFsm?= =?us-ascii?Q?2HKKUSNMhjNp3GKNgno0WUsoX5QSQ9pNckeIZQShXwkwEey4bYjP1UbIJ3k5?= =?us-ascii?Q?mNzPhZPqb3g5EHBfxdSojjTR4fM+E9Ly4+0OGDpkv+hPnnhs3zBh64FdXLiy?= =?us-ascii?Q?n1pmNqD7DtXL7Af9RAkMqiTlt8ZLYK54+RqL9tZraP7ewOrNgzixrhYq6U68?= =?us-ascii?Q?UEbMJwibNyRlLaAnn770kSduPHxUZ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ZA7julrBTD3c7ZdxOl8S2jQucVadxuhhRp3uh1lqnfJ3WtR1v6UamFsVfVcexIHk3iW6wnaczgc26C/ePcPlM721owLODohYC2mS9ULQauCeOs8RYhX/vjvKtoCLkLI0UD1mgtqal26RqZvU2YB+RUgzIB0BShMycoPxJk= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Jan 2018 00:47:47.3669 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: b0bfb3d0-8119-47da-fb99-08d5595619d1 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 53d82571-da19-47e4-9cb4-625a166a4a2a X-MS-Exchange-Transport-CrossTenantHeadersStamped: KL1PR0601MB1880 Cc: Linux-ALSA , Simon Subject: [alsa-devel] [PATCH 17/38] ASoC: wm5110: 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 Acked-by: Charles Keepax Tested-by: Charles Keepax --- sound/soc/codecs/wm5110.c | 42 +++++++++++++++++------------------------- 1 file changed, 17 insertions(+), 25 deletions(-) diff --git a/sound/soc/codecs/wm5110.c b/sound/soc/codecs/wm5110.c index fb0cf9c..d5ece6c 100644 --- a/sound/soc/codecs/wm5110.c +++ b/sound/soc/codecs/wm5110.c @@ -35,6 +35,8 @@ #define WM5110_NUM_ADSP 4 +#define DRV_NAME "wm5110-codec" + struct wm5110_priv { struct arizona_priv core; struct arizona_fll fll[2]; @@ -2229,7 +2231,8 @@ static int wm5110_set_fll(struct snd_soc_codec *codec, int fll_id, int source, static int wm5110_open(struct snd_compr_stream *stream) { struct snd_soc_pcm_runtime *rtd = stream->private_data; - struct wm5110_priv *priv = snd_soc_platform_get_drvdata(rtd->platform); + struct snd_soc_component *component = snd_soc_rtdcom_lookup(rtd, DRV_NAME); + struct wm5110_priv *priv = snd_soc_component_get_drvdata(component); struct arizona *arizona = priv->core.arizona; int n_adsp; @@ -2346,6 +2349,16 @@ static int wm5110_codec_remove(struct snd_soc_codec *codec) ARIZONA_DAC_DIGITAL_VOLUME_6R, }; +static struct snd_compr_ops wm5110_compr_ops = { + .open = wm5110_open, + .free = wm_adsp_compr_free, + .set_params = wm_adsp_compr_set_params, + .get_caps = wm_adsp_compr_get_caps, + .trigger = wm_adsp_compr_trigger, + .pointer = wm_adsp_compr_pointer, + .copy = wm_adsp_compr_copy, +}; + static const struct snd_soc_codec_driver soc_codec_dev_wm5110 = { .probe = wm5110_codec_probe, .remove = wm5110_codec_remove, @@ -2356,6 +2369,8 @@ static int wm5110_codec_remove(struct snd_soc_codec *codec) .set_pll = wm5110_set_fll, .component_driver = { + .name = DRV_NAME, + .compr_ops = &wm5110_compr_ops, .controls = wm5110_snd_controls, .num_controls = ARRAY_SIZE(wm5110_snd_controls), .dapm_widgets = wm5110_dapm_widgets, @@ -2365,20 +2380,6 @@ static int wm5110_codec_remove(struct snd_soc_codec *codec) }, }; -static const struct snd_compr_ops wm5110_compr_ops = { - .open = wm5110_open, - .free = wm_adsp_compr_free, - .set_params = wm_adsp_compr_set_params, - .get_caps = wm_adsp_compr_get_caps, - .trigger = wm_adsp_compr_trigger, - .pointer = wm_adsp_compr_pointer, - .copy = wm_adsp_compr_copy, -}; - -static const struct snd_soc_platform_driver wm5110_compr_platform = { - .compr_ops = &wm5110_compr_ops, -}; - static int wm5110_probe(struct platform_device *pdev) { struct arizona *arizona = dev_get_drvdata(pdev->dev.parent); @@ -2464,23 +2465,15 @@ static int wm5110_probe(struct platform_device *pdev) if (ret < 0) goto err_dsp_irq; - ret = snd_soc_register_platform(&pdev->dev, &wm5110_compr_platform); - if (ret < 0) { - dev_err(&pdev->dev, "Failed to register platform: %d\n", ret); - goto err_spk_irqs; - } - ret = snd_soc_register_codec(&pdev->dev, &soc_codec_dev_wm5110, wm5110_dai, ARRAY_SIZE(wm5110_dai)); if (ret < 0) { dev_err(&pdev->dev, "Failed to register codec: %d\n", ret); - goto err_platform; + goto err_spk_irqs; } return ret; -err_platform: - snd_soc_unregister_platform(&pdev->dev); err_spk_irqs: arizona_free_spk_irqs(arizona); err_dsp_irq: @@ -2495,7 +2488,6 @@ static int wm5110_remove(struct platform_device *pdev) struct arizona *arizona = wm5110->core.arizona; int i; - snd_soc_unregister_platform(&pdev->dev); snd_soc_unregister_codec(&pdev->dev); pm_runtime_disable(&pdev->dev);