From patchwork Tue Sep 6 09:57:43 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 75489 Delivered-To: patch@linaro.org Received: by 10.140.106.11 with SMTP id d11csp459923qgf; Tue, 6 Sep 2016 02:58:17 -0700 (PDT) X-Received: by 10.66.249.134 with SMTP id yu6mr8526142pac.44.1473155892658; Tue, 06 Sep 2016 02:58:12 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y15si34676952pfb.247.2016.09.06.02.58.11; Tue, 06 Sep 2016 02:58:12 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-arm-msm-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 linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-arm-msm-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 S933885AbcIFJ6G (ORCPT + 8 others); Tue, 6 Sep 2016 05:58:06 -0400 Received: from mail-wm0-f46.google.com ([74.125.82.46]:38529 "EHLO mail-wm0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933325AbcIFJ6E (ORCPT ); Tue, 6 Sep 2016 05:58:04 -0400 Received: by mail-wm0-f46.google.com with SMTP id 1so179524918wmz.1 for ; Tue, 06 Sep 2016 02:58:03 -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=KuyzEqJUqYZrLSIv6tmWkuRv7M3f3tWx5y4tcdG4Xg8=; b=SuzKLSPPCgFbMVwx/CUPMGVmsxQfRbKutOVewfczOSDqcohHjm3L3i69DiENjJOMqU OWn3DtYX+EEhrP0ssobkqqlOfmqnM1jLRvay4kRHEVmtDaGgFry+XMPR1zRF2Wp8hSKw ZICe4oz0HpMd2gMTqnkW2E0c5a1dympvql5ac= 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=KuyzEqJUqYZrLSIv6tmWkuRv7M3f3tWx5y4tcdG4Xg8=; b=GikpF92ErZAm6HknDsBiKeYi2mYz0YNOEk7OT/H1Jruyi4hYnPbe373Bf1TfagQnra NOxyh2FAAL8z8JkuJGcQ9M50napVI9d3dXzBDFzvDF4woVHgQDKsyGXJGAFKkUhlrECs 2z3JkfLdVdLPR4tWGr6s3PWskAwCmDUzEkcMOFH0DnwzDenwIJ6DUtNNG0R5ulBIo6O2 Sz5Qu/2nB29PloGYt9myx/UdGQpo6Ys3EttRJngA1k0PhXLD2j0gg6mLRX3iewVY8Pw8 h8MV1KbqeLo7jFEd2ozgEIdXX1EzfcrODZwSbzRq2P1hO2nzgxhQHneJ0IoHU5zDWOZ+ tC8g== X-Gm-Message-State: AE9vXwOQ83XyfVIpLAcquXaASNaLR8CBvK3VrA7zNJ33FupTy7XTEjnH5hapivuMLHJGbVuw X-Received: by 10.194.139.236 with SMTP id rb12mr34870559wjb.101.1473155882492; Tue, 06 Sep 2016 02:58:02 -0700 (PDT) Received: from localhost.localdomain (host-2-103-180-164.as13285.net. [2.103.180.164]) by smtp.gmail.com with ESMTPSA id pm1sm32415679wjb.40.2016.09.06.02.58.01 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 06 Sep 2016 02:58:01 -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 Subject: [PATCH v4 4/6] ASoC: qcom: apq8016-sbc: add support to routing via DT Date: Tue, 6 Sep 2016 10:57:43 +0100 Message-Id: <1473155865-13361-5-git-send-email-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1473155865-13361-1-git-send-email-srinivas.kandagatla@linaro.org> References: <1473155865-13361-1-git-send-email-srinivas.kandagatla@linaro.org> Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org This patch adds support to allow audio routing via Device Tree. This is mostly used to specify MICBIAS and other power supplies relation. Signed-off-by: Srinivas Kandagatla --- .../devicetree/bindings/sound/qcom,apq8016-sbc.txt | 30 ++++++++++++++++++++++ sound/soc/qcom/apq8016_sbc.c | 9 +++++++ 2 files changed, 39 insertions(+) -- 2.7.4 -- To unsubscribe from this list: send the line "unsubscribe linux-arm-msm" 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 4812936..d9d8635 100644 --- a/Documentation/devicetree/bindings/sound/qcom,apq8016-sbc.txt +++ b/Documentation/devicetree/bindings/sound/qcom,apq8016-sbc.txt @@ -16,6 +16,24 @@ Required properties: * "spkr-iomux" - qcom,model : Name of the sound card. +- qcom,audio-routing : A list of the connections between audio components. + Each entry is a pair of strings, the first being the + connection's sink, the second being the connection's + source. Valid names could be power supplies, MicBias + of msm8x16_wcd codec and the jacks on the board: + + Power supplies: + * MIC BIAS External1 + * MIC BIAS External2 + * MIC BIAS Internal1 + * MIC BIAS Internal2 + + Board connectors: + * Headset Mic + * Secondary Mic", + * DMIC + * Ext Spk + Dai-link subnode properties and subnodes: Required dai-link subnodes: @@ -37,6 +55,18 @@ sound: sound { reg-names = "mic-iomux", "spkr-iomux"; qcom,model = "DB410c"; + qcom,audio-routing = + "MIC BIAS External1", "Handset Mic", + "MIC BIAS Internal2", "Headset Mic", + "MIC BIAS External1", "Secondary Mic", + "AMIC1", "MIC BIAS External1", + "AMIC2", "MIC BIAS Internal2", + "AMIC3", "MIC BIAS External1", + "DMIC1", "MIC BIAS Internal1", + "MIC BIAS Internal1", "Digital Mic1", + "DMIC2", "MIC BIAS Internal1", + "MIC BIAS Internal1", "Digital Mic2"; + /* I2S - Internal codec */ internal-dai-link@0 { cpu { /* PRIMARY */ diff --git a/sound/soc/qcom/apq8016_sbc.c b/sound/soc/qcom/apq8016_sbc.c index 5c3ccf3..07f91e9 100644 --- a/sound/soc/qcom/apq8016_sbc.c +++ b/sound/soc/qcom/apq8016_sbc.c @@ -85,6 +85,15 @@ static struct apq8016_sbc_data *apq8016_sbc_parse_of(struct snd_soc_card *card) return ERR_PTR(ret); } + /* DAPM routes */ + if (of_property_read_bool(node, "qcom,audio-routing")) { + ret = snd_soc_of_parse_audio_routing(card, + "qcom,audio-routing"); + if (ret) + return ERR_PTR(ret); + } + + /* Populate links */ num_links = of_get_child_count(node);