aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>2014-05-23 02:25:43 -0400
committerMark Brown <broonie@linaro.org>2014-05-26 09:34:55 -0400
commit8aefda5046f417c551e3acdeb2cf37949a4b75e9 (patch)
treedf2f55e902e7cd76d85c17b89d0e151bb2907e66
parent033e7ed85b8513db4efacbdf0f22db2bed4ff405 (diff)
ASoC: rsnd: module name is unified
Renesas sound driver uses many modules (= SSI/SRC/DVC), and each module had own name. But, each module name can be used as several purpose, like clock name, DMA name etc... This patch uses common name for each module. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@linaro.org>
-rw-r--r--sound/soc/sh/rcar/dvc.c20
-rw-r--r--sound/soc/sh/rcar/src.c23
-rw-r--r--sound/soc/sh/rcar/ssi.c15
3 files changed, 49 insertions, 9 deletions
diff --git a/sound/soc/sh/rcar/dvc.c b/sound/soc/sh/rcar/dvc.c
index 74769b1be005..ed0007006899 100644
--- a/sound/soc/sh/rcar/dvc.c
+++ b/sound/soc/sh/rcar/dvc.c
@@ -13,6 +13,9 @@
13#define RSND_DVC_NAME_SIZE 16 13#define RSND_DVC_NAME_SIZE 16
14#define RSND_DVC_VOLUME_MAX 100 14#define RSND_DVC_VOLUME_MAX 100
15#define RSND_DVC_VOLUME_NUM 2 15#define RSND_DVC_VOLUME_NUM 2
16
17#define DVC_NAME "dvc"
18
16struct rsnd_dvc { 19struct rsnd_dvc {
17 struct rsnd_dvc_platform_info *info; /* rcar_snd.h */ 20 struct rsnd_dvc_platform_info *info; /* rcar_snd.h */
18 struct rsnd_mod mod; 21 struct rsnd_mod mod;
@@ -43,6 +46,17 @@ static void rsnd_dvc_volume_update(struct rsnd_mod *mod)
43 rsnd_mod_write(mod, DVC_VOL1R, vol[1]); 46 rsnd_mod_write(mod, DVC_VOL1R, vol[1]);
44} 47}
45 48
49static int rsnd_dvc_probe_gen2(struct rsnd_mod *mod,
50 struct rsnd_dai *rdai)
51{
52 struct rsnd_priv *priv = rsnd_mod_to_priv(mod);
53 struct device *dev = rsnd_priv_to_dev(priv);
54
55 dev_dbg(dev, "%s (Gen2) is probed\n", rsnd_mod_name(mod));
56
57 return 0;
58}
59
46static int rsnd_dvc_init(struct rsnd_mod *dvc_mod, 60static int rsnd_dvc_init(struct rsnd_mod *dvc_mod,
47 struct rsnd_dai *rdai) 61 struct rsnd_dai *rdai)
48{ 62{
@@ -208,7 +222,8 @@ static int rsnd_dvc_pcm_new(struct rsnd_mod *mod,
208} 222}
209 223
210static struct rsnd_mod_ops rsnd_dvc_ops = { 224static struct rsnd_mod_ops rsnd_dvc_ops = {
211 .name = "dvc (gen2)", 225 .name = DVC_NAME,
226 .probe = rsnd_dvc_probe_gen2,
212 .init = rsnd_dvc_init, 227 .init = rsnd_dvc_init,
213 .quit = rsnd_dvc_quit, 228 .quit = rsnd_dvc_quit,
214 .start = rsnd_dvc_start, 229 .start = rsnd_dvc_start,
@@ -255,7 +270,8 @@ int rsnd_dvc_probe(struct platform_device *pdev,
255 priv->dvc = dvc; 270 priv->dvc = dvc;
256 271
257 for_each_rsnd_dvc(dvc, priv, i) { 272 for_each_rsnd_dvc(dvc, priv, i) {
258 snprintf(name, RSND_DVC_NAME_SIZE, "dvc.%d", i); 273 snprintf(name, RSND_DVC_NAME_SIZE, "%s.%d",
274 DVC_NAME, i);
259 275
260 clk = devm_clk_get(dev, name); 276 clk = devm_clk_get(dev, name);
261 if (IS_ERR(clk)) 277 if (IS_ERR(clk))
diff --git a/sound/soc/sh/rcar/src.c b/sound/soc/sh/rcar/src.c
index c5ddbccd7530..4b5671b0d1e6 100644
--- a/sound/soc/sh/rcar/src.c
+++ b/sound/soc/sh/rcar/src.c
@@ -10,6 +10,8 @@
10 */ 10 */
11#include "rsnd.h" 11#include "rsnd.h"
12 12
13#define SRC_NAME "src"
14
13struct rsnd_src { 15struct rsnd_src {
14 struct rsnd_src_platform_info *info; /* rcar_snd.h */ 16 struct rsnd_src_platform_info *info; /* rcar_snd.h */
15 struct rsnd_mod mod; 17 struct rsnd_mod mod;
@@ -389,6 +391,17 @@ static int rsnd_src_set_convert_rate_gen1(struct rsnd_mod *mod,
389 return 0; 391 return 0;
390} 392}
391 393
394static int rsnd_src_probe_gen1(struct rsnd_mod *mod,
395 struct rsnd_dai *rdai)
396{
397 struct rsnd_priv *priv = rsnd_mod_to_priv(mod);
398 struct device *dev = rsnd_priv_to_dev(priv);
399
400 dev_dbg(dev, "%s (Gen1) is probed\n", rsnd_mod_name(mod));
401
402 return 0;
403}
404
392static int rsnd_src_init_gen1(struct rsnd_mod *mod, 405static int rsnd_src_init_gen1(struct rsnd_mod *mod,
393 struct rsnd_dai *rdai) 406 struct rsnd_dai *rdai)
394{ 407{
@@ -434,7 +447,8 @@ static int rsnd_src_stop_gen1(struct rsnd_mod *mod,
434} 447}
435 448
436static struct rsnd_mod_ops rsnd_src_gen1_ops = { 449static struct rsnd_mod_ops rsnd_src_gen1_ops = {
437 .name = "sru (gen1)", 450 .name = SRC_NAME,
451 .probe = rsnd_src_probe_gen1,
438 .init = rsnd_src_init_gen1, 452 .init = rsnd_src_init_gen1,
439 .quit = rsnd_src_quit, 453 .quit = rsnd_src_quit,
440 .start = rsnd_src_start_gen1, 454 .start = rsnd_src_start_gen1,
@@ -498,6 +512,8 @@ static int rsnd_src_probe_gen2(struct rsnd_mod *mod,
498 if (ret < 0) 512 if (ret < 0)
499 dev_err(dev, "SRC DMA failed\n"); 513 dev_err(dev, "SRC DMA failed\n");
500 514
515 dev_dbg(dev, "%s (Gen2) is probed\n", rsnd_mod_name(mod));
516
501 return ret; 517 return ret;
502} 518}
503 519
@@ -558,7 +574,7 @@ static int rsnd_src_stop_gen2(struct rsnd_mod *mod,
558} 574}
559 575
560static struct rsnd_mod_ops rsnd_src_gen2_ops = { 576static struct rsnd_mod_ops rsnd_src_gen2_ops = {
561 .name = "src (gen2)", 577 .name = SRC_NAME,
562 .probe = rsnd_src_probe_gen2, 578 .probe = rsnd_src_probe_gen2,
563 .remove = rsnd_src_remove_gen2, 579 .remove = rsnd_src_remove_gen2,
564 .init = rsnd_src_init_gen2, 580 .init = rsnd_src_init_gen2,
@@ -652,7 +668,8 @@ int rsnd_src_probe(struct platform_device *pdev,
652 priv->src = src; 668 priv->src = src;
653 669
654 for_each_rsnd_src(src, priv, i) { 670 for_each_rsnd_src(src, priv, i) {
655 snprintf(name, RSND_SRC_NAME_SIZE, "src.%d", i); 671 snprintf(name, RSND_SRC_NAME_SIZE, "%s.%d",
672 SRC_NAME, i);
656 673
657 clk = devm_clk_get(dev, name); 674 clk = devm_clk_get(dev, name);
658 if (IS_ERR(clk)) 675 if (IS_ERR(clk))
diff --git a/sound/soc/sh/rcar/ssi.c b/sound/soc/sh/rcar/ssi.c
index ea8d4e7a7986..2d94a62a6577 100644
--- a/sound/soc/sh/rcar/ssi.c
+++ b/sound/soc/sh/rcar/ssi.c
@@ -57,6 +57,8 @@
57 */ 57 */
58#define CONT (1 << 8) /* WS Continue Function */ 58#define CONT (1 << 8) /* WS Continue Function */
59 59
60#define SSI_NAME "ssi"
61
60struct rsnd_ssi { 62struct rsnd_ssi {
61 struct clk *clk; 63 struct clk *clk;
62 struct rsnd_ssi_platform_info *info; /* rcar_snd.h */ 64 struct rsnd_ssi_platform_info *info; /* rcar_snd.h */
@@ -373,6 +375,8 @@ static int rsnd_ssi_pio_probe(struct rsnd_mod *mod,
373 if (ret) 375 if (ret)
374 dev_err(dev, "SSI request interrupt failed\n"); 376 dev_err(dev, "SSI request interrupt failed\n");
375 377
378 dev_dbg(dev, "%s (PIO) is probed\n", rsnd_mod_name(mod));
379
376 return ret; 380 return ret;
377} 381}
378 382
@@ -405,7 +409,7 @@ static int rsnd_ssi_pio_stop(struct rsnd_mod *mod,
405} 409}
406 410
407static struct rsnd_mod_ops rsnd_ssi_pio_ops = { 411static struct rsnd_mod_ops rsnd_ssi_pio_ops = {
408 .name = "ssi (pio)", 412 .name = SSI_NAME,
409 .probe = rsnd_ssi_pio_probe, 413 .probe = rsnd_ssi_pio_probe,
410 .init = rsnd_ssi_init, 414 .init = rsnd_ssi_init,
411 .quit = rsnd_ssi_quit, 415 .quit = rsnd_ssi_quit,
@@ -430,6 +434,8 @@ static int rsnd_ssi_dma_probe(struct rsnd_mod *mod,
430 if (ret < 0) 434 if (ret < 0)
431 dev_err(dev, "SSI DMA failed\n"); 435 dev_err(dev, "SSI DMA failed\n");
432 436
437 dev_dbg(dev, "%s (DMA) is probed\n", rsnd_mod_name(mod));
438
433 return ret; 439 return ret;
434} 440}
435 441
@@ -480,7 +486,7 @@ static int rsnd_ssi_dma_stop(struct rsnd_mod *mod,
480} 486}
481 487
482static struct rsnd_mod_ops rsnd_ssi_dma_ops = { 488static struct rsnd_mod_ops rsnd_ssi_dma_ops = {
483 .name = "ssi (dma)", 489 .name = SSI_NAME,
484 .probe = rsnd_ssi_dma_probe, 490 .probe = rsnd_ssi_dma_probe,
485 .remove = rsnd_ssi_dma_remove, 491 .remove = rsnd_ssi_dma_remove,
486 .init = rsnd_ssi_init, 492 .init = rsnd_ssi_init,
@@ -493,7 +499,7 @@ static struct rsnd_mod_ops rsnd_ssi_dma_ops = {
493 * Non SSI 499 * Non SSI
494 */ 500 */
495static struct rsnd_mod_ops rsnd_ssi_non_ops = { 501static struct rsnd_mod_ops rsnd_ssi_non_ops = {
496 .name = "ssi (non)", 502 .name = SSI_NAME,
497}; 503};
498 504
499/* 505/*
@@ -620,7 +626,8 @@ int rsnd_ssi_probe(struct platform_device *pdev,
620 for_each_rsnd_ssi(ssi, priv, i) { 626 for_each_rsnd_ssi(ssi, priv, i) {
621 pinfo = &info->ssi_info[i]; 627 pinfo = &info->ssi_info[i];
622 628
623 snprintf(name, RSND_SSI_NAME_SIZE, "ssi.%d", i); 629 snprintf(name, RSND_SSI_NAME_SIZE, "%s.%d",
630 SSI_NAME, i);
624 631
625 clk = devm_clk_get(dev, name); 632 clk = devm_clk_get(dev, name);
626 if (IS_ERR(clk)) 633 if (IS_ERR(clk))