From patchwork Fri Jan 12 00:46:34 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 10158913 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 5CAF9602A7 for ; Fri, 12 Jan 2018 00:47:53 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4955F288DE for ; Fri, 12 Jan 2018 00:47:53 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3E4A328912; Fri, 12 Jan 2018 00:47:53 +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 3540D288DE for ; Fri, 12 Jan 2018 00:47:52 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 1E59E2679F6; Fri, 12 Jan 2018 01:47:50 +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 C8E5B2679F4; Fri, 12 Jan 2018 01:47:48 +0100 (CET) Received: from relmlie1.idc.renesas.com (relmlor2.renesas.com [210.160.252.172]) by alsa0.perex.cz (Postfix) with ESMTP id A5FB22679C0 for ; Fri, 12 Jan 2018 01:46:38 +0100 (CET) Received: from unknown (HELO relmlir4.idc.renesas.com) ([10.200.68.154]) by relmlie1.idc.renesas.com with ESMTP; 12 Jan 2018 09:46:37 +0900 Received: from relmlii2.idc.renesas.com (relmlii2.idc.renesas.com [10.200.68.66]) by relmlir4.idc.renesas.com (Postfix) with ESMTP id 157E262A7F; Fri, 12 Jan 2018 09:46:37 +0900 (JST) X-IronPort-AV: E=Sophos;i="5.46,346,1511794800"; d="scan'208";a="269303590" Received: from mail-sg2apc01lp0243.outbound.protection.outlook.com (HELO APC01-SG2-obe.outbound.protection.outlook.com) ([65.55.88.243]) by relmlii2.idc.renesas.com with ESMTP/TLS/AES256-SHA256; 12 Jan 2018 09:46:36 +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=g70FQ1aOO3kSoPwEpOqaTuNqeg+NBR4rriHpNjPHT4w=; b=kHVRMgS8okYlKf7RFaN9gp+rcILaEqQwSKx/PnM9rxdgM2fTPnDiTYghW9BwMnnVolmrx/B8FGYIRuE0Wzs9ORZXdHnDgGwUvc9uKx8Sb8Bs7mZc23i+izOCRK5cbXj8lenV1TgtazQgSlmDL8I2PLysqmoSJq9p+gBatFszlwk= 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:46:34 +0000 Message-ID: <87d12fgb15.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:46:34 +0000 X-Originating-IP: [211.11.155.138] X-ClientProxiedBy: OSAPR01CA0012.jpnprd01.prod.outlook.com (2603:1096:603:2a::24) 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: e0aa481a-cdc7-4f99-3c46-08d55955ee81 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:pNshn+nGhNgKtHdVdxXejN9SCmvQ/eNs8sQASeMrmcUiG9/QSuCw30OsoEEiKlYJUVL8rkIIpvU0lOzybTmFIcbFEIoFKBU6q7htC+4BjApv9XRtec57QePBSq1d+syL6ufiVbWMRN3bwiHLK2EVKcjMyECukf9MfkAOnFGZi/X91YMmrWAMgIYcAj7wqgC6Jh8XCkSBfnlD2l+3rGc6HwCdlBActJb2sr/BNSrDmCoBt86Vg+/RE7NBuiSaD9gH; 25:kpILaG1ruW2F3tiaP1FURGnrYX6eknoryc+DkAK+VWGZvtk8rRyvpApRnvrYofhK4RjfadPigLE5eOzbQvWeoK1TnuBIqbPK8osOZovZ25loAWbRwLp+6//Ck/fA2ZwazNyYNf/WBAMjVfEfmVJt4MAVay7xbrbFjO2ECESlicNod9UUkfNtbrNTyG/dXwYYmdLMOIHaqX3UKCiguIsBTj1e15jptNbr/lsj0YxWk+kgO9GOjrxsyOiF4PxLqIaJ78Gtk8GusWG+BRe3+CkICgl9JzOpuA6kCDpucdn26Qos1TIkzrmmyPqJhmviPCY3a5I46yVF77VlOudmHUKZvQ==; 31:JrPkkV+ya4cWwqMlYCJKTGaxcQrXxCDj/xX+AO4KuAmT7fkOIssqFlIA1LxVZTuNrJWliU+OUhLN3rGOjZASl8eleU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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)(199004)(189003)(81166006)(83506002)(81156014)(5660300001)(16586007)(3846002)(305945005)(50466002)(76176011)(8676002)(7736002)(52116002)(25786009)(53416004)(6116002)(16526018)(66066001)(2906002)(54906003)(58126008)(53936002)(86362001)(47776003)(68736007)(23726003)(7696005)(105586002)(2950100002)(6486002)(59450400001)(4326008)(69596002)(6916009)(386003)(8936002)(508600001)(97736004)(36756003)(106356001)(16060500001); DIR:OUT; SFP:1102; SCL:1; SRVR:HK2PR0601MB1876; 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; HK2PR0601MB1876; 23:Q46g9MLCTlz5LrD2d/u+18FKgx4NgZLZbDa/GPK?= =?us-ascii?Q?4ycJdl8aLDuhJipsYtC43pR9NllfmqVizdM/IzWmRQbkmItiKXGNsflcyNrs?= =?us-ascii?Q?n99FYWLEyBCLcvw62tZZmn4uHk6X5eltaLp4EohTg6IQGZcXtpmWGRf66huC?= =?us-ascii?Q?3bsJ/r68SEb/eJzBgWdHMkSNpezLh3F2Yh1JoirCXgpFIlzeC2IJBkj4U8Hh?= =?us-ascii?Q?vh1USCNGvX2lHy79Eu7h7pvEevREEpOaqifhjys2U8ulOnDHlVvjcXyfPKzl?= =?us-ascii?Q?A/z7n3ejfhaSm4vvb1BDB/88/TWQNityxWVKNe4abQms0q8ypnGVbTzsGFqa?= =?us-ascii?Q?RI2Lh0FpmHriCG+8GJU4Ml6voGxLbawXRdbaP3fNahzOpyFDn2cJbRi601e/?= =?us-ascii?Q?jxCETcwSA9+Mwm0yxH2a1pOte05XlU1BFL4FQbYGrKTn2f1iWbr1PD74p6MA?= =?us-ascii?Q?AcFP571tCTtqK4T7CeKeH0vcH0h7/INorsnMuro2XYV3LM1J8PMTcy4sZAxX?= =?us-ascii?Q?Sg5RUmYc8TcAH9gIg80E87k+jYuN23DGTPQfz3p8UhNpuWwTynHcKAqMueBY?= =?us-ascii?Q?EjzX/4q5PRwPHepxbdSJDG4t3+aUVouchiCmRVLH5E5jucTmqSJCW3D8zW3d?= =?us-ascii?Q?CnBCOF/8OO3VMKAGCh57a1unk01zk65x/3BoPRqge8hcUa/QHVDgD/iwWPaz?= =?us-ascii?Q?iWB3o+BP1S8kiFVYQzbY5MjfmY3fbJk2IzL9gXziR/79JytV++3ouP81Cvyr?= =?us-ascii?Q?9cmwBEHZ/0uRGSK0bDGwzkso/o1tYWFZE9SlgF4GpVT1kiK92mbEwJPcXcvV?= =?us-ascii?Q?JbZ4j2NEarBIggfdpmvk2OsUycJQsF6YDYmyHZ2NwmKiUw6C+8/OezeUnJMx?= =?us-ascii?Q?4rrra44op1IE5Jiscy8zTLRSAFiJ+MiN6XL9UytUQ+druvBkunDi85BBA17h?= =?us-ascii?Q?JdRld+QDhcM3KAOA8SQMljDJRultltB+LqbirrkEHMznP2itC6v88jr9xzPC?= =?us-ascii?Q?Oy60FuE48LHIfY6h6K5f0Wwl7ByqAQOIYpLzBqsPCrB8DNw=3D=3D?= X-Microsoft-Exchange-Diagnostics: 1; HK2PR0601MB1876; 6:g/+NM2vQZq2qMNmM1tMEVKn/Um81V3cOywo4w6QT+jbM58JSFxQip2Kdlu//Hg6YcALoZ3otUw2NQfbxsZcWsxjI6wsaQiXCQv5dtPLWJsKXrPIMDleD3L527mZzf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ossTenant-OriginalArrivalTime: 12 Jan 2018 00:46:34.7113 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: e0aa481a-cdc7-4f99-3c46-08d55955ee81 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 13/38] ASoC: atmel: 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. To avoid complex operation, this patch adds device pointer to atmel_classd. Signed-off-by: Kuninori Morimoto --- sound/soc/atmel/atmel-classd.c | 4 +++- sound/soc/atmel/atmel-pcm-pdc.c | 6 +++--- sound/soc/atmel/atmel-pdmic.c | 4 +++- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/sound/soc/atmel/atmel-classd.c b/sound/soc/atmel/atmel-classd.c index ebabed6..6bc2b72 100644 --- a/sound/soc/atmel/atmel-classd.c +++ b/sound/soc/atmel/atmel-classd.c @@ -32,6 +32,7 @@ struct atmel_classd { struct regmap *regmap; struct clk *pclk; struct clk *gclk; + struct device *dev; int irq; const struct atmel_classd_pdata *pdata; }; @@ -165,7 +166,7 @@ static void atmel_classd_cpu_dai_shutdown(struct snd_pcm_substream *substream, struct atmel_classd *dd = snd_soc_card_get_drvdata(rtd->card); if (params_physical_width(params) != 16) { - dev_err(rtd->platform->dev, + dev_err(dd->dev, "only supports 16-bit audio data\n"); return -EINVAL; } @@ -587,6 +588,7 @@ static int atmel_classd_probe(struct platform_device *pdev) } dd->phy_base = res->start; + dd->dev = dev; dd->regmap = devm_regmap_init_mmio(dev, io_base, &atmel_classd_regmap_config); diff --git a/sound/soc/atmel/atmel-pcm-pdc.c b/sound/soc/atmel/atmel-pcm-pdc.c index 91b7069..99ca23d 100644 --- a/sound/soc/atmel/atmel-pcm-pdc.c +++ b/sound/soc/atmel/atmel-pcm-pdc.c @@ -393,7 +393,7 @@ static int atmel_pcm_close(struct snd_pcm_substream *substream) .mmap = atmel_pcm_mmap, }; -static struct snd_soc_platform_driver atmel_soc_platform = { +static struct snd_soc_component_driver atmel_soc_platform = { .ops = &atmel_pcm_ops, .pcm_new = atmel_pcm_new, .pcm_free = atmel_pcm_free, @@ -401,13 +401,13 @@ static int atmel_pcm_close(struct snd_pcm_substream *substream) int atmel_pcm_pdc_platform_register(struct device *dev) { - return snd_soc_register_platform(dev, &atmel_soc_platform); + return devm_snd_soc_register_component(dev, &atmel_soc_platform, + NULL, 0); } EXPORT_SYMBOL(atmel_pcm_pdc_platform_register); void atmel_pcm_pdc_platform_unregister(struct device *dev) { - snd_soc_unregister_platform(dev); } EXPORT_SYMBOL(atmel_pcm_pdc_platform_unregister); diff --git a/sound/soc/atmel/atmel-pdmic.c b/sound/soc/atmel/atmel-pdmic.c index 8e3d34b..4eea738 100644 --- a/sound/soc/atmel/atmel-pdmic.c +++ b/sound/soc/atmel/atmel-pdmic.c @@ -32,6 +32,7 @@ struct atmel_pdmic { struct regmap *regmap; struct clk *pclk; struct clk *gclk; + struct device *dev; int irq; struct snd_pcm_substream *substream; const struct atmel_pdmic_pdata *pdata; @@ -206,7 +207,7 @@ static int atmel_pdmic_cpu_dai_prepare(struct snd_pcm_substream *substream, ret = snd_hwparams_to_dma_slave_config(substream, params, slave_config); if (ret) { - dev_err(rtd->platform->dev, + dev_err(dd->dev, "hw params to dma slave configure failed\n"); return ret; } @@ -596,6 +597,7 @@ static int atmel_pdmic_probe(struct platform_device *pdev) return -ENOMEM; dd->pdata = pdata; + dd->dev = dev; dd->irq = platform_get_irq(pdev, 0); if (dd->irq < 0) {