From patchwork Wed May 22 03:51:09 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 10955065 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 039E2112C for ; Wed, 22 May 2019 05:11:40 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E7C2628847 for ; Wed, 22 May 2019 05:11:39 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DC76328B55; Wed, 22 May 2019 05:11: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=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,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]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id DF8BA28B0A for ; Wed, 22 May 2019 05:11:38 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 249D818B8; Wed, 22 May 2019 07:10:47 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 249D818B8 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1558501897; bh=+s12Dtwc8sFBFF5b0IijGrY1kADkfp1VQ9IAgx850F0=; h=Date:From:To:In-Reply-To:References:Cc:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=aVnGh8Ojib08GyP1tI2IWtXeXOaAvilzVxS1RXjUK+IRYwmkP5OKIO2uRmACO2I2K /A/oy2Bcdyo7rGZUpSRujfZDcNr0g8T2v98ZpZ0K5xY8pYw3W++TdpS8P4Iphli9BC iJepAKsMpMkPVnUGNuUFLDXYOlg34yuopojc2hU8= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id AB49CF899E8; Wed, 22 May 2019 05:51:15 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id 6007AF899E8; Wed, 22 May 2019 05:51:14 +0200 (CEST) Received: from relmlie5.idc.renesas.com (relmlor1.renesas.com [210.160.252.171]) by alsa1.perex.cz (Postfix) with ESMTP id B8D19F899E1 for ; Wed, 22 May 2019 05:51:10 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz B8D19F899E1 Date: 22 May 2019 12:51:09 +0900 X-IronPort-AV: E=Sophos;i="5.60,497,1549897200"; d="scan'208";a="16628069" Received: from unknown (HELO relmlir6.idc.renesas.com) ([10.200.68.152]) by relmlie5.idc.renesas.com with ESMTP; 22 May 2019 12:51:09 +0900 Received: from morimoto-PC.renesas.com (unknown [10.166.18.140]) by relmlir6.idc.renesas.com (Postfix) with ESMTP id 8177941717B3; Wed, 22 May 2019 12:51:09 +0900 (JST) Message-ID: <87a7ffi2io.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: <87sgt7p3zo.wl-kuninori.morimoto.gx@renesas.com> References: <87sgt7p3zo.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 138/145] ASoC: Intel: skl_nau88l25_ssm4567: use modern dai_link style X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 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" X-Virus-Scanned: ClamAV using ClamSMTP From: Kuninori Morimoto ASoC is now supporting modern style dai_link (= snd_soc_dai_link_component) for CPU/Codec/Platform. This patch switches to use it. Signed-off-by: Kuninori Morimoto --- sound/soc/intel/boards/skl_nau88l25_ssm4567.c | 132 ++++++++++++++------------ 1 file changed, 69 insertions(+), 63 deletions(-) diff --git a/sound/soc/intel/boards/skl_nau88l25_ssm4567.c b/sound/soc/intel/boards/skl_nau88l25_ssm4567.c index 8433c52..4c9f2c5 100644 --- a/sound/soc/intel/boards/skl_nau88l25_ssm4567.c +++ b/sound/soc/intel/boards/skl_nau88l25_ssm4567.c @@ -164,17 +164,6 @@ static struct snd_soc_codec_conf ssm4567_codec_conf[] = { }, }; -static struct snd_soc_dai_link_component ssm4567_codec_components[] = { - { /* Left */ - .name = "i2c-INT343B:00", - .dai_name = SKL_SSM_CODEC_DAI, - }, - { /* Right */ - .name = "i2c-INT343B:01", - .dai_name = SKL_SSM_CODEC_DAI, - }, -}; - static int skylake_ssm4567_codec_init(struct snd_soc_pcm_runtime *rtd) { int ret; @@ -453,105 +442,140 @@ static const struct snd_soc_ops skylake_refcap_ops = { .startup = skylake_refcap_startup, }; +SND_SOC_DAILINK_DEF(dummy, + DAILINK_COMP_ARRAY(COMP_DUMMY())); + +SND_SOC_DAILINK_DEF(system, + DAILINK_COMP_ARRAY(COMP_CPU("System Pin"))); + +SND_SOC_DAILINK_DEF(reference, + DAILINK_COMP_ARRAY(COMP_CPU("Reference Pin"))); + +SND_SOC_DAILINK_DEF(dmic, + DAILINK_COMP_ARRAY(COMP_CPU("DMIC Pin"))); + +SND_SOC_DAILINK_DEF(hdmi1, + DAILINK_COMP_ARRAY(COMP_CPU("HDMI1 Pin"))); + +SND_SOC_DAILINK_DEF(hdmi2, + DAILINK_COMP_ARRAY(COMP_CPU("HDMI2 Pin"))); + +SND_SOC_DAILINK_DEF(hdmi3, + DAILINK_COMP_ARRAY(COMP_CPU("HDMI3 Pin"))); + +SND_SOC_DAILINK_DEF(ssp0_pin, + DAILINK_COMP_ARRAY(COMP_CPU("SSP0 Pin"))); +SND_SOC_DAILINK_DEF(ssp0_codec, + DAILINK_COMP_ARRAY( + /* Left */ COMP_CODEC("i2c-INT343B:00", SKL_SSM_CODEC_DAI), + /* Right */ COMP_CODEC("i2c-INT343B:01", SKL_SSM_CODEC_DAI))); + +SND_SOC_DAILINK_DEF(ssp1_pin, + DAILINK_COMP_ARRAY(COMP_CPU("SSP1 Pin"))); +SND_SOC_DAILINK_DEF(ssp1_codec, + DAILINK_COMP_ARRAY(COMP_CODEC("i2c-10508825:00", SKL_NUVOTON_CODEC_DAI))); + +SND_SOC_DAILINK_DEF(dmic01_pin, + DAILINK_COMP_ARRAY(COMP_CPU("DMIC01 Pin"))); +SND_SOC_DAILINK_DEF(dmic01_codec, + DAILINK_COMP_ARRAY(COMP_CODEC("dmic-codec", "dmic-hifi"))); + +SND_SOC_DAILINK_DEF(idisp1_pin, + DAILINK_COMP_ARRAY(COMP_CPU("iDisp1 Pin"))); +SND_SOC_DAILINK_DEF(idisp1_codec, + DAILINK_COMP_ARRAY(COMP_CODEC("ehdaudio0D2", "intel-hdmi-hifi1"))); + +SND_SOC_DAILINK_DEF(idisp2_pin, + DAILINK_COMP_ARRAY(COMP_CPU("iDisp2 Pin"))); +SND_SOC_DAILINK_DEF(idisp2_codec, + DAILINK_COMP_ARRAY(COMP_CODEC("ehdaudio0D2", "intel-hdmi-hifi2"))); + +SND_SOC_DAILINK_DEF(idisp3_pin, + DAILINK_COMP_ARRAY(COMP_CPU("iDisp3 Pin"))); +SND_SOC_DAILINK_DEF(idisp3_codec, + DAILINK_COMP_ARRAY(COMP_CODEC("ehdaudio0D2", "intel-hdmi-hifi3"))); + +SND_SOC_DAILINK_DEF(platform, + DAILINK_COMP_ARRAY(COMP_PLATFORM("0000:00:1f.3"))); + /* skylake digital audio interface glue - connects codec <--> CPU */ static struct snd_soc_dai_link skylake_dais[] = { /* Front End DAI links */ [SKL_DPCM_AUDIO_PB] = { .name = "Skl Audio Port", .stream_name = "Audio", - .cpu_dai_name = "System Pin", - .platform_name = "0000:00:1f.3", .dynamic = 1, - .codec_name = "snd-soc-dummy", - .codec_dai_name = "snd-soc-dummy-dai", .nonatomic = 1, .init = skylake_nau8825_fe_init, .trigger = { SND_SOC_DPCM_TRIGGER_POST, SND_SOC_DPCM_TRIGGER_POST}, .dpcm_playback = 1, .ops = &skylake_nau8825_fe_ops, + SND_SOC_DAILINK_REG(system, dummy, platform), }, [SKL_DPCM_AUDIO_CP] = { .name = "Skl Audio Capture Port", .stream_name = "Audio Record", - .cpu_dai_name = "System Pin", - .platform_name = "0000:00:1f.3", .dynamic = 1, - .codec_name = "snd-soc-dummy", - .codec_dai_name = "snd-soc-dummy-dai", .nonatomic = 1, .trigger = { SND_SOC_DPCM_TRIGGER_POST, SND_SOC_DPCM_TRIGGER_POST}, .dpcm_capture = 1, .ops = &skylake_nau8825_fe_ops, + SND_SOC_DAILINK_REG(system, dummy, platform), }, [SKL_DPCM_AUDIO_REF_CP] = { .name = "Skl Audio Reference cap", .stream_name = "Wake on Voice", - .cpu_dai_name = "Reference Pin", - .codec_name = "snd-soc-dummy", - .codec_dai_name = "snd-soc-dummy-dai", - .platform_name = "0000:00:1f.3", .init = NULL, .dpcm_capture = 1, .nonatomic = 1, .dynamic = 1, .ops = &skylake_refcap_ops, + SND_SOC_DAILINK_REG(reference, dummy, platform), }, [SKL_DPCM_AUDIO_DMIC_CP] = { .name = "Skl Audio DMIC cap", .stream_name = "dmiccap", - .cpu_dai_name = "DMIC Pin", - .codec_name = "snd-soc-dummy", - .codec_dai_name = "snd-soc-dummy-dai", - .platform_name = "0000:00:1f.3", .init = NULL, .dpcm_capture = 1, .nonatomic = 1, .dynamic = 1, .ops = &skylake_dmic_ops, + SND_SOC_DAILINK_REG(dmic, dummy, platform), }, [SKL_DPCM_AUDIO_HDMI1_PB] = { .name = "Skl HDMI Port1", .stream_name = "Hdmi1", - .cpu_dai_name = "HDMI1 Pin", - .codec_name = "snd-soc-dummy", - .codec_dai_name = "snd-soc-dummy-dai", - .platform_name = "0000:00:1f.3", .dpcm_playback = 1, .init = NULL, .trigger = { SND_SOC_DPCM_TRIGGER_POST, SND_SOC_DPCM_TRIGGER_POST}, .nonatomic = 1, .dynamic = 1, + SND_SOC_DAILINK_REG(hdmi1, dummy, platform), }, [SKL_DPCM_AUDIO_HDMI2_PB] = { .name = "Skl HDMI Port2", .stream_name = "Hdmi2", - .cpu_dai_name = "HDMI2 Pin", - .codec_name = "snd-soc-dummy", - .codec_dai_name = "snd-soc-dummy-dai", - .platform_name = "0000:00:1f.3", .dpcm_playback = 1, .init = NULL, .trigger = { SND_SOC_DPCM_TRIGGER_POST, SND_SOC_DPCM_TRIGGER_POST}, .nonatomic = 1, .dynamic = 1, + SND_SOC_DAILINK_REG(hdmi2, dummy, platform), }, [SKL_DPCM_AUDIO_HDMI3_PB] = { .name = "Skl HDMI Port3", .stream_name = "Hdmi3", - .cpu_dai_name = "HDMI3 Pin", - .codec_name = "snd-soc-dummy", - .codec_dai_name = "snd-soc-dummy-dai", - .platform_name = "0000:00:1f.3", .trigger = { SND_SOC_DPCM_TRIGGER_POST, SND_SOC_DPCM_TRIGGER_POST}, .dpcm_playback = 1, .init = NULL, .nonatomic = 1, .dynamic = 1, + SND_SOC_DAILINK_REG(hdmi3, dummy, platform), }, /* Back End DAI links */ @@ -559,11 +583,7 @@ static struct snd_soc_dai_link skylake_dais[] = { /* SSP0 - Codec */ .name = "SSP0-Codec", .id = 0, - .cpu_dai_name = "SSP0 Pin", - .platform_name = "0000:00:1f.3", .no_pcm = 1, - .codecs = ssm4567_codec_components, - .num_codecs = ARRAY_SIZE(ssm4567_codec_components), .dai_fmt = SND_SOC_DAIFMT_DSP_A | SND_SOC_DAIFMT_IB_NF | SND_SOC_DAIFMT_CBS_CFS, @@ -572,16 +592,13 @@ static struct snd_soc_dai_link skylake_dais[] = { .be_hw_params_fixup = skylake_ssp_fixup, .dpcm_playback = 1, .dpcm_capture = 1, + SND_SOC_DAILINK_REG(ssp0_pin, ssp0_codec, platform), }, { /* SSP1 - Codec */ .name = "SSP1-Codec", .id = 1, - .cpu_dai_name = "SSP1 Pin", - .platform_name = "0000:00:1f.3", .no_pcm = 1, - .codec_name = "i2c-10508825:00", - .codec_dai_name = SKL_NUVOTON_CODEC_DAI, .init = skylake_nau8825_codec_init, .dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF | SND_SOC_DAIFMT_CBS_CFS, @@ -590,51 +607,40 @@ static struct snd_soc_dai_link skylake_dais[] = { .ops = &skylake_nau8825_ops, .dpcm_playback = 1, .dpcm_capture = 1, + SND_SOC_DAILINK_REG(ssp1_pin, ssp1_codec, platform), }, { .name = "dmic01", .id = 2, - .cpu_dai_name = "DMIC01 Pin", - .codec_name = "dmic-codec", - .codec_dai_name = "dmic-hifi", - .platform_name = "0000:00:1f.3", .ignore_suspend = 1, .be_hw_params_fixup = skylake_dmic_fixup, .dpcm_capture = 1, .no_pcm = 1, + SND_SOC_DAILINK_REG(dmic01_pin, dmic01_codec, platform), }, { .name = "iDisp1", .id = 3, - .cpu_dai_name = "iDisp1 Pin", - .codec_name = "ehdaudio0D2", - .codec_dai_name = "intel-hdmi-hifi1", - .platform_name = "0000:00:1f.3", .dpcm_playback = 1, .init = skylake_hdmi1_init, .no_pcm = 1, + SND_SOC_DAILINK_REG(idisp1_pin, idisp1_codec, platform), }, { .name = "iDisp2", .id = 4, - .cpu_dai_name = "iDisp2 Pin", - .codec_name = "ehdaudio0D2", - .codec_dai_name = "intel-hdmi-hifi2", - .platform_name = "0000:00:1f.3", .init = skylake_hdmi2_init, .dpcm_playback = 1, .no_pcm = 1, + SND_SOC_DAILINK_REG(idisp2_pin, idisp2_codec, platform), }, { .name = "iDisp3", .id = 5, - .cpu_dai_name = "iDisp3 Pin", - .codec_name = "ehdaudio0D2", - .codec_dai_name = "intel-hdmi-hifi3", - .platform_name = "0000:00:1f.3", .init = skylake_hdmi3_init, .dpcm_playback = 1, .no_pcm = 1, + SND_SOC_DAILINK_REG(idisp3_pin, idisp3_codec, platform), }, };