From patchwork Wed Jan 16 08:27:32 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 10765503 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 4128B13B5 for ; Wed, 16 Jan 2019 08:27:41 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 311A12CC2E for ; Wed, 16 Jan 2019 08:27:41 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 259CC2CC4D; Wed, 16 Jan 2019 08:27:41 +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=-2.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE autolearn=ham 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 769B02CC2E for ; Wed, 16 Jan 2019 08:27:40 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 3B9A0266C08; Wed, 16 Jan 2019 09:27:39 +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 6DBE5266C08; Wed, 16 Jan 2019 09:27:36 +0100 (CET) Received: from relmlie6.idc.renesas.com (relmlor2.renesas.com [210.160.252.172]) by alsa0.perex.cz (Postfix) with ESMTP id 607C526699F for ; Wed, 16 Jan 2019 09:27:33 +0100 (CET) Date: 16 Jan 2019 17:27:32 +0900 X-IronPort-AV: E=Sophos;i="5.56,485,1539615600"; d="scan'208";a="5116841" Received: from unknown (HELO relmlir6.idc.renesas.com) ([10.200.68.152]) by relmlie6.idc.renesas.com with ESMTP; 16 Jan 2019 17:27:32 +0900 Received: from morimoto-PC.renesas.com (unknown [10.166.18.140]) by relmlir6.idc.renesas.com (Postfix) with ESMTP id B4D11435A7F0; Wed, 16 Jan 2019 17:27:32 +0900 (JST) Message-ID: <875zupm2z7.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto User-Agent: Wanderlust/2.15.9 Emacs/24.5 Mule/6.0 To: Mark Brown In-Reply-To: <87bm4hm30t.wl-kuninori.morimoto.gx@renesas.com> References: <87bm4hm30t.wl-kuninori.morimoto.gx@renesas.com> MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Cc: Linux-ALSA Subject: [alsa-devel] [PATCH][RFC] ASoC: atmel: atmel-classd: use modern style dai_link 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 ALSA SoC is supporting modern style (= snd_soc_dai_link_component) dai_link for CPU/Codec/Platform, let's switch to it from legacy style. Signed-off-by: Kuninori Morimoto --- sound/soc/atmel/atmel-classd.c | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/sound/soc/atmel/atmel-classd.c b/sound/soc/atmel/atmel-classd.c index 3d70061..5b662a2 100644 --- a/sound/soc/atmel/atmel-classd.c +++ b/sound/soc/atmel/atmel-classd.c @@ -499,18 +499,28 @@ static int atmel_classd_asoc_card_init(struct device *dev, struct snd_soc_card *card) { struct snd_soc_dai_link *dai_link; + struct snd_soc_dai_link_component *dlc; struct atmel_classd *dd = snd_soc_card_get_drvdata(card); dai_link = devm_kzalloc(dev, sizeof(*dai_link), GFP_KERNEL); - if (!dai_link) + /* cpu/codec/platform */ + dlc = devm_kzalloc(dev, sizeof(*dlc) * 3, GFP_KERNEL); + if (!dai_link || !dlc) return -ENOMEM; dai_link->name = "CLASSD"; dai_link->stream_name = "CLASSD PCM"; - dai_link->codec_dai_name = ATMEL_CLASSD_CODEC_DAI_NAME; - dai_link->cpu_dai_name = dev_name(dev); - dai_link->codec_name = dev_name(dev); - dai_link->platform_name = dev_name(dev); + dai_link->cpus = &dlc[0]; + dai_link->num_cpus = 1; + dai_link->codecs = &dlc[1]; + dai_link->num_codecs = 1; + dai_link->platforms = &dlc[2]; + dai_link->num_platforms = 1; + + dai_link->codecs->dai_name = ATMEL_CLASSD_CODEC_DAI_NAME; + dai_link->cpus->dai_name = dev_name(dev); + dai_link->codecs->name = dev_name(dev); + dai_link->platforms->name = dev_name(dev); card->dai_link = dai_link; card->num_links = 1;