From patchwork Wed May 15 13:18:54 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jerome Brunet X-Patchwork-Id: 164302 Delivered-To: patch@linaro.org Received: by 2002:a92:9e1a:0:0:0:0:0 with SMTP id q26csp750307ili; Wed, 15 May 2019 06:19:25 -0700 (PDT) X-Google-Smtp-Source: APXvYqxOx5SYpG619gE5F0TnL+krWRpW0Oeu8KQBZWwmmX2fkKbIdeZzAXhYommQbxxMcSfnFx5z X-Received: by 2002:a17:902:28c9:: with SMTP id f67mr24696292plb.190.1557926365534; Wed, 15 May 2019 06:19:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557926365; cv=none; d=google.com; s=arc-20160816; b=sDtcsfYZKuRwjXmow9i8KHU+gQSxumeXoch89aYKPTDPZm8EdXN4C3FV9N7oo78XAC +31D17YZMq6TfoYaqgzK3y2gxU18QRGiWiX63g02ouqJhakdL2+z0XrzCpHMW6GxWRDW 8F8Y+B7o+2cUjEZXGoOY6mfEE7DmXVW8gxsVyiPnlXWrXHlzS7Ga8klnFeNDBnOmXw1b o1Q83unLIli3JM4xtOxl+uTWlVc0/T+8lJXEMI25KEAhaXWWJqRTP82zqUtzcacn2Ecw UDnwwhCJVlncwWcm2ORVQ0sx+G121+FppHw08wVoF8bXOIAbZdeB+/MM9Fa9sI4DgXkx Px4A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=2h106Z4/ATcPU1QRPJE9+ZrjCSAT+SxJpUGNW5+ypdI=; b=Q/8v7dIJyibQcT6u84wTAINk6B49PLaVzKRJg0TvMWakFYOHMbRthwb50oAN3HUFDZ 6BxfUY37lDt4vOWtT93HfMh853kMIpXq5KvtDl+9WKSbruQ9zpWWOawqsEgi5pSwBFRY MNEXAn/75xS36cNvWQhGl2NH6RTumYfDfTqxVLvs+lgpqUn+l+8Ui+UkEbDgjLD98G3q vsT38RdvVXWlo3xjL6iB5Bhti/v0tjRlvT2yChi+6VPd1+RgRCI9jDsPatxcgE4XzRhq 1F91AlsMtTEwKgt452XU6J2e0G9SmiubSq4mKU84Nucu3efWss6KF8KcZYNWz+RNbT9r t2yQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=X1lAu5ZH; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s36si1880973pga.19.2019.05.15.06.19.25; Wed, 15 May 2019 06:19:25 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=X1lAu5ZH; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728021AbfEONTI (ORCPT + 30 others); Wed, 15 May 2019 09:19:08 -0400 Received: from mail-wr1-f65.google.com ([209.85.221.65]:43939 "EHLO mail-wr1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727951AbfEONTF (ORCPT ); Wed, 15 May 2019 09:19:05 -0400 Received: by mail-wr1-f65.google.com with SMTP id r4so2642050wro.10 for ; Wed, 15 May 2019 06:19:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=2h106Z4/ATcPU1QRPJE9+ZrjCSAT+SxJpUGNW5+ypdI=; b=X1lAu5ZHCCzjYghnscD0OX/jA0eMlPFEIG8XZk5dovfhL4UaTlEOtCBhFZFxVzm/Tx pAuVx3DJBiDzhUUHz/kN5GlFuAml795hgYaBtvabvfgbbSrUquNiIytC02wU6fj3fGpV INbx6MKpj3ZgfAYTSaDK2uVDCHND1QaFcBdR+pzG5vz7wuf9++VSiy/sSnyHl2lnRX4K iD8w9VgD4eEWjD7rTwGUzq2ueadZtVALe0cg3iNfzNm+P/LBrM1AkLpMcCw3Fcdvgogo fQ92LKWlhxnHDQLEc8iLHSjHlbisyKDTjc72ScH+sPXvyRVEgeAlm70JJ+g8h/ZGY0eW KeKg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=2h106Z4/ATcPU1QRPJE9+ZrjCSAT+SxJpUGNW5+ypdI=; b=hBn5mvPAwT3uWgkZ/L+PnEOgkTHDSiptQSB8Cd49AqH+J/B40xcpq2xphvSMaK6g/u JRWbhmiFkbJDUDCPuuRmyIxDqa7pm6bDw6QIdJ+mjV7oQ3exX9ihQq5nCvz6Nl6QBwnu wsvtjHbEceDlIe1VsV+mXN3n4Sx7c2H4H9w/wwtmOhayTAMaTYMVW4CsxWq0KTp98/AT 02CgcOhDyeA1QmeS0s/n2zGcb4RfAkadKrkEBtc8ISAhyxbGmltYKQ2yGr57nS+avMoc alb6WB/9ynWVlmkQIP8p+Rv6NQBHnrla67FmNcu3M0qG0R12Otqer+pcVgYn6EFETvFa Rtqw== X-Gm-Message-State: APjAAAVkGczKZ+v0cOS1sT4Pho3CpGMObtEc8VzrqR7yP8cFCOknPAgn T+AJwjHXku20NL1FeZH0L9NTHA== X-Received: by 2002:adf:f5d1:: with SMTP id k17mr25107467wrp.281.1557926344035; Wed, 15 May 2019 06:19:04 -0700 (PDT) Received: from boomer.local (lmontsouris-657-1-212-31.w90-63.abo.wanadoo.fr. [90.63.244.31]) by smtp.googlemail.com with ESMTPSA id b206sm2789848wmd.28.2019.05.15.06.19.02 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 15 May 2019 06:19:03 -0700 (PDT) From: Jerome Brunet To: Mark Brown , Liam Girdwood , Kevin Hilman Cc: Jerome Brunet , alsa-devel@alsa-project.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-amlogic@lists.infradead.org Subject: [PATCH 1/5] ASoC: meson: axg-card: set link name based on link node name Date: Wed, 15 May 2019 15:18:54 +0200 Message-Id: <20190515131858.32130-2-jbrunet@baylibre.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190515131858.32130-1-jbrunet@baylibre.com> References: <20190515131858.32130-1-jbrunet@baylibre.com> MIME-Version: 1.0 X-Patchwork-Bot: notify Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org So far the link names of the axg sound card was derived from the cpu name of the link. Since the dai link must be unique, it works as long as a device does not provide more than one cpu dai. However, the 'tohdmitx' does provide 2 dais used as cpu on codec-to-codec links Instead of cpu name, use the node name of the dai link. DT already enforce the uniqueness of this name Signed-off-by: Jerome Brunet --- sound/soc/meson/axg-card.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) -- 2.20.1 diff --git a/sound/soc/meson/axg-card.c b/sound/soc/meson/axg-card.c index aa54d2c612c9..5c8deee8d512 100644 --- a/sound/soc/meson/axg-card.c +++ b/sound/soc/meson/axg-card.c @@ -80,10 +80,11 @@ static int axg_card_parse_dai(struct snd_soc_card *card, static int axg_card_set_link_name(struct snd_soc_card *card, struct snd_soc_dai_link *link, + struct device_node *node, const char *prefix) { char *name = devm_kasprintf(card->dev, GFP_KERNEL, "%s.%s", - prefix, link->cpu_of_node->full_name); + prefix, node->full_name); if (!name) return -ENOMEM; @@ -474,7 +475,7 @@ static int axg_card_set_be_link(struct snd_soc_card *card, codec++; } - ret = axg_card_set_link_name(card, link, "be"); + ret = axg_card_set_link_name(card, link, node, "be"); if (ret) dev_err(card->dev, "error setting %pOFn link name\n", np); @@ -483,6 +484,7 @@ static int axg_card_set_be_link(struct snd_soc_card *card, static int axg_card_set_fe_link(struct snd_soc_card *card, struct snd_soc_dai_link *link, + struct device_node *node, bool is_playback) { link->dynamic = 1; @@ -497,7 +499,7 @@ static int axg_card_set_fe_link(struct snd_soc_card *card, else link->dpcm_capture = 1; - return axg_card_set_link_name(card, link, "fe"); + return axg_card_set_link_name(card, link, node, "fe"); } static int axg_card_cpu_is_capture_fe(struct device_node *np) @@ -527,9 +529,9 @@ static int axg_card_add_link(struct snd_soc_card *card, struct device_node *np, return ret; if (axg_card_cpu_is_playback_fe(dai_link->cpu_of_node)) - ret = axg_card_set_fe_link(card, dai_link, true); + ret = axg_card_set_fe_link(card, dai_link, np, true); else if (axg_card_cpu_is_capture_fe(dai_link->cpu_of_node)) - ret = axg_card_set_fe_link(card, dai_link, false); + ret = axg_card_set_fe_link(card, dai_link, np, false); else ret = axg_card_set_be_link(card, dai_link, np);