From patchwork Thu Oct 20 14:20:48 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 78516 Delivered-To: patch@linaro.org Received: by 10.140.97.247 with SMTP id m110csp808909qge; Thu, 20 Oct 2016 07:21:08 -0700 (PDT) X-Received: by 10.99.107.130 with SMTP id g124mr1448880pgc.76.1476973268897; Thu, 20 Oct 2016 07:21:08 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t86si45293082pfg.236.2016.10.20.07.21.08; Thu, 20 Oct 2016 07:21:08 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org; spf=pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org; dmarc=fail (p=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S938634AbcJTOVG (ORCPT + 7 others); Thu, 20 Oct 2016 10:21:06 -0400 Received: from mail-vk0-f49.google.com ([209.85.213.49]:35460 "EHLO mail-vk0-f49.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S941367AbcJTOVE (ORCPT ); Thu, 20 Oct 2016 10:21:04 -0400 Received: by mail-vk0-f49.google.com with SMTP id q126so74426961vkd.2 for ; Thu, 20 Oct 2016 07:21:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=A6HrM0vYb+RLFH1OU3QwuKlVh4Uv1vLfjr+Jl2BfRFk=; b=eU5oNHmyb2muO3OeTlShePuGHhiCN4QeKotbOkXOpWlmwJpYiCsZXR7Nnoe6RYSi7V n07r4CcxNFF639JmmhwrEkvqxR5p5PTWqhoy+DTBYhbCY1sO4xJG5QfZDgiQOTxCKYVT hY0XFDBkp94N8YGcH15upbLPj/BRQNeFOpDX0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=A6HrM0vYb+RLFH1OU3QwuKlVh4Uv1vLfjr+Jl2BfRFk=; b=bfWnYQ9NQMy82zpzeQEbDqVUpVj1PDxA1zUlhXHQB4a/vOPVL2VmKA7eRjdd8WpA3+ 0hfwyGryxxSJW2Gmp8CgZYtfVeEBXSo8VChPLMD6RPruosdEe2XB0KTI86WlDxJZ2LIx pu5wlG+n6uGwcAdhQPDqWylRSzkVfhQZDoY/25Z+0k4Ag8omDzskKBIjyYX9DI1fClTl S61pIwwHrhWscSpy+n8Sd/BvqgWxXSwm1vuVaLFeuI/mx3dR6RtZSp3wIQ0Ztt5u15hW /BGYafKvq+IQnXxHq847Ha+rohOWgAq6kx0n4QHNmVBROTIfEiA/YQ7GRQNrvbpfLvbK ThBw== X-Gm-Message-State: AA6/9Rm9UMNdfYwKVbjDfqbpvooi5dOlo28Vrmcuy0FMWuiuYLW7WCGT88HLxmG1xz7ZMg7R X-Received: by 10.194.125.114 with SMTP id mp18mr582181wjb.106.1476973263578; Thu, 20 Oct 2016 07:21:03 -0700 (PDT) Received: from localhost.localdomain (host-2-98-107-216.as13285.net. [2.98.107.216]) by smtp.gmail.com with ESMTPSA id za1sm75199871wjb.8.2016.10.20.07.21.02 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 20 Oct 2016 07:21:02 -0700 (PDT) From: Srinivas Kandagatla To: broonie@kernel.org, alsa-devel@alsa-project.org Cc: robh+dt@kernel.org, mark.rutland@arm.com, tiwai@suse.com, devicetree@vger.kernel.org, kwestfie@codeaurora.org, linux-arm-msm@vger.kernel.org, srinivas.kandagatla@linaro.org Subject: [PATCH v6 4/5] ASoC: qcom: apq8016-sbc: Add support to multi codec. Date: Thu, 20 Oct 2016 15:20:48 +0100 Message-Id: <1476973249-14547-5-git-send-email-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1476973249-14547-1-git-send-email-srinivas.kandagatla@linaro.org> References: <1476973249-14547-1-git-send-email-srinivas.kandagatla@linaro.org> Sender: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org This patch adds support to multi codec, as the msm8916 codec is now split into two codecs, Analog and Digital. Also update the bindings and example to show that the card supports multicodec. Signed-off-by: Srinivas Kandagatla Acked-by: Rob Herring --- Documentation/devicetree/bindings/sound/qcom,apq8016-sbc.txt | 4 ++-- sound/soc/qcom/apq8016_sbc.c | 11 +++-------- 2 files changed, 5 insertions(+), 10 deletions(-) -- 2.9.2 -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/Documentation/devicetree/bindings/sound/qcom,apq8016-sbc.txt b/Documentation/devicetree/bindings/sound/qcom,apq8016-sbc.txt index 72c1928..6a4aadc 100644 --- a/Documentation/devicetree/bindings/sound/qcom,apq8016-sbc.txt +++ b/Documentation/devicetree/bindings/sound/qcom,apq8016-sbc.txt @@ -44,7 +44,7 @@ Required dai-link subnodes: Required CPU/CODEC subnodes properties: -link-name : Name of the dai link. --sound-dai : phandle and port of CPU/CODEC +-sound-dai : phandle/s and port of CPU/CODEC Example: @@ -72,7 +72,7 @@ sound: sound { sound-dai = <&lpass MI2S_PRIMARY>; }; codec { - sound-dai = <&wcd_codec 0>; + sound-dai = <&lpass_codec 0>, <&wcd_codec 0>; }; }; diff --git a/sound/soc/qcom/apq8016_sbc.c b/sound/soc/qcom/apq8016_sbc.c index 07f91e9..d084d74 100644 --- a/sound/soc/qcom/apq8016_sbc.c +++ b/sound/soc/qcom/apq8016_sbc.c @@ -123,20 +123,15 @@ static struct apq8016_sbc_data *apq8016_sbc_parse_of(struct snd_soc_card *card) return ERR_PTR(-EINVAL); } - link->codec_of_node = of_parse_phandle(codec, "sound-dai", 0); - if (!link->codec_of_node) { - dev_err(card->dev, "error getting codec phandle\n"); - return ERR_PTR(-EINVAL); - } - ret = snd_soc_of_get_dai_name(cpu, &link->cpu_dai_name); if (ret) { dev_err(card->dev, "error getting cpu dai name\n"); return ERR_PTR(ret); } - ret = snd_soc_of_get_dai_name(codec, &link->codec_dai_name); - if (ret) { + ret = snd_soc_of_get_dai_link_codecs(dev, codec, link); + + if (ret < 0) { dev_err(card->dev, "error getting codec dai name\n"); return ERR_PTR(ret); }