aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/sh/rcar/core.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/soc/sh/rcar/core.c')
-rw-r--r--sound/soc/sh/rcar/core.c53
1 files changed, 24 insertions, 29 deletions
diff --git a/sound/soc/sh/rcar/core.c b/sound/soc/sh/rcar/core.c
index 59e250cc2e9d..022996d2db13 100644
--- a/sound/soc/sh/rcar/core.c
+++ b/sound/soc/sh/rcar/core.c
@@ -1031,25 +1031,19 @@ static const struct snd_soc_dai_ops rsnd_soc_dai_ops = {
.prepare = rsnd_soc_dai_prepare,
};
-static void rsnd_parse_connect_simple(struct rsnd_priv *priv,
- struct device_node *dai_np,
- int dai_i, int is_play)
+static void rsnd_parse_tdm_split_mode(struct rsnd_priv *priv,
+ struct rsnd_dai_stream *io,
+ struct device_node *dai_np)
{
struct device *dev = rsnd_priv_to_dev(priv);
- struct rsnd_dai *rdai = rsnd_rdai_get(priv, dai_i);
- struct rsnd_dai_stream *io = is_play ?
- &rdai->playback :
- &rdai->capture;
struct device_node *ssiu_np = rsnd_ssiu_of_node(priv);
struct device_node *np;
+ int is_play = rsnd_io_is_play(io);
int i, j;
if (!ssiu_np)
return;
- if (!rsnd_io_to_mod_ssi(io))
- return;
-
/*
* This driver assumes that it is TDM Split mode
* if it includes ssiu node
@@ -1074,12 +1068,21 @@ static void rsnd_parse_connect_simple(struct rsnd_priv *priv,
}
}
+static void rsnd_parse_connect_simple(struct rsnd_priv *priv,
+ struct rsnd_dai_stream *io,
+ struct device_node *dai_np)
+{
+ if (!rsnd_io_to_mod_ssi(io))
+ return;
+
+ rsnd_parse_tdm_split_mode(priv, io, dai_np);
+}
+
static void rsnd_parse_connect_graph(struct rsnd_priv *priv,
struct rsnd_dai_stream *io,
struct device_node *endpoint)
{
struct device *dev = rsnd_priv_to_dev(priv);
- struct device_node *remote_port = of_graph_get_remote_port(endpoint);
struct device_node *remote_node = of_graph_get_remote_port_parent(endpoint);
if (!rsnd_io_to_mod_ssi(io))
@@ -1097,14 +1100,7 @@ static void rsnd_parse_connect_graph(struct rsnd_priv *priv,
dev_dbg(dev, "%s connected to HDMI1\n", io->name);
}
- /*
- * This driver assumes that it is TDM Split mode
- * if remote node has multi endpoint
- */
- if (of_get_child_count(remote_port) > 1) {
- rsnd_flags_set(io, RSND_STREAM_TDM_SPLIT);
- dev_dbg(dev, "%s is part of TDM Split\n", io->name);
- }
+ rsnd_parse_tdm_split_mode(priv, io, endpoint);
}
void rsnd_parse_connect_common(struct rsnd_dai *rdai,
@@ -1292,8 +1288,10 @@ static int rsnd_dai_probe(struct rsnd_priv *priv)
for_each_child_of_node(dai_node, dai_np) {
__rsnd_dai_probe(priv, dai_np, dai_i);
if (rsnd_is_gen3(priv)) {
- rsnd_parse_connect_simple(priv, dai_np, dai_i, 1);
- rsnd_parse_connect_simple(priv, dai_np, dai_i, 0);
+ struct rsnd_dai *rdai = rsnd_rdai_get(priv, dai_i);
+
+ rsnd_parse_connect_simple(priv, &rdai->playback, dai_np);
+ rsnd_parse_connect_simple(priv, &rdai->capture, dai_np);
}
dai_i++;
}
@@ -1526,14 +1524,14 @@ int rsnd_kctrl_new(struct rsnd_mod *mod,
int ret;
/*
- * 1) Avoid duplicate register (ex. MIXer case)
- * 2) re-register if card was rebinded
+ * 1) Avoid duplicate register for DVC with MIX case
+ * 2) Allow duplicate register for MIX
+ * 3) re-register if card was rebinded
*/
list_for_each_entry(kctrl, &card->controls, list) {
struct rsnd_kctrl_cfg *c = kctrl->private_data;
- if (strcmp(kctrl->id.name, name) == 0 &&
- c->mod == mod)
+ if (c == cfg)
return 0;
}
@@ -1575,7 +1573,6 @@ static int rsnd_preallocate_pages(struct snd_soc_pcm_runtime *rtd,
struct rsnd_priv *priv = rsnd_io_to_priv(io);
struct device *dev = rsnd_priv_to_dev(priv);
struct snd_pcm_substream *substream;
- int err;
/*
* use Audio-DMAC dev if we can use IPMMU
@@ -1588,12 +1585,10 @@ static int rsnd_preallocate_pages(struct snd_soc_pcm_runtime *rtd,
for (substream = rtd->pcm->streams[stream].substream;
substream;
substream = substream->next) {
- err = snd_pcm_lib_preallocate_pages(substream,
+ snd_pcm_lib_preallocate_pages(substream,
SNDRV_DMA_TYPE_DEV,
dev,
PREALLOC_BUFFER, PREALLOC_BUFFER_MAX);
- if (err < 0)
- return err;
}
return 0;