Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp349379pxb; Thu, 25 Feb 2021 04:23:01 -0800 (PST) X-Google-Smtp-Source: ABdhPJw0WC66br87UJRTAvQmrZ55UAvJV8reMk6W/2b2yBTQ0CVp9k77zkbKcukKMxAQBj4QBsbb X-Received: by 2002:a05:6402:402:: with SMTP id q2mr2650614edv.116.1614255780975; Thu, 25 Feb 2021 04:23:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614255780; cv=none; d=google.com; s=arc-20160816; b=UAtVE6uropCiPwJC27v3X0Q6AB7wI5qtBOUEqDfWDovsfILfOjlo/JWcYmOEiOZXs0 D63SLKwAx81/Klb8dhDLJQUjCgsgfFxQPus+jLMo317yahvE8Hm/5bvQf2weamAFLeJ+ hdfRkaFKS2pI30aSWPlJpvWG2SMRAUDJVdyXTR4ppdC1G1YR6BaVlPI548pAyQdH8fDV Ie4CymV/qLuquxpALTM4T8kElSGCTAKWA2Eb4bcc+/jzTZwCQ6CyeQuBWxK1t6T0ioFN HchsSiDzweQ++bo2qC1DBARWKuR4S/zN8uGmbPWwEAH3BYPWr5ZNrdHDZszyUehPrKWL Awzg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:to:from; bh=KJkJEoRT10juTJLKq0UfrdicySAeLSJz0fL+ya1CEgI=; b=DJU5jo7w4AUIg5wSktYiga1GpS+OQVa5OAnSpDo8akUEanlA9PMcStKMSVE67PCW4e zi5hYq/BSUR8jheqpEdsNY/TTeCyIU6zx9hznA4I0B+BHU7ZGcS8DjEZnq2E7tueXBq5 AchX8ksF9VWuLKdWn8wP5BG4gIocCwyDennqLL/aGHOojiepqZ2VlyolR2OiSXcH2ebF qTY3vqX386Mb/sg3CpC7HGLSrB3AIPnbwLw8jfTZGR8HRXDx2Knm1HUCcvSm2TmP87JR MzHvwVh6/qNz9bD6B2hSiKudMCaYh+ARUohxtotjgCfhKyrrwJa0n/bW/s8BR5pnszpU jEag== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p62si3212250edp.242.2021.02.25.04.22.38; Thu, 25 Feb 2021 04:23:00 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233524AbhBYMWC (ORCPT + 99 others); Thu, 25 Feb 2021 07:22:02 -0500 Received: from inva021.nxp.com ([92.121.34.21]:57174 "EHLO inva021.nxp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232600AbhBYMVg (ORCPT ); Thu, 25 Feb 2021 07:21:36 -0500 Received: from inva021.nxp.com (localhost [127.0.0.1]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 96293200C0F; Thu, 25 Feb 2021 13:20:48 +0100 (CET) Received: from invc005.ap-rdc01.nxp.com (invc005.ap-rdc01.nxp.com [165.114.16.14]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 51FFD200C38; Thu, 25 Feb 2021 13:20:43 +0100 (CET) Received: from localhost.localdomain (shlinux2.ap.freescale.net [10.192.224.44]) by invc005.ap-rdc01.nxp.com (Postfix) with ESMTP id 97A4340291; Thu, 25 Feb 2021 13:20:36 +0100 (CET) From: Shengjiu Wang To: lgirdwood@gmail.com, broonie@kernel.org, perex@perex.cz, tiwai@suse.com, pierre-louis.bossart@linux.intel.com, stephan@gerhold.net, guennadi.liakhovetski@linux.intel.com, kai.vehmanen@linux.intel.com, alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org Subject: [PATCH] ASoC: simple-card: Add dummy dai support simple sound card Date: Thu, 25 Feb 2021 20:08:32 +0800 Message-Id: <1614254912-15746-1-git-send-email-shengjiu.wang@nxp.com> X-Mailer: git-send-email 2.7.4 X-Virus-Scanned: ClamAV using ClamSMTP Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org If sound card doesn't need specific codec device, just dummy codec is enough, then we can link the dummy component directly. In this case, user needs to specify below setting in devicetree. Previously the sound-dai is a node of codec, now we check if it is zero before parsing the node, zero means dummy component is specified. simple-audio-card,codec { sound-dai = <0>; }; Signed-off-by: Shengjiu Wang --- sound/soc/generic/simple-card.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/sound/soc/generic/simple-card.c b/sound/soc/generic/simple-card.c index c262281bc64d..8b0cabd1bad1 100644 --- a/sound/soc/generic/simple-card.c +++ b/sound/soc/generic/simple-card.c @@ -34,10 +34,19 @@ static int asoc_simple_parse_dai(struct device_node *node, { struct of_phandle_args args; int ret; + u32 val; if (!node) return 0; + ret = of_property_read_u32(node, DAI, &val); + if (val == 0) { + dlc->of_node = NULL; + dlc->dai_name = "snd-soc-dummy-dai"; + dlc->name = "snd-soc-dummy"; + return 0; + } + /* * Get node via "sound-dai = <&phandle port>" * it will be used as xxx_of_node on soc_bind_dai_link() -- 2.27.0