From 53ba2aa314164f7fcd3acf9594313811256a52c4 Mon Sep 17 00:00:00 2001 From: Julia Lawall Date: Sat, 15 Jul 2017 09:19:07 +0200 Subject: ASoC: rsnd: add missing of_node_put for_each_child_of_node performs an of_node_get on each iteration, so a jump out of the loop requires an of_node_put. The semantic patch that fixes this problem is as follows (http://coccinelle.lip6.fr): // @@ local idexpression n; expression e,e1; identifier l; @@ for_each_child_of_node(e1,n) { ... ( of_node_put(n); | e = n | + of_node_put(n); ? goto l; ) ... } ... l: ... when != n // Signed-off-by: Julia Lawall Signed-off-by: Mark Brown --- sound/soc/sh/rcar/ctu.c | 5 ++++- sound/soc/sh/rcar/dvc.c | 5 ++++- sound/soc/sh/rcar/mix.c | 5 ++++- sound/soc/sh/rcar/src.c | 6 +++++- sound/soc/sh/rcar/ssi.c | 6 +++++- 5 files changed, 22 insertions(+), 5 deletions(-) (limited to 'sound/soc') diff --git a/sound/soc/sh/rcar/ctu.c b/sound/soc/sh/rcar/ctu.c index 4ba8f2fe7a4c..e7f53f44165d 100644 --- a/sound/soc/sh/rcar/ctu.c +++ b/sound/soc/sh/rcar/ctu.c @@ -394,13 +394,16 @@ int rsnd_ctu_probe(struct rsnd_priv *priv) clk = devm_clk_get(dev, name); if (IS_ERR(clk)) { ret = PTR_ERR(clk); + of_node_put(np); goto rsnd_ctu_probe_done; } ret = rsnd_mod_init(priv, rsnd_mod_get(ctu), &rsnd_ctu_ops, clk, rsnd_mod_get_status, RSND_MOD_CTU, i); - if (ret) + if (ret) { + of_node_put(np); goto rsnd_ctu_probe_done; + } i++; } diff --git a/sound/soc/sh/rcar/dvc.c b/sound/soc/sh/rcar/dvc.c index 99d2d9459e75..1743ade3cc55 100644 --- a/sound/soc/sh/rcar/dvc.c +++ b/sound/soc/sh/rcar/dvc.c @@ -380,13 +380,16 @@ int rsnd_dvc_probe(struct rsnd_priv *priv) clk = devm_clk_get(dev, name); if (IS_ERR(clk)) { ret = PTR_ERR(clk); + of_node_put(np); goto rsnd_dvc_probe_done; } ret = rsnd_mod_init(priv, rsnd_mod_get(dvc), &rsnd_dvc_ops, clk, rsnd_mod_get_status, RSND_MOD_DVC, i); - if (ret) + if (ret) { + of_node_put(np); goto rsnd_dvc_probe_done; + } i++; } diff --git a/sound/soc/sh/rcar/mix.c b/sound/soc/sh/rcar/mix.c index 195fc7bb22af..6c4826c189a4 100644 --- a/sound/soc/sh/rcar/mix.c +++ b/sound/soc/sh/rcar/mix.c @@ -168,13 +168,16 @@ int rsnd_mix_probe(struct rsnd_priv *priv) clk = devm_clk_get(dev, name); if (IS_ERR(clk)) { ret = PTR_ERR(clk); + of_node_put(np); goto rsnd_mix_probe_done; } ret = rsnd_mod_init(priv, rsnd_mod_get(mix), &rsnd_mix_ops, clk, rsnd_mod_get_status, RSND_MOD_MIX, i); - if (ret) + if (ret) { + of_node_put(np); goto rsnd_mix_probe_done; + } i++; } diff --git a/sound/soc/sh/rcar/src.c b/sound/soc/sh/rcar/src.c index 7aa239e28491..8e9a1de0ec25 100644 --- a/sound/soc/sh/rcar/src.c +++ b/sound/soc/sh/rcar/src.c @@ -581,20 +581,24 @@ int rsnd_src_probe(struct rsnd_priv *priv) src->irq = irq_of_parse_and_map(np, 0); if (!src->irq) { ret = -EINVAL; + of_node_put(np); goto rsnd_src_probe_done; } clk = devm_clk_get(dev, name); if (IS_ERR(clk)) { ret = PTR_ERR(clk); + of_node_put(np); goto rsnd_src_probe_done; } ret = rsnd_mod_init(priv, rsnd_mod_get(src), &rsnd_src_ops, clk, rsnd_mod_get_status, RSND_MOD_SRC, i); - if (ret) + if (ret) { + of_node_put(np); goto rsnd_src_probe_done; + } skip: i++; diff --git a/sound/soc/sh/rcar/ssi.c b/sound/soc/sh/rcar/ssi.c index 46feddd78ee2..49cdc5e007b3 100644 --- a/sound/soc/sh/rcar/ssi.c +++ b/sound/soc/sh/rcar/ssi.c @@ -1079,6 +1079,7 @@ int rsnd_ssi_probe(struct rsnd_priv *priv) clk = devm_clk_get(dev, name); if (IS_ERR(clk)) { ret = PTR_ERR(clk); + of_node_put(np); goto rsnd_ssi_probe_done; } @@ -1091,6 +1092,7 @@ int rsnd_ssi_probe(struct rsnd_priv *priv) ssi->irq = irq_of_parse_and_map(np, 0); if (!ssi->irq) { ret = -EINVAL; + of_node_put(np); goto rsnd_ssi_probe_done; } @@ -1101,8 +1103,10 @@ int rsnd_ssi_probe(struct rsnd_priv *priv) ret = rsnd_mod_init(priv, rsnd_mod_get(ssi), ops, clk, rsnd_ssi_get_status, RSND_MOD_SSI, i); - if (ret) + if (ret) { + of_node_put(np); goto rsnd_ssi_probe_done; + } i++; } -- cgit v1.2.3 From 32e1b60d8f91be932c4a624d4153224895b65ec7 Mon Sep 17 00:00:00 2001 From: "Gustavo A. R. Silva" Date: Mon, 17 Jul 2017 10:30:20 -0500 Subject: ASoC: rsnd: remove unnecessary static in rsnd_ssiu_probe() Remove unnecessary static on local variable ops. Such variable is initialized before being used, on every execution path throughout the function. The static has no benefit and, removing it reduces the code size. This issue was detected using Coccinelle and the following semantic patch: @bad exists@ position p; identifier x; type T; @@ static T x@p; ... x = <+...x...+> @@ identifier x; expression e; type T; position p != bad.p; @@ -static T x@p; ... when != x when strict ?x = e; In the following log you can see the difference in the code size. Also, there is a significant difference in the bss segment. This log is the output of the size command, before and after the code change: before: text data bss dec hex filename 3211 680 64 3955 f73 sound/soc/sh/rcar/ssiu.o after: text data bss dec hex filename 3207 592 0 3799 ed7 sound/soc/sh/rcar/ssiu.o Signed-off-by: Gustavo A. R. Silva Signed-off-by: Mark Brown --- sound/soc/sh/rcar/ssiu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sound/soc') diff --git a/sound/soc/sh/rcar/ssiu.c b/sound/soc/sh/rcar/ssiu.c index bed2c9c0004b..4d948757d300 100644 --- a/sound/soc/sh/rcar/ssiu.c +++ b/sound/soc/sh/rcar/ssiu.c @@ -250,7 +250,7 @@ int rsnd_ssiu_probe(struct rsnd_priv *priv) { struct device *dev = rsnd_priv_to_dev(priv); struct rsnd_ssiu *ssiu; - static struct rsnd_mod_ops *ops; + struct rsnd_mod_ops *ops; int i, nr, ret; /* same number to SSI */ -- cgit v1.2.3 From 16d4498962c7b76a76553e8dd943abe1e9facc0d Mon Sep 17 00:00:00 2001 From: Kuninori Morimoto Date: Mon, 24 Jul 2017 01:45:59 +0000 Subject: ASoC: rsnd: don't use private_value on rsnd_kctrl_new() Current rsnd kctrl is using both .private_value (for rsnd_kctrl_cfg) and .private_data (for rsnd_mod) on snd_kcontrol. But only 1 private data (= rsnd_kctrl_cfg) can be enough if it has rsnd_mod pointer. This patch doesn't use private_value. Signed-off-by: Kuninori Morimoto Signed-off-by: Mark Brown --- sound/soc/sh/rcar/core.c | 14 ++++++-------- sound/soc/sh/rcar/rsnd.h | 1 + 2 files changed, 7 insertions(+), 8 deletions(-) (limited to 'sound/soc') diff --git a/sound/soc/sh/rcar/core.c b/sound/soc/sh/rcar/core.c index 3f2ced26ed37..acafb838b7b7 100644 --- a/sound/soc/sh/rcar/core.c +++ b/sound/soc/sh/rcar/core.c @@ -1169,11 +1169,10 @@ static struct snd_pcm_ops rsnd_pcm_ops = { /* * snd_kcontrol */ -#define kcontrol_to_cfg(kctrl) ((struct rsnd_kctrl_cfg *)kctrl->private_value) static int rsnd_kctrl_info(struct snd_kcontrol *kctrl, struct snd_ctl_elem_info *uinfo) { - struct rsnd_kctrl_cfg *cfg = kcontrol_to_cfg(kctrl); + struct rsnd_kctrl_cfg *cfg = snd_kcontrol_chip(kctrl); if (cfg->texts) { uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED; @@ -1199,7 +1198,7 @@ static int rsnd_kctrl_info(struct snd_kcontrol *kctrl, static int rsnd_kctrl_get(struct snd_kcontrol *kctrl, struct snd_ctl_elem_value *uc) { - struct rsnd_kctrl_cfg *cfg = kcontrol_to_cfg(kctrl); + struct rsnd_kctrl_cfg *cfg = snd_kcontrol_chip(kctrl); int i; for (i = 0; i < cfg->size; i++) @@ -1214,8 +1213,7 @@ static int rsnd_kctrl_get(struct snd_kcontrol *kctrl, static int rsnd_kctrl_put(struct snd_kcontrol *kctrl, struct snd_ctl_elem_value *uc) { - struct rsnd_mod *mod = snd_kcontrol_chip(kctrl); - struct rsnd_kctrl_cfg *cfg = kcontrol_to_cfg(kctrl); + struct rsnd_kctrl_cfg *cfg = snd_kcontrol_chip(kctrl); int i, change = 0; if (!cfg->accept(cfg->io)) @@ -1232,7 +1230,7 @@ static int rsnd_kctrl_put(struct snd_kcontrol *kctrl, } if (change && cfg->update) - cfg->update(cfg->io, mod); + cfg->update(cfg->io, cfg->mod); return change; } @@ -1284,14 +1282,13 @@ int rsnd_kctrl_new(struct rsnd_mod *mod, .index = rtd->num, .get = rsnd_kctrl_get, .put = rsnd_kctrl_put, - .private_value = (unsigned long)cfg, }; int ret; if (size > RSND_MAX_CHANNELS) return -EINVAL; - kctrl = snd_ctl_new1(&knew, mod); + kctrl = snd_ctl_new1(&knew, cfg); if (!kctrl) return -ENOMEM; @@ -1307,6 +1304,7 @@ int rsnd_kctrl_new(struct rsnd_mod *mod, cfg->card = card; cfg->kctrl = kctrl; cfg->io = io; + cfg->mod = mod; return 0; } diff --git a/sound/soc/sh/rcar/rsnd.h b/sound/soc/sh/rcar/rsnd.h index 99c57611df88..c5de71f2dc8c 100644 --- a/sound/soc/sh/rcar/rsnd.h +++ b/sound/soc/sh/rcar/rsnd.h @@ -614,6 +614,7 @@ struct rsnd_kctrl_cfg { struct rsnd_dai_stream *io; struct snd_card *card; struct snd_kcontrol *kctrl; + struct rsnd_mod *mod; }; #define RSND_MAX_CHANNELS 8 -- cgit v1.2.3 From 3c9736aa1ab59e64ebc33b140b000f90c8f9de46 Mon Sep 17 00:00:00 2001 From: Kuninori Morimoto Date: Thu, 27 Jul 2017 01:32:06 +0000 Subject: ASoC: rsnd: merge snd_pcm_ops::open and snd_soc_dai_ops::startup Current rsnd driver has snd_pcm_ops::open and snd_soc_dai_ops::startup, but, these are called from soc_pcm_open in same time. This patch merge these into rsnd_soc_dai_startup() Signed-off-by: Kuninori Morimoto Signed-off-by: Mark Brown --- sound/soc/sh/rcar/core.c | 80 +++++++++++++++++++----------------------------- 1 file changed, 31 insertions(+), 49 deletions(-) (limited to 'sound/soc') diff --git a/sound/soc/sh/rcar/core.c b/sound/soc/sh/rcar/core.c index acafb838b7b7..c34562388cfa 100644 --- a/sound/soc/sh/rcar/core.c +++ b/sound/soc/sh/rcar/core.c @@ -844,12 +844,28 @@ static int rsnd_soc_hw_rule_channels(struct snd_pcm_hw_params *params, ir, &ic); } -static void rsnd_soc_hw_constraint(struct snd_pcm_runtime *runtime, - struct snd_soc_dai *dai) +static struct snd_pcm_hardware rsnd_pcm_hardware = { + .info = SNDRV_PCM_INFO_INTERLEAVED | + SNDRV_PCM_INFO_MMAP | + SNDRV_PCM_INFO_MMAP_VALID, + .buffer_bytes_max = 64 * 1024, + .period_bytes_min = 32, + .period_bytes_max = 8192, + .periods_min = 1, + .periods_max = 32, + .fifo_size = 256, +}; + +static int rsnd_soc_dai_startup(struct snd_pcm_substream *substream, + struct snd_soc_dai *dai) { struct rsnd_dai *rdai = rsnd_dai_to_rdai(dai); + struct rsnd_priv *priv = rsnd_rdai_to_priv(rdai); + struct rsnd_dai_stream *io = rsnd_rdai_to_io(rdai, substream); struct snd_pcm_hw_constraint_list *constraint = &rdai->constraint; + struct snd_pcm_runtime *runtime = substream->runtime; unsigned int max_channels = rsnd_rdai_channels_get(rdai); + int ret; int i; /* @@ -866,34 +882,26 @@ static void rsnd_soc_hw_constraint(struct snd_pcm_runtime *runtime, constraint->count = i + 1; } + snd_soc_set_runtime_hwparams(substream, &rsnd_pcm_hardware); + snd_pcm_hw_constraint_list(runtime, 0, SNDRV_PCM_HW_PARAM_CHANNELS, constraint); + snd_pcm_hw_constraint_integer(runtime, + SNDRV_PCM_HW_PARAM_PERIODS); + /* * Sampling Rate / Channel Limitation * It depends on Clock Master Mode */ - if (!rsnd_rdai_is_clk_master(rdai)) - return; - - snd_pcm_hw_rule_add(runtime, 0, SNDRV_PCM_HW_PARAM_RATE, - rsnd_soc_hw_rule_rate, dai, - SNDRV_PCM_HW_PARAM_CHANNELS, -1); - snd_pcm_hw_rule_add(runtime, 0, SNDRV_PCM_HW_PARAM_CHANNELS, - rsnd_soc_hw_rule_channels, dai, - SNDRV_PCM_HW_PARAM_RATE, -1); -} - -static int rsnd_soc_dai_startup(struct snd_pcm_substream *substream, - struct snd_soc_dai *dai) -{ - struct rsnd_dai *rdai = rsnd_dai_to_rdai(dai); - struct rsnd_priv *priv = rsnd_rdai_to_priv(rdai); - struct rsnd_dai_stream *io = rsnd_rdai_to_io(rdai, substream); - int ret; - - /* rsnd_io_to_runtime() is not yet enabled here */ - rsnd_soc_hw_constraint(substream->runtime, dai); + if (rsnd_rdai_is_clk_master(rdai)) { + snd_pcm_hw_rule_add(runtime, 0, SNDRV_PCM_HW_PARAM_RATE, + rsnd_soc_hw_rule_rate, dai, + SNDRV_PCM_HW_PARAM_CHANNELS, -1); + snd_pcm_hw_rule_add(runtime, 0, SNDRV_PCM_HW_PARAM_CHANNELS, + rsnd_soc_hw_rule_channels, dai, + SNDRV_PCM_HW_PARAM_RATE, -1); + } /* * call rsnd_dai_call without spinlock @@ -1105,31 +1113,6 @@ static int rsnd_dai_probe(struct rsnd_priv *priv) /* * pcm ops */ -static struct snd_pcm_hardware rsnd_pcm_hardware = { - .info = SNDRV_PCM_INFO_INTERLEAVED | - SNDRV_PCM_INFO_MMAP | - SNDRV_PCM_INFO_MMAP_VALID, - .buffer_bytes_max = 64 * 1024, - .period_bytes_min = 32, - .period_bytes_max = 8192, - .periods_min = 1, - .periods_max = 32, - .fifo_size = 256, -}; - -static int rsnd_pcm_open(struct snd_pcm_substream *substream) -{ - struct snd_pcm_runtime *runtime = substream->runtime; - int ret = 0; - - snd_soc_set_runtime_hwparams(substream, &rsnd_pcm_hardware); - - ret = snd_pcm_hw_constraint_integer(runtime, - SNDRV_PCM_HW_PARAM_PERIODS); - - return ret; -} - static int rsnd_hw_params(struct snd_pcm_substream *substream, struct snd_pcm_hw_params *hw_params) { @@ -1159,7 +1142,6 @@ static snd_pcm_uframes_t rsnd_pointer(struct snd_pcm_substream *substream) } static struct snd_pcm_ops rsnd_pcm_ops = { - .open = rsnd_pcm_open, .ioctl = snd_pcm_lib_ioctl, .hw_params = rsnd_hw_params, .hw_free = snd_pcm_lib_free_pages, -- cgit v1.2.3 From bf23c6a3813aac96e0af01565aba012b25c8bae5 Mon Sep 17 00:00:00 2001 From: Kuninori Morimoto Date: Tue, 8 Aug 2017 01:32:08 +0000 Subject: ASoC: rsnd: move rsnd_ssi_config_init() execute condition into it. Make it the same style as other functions Signed-off-by: Kuninori Morimoto Signed-off-by: Mark Brown --- sound/soc/sh/rcar/ssi.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'sound/soc') diff --git a/sound/soc/sh/rcar/ssi.c b/sound/soc/sh/rcar/ssi.c index 49cdc5e007b3..3ee7b2de7dea 100644 --- a/sound/soc/sh/rcar/ssi.c +++ b/sound/soc/sh/rcar/ssi.c @@ -335,6 +335,9 @@ static void rsnd_ssi_config_init(struct rsnd_mod *mod, u32 wsr; int is_tdm; + if (rsnd_ssi_is_parent(mod, io)) + return; + is_tdm = rsnd_runtime_is_ssi_tdm(io); /* @@ -472,8 +475,7 @@ static int rsnd_ssi_init(struct rsnd_mod *mod, if (ret < 0) return ret; - if (!rsnd_ssi_is_parent(mod, io)) - rsnd_ssi_config_init(mod, io); + rsnd_ssi_config_init(mod, io); rsnd_ssi_register_setup(mod); -- cgit v1.2.3 From bb002f925ae18c0c9d72d87b74b311a5209d7178 Mon Sep 17 00:00:00 2001 From: Kuninori Morimoto Date: Tue, 8 Aug 2017 01:32:42 +0000 Subject: ASoC: rsnd: rsnd_ssi_can_output_clk() macro For example SSI0/SSI1 case, SSI1 can share pin with SSI0. And then, SSI1 needs SSI0's clock. This clock controlling is very picky and difficult to understand in current code. This patch adds new rsnd_ssi_can_output_clk() macro, the code will be more understandable. Signed-off-by: Kuninori Morimoto Signed-off-by: Mark Brown --- sound/soc/sh/rcar/ssi.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'sound/soc') diff --git a/sound/soc/sh/rcar/ssi.c b/sound/soc/sh/rcar/ssi.c index 3ee7b2de7dea..434996d4054a 100644 --- a/sound/soc/sh/rcar/ssi.c +++ b/sound/soc/sh/rcar/ssi.c @@ -106,6 +106,7 @@ struct rsnd_ssi { (rsnd_ssi_multi_slaves(io) & (1 << rsnd_mod_id(mod))) #define rsnd_ssi_is_run_mods(mod, io) \ (rsnd_ssi_run_mods(io) & (1 << rsnd_mod_id(mod))) +#define rsnd_ssi_can_output_clk(mod) (!__rsnd_ssi_is_pin_sharing(mod)) int rsnd_ssi_hdmi_port(struct rsnd_dai_stream *io) { @@ -255,7 +256,6 @@ static int rsnd_ssi_master_clk_start(struct rsnd_mod *mod, struct device *dev = rsnd_priv_to_dev(priv); struct rsnd_dai *rdai = rsnd_io_to_rdai(io); struct rsnd_ssi *ssi = rsnd_mod_to_ssi(mod); - struct rsnd_mod *ssi_parent_mod = rsnd_io_to_mod_ssip(io); int chan = rsnd_runtime_channel_for_ssi(io); int idx, ret; unsigned int main_rate; @@ -266,7 +266,7 @@ static int rsnd_ssi_master_clk_start(struct rsnd_mod *mod, if (!rsnd_rdai_is_clk_master(rdai)) return 0; - if (ssi_parent_mod && !rsnd_ssi_is_parent(mod, io)) + if (!rsnd_ssi_can_output_clk(mod)) return 0; if (rsnd_ssi_is_multi_slave(mod, io)) @@ -307,12 +307,11 @@ static void rsnd_ssi_master_clk_stop(struct rsnd_mod *mod, { struct rsnd_dai *rdai = rsnd_io_to_rdai(io); struct rsnd_ssi *ssi = rsnd_mod_to_ssi(mod); - struct rsnd_mod *ssi_parent_mod = rsnd_io_to_mod_ssip(io); if (!rsnd_rdai_is_clk_master(rdai)) return; - if (ssi_parent_mod && !rsnd_ssi_is_parent(mod, io)) + if (!rsnd_ssi_can_output_clk(mod)) return; if (ssi->usrcnt > 1) -- cgit v1.2.3 From 213691c7e873206742b39751895d15b41a02b3d1 Mon Sep 17 00:00:00 2001 From: Kuninori Morimoto Date: Thu, 10 Aug 2017 00:07:00 +0000 Subject: ASoC: rsnd: call free_irq() both DMA/PIO mode commit 701172dca15b ("ASoC: rsnd: don't use devm_request_irq() for SSI") exchanged devm_request_irq() to request_irq() for SSI, because SSI will fallback into PIO mode if DMA doesn't work. But, because of it, PIO mode needed to call free_irq() when removing, not only DMA mode. This patch call free_irq() both PIO/DMA. Otherwise, rsnd IRQ handler will be increased if user tried many unbind/bind. Fixes: 701172dca15b ("ASoC: rsnd: don't use devm_request_irq() for SSI") Signed-off-by: Kuninori Morimoto Signed-off-by: Mark Brown --- sound/soc/sh/rcar/ssi.c | 37 +++++++++++++++++++------------------ 1 file changed, 19 insertions(+), 18 deletions(-) (limited to 'sound/soc') diff --git a/sound/soc/sh/rcar/ssi.c b/sound/soc/sh/rcar/ssi.c index 0309de58bf18..281ed0da6ba1 100644 --- a/sound/soc/sh/rcar/ssi.c +++ b/sound/soc/sh/rcar/ssi.c @@ -792,6 +792,23 @@ static int rsnd_ssi_common_probe(struct rsnd_mod *mod, return ret; } +static int rsnd_ssi_common_remove(struct rsnd_mod *mod, + struct rsnd_dai_stream *io, + struct rsnd_priv *priv) +{ + struct rsnd_ssi *ssi = rsnd_mod_to_ssi(mod); + struct rsnd_mod *pure_ssi_mod = rsnd_io_to_mod_ssi(io); + + /* Do nothing if non SSI (= SSI parent, multi SSI) mod */ + if (pure_ssi_mod != mod) + return 0; + + /* PIO will request IRQ again */ + free_irq(ssi->irq, mod); + + return 0; +} + static int rsnd_ssi_pointer(struct rsnd_mod *mod, struct rsnd_dai_stream *io, snd_pcm_uframes_t *pointer) @@ -807,6 +824,7 @@ static int rsnd_ssi_pointer(struct rsnd_mod *mod, static struct rsnd_mod_ops rsnd_ssi_pio_ops = { .name = SSI_NAME, .probe = rsnd_ssi_common_probe, + .remove = rsnd_ssi_common_remove, .init = rsnd_ssi_init, .quit = rsnd_ssi_quit, .start = rsnd_ssi_start, @@ -841,23 +859,6 @@ static int rsnd_ssi_dma_probe(struct rsnd_mod *mod, return ret; } -static int rsnd_ssi_dma_remove(struct rsnd_mod *mod, - struct rsnd_dai_stream *io, - struct rsnd_priv *priv) -{ - struct rsnd_ssi *ssi = rsnd_mod_to_ssi(mod); - struct rsnd_mod *pure_ssi_mod = rsnd_io_to_mod_ssi(io); - - /* Do nothing if non SSI (= SSI parent, multi SSI) mod */ - if (pure_ssi_mod != mod) - return 0; - - /* PIO will request IRQ again */ - free_irq(ssi->irq, mod); - - return 0; -} - static int rsnd_ssi_fallback(struct rsnd_mod *mod, struct rsnd_dai_stream *io, struct rsnd_priv *priv) @@ -899,7 +900,7 @@ static struct rsnd_mod_ops rsnd_ssi_dma_ops = { .name = SSI_NAME, .dma_req = rsnd_ssi_dma_req, .probe = rsnd_ssi_dma_probe, - .remove = rsnd_ssi_dma_remove, + .remove = rsnd_ssi_common_remove, .init = rsnd_ssi_init, .quit = rsnd_ssi_quit, .start = rsnd_ssi_start, -- cgit v1.2.3 From bf9b29c784b393d1e506945f1e24e871d2587eb3 Mon Sep 17 00:00:00 2001 From: Kuninori Morimoto Date: Thu, 10 Aug 2017 00:07:20 +0000 Subject: ASoC: rsnd: add rsnd_ssi_flags_has/add() macro Current rsnd_ssi_mode_flags() is not useful. This patch adds new rsnd_ssi_flags_has/add() macro for it. Signed-off-by: Kuninori Morimoto Signed-off-by: Mark Brown --- sound/soc/sh/rcar/ssi.c | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) (limited to 'sound/soc') diff --git a/sound/soc/sh/rcar/ssi.c b/sound/soc/sh/rcar/ssi.c index 281ed0da6ba1..ca9355b86bd9 100644 --- a/sound/soc/sh/rcar/ssi.c +++ b/sound/soc/sh/rcar/ssi.c @@ -101,7 +101,8 @@ struct rsnd_ssi { #define rsnd_ssi_to_dma(mod) ((ssi)->dma) #define rsnd_ssi_nr(priv) ((priv)->ssi_nr) #define rsnd_mod_to_ssi(_mod) container_of((_mod), struct rsnd_ssi, mod) -#define rsnd_ssi_mode_flags(p) ((p)->flags) +#define rsnd_ssi_flags_has(p, f) ((p)->flags & f) +#define rsnd_ssi_flags_set(p, f) ((p)->flags |= f) #define rsnd_ssi_is_parent(ssi, io) ((ssi) == rsnd_io_to_mod_ssip(io)) #define rsnd_ssi_is_multi_slave(mod, io) \ (rsnd_ssi_multi_slaves(io) & (1 << rsnd_mod_id(mod))) @@ -114,10 +115,10 @@ int rsnd_ssi_hdmi_port(struct rsnd_dai_stream *io) struct rsnd_mod *mod = rsnd_io_to_mod_ssi(io); struct rsnd_ssi *ssi = rsnd_mod_to_ssi(mod); - if (rsnd_ssi_mode_flags(ssi) & RSND_SSI_HDMI0) + if (rsnd_ssi_flags_has(ssi, RSND_SSI_HDMI0)) return RSND_SSI_HDMI_PORT0; - if (rsnd_ssi_mode_flags(ssi) & RSND_SSI_HDMI1) + if (rsnd_ssi_flags_has(ssi, RSND_SSI_HDMI1)) return RSND_SSI_HDMI_PORT1; return 0; @@ -132,7 +133,7 @@ int rsnd_ssi_use_busif(struct rsnd_dai_stream *io) if (!rsnd_ssi_is_dma_mode(mod)) return 0; - if (!(rsnd_ssi_mode_flags(ssi) & RSND_SSI_NO_BUSIF)) + if (!(rsnd_ssi_flags_has(ssi, RSND_SSI_NO_BUSIF))) use_busif = 1; if (rsnd_io_to_mod_src(io)) use_busif = 1; @@ -986,13 +987,13 @@ static void __rsnd_ssi_parse_hdmi_connection(struct rsnd_priv *priv, ssi = rsnd_mod_to_ssi(mod); if (strstr(remote_ep->full_name, "hdmi0")) { - ssi->flags |= RSND_SSI_HDMI0; + rsnd_ssi_flags_set(ssi, RSND_SSI_HDMI0); dev_dbg(dev, "%s[%d] connected to HDMI0\n", rsnd_mod_name(mod), rsnd_mod_id(mod)); } if (strstr(remote_ep->full_name, "hdmi1")) { - ssi->flags |= RSND_SSI_HDMI1; + rsnd_ssi_flags_set(ssi, RSND_SSI_HDMI1); dev_dbg(dev, "%s[%d] connected to HDMI1\n", rsnd_mod_name(mod), rsnd_mod_id(mod)); } @@ -1025,7 +1026,7 @@ int __rsnd_ssi_is_pin_sharing(struct rsnd_mod *mod) { struct rsnd_ssi *ssi = rsnd_mod_to_ssi(mod); - return !!(rsnd_ssi_mode_flags(ssi) & RSND_SSI_CLK_PIN_SHARE); + return !!(rsnd_ssi_flags_has(ssi, RSND_SSI_CLK_PIN_SHARE)); } static u32 *rsnd_ssi_get_status(struct rsnd_dai_stream *io, @@ -1108,10 +1109,10 @@ int rsnd_ssi_probe(struct rsnd_priv *priv) } if (of_get_property(np, "shared-pin", NULL)) - ssi->flags |= RSND_SSI_CLK_PIN_SHARE; + rsnd_ssi_flags_set(ssi, RSND_SSI_CLK_PIN_SHARE); if (of_get_property(np, "no-busif", NULL)) - ssi->flags |= RSND_SSI_NO_BUSIF; + rsnd_ssi_flags_set(ssi, RSND_SSI_NO_BUSIF); ssi->irq = irq_of_parse_and_map(np, 0); if (!ssi->irq) { -- cgit v1.2.3 From b6e58fcacb3edc6245ecf700207ba675cba18018 Mon Sep 17 00:00:00 2001 From: Kuninori Morimoto Date: Thu, 10 Aug 2017 00:07:38 +0000 Subject: ASoC: rsnd: call request_irq/free_irq once in MIX case Each module's dai callback function availability is controlled by mod->status. For example "always called", "call once". In .probe/.remove case, it needs to be called always, because .probe will call xxx_attach() function on .probe, especially if platform is using MIXer. For example, below case, MIX0/DVC0/SSI0 needs to be called twice. playback = <&src0 &ctu02 &mix0 &dvc0 &ssi0>; playback = <&src2 &ctu03 &mix0 &dvc0 &ssi0>; But in this case, SSI0 will call request_irq() twice. This patch add new RSND_SSI_PROBED flag and control it Signed-off-by: Kuninori Morimoto Signed-off-by: Mark Brown --- sound/soc/sh/rcar/ssi.c | 27 ++++++++++++++++++++++----- 1 file changed, 22 insertions(+), 5 deletions(-) (limited to 'sound/soc') diff --git a/sound/soc/sh/rcar/ssi.c b/sound/soc/sh/rcar/ssi.c index ca9355b86bd9..8bb47144660b 100644 --- a/sound/soc/sh/rcar/ssi.c +++ b/sound/soc/sh/rcar/ssi.c @@ -90,6 +90,7 @@ struct rsnd_ssi { #define RSND_SSI_NO_BUSIF (1 << 1) /* SSI+DMA without BUSIF */ #define RSND_SSI_HDMI0 (1 << 2) /* for HDMI0 */ #define RSND_SSI_HDMI1 (1 << 3) /* for HDMI1 */ +#define RSND_SSI_PROBED (1 << 4) #define for_each_rsnd_ssi(pos, priv, i) \ for (i = 0; \ @@ -103,6 +104,7 @@ struct rsnd_ssi { #define rsnd_mod_to_ssi(_mod) container_of((_mod), struct rsnd_ssi, mod) #define rsnd_ssi_flags_has(p, f) ((p)->flags & f) #define rsnd_ssi_flags_set(p, f) ((p)->flags |= f) +#define rsnd_ssi_flags_del(p, f) ((p)->flags = ((p)->flags & ~f)) #define rsnd_ssi_is_parent(ssi, io) ((ssi) == rsnd_io_to_mod_ssip(io)) #define rsnd_ssi_is_multi_slave(mod, io) \ (rsnd_ssi_multi_slaves(io) & (1 << rsnd_mod_id(mod))) @@ -784,11 +786,22 @@ static int rsnd_ssi_common_probe(struct rsnd_mod *mod, /* * SSI might be called again as PIO fallback * It is easy to manual handling for IRQ request/free + * + * OTOH, this function might be called many times if platform is + * using MIX. It needs xxx_attach() many times on xxx_probe(). + * Because of it, we can't control .probe/.remove calling count by + * mod->status. + * But it don't need to call request_irq() many times. + * Let's control it by RSND_SSI_PROBED flag. */ - ret = request_irq(ssi->irq, - rsnd_ssi_interrupt, - IRQF_SHARED, - dev_name(dev), mod); + if (!rsnd_ssi_flags_has(ssi, RSND_SSI_PROBED)) { + ret = request_irq(ssi->irq, + rsnd_ssi_interrupt, + IRQF_SHARED, + dev_name(dev), mod); + + rsnd_ssi_flags_set(ssi, RSND_SSI_PROBED); + } return ret; } @@ -805,7 +818,11 @@ static int rsnd_ssi_common_remove(struct rsnd_mod *mod, return 0; /* PIO will request IRQ again */ - free_irq(ssi->irq, mod); + if (rsnd_ssi_flags_has(ssi, RSND_SSI_PROBED)) { + free_irq(ssi->irq, mod); + + rsnd_ssi_flags_del(ssi, RSND_SSI_PROBED); + } return 0; } -- cgit v1.2.3 From 0d7820d0918efa6c2a53acdfc47cbfc3b48df727 Mon Sep 17 00:00:00 2001 From: Markus Elfring Date: Thu, 10 Aug 2017 17:13:19 +0200 Subject: ASoC: rsnd: Delete an error message for a failed memory allocation in three functions Omit an extra message for a memory allocation failure in these functions. This issue was detected by using the Coccinelle software. Link: http://events.linuxfoundation.org/sites/events/files/slides/LCJ16-Refactor_Strings-WSang_0.pdf Signed-off-by: Markus Elfring Signed-off-by: Mark Brown --- sound/soc/sh/rcar/adg.c | 4 +--- sound/soc/sh/rcar/core.c | 4 +--- sound/soc/sh/rcar/gen.c | 4 +--- 3 files changed, 3 insertions(+), 9 deletions(-) (limited to 'sound/soc') diff --git a/sound/soc/sh/rcar/adg.c b/sound/soc/sh/rcar/adg.c index 5b5389e5b92b..938baff86ef2 100644 --- a/sound/soc/sh/rcar/adg.c +++ b/sound/soc/sh/rcar/adg.c @@ -586,10 +586,8 @@ int rsnd_adg_probe(struct rsnd_priv *priv) int ret; adg = devm_kzalloc(dev, sizeof(*adg), GFP_KERNEL); - if (!adg) { - dev_err(dev, "ADG allocate failed\n"); + if (!adg) return -ENOMEM; - } ret = rsnd_mod_init(priv, &adg->mod, &adg_ops, NULL, NULL, 0, 0); diff --git a/sound/soc/sh/rcar/core.c b/sound/soc/sh/rcar/core.c index 2c12ad2b2b34..650cc28b0fb6 100644 --- a/sound/soc/sh/rcar/core.c +++ b/sound/soc/sh/rcar/core.c @@ -1401,10 +1401,8 @@ static int rsnd_probe(struct platform_device *pdev) * init priv data */ priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL); - if (!priv) { - dev_err(dev, "priv allocate failed\n"); + if (!priv) return -ENODEV; - } priv->pdev = pdev; priv->flags = (unsigned long)of_device_get_match_data(dev); diff --git a/sound/soc/sh/rcar/gen.c b/sound/soc/sh/rcar/gen.c index ee00e3516911..f04c4100043a 100644 --- a/sound/soc/sh/rcar/gen.c +++ b/sound/soc/sh/rcar/gen.c @@ -406,10 +406,8 @@ int rsnd_gen_probe(struct rsnd_priv *priv) int ret; gen = devm_kzalloc(dev, sizeof(*gen), GFP_KERNEL); - if (!gen) { - dev_err(dev, "GEN allocate failed\n"); + if (!gen) return -ENOMEM; - } priv->gen = gen; -- cgit v1.2.3 From 517725545179be8d32730844f1619ee31ef04bf3 Mon Sep 17 00:00:00 2001 From: Bhumika Goyal Date: Mon, 14 Aug 2017 17:08:48 +0530 Subject: ASoC: sh: make snd_soc_platform_driver const Make these const as they are either passed as the 2nd argument to the function devm_snd_soc_register_platform or snd_soc_register_platform, and the arguments are of type const. Done using Coccinelle. Signed-off-by: Bhumika Goyal Signed-off-by: Mark Brown --- sound/soc/sh/dma-sh7760.c | 2 +- sound/soc/sh/fsi.c | 2 +- sound/soc/sh/rcar/core.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'sound/soc') diff --git a/sound/soc/sh/dma-sh7760.c b/sound/soc/sh/dma-sh7760.c index 8fad4441c87d..81c743322445 100644 --- a/sound/soc/sh/dma-sh7760.c +++ b/sound/soc/sh/dma-sh7760.c @@ -320,7 +320,7 @@ static int camelot_pcm_new(struct snd_soc_pcm_runtime *rtd) return 0; } -static struct snd_soc_platform_driver sh7760_soc_platform = { +static const struct snd_soc_platform_driver sh7760_soc_platform = { .ops = &camelot_pcm_ops, .pcm_new = camelot_pcm_new, }; diff --git a/sound/soc/sh/fsi.c b/sound/soc/sh/fsi.c index 7c4bdd82bb95..90021b8a799a 100644 --- a/sound/soc/sh/fsi.c +++ b/sound/soc/sh/fsi.c @@ -1818,7 +1818,7 @@ static struct snd_soc_dai_driver fsi_soc_dai[] = { }, }; -static struct snd_soc_platform_driver fsi_soc_platform = { +static const struct snd_soc_platform_driver fsi_soc_platform = { .ops = &fsi_pcm_ops, .pcm_new = fsi_pcm_new, }; diff --git a/sound/soc/sh/rcar/core.c b/sound/soc/sh/rcar/core.c index 3f2ced26ed37..e50f7e7981c8 100644 --- a/sound/soc/sh/rcar/core.c +++ b/sound/soc/sh/rcar/core.c @@ -1339,7 +1339,7 @@ static int rsnd_pcm_new(struct snd_soc_pcm_runtime *rtd) PREALLOC_BUFFER, PREALLOC_BUFFER_MAX); } -static struct snd_soc_platform_driver rsnd_soc_platform = { +static const struct snd_soc_platform_driver rsnd_soc_platform = { .ops = &rsnd_pcm_ops, .pcm_new = rsnd_pcm_new, }; -- cgit v1.2.3 From b23bd34c402d08a2c1d6facdba4a75e016601c12 Mon Sep 17 00:00:00 2001 From: Arvind Yadav Date: Mon, 14 Aug 2017 11:26:32 +0530 Subject: ASoC: sh: constify snd_pcm_ops structures snd_pcm_ops are not supposed to change at runtime. All functions working with snd_pcm_ops provided by work with const snd_pcm_ops. So mark the non-const structs as const. Signed-off-by: Arvind Yadav Signed-off-by: Mark Brown --- sound/soc/sh/dma-sh7760.c | 2 +- sound/soc/sh/fsi.c | 2 +- sound/soc/sh/rcar/core.c | 2 +- sound/soc/sh/siu_pcm.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) (limited to 'sound/soc') diff --git a/sound/soc/sh/dma-sh7760.c b/sound/soc/sh/dma-sh7760.c index 81c743322445..35788a6db963 100644 --- a/sound/soc/sh/dma-sh7760.c +++ b/sound/soc/sh/dma-sh7760.c @@ -294,7 +294,7 @@ static snd_pcm_uframes_t camelot_pos(struct snd_pcm_substream *substream) return bytes_to_frames(runtime, pos); } -static struct snd_pcm_ops camelot_pcm_ops = { +static const struct snd_pcm_ops camelot_pcm_ops = { .open = camelot_pcm_open, .close = camelot_pcm_close, .ioctl = snd_pcm_lib_ioctl, diff --git a/sound/soc/sh/fsi.c b/sound/soc/sh/fsi.c index 90021b8a799a..5d7d9fe8bc98 100644 --- a/sound/soc/sh/fsi.c +++ b/sound/soc/sh/fsi.c @@ -1755,7 +1755,7 @@ static snd_pcm_uframes_t fsi_pointer(struct snd_pcm_substream *substream) return fsi_sample2frame(fsi, io->buff_sample_pos); } -static struct snd_pcm_ops fsi_pcm_ops = { +static const struct snd_pcm_ops fsi_pcm_ops = { .open = fsi_pcm_open, .ioctl = snd_pcm_lib_ioctl, .hw_params = fsi_hw_params, diff --git a/sound/soc/sh/rcar/core.c b/sound/soc/sh/rcar/core.c index e50f7e7981c8..08f3a06978e1 100644 --- a/sound/soc/sh/rcar/core.c +++ b/sound/soc/sh/rcar/core.c @@ -1158,7 +1158,7 @@ static snd_pcm_uframes_t rsnd_pointer(struct snd_pcm_substream *substream) return pointer; } -static struct snd_pcm_ops rsnd_pcm_ops = { +static const struct snd_pcm_ops rsnd_pcm_ops = { .open = rsnd_pcm_open, .ioctl = snd_pcm_lib_ioctl, .hw_params = rsnd_hw_params, diff --git a/sound/soc/sh/siu_pcm.c b/sound/soc/sh/siu_pcm.c index 82902f56e82f..3118cb0ee3f2 100644 --- a/sound/soc/sh/siu_pcm.c +++ b/sound/soc/sh/siu_pcm.c @@ -593,7 +593,7 @@ static void siu_pcm_free(struct snd_pcm *pcm) dev_dbg(pcm->card->dev, "%s\n", __func__); } -static struct snd_pcm_ops siu_pcm_ops = { +static const struct snd_pcm_ops siu_pcm_ops = { .open = siu_pcm_open, .close = siu_pcm_close, .ioctl = snd_pcm_lib_ioctl, -- cgit v1.2.3 From 5c2e035e69ffff4c8b3f0a2ddfefa102ad9d9d42 Mon Sep 17 00:00:00 2001 From: Bhumika Goyal Date: Thu, 17 Aug 2017 15:46:11 +0530 Subject: ASoC: sh: make snd_pcm_hardware const Make these const as they are only passed as the 2nd argument to the function snd_soc_set_runtime_hwparams, which is const. Done using Coccinelle. Signed-off-by: Bhumika Goyal Signed-off-by: Mark Brown --- sound/soc/sh/dma-sh7760.c | 2 +- sound/soc/sh/fsi.c | 2 +- sound/soc/sh/rcar/core.c | 2 +- sound/soc/sh/siu_dai.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) (limited to 'sound/soc') diff --git a/sound/soc/sh/dma-sh7760.c b/sound/soc/sh/dma-sh7760.c index 35788a6db963..1e7d417b53ef 100644 --- a/sound/soc/sh/dma-sh7760.c +++ b/sound/soc/sh/dma-sh7760.c @@ -89,7 +89,7 @@ struct camelot_pcm { #define DMABRG_PREALLOC_BUFFER 32 * 1024 #define DMABRG_PREALLOC_BUFFER_MAX 32 * 1024 -static struct snd_pcm_hardware camelot_pcm_hardware = { +static const struct snd_pcm_hardware camelot_pcm_hardware = { .info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED | SNDRV_PCM_INFO_BLOCK_TRANSFER | diff --git a/sound/soc/sh/fsi.c b/sound/soc/sh/fsi.c index 5d7d9fe8bc98..39ec772912d5 100644 --- a/sound/soc/sh/fsi.c +++ b/sound/soc/sh/fsi.c @@ -1710,7 +1710,7 @@ static const struct snd_soc_dai_ops fsi_dai_ops = { * pcm ops */ -static struct snd_pcm_hardware fsi_pcm_hardware = { +static const struct snd_pcm_hardware fsi_pcm_hardware = { .info = SNDRV_PCM_INFO_INTERLEAVED | SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_MMAP_VALID, diff --git a/sound/soc/sh/rcar/core.c b/sound/soc/sh/rcar/core.c index df39831b8e8f..107133297e8d 100644 --- a/sound/soc/sh/rcar/core.c +++ b/sound/soc/sh/rcar/core.c @@ -843,7 +843,7 @@ static int rsnd_soc_hw_rule_channels(struct snd_pcm_hw_params *params, ir, &ic); } -static struct snd_pcm_hardware rsnd_pcm_hardware = { +static const struct snd_pcm_hardware rsnd_pcm_hardware = { .info = SNDRV_PCM_INFO_INTERLEAVED | SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_MMAP_VALID, diff --git a/sound/soc/sh/siu_dai.c b/sound/soc/sh/siu_dai.c index 4a22aadac294..160502947da2 100644 --- a/sound/soc/sh/siu_dai.c +++ b/sound/soc/sh/siu_dai.c @@ -333,7 +333,7 @@ static void siu_dai_spbstop(struct siu_port *port_info) /* API functions */ /* Playback and capture hardware properties are identical */ -static struct snd_pcm_hardware siu_dai_pcm_hw = { +static const struct snd_pcm_hardware siu_dai_pcm_hw = { .info = SNDRV_PCM_INFO_INTERLEAVED, .formats = SNDRV_PCM_FMTBIT_S16, .rates = SNDRV_PCM_RATE_8000_48000, -- cgit v1.2.3 From a46d0592d164c017342d2d86e5d123735ec046ae Mon Sep 17 00:00:00 2001 From: Bhumika Goyal Date: Wed, 16 Aug 2017 22:29:30 +0530 Subject: ASoC: sh: make snd_soc_ops const Make this const as it is only stored in the ops field of a snd_soc_dai_link structure, which is const. Done using Coccinelle. Signed-off-by: Bhumika Goyal Signed-off-by: Mark Brown --- sound/soc/sh/migor.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sound/soc') diff --git a/sound/soc/sh/migor.c b/sound/soc/sh/migor.c index 672bcd4c252b..ecb057ff9fbb 100644 --- a/sound/soc/sh/migor.c +++ b/sound/soc/sh/migor.c @@ -98,7 +98,7 @@ static int migor_hw_free(struct snd_pcm_substream *substream) return 0; } -static struct snd_soc_ops migor_dai_ops = { +static const struct snd_soc_ops migor_dai_ops = { .hw_params = migor_hw_params, .hw_free = migor_hw_free, }; -- cgit v1.2.3 From b65cb7a590274bf5dbf5bbccbbd0c495c27ab14d Mon Sep 17 00:00:00 2001 From: Kuninori Morimoto Date: Mon, 21 Aug 2017 07:03:01 +0000 Subject: ASoC: rsnd: tidyup comments position/space/tab Signed-off-by: Kuninori Morimoto Signed-off-by: Mark Brown --- sound/soc/sh/rcar/dma.c | 2 +- sound/soc/sh/rcar/src.c | 7 +++---- 2 files changed, 4 insertions(+), 5 deletions(-) (limited to 'sound/soc') diff --git a/sound/soc/sh/rcar/dma.c b/sound/soc/sh/rcar/dma.c index 60aa5e96a49f..041ec1080d52 100644 --- a/sound/soc/sh/rcar/dma.c +++ b/sound/soc/sh/rcar/dma.c @@ -604,8 +604,8 @@ rsnd_gen2_dma_addr(struct rsnd_dai_stream *io, dma_addr_t in_addr; } dma_addrs[3][2][3] = { /* SRC */ + /* Capture */ {{{ 0, 0 }, - /* Capture */ { RDMA_SRC_O_N(src, id), RDMA_SRC_I_P(src, id) }, { RDMA_CMD_O_N(src, id), RDMA_SRC_I_P(src, id) } }, /* Playback */ diff --git a/sound/soc/sh/rcar/src.c b/sound/soc/sh/rcar/src.c index 8e9a1de0ec25..46400397dbbd 100644 --- a/sound/soc/sh/rcar/src.c +++ b/sound/soc/sh/rcar/src.c @@ -108,7 +108,6 @@ unsigned int rsnd_src_get_rate(struct rsnd_priv *priv, int is_play = rsnd_io_is_play(io); /* - * * Playback * runtime_rate -> [SRC] -> convert_rate * @@ -203,13 +202,13 @@ static void rsnd_src_set_convert_rate(struct rsnd_dai_stream *io, use_src = (fin != fout) | rsnd_src_sync_is_enabled(mod); /* - * SRC_ADINR + * SRC_ADINR */ adinr = rsnd_get_adinr_bit(mod, io) | rsnd_runtime_channel_original(io); /* - * SRC_IFSCR / SRC_IFSVR + * SRC_IFSCR / SRC_IFSVR */ ifscr = 0; fsrate = 0; @@ -223,7 +222,7 @@ static void rsnd_src_set_convert_rate(struct rsnd_dai_stream *io, } /* - * SRC_SRCCR / SRC_ROUTE_MODE0 + * SRC_SRCCR / SRC_ROUTE_MODE0 */ cr = 0x00011110; route = 0x0; -- cgit v1.2.3 From c16293560a1c188a05cba1dcc46548d33b641c06 Mon Sep 17 00:00:00 2001 From: Kuninori Morimoto Date: Tue, 22 Aug 2017 00:02:03 +0000 Subject: ASoC: rsnd: remove unused rsnd_xxx_to_dma() Signed-off-by: Kuninori Morimoto Signed-off-by: Mark Brown --- sound/soc/sh/rcar/src.c | 1 - sound/soc/sh/rcar/ssi.c | 1 - 2 files changed, 2 deletions(-) (limited to 'sound/soc') diff --git a/sound/soc/sh/rcar/src.c b/sound/soc/sh/rcar/src.c index 46400397dbbd..510b68a483b4 100644 --- a/sound/soc/sh/rcar/src.c +++ b/sound/soc/sh/rcar/src.c @@ -27,7 +27,6 @@ struct rsnd_src { #define RSND_SRC_NAME_SIZE 16 #define rsnd_src_get(priv, id) ((struct rsnd_src *)(priv->src) + id) -#define rsnd_src_to_dma(src) ((src)->dma) #define rsnd_src_nr(priv) ((priv)->src_nr) #define rsnd_src_sync_is_enabled(mod) (rsnd_mod_to_src(mod)->sen.val) diff --git a/sound/soc/sh/rcar/ssi.c b/sound/soc/sh/rcar/ssi.c index 8bb47144660b..fffc07e72627 100644 --- a/sound/soc/sh/rcar/ssi.c +++ b/sound/soc/sh/rcar/ssi.c @@ -99,7 +99,6 @@ struct rsnd_ssi { i++) #define rsnd_ssi_get(priv, id) ((struct rsnd_ssi *)(priv->ssi) + id) -#define rsnd_ssi_to_dma(mod) ((ssi)->dma) #define rsnd_ssi_nr(priv) ((priv)->ssi_nr) #define rsnd_mod_to_ssi(_mod) container_of((_mod), struct rsnd_ssi, mod) #define rsnd_ssi_flags_has(p, f) ((p)->flags & f) -- cgit v1.2.3