From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
To: Mark Brown <broonie@kernel.org>
Cc: Linux-ALSA <alsa-devel@alsa-project.org>,
Liam Girdwood <lgirdwood@gmail.com>, Simon <horms@verge.net.au>,
linux-renesas-soc@vger.kernel.org
Subject: [PATCH 02/39 v2] ASoC: simple-card: use common PREFIX for each DT property
Date: Tue, 31 May 2016 08:59:01 +0000 [thread overview]
Message-ID: <87d1o2sj6z.wl%kuninori.morimoto.gx@renesas.com> (raw)
In-Reply-To: <87fusysjam.wl%kuninori.morimoto.gx@renesas.com>
From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
sound/soc/generic/simple-card.c | 24 +++++++++++++-----------
1 file changed, 13 insertions(+), 11 deletions(-)
diff --git a/sound/soc/generic/simple-card.c b/sound/soc/generic/simple-card.c
index 4e39c0f..b6e6d9a 100644
--- a/sound/soc/generic/simple-card.c
+++ b/sound/soc/generic/simple-card.c
@@ -40,6 +40,8 @@ struct simple_card_data {
#define simple_priv_to_link(priv, i) ((priv)->snd_card.dai_link + i)
#define simple_priv_to_props(priv, i) ((priv)->dai_props + i)
+#define PREFIX "simple-audio-card,"
+
static int asoc_simple_card_startup(struct snd_pcm_substream *substream)
{
struct snd_soc_pcm_runtime *rtd = substream->private_data;
@@ -344,7 +346,7 @@ static int asoc_simple_card_dai_link_of(struct device_node *node,
/* For single DAI link & old style of DT node */
if (is_top_level_node)
- prefix = "simple-audio-card,";
+ prefix = PREFIX;
snprintf(prop, sizeof(prop), "%scpu", prefix);
cpu = of_get_child_by_name(node, prop);
@@ -453,26 +455,26 @@ static int asoc_simple_card_parse_of(struct device_node *node,
return -EINVAL;
/* Parse the card name from DT */
- snd_soc_of_parse_card_name(&priv->snd_card, "simple-audio-card,name");
+ snd_soc_of_parse_card_name(&priv->snd_card, PREFIX "name");
/* The off-codec widgets */
- if (of_property_read_bool(node, "simple-audio-card,widgets")) {
+ if (of_property_read_bool(node, PREFIX "widgets")) {
ret = snd_soc_of_parse_audio_simple_widgets(&priv->snd_card,
- "simple-audio-card,widgets");
+ PREFIX "widgets");
if (ret)
return ret;
}
/* DAPM routes */
- if (of_property_read_bool(node, "simple-audio-card,routing")) {
+ if (of_property_read_bool(node, PREFIX "routing")) {
ret = snd_soc_of_parse_audio_routing(&priv->snd_card,
- "simple-audio-card,routing");
+ PREFIX "routing");
if (ret)
return ret;
}
/* Factor to mclk, used in hw_params() */
- ret = of_property_read_u32(node, "simple-audio-card,mclk-fs", &val);
+ ret = of_property_read_u32(node, PREFIX "mclk-fs", &val);
if (ret == 0)
priv->mclk_fs = val;
@@ -480,7 +482,7 @@ static int asoc_simple_card_parse_of(struct device_node *node,
priv->snd_card.name : "");
/* Single/Muti DAI link(s) & New style of DT node */
- if (of_get_child_by_name(node, "simple-audio-card,dai-link")) {
+ if (of_get_child_by_name(node, PREFIX "dai-link")) {
struct device_node *np = NULL;
int i = 0;
@@ -502,13 +504,13 @@ static int asoc_simple_card_parse_of(struct device_node *node,
}
priv->gpio_hp_det = of_get_named_gpio_flags(node,
- "simple-audio-card,hp-det-gpio", 0, &flags);
+ PREFIX "hp-det-gpio", 0, &flags);
priv->gpio_hp_det_invert = !!(flags & OF_GPIO_ACTIVE_LOW);
if (priv->gpio_hp_det == -EPROBE_DEFER)
return -EPROBE_DEFER;
priv->gpio_mic_det = of_get_named_gpio_flags(node,
- "simple-audio-card,mic-det-gpio", 0, &flags);
+ PREFIX "mic-det-gpio", 0, &flags);
priv->gpio_mic_det_invert = !!(flags & OF_GPIO_ACTIVE_LOW);
if (priv->gpio_mic_det == -EPROBE_DEFER)
return -EPROBE_DEFER;
@@ -543,7 +545,7 @@ static int asoc_simple_card_probe(struct platform_device *pdev)
int num_links, ret;
/* Get the number of DAI links */
- if (np && of_get_child_by_name(np, "simple-audio-card,dai-link"))
+ if (np && of_get_child_by_name(np, PREFIX "dai-link"))
num_links = of_get_child_count(np);
else
num_links = 1;
--
1.9.1
next prev parent reply other threads:[~2016-05-31 8:59 UTC|newest]
Thread overview: 68+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-05-31 8:56 [PATCH 00/39 v2] ASoC: add simple-card-core and standardize "simple" card Kuninori Morimoto
2016-05-31 8:58 ` [PATCH 01/39 v2] ASoC: rsrc-card: remove unused dai_num Kuninori Morimoto
2016-05-31 8:59 ` Kuninori Morimoto [this message]
2016-06-13 15:47 ` Applied "ASoC: simple-card: use common PREFIX for each DT property" to the asoc tree Mark Brown
2016-05-31 8:59 ` [PATCH 03/39 v2] ASoC: simple-card: add new asoc_simple_jack and use it Kuninori Morimoto
2016-06-29 18:20 ` Applied "ASoC: simple-card: add new asoc_simple_jack and use it" to the asoc tree Mark Brown
2016-05-31 9:00 ` [PATCH 04/39 v2] ASoC: add new simple-card-utils.c Kuninori Morimoto
2016-06-29 18:20 ` Applied "ASoC: add new simple-card-utils.c" to the asoc tree Mark Brown
2016-05-31 9:00 ` [PATCH 05/39 v2] ASoC: simple-card-utils: add asoc_simple_card_parse_tdm() Kuninori Morimoto
2016-06-29 18:11 ` Mark Brown
2016-06-30 0:03 ` Kuninori Morimoto
2016-05-31 9:01 ` [PATCH 06/39 v2] ASoC: simple-card-utils: add asoc_simple_card_parse_dailink_name() Kuninori Morimoto
2016-06-29 18:14 ` Mark Brown
2016-06-30 5:32 ` Kuninori Morimoto
2016-05-31 9:01 ` [PATCH 07/39 v2] ASoC: simple-card-utils: add asoc_simple_card_parse_card_name() Kuninori Morimoto
2016-06-29 18:15 ` Mark Brown
2016-06-30 2:55 ` Kuninori Morimoto
2016-07-01 9:52 ` Mark Brown
2016-07-03 23:54 ` Kuninori Morimoto
2016-07-04 0:20 ` Kuninori Morimoto
2016-07-04 8:50 ` Mark Brown
2016-07-04 8:59 ` Kuninori Morimoto
2016-07-05 12:10 ` Mark Brown
2016-07-05 23:12 ` Kuninori Morimoto
2016-05-31 9:01 ` [PATCH 08/39 v2] ASoC: simple-card-utils: add asoc_simple_card_parse_card_prefix() Kuninori Morimoto
2016-06-29 18:17 ` Mark Brown
2016-05-31 9:02 ` [PATCH 09/39 v2] ASoC: simple-card-utils: add asoc_simple_card_parse_clk() Kuninori Morimoto
2016-06-29 18:18 ` Mark Brown
2016-06-30 0:25 ` Kuninori Morimoto
2016-06-30 0:39 ` Kuninori Morimoto
2016-07-01 9:55 ` Mark Brown
2016-07-03 23:58 ` Kuninori Morimoto
2016-05-31 9:03 ` [PATCH 10/39 v2] ASoC: simple-card-utils: add asoc_simple_card_parse_endpoint() Kuninori Morimoto
2016-06-29 18:34 ` Mark Brown
2016-05-31 9:03 ` [PATCH 11/39 v2] ASoC: simple-card-utils: add asoc_simple_card_init_dai() Kuninori Morimoto
2016-05-31 9:03 ` [PATCH 12/39 v2] ASoC: simple-card-utils: add asoc_simple_card_canonicalize_dailink() Kuninori Morimoto
2016-05-31 9:04 ` [PATCH 13/39 v2] ASoC: simple-card-utils: add asoc_simple_card_canonicalize_cpu() Kuninori Morimoto
2016-05-31 9:04 ` [PATCH 14/39 v2] ASoC: simple-card-utils: add asoc_simple_card_clean_reference() Kuninori Morimoto
2016-05-31 9:05 ` [PATCH 15/39 v2] ASoC: simple-card: use asoc_simple_card_parse_daifmt() Kuninori Morimoto
2016-05-31 9:05 ` [PATCH 16/39 v2] ASoC: simple-card: use asoc_simple_card_parse_clk() Kuninori Morimoto
2016-05-31 9:05 ` [PATCH 17/39 v2] ASoC: simple-card: use asoc_simple_card_parse_endpoint() Kuninori Morimoto
2016-05-31 9:06 ` [PATCH 18/39 v2] ASoC: simple-card: use asoc_simple_card_parse_tdm() Kuninori Morimoto
2016-05-31 9:06 ` [PATCH 19/39 v2] ASoC: simple-card: use asoc_simple_card_parse_card_name() Kuninori Morimoto
2016-07-16 12:03 ` Applied "ASoC: simple-card: use asoc_simple_card_parse_card_name()" to the asoc tree Mark Brown
2016-05-31 9:07 ` [PATCH 20/39 v2] ASoC: simple-card: use asoc_simple_card_parse_dailink_name() Kuninori Morimoto
2016-05-31 9:07 ` [PATCH 21/39 v2] ASoC: simple-card: use asoc_simple_card_init_dai() Kuninori Morimoto
2016-05-31 9:07 ` [PATCH 22/39 v2] ASoC: simple-card: use asoc_simple_card_canonicalize_dailink() Kuninori Morimoto
2016-05-31 9:08 ` [PATCH 23/39 v2] ASoC: simple-card: use asoc_simple_card_canonicalize_cpu() Kuninori Morimoto
2016-05-31 9:08 ` [PATCH 24/39 v2] ASoC: simple-card: use asoc_simple_card_clean_reference() Kuninori Morimoto
2016-05-31 9:09 ` [PATCH 25/39 v2] ASoC: rsrc-card: use asoc_simple_card_parse_daifmt() Kuninori Morimoto
2016-07-01 15:59 ` Applied "ASoC: rsrc-card: use asoc_simple_card_parse_daifmt()" to the asoc tree Mark Brown
2016-05-31 9:09 ` [PATCH 26/39 v2] ASoC: rsrc-card: use asoc_simple_card_parse_dailink_name() Kuninori Morimoto
2016-05-31 9:09 ` [PATCH 27/39 v2] ASoC: rsrc-card: use asoc_simple_dai instead of rsrc_card_dai Kuninori Morimoto
2016-05-31 9:10 ` [PATCH 28/39 v2] ASoC: rsrc-card: use asoc_simple_card_parse_clk() Kuninori Morimoto
2016-05-31 9:10 ` [PATCH 29/39 v2] ASoC: rsrc-card: use asoc_simple_card_parse_endpoint() Kuninori Morimoto
2016-05-31 9:11 ` [PATCH 30/39 v2] ASoC: rsrc-card: use asoc_simple_card_parse_card_name() Kuninori Morimoto
2016-05-31 9:11 ` [PATCH 31/39 v2] ASoC: rsrc-card: use asoc_simple_card_parse_card_prefix() Kuninori Morimoto
2016-05-31 9:11 ` [PATCH 32/39 v2] ASoC: rsrc-card: use asoc_simple_card_parse_tdm() Kuninori Morimoto
2016-05-31 9:12 ` [PATCH 33/39 v2] ASoC: rsrc-card: use asoc_simple_card_init_dai() Kuninori Morimoto
2016-05-31 9:12 ` [PATCH 34/39 v2] ASoC: rsrc-card: use asoc_simple_card_canonicalize_cpu() Kuninori Morimoto
2016-05-31 9:13 ` [PATCH 35/39 v2] ASoC: rsrc-card: use asoc_simple_card_canonicalize_dailink() Kuninori Morimoto
2016-05-31 9:13 ` [PATCH 36/39 v2] ASoC: rsrc-card: use asoc_simple_card_clean_reference() Kuninori Morimoto
2016-05-31 9:13 ` [PATCH 37/39 v2] ASoC: rsrc-card: rename rsrc-card to simple-dpcm-card phase1 Kuninori Morimoto
2016-05-31 9:14 ` [PATCH 38/39 v2] ASoC: rsrc-card: rename rsrc-card to simple-dpcm-card phase2 Kuninori Morimoto
2016-05-31 9:14 ` [PATCH 39/39 v2] ASoC: rsrc-card: rename rsrc-card to simple-dpcm-card phase3 Kuninori Morimoto
2016-06-20 1:49 ` [PATCH 00/39 v2] ASoC: add simple-card-core and standardize "simple" card Kuninori Morimoto
2016-06-29 18:16 ` Mark Brown
2016-06-30 5:34 ` Kuninori Morimoto
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87d1o2sj6z.wl%kuninori.morimoto.gx@renesas.com \
--to=kuninori.morimoto.gx@renesas.com \
--cc=alsa-devel@alsa-project.org \
--cc=broonie@kernel.org \
--cc=horms@verge.net.au \
--cc=lgirdwood@gmail.com \
--cc=linux-renesas-soc@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).