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); From patchwork Wed May 15 13:18:55 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jerome Brunet X-Patchwork-Id: 164300 Delivered-To: patch@linaro.org Received: by 2002:a92:9e1a:0:0:0:0:0 with SMTP id q26csp750206ili; Wed, 15 May 2019 06:19:21 -0700 (PDT) X-Google-Smtp-Source: APXvYqyrZIx3WEicFJxl00sYjvTk0q0Q9oMh6Qlmu6zl+qvDdy+65AGZZBZTZVkv2L2cAVc9p8ct X-Received: by 2002:a63:7054:: with SMTP id a20mr30455774pgn.354.1557926361829; Wed, 15 May 2019 06:19:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557926361; cv=none; d=google.com; s=arc-20160816; b=X77wkUBDk4uvHp/AmMHOcSZaX+0DzdFZb3b9fxA8bOJvlpL0AZvwfjKMSksJGu/EeW fpCQIVl4C9owXK/wkjROqfh5WeqVstwoweYmXG069GUhWuACJAUapdwqFhxL6Brx9uOt 0AIU19khGS4PKMbRg9SNbWBNr87FNltWo6zhx6sJfCHWSJ6+5VeJ8ALgmsxEFBUElEEk YUHwI9+jxoyuZOo2B05wOfOsN4RUbSvSYEzzvun/V7/r0IQwsZEfaBeTD2ZDO72e1X7h qpcLSwRO5uR31jPCe0d2U8R/UV5J2dvEB9FgmiTo4g+cjtFF28aQ0Yg9er7RjFkAZxzK MV4Q== 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=Qs77ALhE/gKtnduPvCRtEn1+XaA68gtG693yCTv90Vk=; b=CaAym7Xi/kOfHKvRMaN1JmHHDNSifSe9fSehnO0/B+PqUiypdX9Vhj2P5k1p5mjemm 9ynaoNvxVHm2qU4t49JVM1lRKVSldez1UIKsXPpU4E6yTdEwxgTEe+fTlFkjsiUi/Qir lDhE3ZZIK6VuQ07FEmYq00uJTa6DuWjhmdr3wL4ZL5hTlO6sx/MScInJgSvf7ItTagUk gyNxB4qRRuespJy5aDBJG3BHouUtESBCwBABlZTIkk7GV0LnghASI+A6xIevlG5UJq60 bT0h2BvPvitUFHpPbgxRxKjG/7IiOPCGdfxNUF8CZmnBSSLTREOZ4FYQ6/FYAFKjm+yh IvBQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=zDGPkuHo; 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 v65si2180727pfb.77.2019.05.15.06.19.21; Wed, 15 May 2019 06:19:21 -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=zDGPkuHo; 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 S1728050AbfEONTI (ORCPT + 30 others); Wed, 15 May 2019 09:19:08 -0400 Received: from mail-wr1-f68.google.com ([209.85.221.68]:46924 "EHLO mail-wr1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727955AbfEONTG (ORCPT ); Wed, 15 May 2019 09:19:06 -0400 Received: by mail-wr1-f68.google.com with SMTP id r7so2622054wrr.13 for ; Wed, 15 May 2019 06:19:05 -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=Qs77ALhE/gKtnduPvCRtEn1+XaA68gtG693yCTv90Vk=; b=zDGPkuHoA+3szCHGN82vW7BAjTdBaU1OEwV8QGKRxUxlc/CvIbHhm/IJhbrHViITb8 Msdp/fTbSM4btIYHBKCNaYVZ9n8AnJab4dM4x4ATaPA9r1roYVf93Xdo/bChCE+wWkEF cGZtKlUI9OejPiIb8VyEOg8mXy/XHD6YGtjlzYGbKpIsVSJv5wl2PlyVRCqOl5BZHpN/ wTf4ruJlum1SBBQ948AXlntz0/Js3jMwR6yC+lrrFR/UGBPwf1KNKAnPJwoKaGlMcdUp 2gKy5rNYaka0c8ojR19pSXOI0kOgsA8uDExnZ4ASqvPi2hzP4gUjXhCDeem7dIDTL5zT wvTw== 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=Qs77ALhE/gKtnduPvCRtEn1+XaA68gtG693yCTv90Vk=; b=c99gX7GGYU3eTcoNWjW3U7e/NIzS5etR/c43/AdE9yfN7SxWVDbwxKaKD8if3f+GIt XAvpKWeeV5O+9tXOQQogi5Cm2hQX5mkhDbRJ5psOEmc/DC/bAZwOX9B7rMy9zdGfx2xU 1F2Q5BXjmX6CcBNq1/a7aM2LRzyMpvxl39KxA+HlMFOvGtbgTzlpCgziqqXWqBkMmaLd CRzTvZzLhTKco13NvlHdv5CGs1ffQ/c2fC80r7wa3HfWRuOCkH+jFIE9CxQFXu0Q1Xby bkJsHuNLXlr4yKhD5mpeeTKh3OyJICwpwPsB/STEyvBNG88sA9HPTw+9LzR+Xc3KAxm3 BCvw== X-Gm-Message-State: APjAAAVPUv4fnFwPpCLWx3DXoPQ2Uc/lPxJwrxCTV5u15przv0tKbJeU MLOIHLyVN9nX5mZpT2aeU5br/A== X-Received: by 2002:adf:b641:: with SMTP id i1mr25792669wre.288.1557926344965; 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.04 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 15 May 2019 06:19:04 -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 2/5] ASoC: dapm: allow muxes to force a disconnect Date: Wed, 15 May 2019 15:18:55 +0200 Message-Id: <20190515131858.32130-3-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 Let soc_dapm_mux_update_power() accept NULL as 'e' enum. It makes the code a bit more robust and, more importantly, let the calling mux force a disconnect of the output path if necessary. This is useful if the dapm elements following the mux must be off while updating the mux, to avoid glitches or force a (re)configuration. Signed-off-by: Jerome Brunet --- sound/soc/soc-dapm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.20.1 diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c index 81a7a12196ff..a4d6c068b545 100644 --- a/sound/soc/soc-dapm.c +++ b/sound/soc/soc-dapm.c @@ -2245,7 +2245,7 @@ static int soc_dapm_mux_update_power(struct snd_soc_card *card, dapm_kcontrol_for_each_path(path, kcontrol) { found = 1; /* we now need to match the string in the enum to the path */ - if (!(strcmp(path->name, e->texts[mux]))) + if (e && !(strcmp(path->name, e->texts[mux]))) connect = true; else connect = false;