From patchwork Wed Aug 20 07:13:08 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 4748781 Return-Path: X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 60F1BC0338 for ; Wed, 20 Aug 2014 10:13:54 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 89F7B20122 for ; Wed, 20 Aug 2014 10:13:53 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id 5BE31200FE for ; Wed, 20 Aug 2014 10:13:52 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 6B58B265806; Wed, 20 Aug 2014 12:13:51 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=no version=3.3.1 Received: from alsa0.perex.cz (localhost [IPv6:::1]) by alsa0.perex.cz (Postfix) with ESMTP id 854C626586E; Wed, 20 Aug 2014 12:10:54 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id 0324326586E; Wed, 20 Aug 2014 12:10:52 +0200 (CEST) Received: from mail-pd0-f181.google.com (mail-pd0-f181.google.com [209.85.192.181]) by alsa0.perex.cz (Postfix) with ESMTP id 657182658C8 for ; Wed, 20 Aug 2014 12:06:22 +0200 (CEST) Received: by mail-pd0-f181.google.com with SMTP id g10so11285535pdj.40 for ; Wed, 20 Aug 2014 03:06:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:sender:message-id:from:subject:user-agent:to:cc:in-reply-to :references:mime-version:content-type; bh=JlLPVF0masuFv+WE+FBvzyxirJTVeWD8Wdvqcpz6U6w=; b=ZME0a7AKAnegMrTaJ9VYLTHpolaCCiEMBBNzvVeuDH3Y6zozO1lrypbydTSHgyg+0o kftWihirlRdhPww+aP861326oazfcFkV5mXFlDQpa0pHLvbIyWrSnF35c5wBhnpeI+7O tDZOHM45G6mif3ThpAA2osdzpTgFfj//h5bUoeUFWwTxr/vrhnpodxFJHysdf1BvqnrY bo1C9OtHqJqOU2Hhm8tUxnR33FbTiDM/psHFe8ov43L/9x4QVty0BftU0Thip2avoshW VF9D8t1498UmgQ7UncUO2fE4pizI9qm/C0MJW30UbQnzBK7me7/g6GU5Hn90gDTrHndG ob9Q== X-Received: by 10.66.65.202 with SMTP id z10mr48608068pas.20.1408518789385; Wed, 20 Aug 2014 00:13:09 -0700 (PDT) Received: from remon.gmail.com (49.14.32.202.bf.2iij.net. [202.32.14.49]) by mx.google.com with ESMTPSA id fs6sm32717828pdb.60.2014.08.20.00.13.07 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Wed, 20 Aug 2014 00:13:08 -0700 (PDT) Date: Wed, 20 Aug 2014 00:13:08 -0700 (PDT) Message-ID: <874mx7iqgt.wl%kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto User-Agent: Wanderlust/2.14.0 Emacs/23.3 Mule/6.0 To: Mark Brown In-Reply-To: <87fvgriqrb.wl%kuninori.morimoto.gx@gmail.com> References: <87fvgriqrb.wl%kuninori.morimoto.gx@gmail.com> MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Cc: devicetree@vger.kernel.org, Linux-ALSA , Simon , Liam Girdwood Subject: [alsa-devel] [PATCH 8/8] ASoC: add snd-soc-dummy DT support X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP From: Kuninori Morimoto This patch adds snd-soc-dummy DT binding support. It removes .stream_name from dummy_dai, because "Playback" / "Capture" is very popular naming. The DAPM will lost correct route settings if other CPU/Codec was using same stream name. And it will be problem when DPCM case. Like below FE CPU (rsnd): "DAI0 Playback" Codec (dummy): "Playback" BE CPU (dummy): "Playback" Codec (ak4642): "Playback" simple-audio-card,routing = "Playback", "DAI0 Playback"; Signed-off-by: Kuninori Morimoto --- .../devicetree/bindings/sound/snd-soc-dummy | 13 +++++++++++++ sound/soc/soc-utils.c | 12 +++++++++--- 2 files changed, 22 insertions(+), 3 deletions(-) create mode 100644 Documentation/devicetree/bindings/sound/snd-soc-dummy diff --git a/Documentation/devicetree/bindings/sound/snd-soc-dummy b/Documentation/devicetree/bindings/sound/snd-soc-dummy new file mode 100644 index 0000000..ea3fe0c --- /dev/null +++ b/Documentation/devicetree/bindings/sound/snd-soc-dummy @@ -0,0 +1,13 @@ +snd-soc-dummy: + +ALSA SoC dummy codec. + +Required properties: + + - compatible : "alsa-soc-dummy" + +Example: + +sound_dummy { + compatible = "alsa-soc-dummy"; +}; diff --git a/sound/soc/soc-utils.c b/sound/soc/soc-utils.c index 7f22ca3..df11010 100644 --- a/sound/soc/soc-utils.c +++ b/sound/soc/soc-utils.c @@ -12,7 +12,8 @@ * Free Software Foundation; either version 2 of the License, or (at your * option) any later version. */ - +#include +#include #include #include #include @@ -104,14 +105,12 @@ static struct snd_soc_codec_driver dummy_codec; static struct snd_soc_dai_driver dummy_dai = { .name = "snd-soc-dummy-dai", .playback = { - .stream_name = "Playback", .channels_min = 1, .channels_max = 384, .rates = STUB_RATES, .formats = STUB_FORMATS, }, .capture = { - .stream_name = "Capture", .channels_min = 1, .channels_max = 384, .rates = STUB_RATES, @@ -151,10 +150,17 @@ static int snd_soc_dummy_remove(struct platform_device *pdev) return 0; } +static struct of_device_id soc_dummy_of_match[] = { + { .compatible = "alsa-soc-dummy" }, + {}, +}; +MODULE_DEVICE_TABLE(of, soc_dummy_of_match); + static struct platform_driver soc_dummy_driver = { .driver = { .name = "snd-soc-dummy", .owner = THIS_MODULE, + .of_match_table = soc_dummy_of_match, }, .probe = snd_soc_dummy_probe, .remove = snd_soc_dummy_remove,