From patchwork Thu Aug 24 04:52:21 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeffy Chen X-Patchwork-Id: 9918989 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 AC14C602A0 for ; Thu, 24 Aug 2017 04:53:35 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9E15628B2A for ; Thu, 24 Aug 2017 04:53:35 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 91DB528B4A; Thu, 24 Aug 2017 04:53:35 +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.9 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE autolearn=unavailable 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 DB2E728B3E for ; Thu, 24 Aug 2017 04:53:34 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id D878926745F; Thu, 24 Aug 2017 06:52:54 +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 6B7E126745F; Thu, 24 Aug 2017 06:52:54 +0200 (CEST) Received: from regular1.263xmail.com (regular1.263xmail.com [211.150.99.132]) by alsa0.perex.cz (Postfix) with ESMTP id 25D16267453 for ; Thu, 24 Aug 2017 06:52:47 +0200 (CEST) Received: from jeffy.chen?rock-chips.com (unknown [192.168.167.139]) by regular1.263xmail.com (Postfix) with ESMTP id D718393DF; Thu, 24 Aug 2017 12:52:44 +0800 (CST) X-263anti-spam: KSV:0; X-MAIL-GRAY: 0 X-MAIL-DELIVERY: 1 X-KSVirus-check: 0 X-ABS-CHECKED: 4 Received: from localhost (localhost [127.0.0.1]) by smtp.263.net (Postfix) with ESMTPA id 2D9FA81A; Thu, 24 Aug 2017 12:52:38 +0800 (CST) X-RL-SENDER: jeffy.chen@rock-chips.com X-FST-TO: linux-kernel@vger.kernel.org X-SENDER-IP: 103.29.142.67 X-LOGIN-NAME: jeffy.chen@rock-chips.com X-UNIQUE-TAG: X-ATTACHMENT-NUM: 0 X-SENDER: cjf@rock-chips.com X-DNS-TYPE: 0 Received: from localhost (unknown [103.29.142.67]) by smtp.263.net (Postfix) whith ESMTP id 26736K2TU1Y; Thu, 24 Aug 2017 12:52:45 +0800 (CST) From: Jeffy Chen To: linux-kernel@vger.kernel.org, dgreid@chromium.org, heiko@sntech.de Date: Thu, 24 Aug 2017 12:52:21 +0800 Message-Id: <20170824045227.15504-2-jeffy.chen@rock-chips.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170824045227.15504-1-jeffy.chen@rock-chips.com> References: <20170824045227.15504-1-jeffy.chen@rock-chips.com> Cc: alsa-devel@alsa-project.org, briannorris@chromium.org, Liam Girdwood , Mark Brown , Jeffy Chen , dianders@chromium.org, linux-rockchip@lists.infradead.org, mka@chromium.org, Takashi Iwai , linux-arm-kernel@lists.infradead.org Subject: [alsa-devel] [RESENT PATCH v7 1/7] ASoC: rockchip: Use codec of_node and dai_name for rt5514 dsp 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: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP Currently we are using codec name for rt5514 dsp dai link, use codec of_node instead. Signed-off-by: Jeffy Chen Reviewed-by: Matthias Kaehlcke Tested-by: Matthias Kaehlcke --- Changes in v7: Rebase on the newest for-next Changes in v6: None Changes in v3: None Changes in v2: None sound/soc/rockchip/rk3399_gru_sound.c | 34 ++-------------------------------- 1 file changed, 2 insertions(+), 32 deletions(-) diff --git a/sound/soc/rockchip/rk3399_gru_sound.c b/sound/soc/rockchip/rk3399_gru_sound.c index 566ccb39fb31..cd2fdba922f1 100644 --- a/sound/soc/rockchip/rk3399_gru_sound.c +++ b/sound/soc/rockchip/rk3399_gru_sound.c @@ -247,8 +247,6 @@ enum { DAILINK_RT5514_DSP, }; -#define DAILINK_ENTITIES (DAILINK_DA7219 + 1) - static struct snd_soc_dai_link rockchip_dailinks[] = { [DAILINK_MAX98357A] = { .name = "MAX98357A", @@ -282,8 +280,7 @@ static struct snd_soc_dai_link rockchip_dailinks[] = { [DAILINK_RT5514_DSP] = { .name = "RT5514 DSP", .stream_name = "Wake on Voice", - .codec_name = "snd-soc-dummy", - .codec_dai_name = "snd-soc-dummy-dai", + .codec_dai_name = "rt5514-dsp-cpu-dai", }, }; @@ -300,17 +297,10 @@ static struct snd_soc_card rockchip_sound_card = { .num_controls = ARRAY_SIZE(rockchip_controls), }; -static int rockchip_sound_match_stub(struct device *dev, void *data) -{ - return 1; -} - static int rockchip_sound_probe(struct platform_device *pdev) { struct snd_soc_card *card = &rockchip_sound_card; struct device_node *cpu_node; - struct device *dev; - struct device_driver *drv; int i, ret; cpu_node = of_parse_phandle(pdev->dev.of_node, "rockchip,cpu", 0); @@ -319,7 +309,7 @@ static int rockchip_sound_probe(struct platform_device *pdev) return -EINVAL; } - for (i = 0; i < DAILINK_ENTITIES; i++) { + for (i = 0; i < ARRAY_SIZE(rockchip_dailinks); i++) { rockchip_dailinks[i].platform_of_node = cpu_node; rockchip_dailinks[i].cpu_of_node = cpu_node; @@ -332,22 +322,6 @@ static int rockchip_sound_probe(struct platform_device *pdev) } } - /** - * To acquire the spi driver of the rt5514 and set the dai-links names - * for soc_bind_dai_link - */ - drv = driver_find("rt5514", &spi_bus_type); - if (!drv) { - dev_err(&pdev->dev, "Can not find the rt5514 driver at the spi bus\n"); - return -EINVAL; - } - - dev = driver_find_device(drv, NULL, NULL, rockchip_sound_match_stub); - if (!dev) { - dev_err(&pdev->dev, "Can not find the rt5514 device\n"); - return -ENODEV; - } - /* Set DMIC wakeup delay */ ret = device_property_read_u32(&pdev->dev, "dmic-wakeup-delay-ms", &dmic_wakeup_delay); @@ -357,10 +331,6 @@ static int rockchip_sound_probe(struct platform_device *pdev) "no optional property 'dmic-wakeup-delay-ms' found, default: no delay\n"); } - rockchip_dailinks[DAILINK_RT5514_DSP].cpu_name = kstrdup_const(dev_name(dev), GFP_KERNEL); - rockchip_dailinks[DAILINK_RT5514_DSP].cpu_dai_name = kstrdup_const(dev_name(dev), GFP_KERNEL); - rockchip_dailinks[DAILINK_RT5514_DSP].platform_name = kstrdup_const(dev_name(dev), GFP_KERNEL); - card->dev = &pdev->dev; ret = devm_snd_soc_register_card(&pdev->dev, card);