From patchwork Fri Sep 1 06:30:13 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 9933549 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 DC27F6016C for ; Fri, 1 Sep 2017 06:30:39 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CBF1A28565 for ; Fri, 1 Sep 2017 06:30:39 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BFE0728574; Fri, 1 Sep 2017 06:30:39 +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 0CEF028565 for ; Fri, 1 Sep 2017 06:30:39 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id E382726762C; Fri, 1 Sep 2017 08:30:37 +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 424EA26761D; Fri, 1 Sep 2017 08:30:36 +0200 (CEST) Received: from relmlie2.idc.renesas.com (relmlor3.renesas.com [210.160.252.173]) by alsa0.perex.cz (Postfix) with ESMTP id 0690D26761C for ; Fri, 1 Sep 2017 08:30:17 +0200 (CEST) Received: from unknown (HELO relmlir2.idc.renesas.com) ([10.200.68.152]) by relmlie2.idc.renesas.com with ESMTP; 01 Sep 2017 15:30:16 +0900 Received: from relmlii1.idc.renesas.com (relmlii1.idc.renesas.com [10.200.68.65]) by relmlir2.idc.renesas.com (Postfix) with ESMTP id 075D96CB70; Fri, 1 Sep 2017 15:30:16 +0900 (JST) X-IronPort-AV: E=Sophos;i="5.41,456,1498489200"; d="scan'208";a="255517297" Received: from mail-pu1apc01lp0018.outbound.protection.outlook.com (HELO APC01-PU1-obe.outbound.protection.outlook.com) ([65.55.88.18]) by relmlii1.idc.renesas.com with ESMTP/TLS/AES256-SHA256; 01 Sep 2017 15:30:15 +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=wVjFx9KkBKA/qFqLvhuJ3vW9fpc+2CNMD4086gjwOz8=; b=bbPGZ73oxe9wSJkja5FRCiJH3MJPSS6RZpc2ten0QnhyrjwIlqDM539lY4E3q2cvkM0IDXbYzJGMLbC7cEou/92sOeRsuIr+GAgQv9wj4J27EbEkbimLULH39nnzscSh3gPAoyHQT3MjTEcIjQASDpKAyihJZNGIRjX+sCh8TEs= Received: from morimoto-PC.renesas.com (211.11.155.138) by KL1PR0601MB1877.apcprd06.prod.outlook.com (2603:1096:802:7::22) 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:13 +0000 Message-ID: <87val3j5td.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:13 +0000 X-Originating-IP: [211.11.155.138] X-ClientProxiedBy: HK2PR02CA0222.apcprd02.prod.outlook.com (2603:1096:201:20::34) To KL1PR0601MB1877.apcprd06.prod.outlook.com (2603:1096:802:7::22) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: e673b5c2-6803-4640-ac3d-08d4f102e772 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:KL1PR0601MB1877; X-Microsoft-Exchange-Diagnostics: 1; KL1PR0601MB1877; 3:4uMSmbc06pwF0JsBsRCoF7jq5O22vE6FeJ4UX2s6BxeLNKrQw60MJ3mTiMYLyUpxsj6PUI+ww+dNMg6vWdew4YYNcLF9NFRusCf3zxU0elU0kkDPa+jnTnRx0mI1vslDWOhkiQzfjU8uv+l1/YGdeNrVnzCjybbY+pVOnVwj6WvbOwld3MxORhhj3u4uiZOsy0YnrCr5v0RR62N+BQoOoRKynFCY0ynJ/8u92ZY2PAtQCVxIz5Fo19u6jZtljVoW; 25:7lg+L/F/Vg5nGk1DEPoUNRHchbOtoIPMPScKyYXAYJ4DCrzGQkxUR9viLObHRhMkfRvn0l1vtIzlyge5EHo55D4c8RxY8FHyOy93Oa0vXfHY61SAa1Lf5QAU8Oe3eBJkK8GiHvY28I1OZ8PBHqUWtRNUqwq/QA9ZoS9P/PtJXtfkDkELSGIxpWtIQLMd/NGqc+byT/W6TfiKQuQ5mCdI16acqaCx23mCN8Z6thpX+l2XPd4cVUy77M84X4wYYtIowjaYSGhUoHuP0uXBARYsI1hWW4qrTlOJ0Z1awKMoKbE8UEH+t5sV6rsrDqxy0QoLkq8DTkFgORoW4R8Y4PG+7g==; 31:gA0O68I4vNyJ5w78H4feyvPTVigy9jiWhmB+KrN2Ci6g/4y0IqGIclRwqd8yZ0VBA/GiKlkXvS/raPZV+amm6oIaKorcpPYzarvDlOpD/fpgWhLNPoHfPmgoy6N7hPXuMl0S4g7089iWxNWQHi/ILev+S7Y9cOa/K0cghsAFyXl+Krpr+akofETE6gHv7MrwEauHEoA5pBzKoD7PpOx5/H7PRD090CblUHjvWWp3YVU= X-MS-TrafficTypeDiagnostic: KL1PR0601MB1877: Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=kuninori.morimoto.gx@renesas.com; X-Microsoft-Exchange-Diagnostics: 1; KL1PR0601MB1877; 20:Yjltdo9xRxDeTApBUvdrSRFTgSJi/3PXe27RBLKR5PvcwnDwi/mgW/b7VZFnIshilunIK7aI6JO2ArTnnKsFhl1d8VZ1c4+v6mk03t/OIDtF8LDZ9D5GtvoZpa4sqt1NQKeaUrgb/4knFv4fG58mOZwCS93bDXZ+pWmE3tu/XTrbHZL8JqgbHLakOj3LefuhZ2zqTEIAFTq5XYjkcE7wosUHz3R7Buuc7q3pSQqwwcShay3nUq3Eigbf5kgmFBzDZu5E5K0rPZKpMD7pS+q7qg2SN9gZ5qvKFHyK9OH/FevgvYRxHpUZMk/MjVkolfF05bT1fK1kmMLXcn5jQ4NCgUBp3HlsmQWmMNYZImuKAJsSfJB4qOlZbnk02LjuIm3wWoMwxqvuksg2NdreWkxCqfHpxdI6RyT9C9lXhR3Ltx9tWdmUb6CPHkbRozWvfr/O9mNcQTvQcQXoKnGTCxLXcoqEzbUsx6ZZn9WDvWj+IkRmR8Sm6TiuKqrmYITY08p2; 4:hI6dbOgK2h1+D/1mBsujK3djuAdA4VWC8ww5HkRYWaChXXGdPk1xaeYTPrejE04BttVDPHOKHseGIUeeDEXpS8LDXP6ty1oI2tdBMg1Q832FaeVGpB7tdmJ73vOfMDwA7Bv9Pyo42f0Em5Bl555bZhsvDTW9JwMo44XQvAzCQruROUx34R4Tx19xjpkSz6ppUL9sJQQ45GVJ3NV9c6UlLLwg3NKm4G5rx5yhu0oaoaiXMpHKDWuctLJeQrJOcnQknedkcIrUhG6dqI6LFNxeU9uA7CaHnciiU8Qvm5B+fVw= 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)(8121501046)(5005006)(93006095)(93001095)(3002001)(100000703101)(100105400095)(10201501046)(6055026)(6041248)(20161123558100)(20161123560025)(20161123555025)(20161123564025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123562025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:KL1PR0601MB1877; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:KL1PR0601MB1877; X-Forefront-PRVS: 0417A3FFD2 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(7370300001)(4630300001)(6009001)(39860400002)(199003)(189002)(42186005)(36756003)(53936002)(47776003)(7350300001)(478600001)(4326008)(54356999)(50986999)(86362001)(101416001)(76176999)(66066001)(33646002)(25786009)(69596002)(83506001)(23726003)(305945005)(6116002)(3846002)(50466002)(7736002)(2906002)(6486002)(189998001)(8676002)(2950100002)(110136004)(53416004)(5660300001)(54906002)(105586002)(106356001)(68736007)(97736004)(6916009)(4001350100001)(81156014)(81166006)(13513002)(16060500001); DIR:OUT; SFP:1102; SCL:1; SRVR:KL1PR0601MB1877; 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; KL1PR0601MB1877; 23:sdPeGoujaOY/8ktQ/yijwUGHuO6lcNlKjE7H/9S?= =?us-ascii?Q?AEHm9GtGuWH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mQjwVFwEliX5mTRp0OVgy7KHxnyMfjem66Z3l4UNm5UmYRSbUNv30e34pIID0720gajuQ3htx9MpcS/RjRGhBuv1vZVQr9KgtUU4qAiAFkPE4ZBxdlPSarWU3U9eaSyIeAHcG7ELyIXXpdzeWIOD0= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; KL1PR0601MB1877; 20:3uWJ7LpboybW+bPXPi+7PXRXPxFUou1a4Mze4zu0wGllQJ1gzBfoeT69K/O/o3GVcjp6Ttl+D1HJZq/EMPh+LwMhPlx5Iohmw56GOtDgv7IdzOCwQsxSsvs5YK8pPXGQhLZJ+34dqw11YN/ujmuaiLrlzLSsmUatjeSMsjkj4hw= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Sep 2017 06:30:13.6050 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: KL1PR0601MB1877 Cc: Linux-ALSA , Lars-Peter Subject: [alsa-devel] [SAMPLE 5/6] ASoC: replace platform to component on atmel-xxx 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. 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 ec9f59f..8521c47 100644 --- a/sound/soc/atmel/atmel-classd.c +++ b/sound/soc/atmel/atmel-classd.c @@ -33,6 +33,7 @@ struct atmel_classd { struct clk *pclk; struct clk *gclk; struct clk *aclk; + struct device *dev; int irq; const struct atmel_classd_pdata *pdata; }; @@ -166,7 +167,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; } @@ -606,6 +607,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) {