Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp1027323ybv; Fri, 7 Feb 2020 13:00:10 -0800 (PST) X-Google-Smtp-Source: APXvYqxwMHXd41W7OsVh/61hFHo5mx3tKRSfgQfQzqil0QERE5LiT3fNNnrnIzOLnUc/RvsE1rAk X-Received: by 2002:a05:6808:8ca:: with SMTP id k10mr3325943oij.164.1581109209924; Fri, 07 Feb 2020 13:00:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581109209; cv=none; d=google.com; s=arc-20160816; b=cIFnX5GdHRxdyixpml60haHmmLnJNXZsgFRoLK0jpxfcSmo1NfLz6vL68U5oWBm7TW w2Ls2PyYlxs/5tJHeweZb2mpnsF3Bmk/iYfLVPk/dBlGiRXFbr9t1iKJMOOFIXDW/EBI sfj7IR4tysnkwrAeZKblR9BsAM/uYU1WAag//NoeAtR9W6We5PuOFKomuQdZVT7JQibf MuEV+XbIzAT0vaQaDYCnb1rpyC/YbxGTg/oV3i9C8lY9wIs9PGeDt9U2CA2sUjM+ojN/ 3fdgHog3F58+JNEc/xTvQz3SWiNPsM7kgVx9EAx/AZ9uIfIl3F2RyJO+Pimmf+jFljv4 oBbQ== 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:dkim-filter; bh=ETimvPxlhSv3UnHdR3sMFlCASzRDsVkv5A46uX4f778=; b=LGDezW67z1STSwm48OmNmRc2eVC8SfNeHWpMSVGItYDpKkFduPWtwQsAOCsPctZByw 1zltAFX2mVFjHSmr1WGShvOVeJt8eP39V3pGlBUDd3uRvXIo6WiIjBeYaLUZ5WFQ+o7I cIRliJMHzVWPCMfxMP1ff96SN+2e/QDIuwVht9g0FO/Zk9r6PZngv4LTjwpA3lRfGpTd SDgzRUVyfixooxlNOjs612QmIlh5UimPacxPJT4vvhdU6MRl2W5rXyH+DHLB3nLhFr43 cvfwxS9+B0ktJEFzIdqc28v7VPN2G6L8olsLOC+ZgM76adIAxYyyQuiDDfkh+mY3N0vL RMnA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@serbinski.com header.s=default header.b=h0NDVPuH; 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 106si264383oti.106.2020.02.07.12.59.58; Fri, 07 Feb 2020 13:00:09 -0800 (PST) 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=@serbinski.com header.s=default header.b=h0NDVPuH; 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 S1727578AbgBGU6r (ORCPT + 99 others); Fri, 7 Feb 2020 15:58:47 -0500 Received: from mail.serbinski.com ([162.218.126.2]:46950 "EHLO mail.serbinski.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727031AbgBGU6o (ORCPT ); Fri, 7 Feb 2020 15:58:44 -0500 Received: from localhost (unknown [127.0.0.1]) by mail.serbinski.com (Postfix) with ESMTP id 94808D00723; Fri, 7 Feb 2020 20:50:34 +0000 (UTC) X-Virus-Scanned: amavisd-new at serbinski.com Received: from mail.serbinski.com ([127.0.0.1]) by localhost (mail.serbinski.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id RYQe4sNuTc_o; Fri, 7 Feb 2020 15:50:27 -0500 (EST) Received: from anet (ipagstaticip-7ac5353e-e7de-3a0d-ff65-4540e9bc137f.sdsl.bell.ca [142.112.15.192]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.serbinski.com (Postfix) with ESMTPSA id 0D866D006F9; Fri, 7 Feb 2020 15:50:27 -0500 (EST) DKIM-Filter: OpenDKIM Filter v2.11.0 mail.serbinski.com 0D866D006F9 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=serbinski.com; s=default; t=1581108627; bh=ETimvPxlhSv3UnHdR3sMFlCASzRDsVkv5A46uX4f778=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=h0NDVPuHG5BrYyomgj6lbDXKJoOpSpwmhTw4xpD+Rq8tk/kTCiTyCcHCMC7ELF7qi D4U+5b/XVaaghNQ/RrklZ3Kx0LspwU8Vn49AQbpxECRUC0pbo68x4xR/TBg2AKqLH5 KYSqFZ6iC+Y6hvf+6kLg3XIcVXfd/0ujEDFt2MQE= From: Adam Serbinski To: Mark Brown , Srini Kandagatla , Rob Herring , Bjorn Andersson Cc: Adam Serbinski , Andy Gross , Mark Rutland , Liam Girdwood , Patrick Lai , Banajit Goswami , Jaroslav Kysela , Takashi Iwai , alsa-devel@alsa-project.org, linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 6/8] ASoC: qcom/common: Use snd-soc-dummy-dai when codec is not specified Date: Fri, 7 Feb 2020 15:50:11 -0500 Message-Id: <20200207205013.12274-7-adam@serbinski.com> X-Mailer: git-send-email 2.21.1 In-Reply-To: <20200207205013.12274-1-adam@serbinski.com> References: <20200207205013.12274-1-adam@serbinski.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org When not specifying a codec, use snd-soc-dummy-dai. This supports the case where a fixed configuration codec is attached, such as bluetooth hfp. Signed-off-by: Adam Serbinski CC: Andy Gross CC: Mark Rutland CC: Liam Girdwood CC: Patrick Lai CC: Banajit Goswami CC: Jaroslav Kysela CC: Takashi Iwai CC: alsa-devel@alsa-project.org CC: linux-arm-msm@vger.kernel.org CC: devicetree@vger.kernel.org CC: linux-kernel@vger.kernel.org --- sound/soc/qcom/common.c | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/sound/soc/qcom/common.c b/sound/soc/qcom/common.c index 6c20bdd850f3..aa2f2238aca0 100644 --- a/sound/soc/qcom/common.c +++ b/sound/soc/qcom/common.c @@ -84,7 +84,7 @@ int qcom_snd_parse_of(struct snd_soc_card *card) goto err; } - if (codec && platform) { + if (platform) { link->platforms->of_node = of_parse_phandle(platform, "sound-dai", 0); @@ -94,10 +94,22 @@ int qcom_snd_parse_of(struct snd_soc_card *card) goto err; } - ret = snd_soc_of_get_dai_link_codecs(dev, codec, link); - if (ret < 0) { - dev_err(card->dev, "%s: codec dai not found\n", link->name); - goto err; + if (codec) { + ret = snd_soc_of_get_dai_link_codecs(dev, codec, link); + if (ret < 0) { + dev_err(card->dev, "%s: codec dai not found\n", link->name); + goto err; + } + } else { + dlc = devm_kzalloc(dev, + sizeof(*dlc), GFP_KERNEL); + if (!dlc) + return -ENOMEM; + + link->codecs = dlc; + link->num_codecs = 1; + link->codecs->dai_name = "snd-soc-dummy-dai"; + link->codecs->name = "snd-soc-dummy"; } link->no_pcm = 1; link->ignore_pmdown_time = 1; -- 2.21.1