From patchwork Tue Aug 22 15:35:49 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeffy Chen X-Patchwork-Id: 9915557 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 595CE608A6 for ; Tue, 22 Aug 2017 15:38:12 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4E5FF288AA for ; Tue, 22 Aug 2017 15:38:12 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 419D5288AD; Tue, 22 Aug 2017 15:38:12 +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.6 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_LOW autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 07EFD288AE for ; Tue, 22 Aug 2017 15:38:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=2Hqg3A+1/L8/Tpxs/IcUfX4lbOLBb5NRuFSeB1ykuHY=; b=RQbu2X2R+84TwO8BdQWduCGJj8 m7nu99Zg3iiERC9lQn1yC8Nw/1BrpndjyyNFlKJB5TyQVdyyGmD1zvoHw2wZB5ebp4d4iDembuQdv 18TKO4yIR8eoAiZupRfiYcM9A2U44Pwi3QerWkovfQib/bMP8PymKCw+GshAgSF3AfBBmVbOuKn/S F/NiG4IYfThemw0w9RRcUqMrsHUPu0iBxtJ9FbWN9YuKzJqrZaDG1KeHlKh7xzoJ6fFm4SPD4/E2Z TFwReDe5ZCXphnbrKWKkubURBggr3DV717oTWOyXDKtDBpPoVGPs6gtC6NQgxwPfVEW7JYYMsKkMf wbRE05yA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1dkBFI-0003fI-Sl; Tue, 22 Aug 2017 15:37:36 +0000 Received: from merlin.infradead.org ([2001:8b0:10b:1231::1]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1dkBEi-0003JR-1R; Tue, 22 Aug 2017 15:37:00 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=References:In-Reply-To:Message-Id:Date: Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=q7fA4GvHvoVeBjvYtB0fbDOvPDgipra7Q/nPpSYVNWQ=; b=UpOcdw1eQDb2OshVCWf5SpGzS KcApL1xv2FkF88NAnJuzA1jgZI2cY8EESZJPrEBSb53dh91a7rC0hoJeq7bH76LY11frEwe6zJBbo Pdg13qDXyB/Rx43V8TiBUbJRDGySiykAdVgca1g0tt4mMZlL6NIN3IR29X5+OGUog8pN6y+ufgvtW B5DSAqYquxafvFOJf14pQeMU3c6YJoI7VP1bPM0ahoT2oyHEKkKwci2lXg2aAtA612CrJ2lNT17Ka lHXwgK1mIwcLs6PpwaDTNEytLP8XgMDtCpXEd4E6Mf8GvRMi8Kh0/59By9v0j++LKgx5g6caHLCX3 3eTXIdeTw==; Received: from regular1.263xmail.com ([211.150.99.139]) by merlin.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1dkBEd-0003Pg-Ur; Tue, 22 Aug 2017 15:36:58 +0000 Received: from jeffy.chen?rock-chips.com (unknown [192.168.167.160]) by regular1.263xmail.com (Postfix) with ESMTP id 0C7B15480; Tue, 22 Aug 2017 23:36:23 +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 E76AA369; Tue, 22 Aug 2017 23:36:16 +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 24151CYH6FK; Tue, 22 Aug 2017 23:36:24 +0800 (CST) From: Jeffy Chen To: linux-kernel@vger.kernel.org, dgreid@chromium.org, heiko@sntech.de Subject: [RESENT PATCH v6 2/8] ASoC: rockchip: Use codec of_node and dai_name for rt5514 dsp Date: Tue, 22 Aug 2017 23:35:49 +0800 Message-Id: <20170822153555.20735-3-jeffy.chen@rock-chips.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170822153555.20735-1-jeffy.chen@rock-chips.com> References: <20170822153555.20735-1-jeffy.chen@rock-chips.com> X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: alsa-devel@alsa-project.org, briannorris@chromium.org, Liam Girdwood , Mark Brown , Jeffy Chen , dianders@chromium.org, Jaroslav Kysela , linux-rockchip@lists.infradead.org, mka@chromium.org, Takashi Iwai , linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+patchwork-linux-rockchip=patchwork.kernel.org@lists.infradead.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 --- Changes in v6: None Changes in v5: 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 70b5821afb17..944fefac7875 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; platform_set_drvdata(pdev, card);