Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp2803402ybv; Sun, 9 Feb 2020 07:49:17 -0800 (PST) X-Google-Smtp-Source: APXvYqysWnCdZlZu3tXQ6ZPZe0uJjdvny+0lBP5cJzag/bS41g2BKekGpnOYkA6z5lSISrIwJtq+ X-Received: by 2002:aca:aa0a:: with SMTP id t10mr7869188oie.156.1581263357149; Sun, 09 Feb 2020 07:49:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581263357; cv=none; d=google.com; s=arc-20160816; b=ZI4TKTPCFvBZHEMeQdxE1ft70+XWN4rr9Nzh/sjW33ubsBAlW9ndhmNSLYeoAVJy1q aZOSAb3ngMtD+bw+k9uyuHUGzBcVEIz96Xt8I0xa49QhgkSyvrAOxhcJi0v/B1oejGBi hHsTxGIQpifANAjYD+wrjnO03/j/P5hu4f5AFKfcPX2TpZM4dspTuyWD+iT4/RPFJaBt M92wcrSepFbXSXqxG4R4zHwWV0iDOdzLU5rJPFHL+jS0txU7VPyh03/1a2UP1isU0C4B X488QxjXLMxK8RFu8gJwRtV4BxHfF8SwbLHqVtQoTWK87OluhNAooYxTw6xwNsc4LeS/ BlZg== 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=QOb9QSiS4R1DT9g1DC7dFIMlBgBiYuPjBSgM9y9gspGtNEfIp86nm2KjCA+3In7LO3 O+u0c9ZCvowu7tIRASUL1pZB4pgAaTEWESmedBsR1p63qbhVb/V6kGk0cTx/615hmaHS 87qPOxlUZTymBftpU90atXOV6nU/BXHTPlV9nBJUox1dmk0WWvUBv2s05S3agS02EtV0 ZbGHbHWbHmR54JT5bJCu3TEZZfzY4aPquzGsTqMeuBUleKfhHIHxb1c2ofH/apP/o1Q3 xNgvrK6pynb89oNGwsi/fE0m8rMZdlOYfluHGOpT+24txr0NKVs6iIVz04XeItB9mf4u Nq5g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@serbinski.com header.s=default header.b="vkG/caFn"; 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 f23si3227594oto.205.2020.02.09.07.49.05; Sun, 09 Feb 2020 07:49:17 -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="vkG/caFn"; 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 S1727898AbgBIPsi (ORCPT + 99 others); Sun, 9 Feb 2020 10:48:38 -0500 Received: from mail.serbinski.com ([162.218.126.2]:32952 "EHLO mail.serbinski.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727881AbgBIPsg (ORCPT ); Sun, 9 Feb 2020 10:48:36 -0500 Received: from localhost (unknown [127.0.0.1]) by mail.serbinski.com (Postfix) with ESMTP id 86E81D00716; Sun, 9 Feb 2020 15:48:33 +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 j742tjVpCIOM; Sun, 9 Feb 2020 10:48:24 -0500 (EST) Received: from anet (23-233-80-73.cpe.pppoe.ca [23.233.80.73]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.serbinski.com (Postfix) with ESMTPSA id 5C22CD00717; Sun, 9 Feb 2020 10:48:10 -0500 (EST) DKIM-Filter: OpenDKIM Filter v2.11.0 mail.serbinski.com 5C22CD00717 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=serbinski.com; s=default; t=1581263290; bh=ETimvPxlhSv3UnHdR3sMFlCASzRDsVkv5A46uX4f778=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=vkG/caFnE8m1E/W1a+a64GnTSi1zoYv2sl9AH9dQs5+ng5URuKdFHmgUDCD0d1eag xHralk0esT8FSs+YMIbay8uNkINY4y64fmmc7AxfHY/feKQiohFOdgBVv+DzpzMV/j dJD+IefZGnBM/T3l8QcNfT6vOJJd5KaGrhOy7XNU= 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 v2 6/8] ASoC: qcom/common: Use snd-soc-dummy-dai when codec is not specified Date: Sun, 9 Feb 2020 10:47:46 -0500 Message-Id: <20200209154748.3015-7-adam@serbinski.com> X-Mailer: git-send-email 2.21.1 In-Reply-To: <20200209154748.3015-1-adam@serbinski.com> References: <20200207205013.12274-1-adam@serbinski.com> <20200209154748.3015-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