diff options
author | Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> | 2014-01-23 21:39:40 -0500 |
---|---|---|
committer | Mark Brown <broonie@linaro.org> | 2014-02-03 07:41:36 -0500 |
commit | dd27d808f9e084e7e9c4719c17f17d1fa35c45a6 (patch) | |
tree | 0780de34d49879179f38fa726f110a65339bfad0 /sound/soc/sh/rcar | |
parent | 7b5ce9759a60ebdffa1e76224ccb3d85bd06e4ac (diff) |
ASoC: rsnd: remove ssiu from ssi.c
Now, SSI_MODE0/1 are controlled under scu.c
ssiu is no longer needed on ssi.c
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
Diffstat (limited to 'sound/soc/sh/rcar')
-rw-r--r-- | sound/soc/sh/rcar/rsnd.h | 3 | ||||
-rw-r--r-- | sound/soc/sh/rcar/ssi.c | 24 |
2 files changed, 9 insertions, 18 deletions
diff --git a/sound/soc/sh/rcar/rsnd.h b/sound/soc/sh/rcar/rsnd.h index 85b926229b81..e92b1f438f74 100644 --- a/sound/soc/sh/rcar/rsnd.h +++ b/sound/soc/sh/rcar/rsnd.h | |||
@@ -280,7 +280,8 @@ struct rsnd_priv { | |||
280 | /* | 280 | /* |
281 | * below value will be filled on rsnd_ssi_probe() | 281 | * below value will be filled on rsnd_ssi_probe() |
282 | */ | 282 | */ |
283 | void *ssiu; | 283 | void *ssi; |
284 | int ssi_nr; | ||
284 | 285 | ||
285 | /* | 286 | /* |
286 | * below value will be filled on rsnd_dai_probe() | 287 | * below value will be filled on rsnd_dai_probe() |
diff --git a/sound/soc/sh/rcar/ssi.c b/sound/soc/sh/rcar/ssi.c index 0f314db8cb50..dc72439da58d 100644 --- a/sound/soc/sh/rcar/ssi.c +++ b/sound/soc/sh/rcar/ssi.c | |||
@@ -74,18 +74,13 @@ struct rsnd_ssi { | |||
74 | unsigned int rate; | 74 | unsigned int rate; |
75 | }; | 75 | }; |
76 | 76 | ||
77 | struct rsnd_ssiu { | ||
78 | int ssi_nr; | ||
79 | struct rsnd_ssi *ssi; | ||
80 | }; | ||
81 | |||
82 | #define for_each_rsnd_ssi(pos, priv, i) \ | 77 | #define for_each_rsnd_ssi(pos, priv, i) \ |
83 | for (i = 0; \ | 78 | for (i = 0; \ |
84 | (i < rsnd_ssi_nr(priv)) && \ | 79 | (i < rsnd_ssi_nr(priv)) && \ |
85 | ((pos) = ((struct rsnd_ssiu *)((priv)->ssiu))->ssi + i); \ | 80 | ((pos) = ((struct rsnd_ssi *)(priv)->ssi + i)); \ |
86 | i++) | 81 | i++) |
87 | 82 | ||
88 | #define rsnd_ssi_nr(priv) (((struct rsnd_ssiu *)((priv)->ssiu))->ssi_nr) | 83 | #define rsnd_ssi_nr(priv) ((priv)->ssi_nr) |
89 | #define rsnd_mod_to_ssi(_mod) container_of((_mod), struct rsnd_ssi, mod) | 84 | #define rsnd_mod_to_ssi(_mod) container_of((_mod), struct rsnd_ssi, mod) |
90 | #define rsnd_dma_to_ssi(dma) rsnd_mod_to_ssi(rsnd_dma_to_mod(dma)) | 85 | #define rsnd_dma_to_ssi(dma) rsnd_mod_to_ssi(rsnd_dma_to_mod(dma)) |
91 | #define rsnd_ssi_pio_available(ssi) ((ssi)->info->pio_irq > 0) | 86 | #define rsnd_ssi_pio_available(ssi) ((ssi)->info->pio_irq > 0) |
@@ -94,8 +89,6 @@ struct rsnd_ssiu { | |||
94 | #define rsnd_ssi_clk_from_parent(ssi) ((ssi)->parent) | 89 | #define rsnd_ssi_clk_from_parent(ssi) ((ssi)->parent) |
95 | #define rsnd_ssi_mode_flags(p) ((p)->info->flags) | 90 | #define rsnd_ssi_mode_flags(p) ((p)->info->flags) |
96 | #define rsnd_ssi_dai_id(ssi) ((ssi)->info->dai_id) | 91 | #define rsnd_ssi_dai_id(ssi) ((ssi)->info->dai_id) |
97 | #define rsnd_ssi_to_ssiu(ssi)\ | ||
98 | (((struct rsnd_ssiu *)((ssi) - rsnd_mod_id(&(ssi)->mod))) - 1) | ||
99 | 92 | ||
100 | static void rsnd_ssi_status_check(struct rsnd_mod *mod, | 93 | static void rsnd_ssi_status_check(struct rsnd_mod *mod, |
101 | u32 bit) | 94 | u32 bit) |
@@ -515,7 +508,7 @@ struct rsnd_mod *rsnd_ssi_mod_get(struct rsnd_priv *priv, int id) | |||
515 | if (WARN_ON(id < 0 || id >= rsnd_ssi_nr(priv))) | 508 | if (WARN_ON(id < 0 || id >= rsnd_ssi_nr(priv))) |
516 | id = 0; | 509 | id = 0; |
517 | 510 | ||
518 | return &(((struct rsnd_ssiu *)(priv->ssiu))->ssi + id)->mod; | 511 | return &((struct rsnd_ssi *)(priv->ssi) + id)->mod; |
519 | } | 512 | } |
520 | 513 | ||
521 | int rsnd_ssi_is_pin_sharing(struct rsnd_mod *mod) | 514 | int rsnd_ssi_is_pin_sharing(struct rsnd_mod *mod) |
@@ -552,7 +545,6 @@ int rsnd_ssi_probe(struct platform_device *pdev, | |||
552 | struct device *dev = rsnd_priv_to_dev(priv); | 545 | struct device *dev = rsnd_priv_to_dev(priv); |
553 | struct rsnd_mod_ops *ops; | 546 | struct rsnd_mod_ops *ops; |
554 | struct clk *clk; | 547 | struct clk *clk; |
555 | struct rsnd_ssiu *ssiu; | ||
556 | struct rsnd_ssi *ssi; | 548 | struct rsnd_ssi *ssi; |
557 | char name[RSND_SSI_NAME_SIZE]; | 549 | char name[RSND_SSI_NAME_SIZE]; |
558 | int i, nr, ret; | 550 | int i, nr, ret; |
@@ -561,16 +553,14 @@ int rsnd_ssi_probe(struct platform_device *pdev, | |||
561 | * init SSI | 553 | * init SSI |
562 | */ | 554 | */ |
563 | nr = info->ssi_info_nr; | 555 | nr = info->ssi_info_nr; |
564 | ssiu = devm_kzalloc(dev, sizeof(*ssiu) + (sizeof(*ssi) * nr), | 556 | ssi = devm_kzalloc(dev, sizeof(*ssi) * nr, GFP_KERNEL); |
565 | GFP_KERNEL); | 557 | if (!ssi) { |
566 | if (!ssiu) { | ||
567 | dev_err(dev, "SSI allocate failed\n"); | 558 | dev_err(dev, "SSI allocate failed\n"); |
568 | return -ENOMEM; | 559 | return -ENOMEM; |
569 | } | 560 | } |
570 | 561 | ||
571 | priv->ssiu = ssiu; | 562 | priv->ssi = ssi; |
572 | ssiu->ssi = (struct rsnd_ssi *)(ssiu + 1); | 563 | priv->ssi_nr = nr; |
573 | ssiu->ssi_nr = nr; | ||
574 | 564 | ||
575 | for_each_rsnd_ssi(ssi, priv, i) { | 565 | for_each_rsnd_ssi(ssi, priv, i) { |
576 | pinfo = &info->ssi_info[i]; | 566 | pinfo = &info->ssi_info[i]; |