From patchwork Wed Aug 24 11:20:22 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Brown X-Patchwork-Id: 104694 Delivered-To: patch@linaro.org Received: by 10.140.29.52 with SMTP id a49csp578871qga; Wed, 24 Aug 2016 17:36:53 -0700 (PDT) X-Received: by 10.194.26.166 with SMTP id m6mr4832533wjg.120.1472085413435; Wed, 24 Aug 2016 17:36:53 -0700 (PDT) Return-Path: Received: from alsa0.perex.cz (alsa0.perex.cz. [77.48.224.243]) by mx.google.com with ESMTP id k3si7007714wjn.281.2016.08.24.17.36.53; Wed, 24 Aug 2016 17:36:53 -0700 (PDT) Received-SPF: neutral (google.com: 77.48.224.243 is neither permitted nor denied by best guess record for domain of alsa-devel-bounces@alsa-project.org) client-ip=77.48.224.243; Authentication-Results: mx.google.com; spf=neutral (google.com: 77.48.224.243 is neither permitted nor denied by best guess record for domain of alsa-devel-bounces@alsa-project.org) smtp.mailfrom=alsa-devel-bounces@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id AB2C6266E0B; Thu, 25 Aug 2016 02:36:52 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.2.4 (2008-01-01) on mail1.perex.cz X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.2.4 Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id CDC6A2682F5; Wed, 24 Aug 2016 20:16:17 +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 836FA2682F6; Wed, 24 Aug 2016 20:16:17 +0200 (CEST) Received: from mezzanine.sirena.org.uk (mezzanine.sirena.org.uk [106.187.55.193]) by alsa0.perex.cz (Postfix) with ESMTP id 42AE626722B for ; Wed, 24 Aug 2016 13:20:35 +0200 (CEST) Received: from debutante.sirena.org.uk ([2a01:348:6:8808:fab::3] helo=debutante) by mezzanine.sirena.org.uk with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1bcWEL-0005Nu-G1; Wed, 24 Aug 2016 11:20:27 +0000 Received: from broonie by debutante with local (Exim 4.87) (envelope-from ) id 1bcWEI-00006I-IU; Wed, 24 Aug 2016 12:20:22 +0100 From: Mark Brown To: Kuninori Morimoto In-Reply-To: <87a8g4i8cc.wl%kuninori.morimoto.gx@renesas.com> Message-Id: Date: Wed, 24 Aug 2016 12:20:22 +0100 X-SA-Exim-Connect-IP: 2a01:348:6:8808:fab::3 X-SA-Exim-Mail-From: broonie@sirena.org.uk X-SA-Exim-Version: 4.2.1 (built Mon, 26 Dec 2011 16:24:06 +0000) X-SA-Exim-Scanned: No (on mezzanine.sirena.org.uk); Unknown failure Cc: Linux-ALSA , Mark Brown , Liam Girdwood , Simon Subject: [alsa-devel] Applied "ASoC: rsrc-card: rename rsrc-card to simple-scu-card phase2" to the asoc tree 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: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org The patch ASoC: rsrc-card: rename rsrc-card to simple-scu-card phase2 has been applied to the asoc tree at git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted. You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed. If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced. Please add any relevant lists and maintainers to the CCs when replying to this mail. Thanks, Mark >From 64df0e6842925311d74f6944710495981d5a0ace Mon Sep 17 00:00:00 2001 From: Kuninori Morimoto Date: Tue, 23 Aug 2016 01:34:43 +0000 Subject: [PATCH] ASoC: rsrc-card: rename rsrc-card to simple-scu-card phase2 rsrc-card which is using DPCM feature was created for Renesas sound. But not only Renesas, but many SoC can use this driver, because it is based on simple-card driver. To use it as more open driver, rsrc-card will be renamed to simple-scu-card. In order to easy patch review, as 2nd step, this patch adds new compatible "simple-scu-audio-card"; rcar-card used specific property, not "simple-audio-card", but it should be now. Actually, rsrc-card is upstreamed driver, but noone is using it on upstream. The user is only local, and it is only me. Thus, there is no compatible break by this patch. This patch uses "simple-audio-card" prefix. And it removes rcar-card specifix compatible too. Signed-off-by: Kuninori Morimoto Signed-off-by: Mark Brown --- .../bindings/sound/renesas,rsrc-card.txt | 52 +++++++++++--------- sound/soc/sh/rcar/rsrc-card.c | 55 +++++++++------------- 2 files changed, 51 insertions(+), 56 deletions(-) -- 2.8.1 _______________________________________________ Alsa-devel mailing list Alsa-devel@alsa-project.org http://mailman.alsa-project.org/mailman/listinfo/alsa-devel diff --git a/Documentation/devicetree/bindings/sound/renesas,rsrc-card.txt b/Documentation/devicetree/bindings/sound/renesas,rsrc-card.txt index f148bf27723b..ecb4a249fe6e 100644 --- a/Documentation/devicetree/bindings/sound/renesas,rsrc-card.txt +++ b/Documentation/devicetree/bindings/sound/renesas,rsrc-card.txt @@ -1,35 +1,36 @@ -Renesas Sampling Rate Convert Sound Card: +ASoC simple SCU Sound Card -Renesas Sampling Rate Convert Sound Card specifies audio DAI connections of SoC <-> codec. +Simple-Card specifies audio DAI connections of SoC <-> codec. Required properties: -- compatible : "renesas,rsrc-card" +- compatible : "simple-scu-audio-card" + "renesas,rsrc-card" Optional properties: -- card_name : User specified audio sound card name, one string +- simple-audio-card,name : User specified audio sound card name, one string property. -- cpu : CPU sub-node -- codec : CODEC sub-node +- simple-audio-card,cpu : CPU sub-node +- simple-audio-card,codec : CODEC sub-node Optional subnode properties: -- format : CPU/CODEC common audio format. +- simple-audio-card,format : CPU/CODEC common audio format. "i2s", "right_j", "left_j" , "dsp_a" "dsp_b", "ac97", "pdm", "msb", "lsb" -- frame-master : Indicates dai-link frame master. +- simple-audio-card,frame-master : Indicates dai-link frame master. phandle to a cpu or codec subnode. -- bitclock-master : Indicates dai-link bit clock master. +- simple-audio-card,bitclock-master : Indicates dai-link bit clock master. phandle to a cpu or codec subnode. -- bitclock-inversion : bool property. Add this if the +- simple-audio-card,bitclock-inversion : bool property. Add this if the dai-link uses bit clock inversion. -- frame-inversion : bool property. Add this if the +- simple-audio-card,frame-inversion : bool property. Add this if the dai-link uses frame clock inversion. -- convert-rate : platform specified sampling rate convert -- convert-channels : platform specified converted channel size (2 - 8 ch) -- audio-prefix : see audio-routing -- audio-routing : A list of the connections between audio components. +- simple-audio-card,convert-rate : platform specified sampling rate convert +- simple-audio-card,convert-channels : platform specified converted channel size (2 - 8 ch) +- simple-audio-card,prefix : see audio-routing +- simple-audio-card,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 for sources. use audio-prefix if some components is using same sink/sources naming. @@ -54,18 +55,25 @@ Optional CPU/CODEC subnodes properties: Example sound { - compatible = "renesas,rsrc-card,lager"; + compatible = "simple-scu-audio-card"; - card-name = "rsnd-ak4643"; - format = "left_j"; - bitclock-master = <&sndcodec>; - frame-master = <&sndcodec>; + simple-audio-card,name = "rsnd-ak4643"; + simple-audio-card,format = "left_j"; + simple-audio-card,format = "left_j"; + simple-audio-card,bitclock-master = <&sndcodec>; + simple-audio-card,frame-master = <&sndcodec>; - sndcpu: cpu { + simple-audio-card,convert-rate = <48000>; /* see audio_clk_a */ + + simple-audio-card,prefix = "ak4642"; + simple-audio-card,routing = "ak4642 Playback", "DAI0 Playback", + "DAI0 Capture", "ak4642 Capture"; + + sndcpu: simple-audio-card,cpu { sound-dai = <&rcar_sound>; }; - sndcodec: codec { + sndcodec: simple-audio-card,codec { sound-dai = <&ak4643>; system-clock-frequency = <11289600>; }; diff --git a/sound/soc/sh/rcar/rsrc-card.c b/sound/soc/sh/rcar/rsrc-card.c index a0d0f3679eeb..3fa19084e326 100644 --- a/sound/soc/sh/rcar/rsrc-card.c +++ b/sound/soc/sh/rcar/rsrc-card.c @@ -30,6 +30,7 @@ struct asoc_simple_card_of_data { static const struct of_device_id asoc_simple_card_of_match[] = { { .compatible = "renesas,rsrc-card", }, + { .compatible = "simple-scu-audio-card", }, {}, }; MODULE_DEVICE_TABLE(of, asoc_simple_card_of_match); @@ -51,6 +52,7 @@ struct asoc_simple_card_priv { #define DAI "sound-dai" #define CELL "#sound-dai-cells" +#define PREFIX "simple-audio-card," static int asoc_simple_card_startup(struct snd_pcm_substream *substream) { @@ -161,10 +163,6 @@ static int asoc_simple_card_parse_links(struct device_node *np, asoc_simple_card_canonicalize_cpu(dai_link, is_single_links); } else { - const struct asoc_simple_card_of_data *of_data; - - of_data = of_device_get_match_data(dev); - /* FE is dummy */ dai_link->cpu_of_node = NULL; dai_link->cpu_dai_name = "snd-soc-dummy-dai"; @@ -188,16 +186,10 @@ static int asoc_simple_card_parse_links(struct device_node *np, if (ret < 0) return ret; - /* additional name prefix */ - if (of_data) { - priv->codec_conf.of_node = dai_link->codec_of_node; - priv->codec_conf.name_prefix = of_data->prefix; - } else { - snd_soc_of_parse_audio_prefix(&priv->snd_card, - &priv->codec_conf, - dai_link->codec_of_node, - "audio-prefix"); - } + snd_soc_of_parse_audio_prefix(&priv->snd_card, + &priv->codec_conf, + dai_link->codec_of_node, + PREFIX "prefix"); } ret = asoc_simple_card_canonicalize_dailink(dai_link); @@ -232,9 +224,9 @@ static int asoc_simple_card_dai_link_of(struct device_node *node, for_each_child_of_node(node, np) { dai_link = simple_priv_to_link(priv, i); - if (strcmp(np->name, "codec") == 0) { + if (strcmp(np->name, PREFIX "codec") == 0) { ret = asoc_simple_card_parse_daifmt(dev, node, np, - NULL, &daifmt); + PREFIX, &daifmt); if (ret < 0) return ret; break; @@ -248,7 +240,7 @@ static int asoc_simple_card_dai_link_of(struct device_node *node, dai_link->dai_fmt = daifmt; is_fe = false; - if (strcmp(np->name, "cpu") == 0) + if (strcmp(np->name, PREFIX "cpu") == 0) is_fe = true; ret = asoc_simple_card_parse_links(np, priv, i, is_fe); @@ -264,7 +256,6 @@ static int asoc_simple_card_parse_of(struct device_node *node, struct asoc_simple_card_priv *priv, struct device *dev) { - const struct asoc_simple_card_of_data *of_data = of_device_get_match_data(dev); struct asoc_simple_dai *props; struct snd_soc_dai_link *links; int ret; @@ -290,33 +281,29 @@ static int asoc_simple_card_parse_of(struct device_node *node, priv->snd_card.codec_conf = &priv->codec_conf; priv->snd_card.num_configs = 1; - if (of_data) { - priv->snd_card.of_dapm_routes = of_data->routes; - priv->snd_card.num_of_dapm_routes = of_data->num_routes; - } else { - snd_soc_of_parse_audio_routing(&priv->snd_card, - "audio-routing"); - } + ret = snd_soc_of_parse_audio_routing(&priv->snd_card, PREFIX "routing"); + if (ret < 0) + return ret; /* sampling rate convert */ - of_property_read_u32(node, "convert-rate", &priv->convert_rate); + of_property_read_u32(node, PREFIX "convert-rate", &priv->convert_rate); /* channels transfer */ - of_property_read_u32(node, "convert-channels", &priv->convert_channels); - - dev_dbg(dev, "New rsrc-audio-card: %s\n", - priv->snd_card.name ? priv->snd_card.name : ""); - dev_dbg(dev, "SRC : convert_rate %d\n", priv->convert_rate); - dev_dbg(dev, "CTU : convert_channels %d\n", priv->convert_channels); + of_property_read_u32(node, PREFIX "convert-channels", &priv->convert_channels); ret = asoc_simple_card_dai_link_of(node, priv); if (ret < 0) return ret; - ret = asoc_simple_card_parse_card_name(&priv->snd_card, "card-"); + ret = asoc_simple_card_parse_card_name(&priv->snd_card, PREFIX); if (ret < 0) return ret; + dev_dbg(dev, "New card: %s\n", + priv->snd_card.name ? priv->snd_card.name : ""); + dev_dbg(dev, "convert_rate %d\n", priv->convert_rate); + dev_dbg(dev, "convert_channels %d\n", priv->convert_channels); + return 0; } @@ -359,7 +346,7 @@ static int asoc_simple_card_remove(struct platform_device *pdev) static struct platform_driver asoc_simple_card = { .driver = { - .name = "renesas-src-audio-card", + .name = "simple-scu-audio-card", .of_match_table = asoc_simple_card_of_match, }, .probe = asoc_simple_card_probe,