diff options
Diffstat (limited to 'sound/soc/sh/rcar/rsnd.h')
-rw-r--r-- | sound/soc/sh/rcar/rsnd.h | 29 |
1 files changed, 22 insertions, 7 deletions
diff --git a/sound/soc/sh/rcar/rsnd.h b/sound/soc/sh/rcar/rsnd.h index 7a0e52b4640a..085329878525 100644 --- a/sound/soc/sh/rcar/rsnd.h +++ b/sound/soc/sh/rcar/rsnd.h | |||
@@ -21,10 +21,11 @@ | |||
21 | #include <linux/of_irq.h> | 21 | #include <linux/of_irq.h> |
22 | #include <linux/sh_dma.h> | 22 | #include <linux/sh_dma.h> |
23 | #include <linux/workqueue.h> | 23 | #include <linux/workqueue.h> |
24 | #include <sound/rcar_snd.h> | ||
25 | #include <sound/soc.h> | 24 | #include <sound/soc.h> |
26 | #include <sound/pcm_params.h> | 25 | #include <sound/pcm_params.h> |
27 | 26 | ||
27 | #include "rcar_snd.h" | ||
28 | |||
28 | /* | 29 | /* |
29 | * pseudo register | 30 | * pseudo register |
30 | * | 31 | * |
@@ -214,6 +215,7 @@ struct rsnd_dma { | |||
214 | }; | 215 | }; |
215 | #define rsnd_dma_to_dmaen(dma) (&(dma)->dma.en) | 216 | #define rsnd_dma_to_dmaen(dma) (&(dma)->dma.en) |
216 | #define rsnd_dma_to_dmapp(dma) (&(dma)->dma.pp) | 217 | #define rsnd_dma_to_dmapp(dma) (&(dma)->dma.pp) |
218 | #define rsnd_dma_to_mod(_dma) container_of((_dma), struct rsnd_mod, dma) | ||
217 | 219 | ||
218 | void rsnd_dma_start(struct rsnd_dai_stream *io, struct rsnd_dma *dma); | 220 | void rsnd_dma_start(struct rsnd_dai_stream *io, struct rsnd_dma *dma); |
219 | void rsnd_dma_stop(struct rsnd_dai_stream *io, struct rsnd_dma *dma); | 221 | void rsnd_dma_stop(struct rsnd_dai_stream *io, struct rsnd_dma *dma); |
@@ -225,8 +227,6 @@ int rsnd_dma_probe(struct platform_device *pdev, | |||
225 | struct dma_chan *rsnd_dma_request_channel(struct device_node *of_node, | 227 | struct dma_chan *rsnd_dma_request_channel(struct device_node *of_node, |
226 | struct rsnd_mod *mod, char *name); | 228 | struct rsnd_mod *mod, char *name); |
227 | 229 | ||
228 | #define rsnd_dma_to_mod(_dma) container_of((_dma), struct rsnd_mod, dma) | ||
229 | |||
230 | /* | 230 | /* |
231 | * R-Car sound mod | 231 | * R-Car sound mod |
232 | */ | 232 | */ |
@@ -330,8 +330,9 @@ struct rsnd_mod { | |||
330 | #define rsnd_mod_to_priv(mod) ((mod)->priv) | 330 | #define rsnd_mod_to_priv(mod) ((mod)->priv) |
331 | #define rsnd_mod_to_dma(mod) (&(mod)->dma) | 331 | #define rsnd_mod_to_dma(mod) (&(mod)->dma) |
332 | #define rsnd_mod_id(mod) ((mod) ? (mod)->id : -1) | 332 | #define rsnd_mod_id(mod) ((mod) ? (mod)->id : -1) |
333 | #define rsnd_mod_hw_start(mod) clk_enable((mod)->clk) | 333 | #define rsnd_mod_power_on(mod) clk_enable((mod)->clk) |
334 | #define rsnd_mod_hw_stop(mod) clk_disable((mod)->clk) | 334 | #define rsnd_mod_power_off(mod) clk_disable((mod)->clk) |
335 | #define rsnd_mod_get(ip) (&(ip)->mod) | ||
335 | 336 | ||
336 | int rsnd_mod_init(struct rsnd_priv *priv, | 337 | int rsnd_mod_init(struct rsnd_priv *priv, |
337 | struct rsnd_mod *mod, | 338 | struct rsnd_mod *mod, |
@@ -571,9 +572,12 @@ int rsnd_ssi_probe(struct platform_device *pdev, | |||
571 | void rsnd_ssi_remove(struct platform_device *pdev, | 572 | void rsnd_ssi_remove(struct platform_device *pdev, |
572 | struct rsnd_priv *priv); | 573 | struct rsnd_priv *priv); |
573 | struct rsnd_mod *rsnd_ssi_mod_get(struct rsnd_priv *priv, int id); | 574 | struct rsnd_mod *rsnd_ssi_mod_get(struct rsnd_priv *priv, int id); |
574 | int rsnd_ssi_is_pin_sharing(struct rsnd_mod *mod); | ||
575 | int rsnd_ssi_is_dma_mode(struct rsnd_mod *mod); | 575 | int rsnd_ssi_is_dma_mode(struct rsnd_mod *mod); |
576 | int rsnd_ssi_use_busif(struct rsnd_dai_stream *io, struct rsnd_mod *mod); | 576 | int rsnd_ssi_use_busif(struct rsnd_dai_stream *io); |
577 | |||
578 | #define rsnd_ssi_is_pin_sharing(io) \ | ||
579 | __rsnd_ssi_is_pin_sharing(rsnd_io_to_mod_ssi(io)) | ||
580 | int __rsnd_ssi_is_pin_sharing(struct rsnd_mod *mod); | ||
577 | 581 | ||
578 | /* | 582 | /* |
579 | * R-Car SRC | 583 | * R-Car SRC |
@@ -627,4 +631,15 @@ void rsnd_dvc_remove(struct platform_device *pdev, | |||
627 | struct rsnd_priv *priv); | 631 | struct rsnd_priv *priv); |
628 | struct rsnd_mod *rsnd_dvc_mod_get(struct rsnd_priv *priv, int id); | 632 | struct rsnd_mod *rsnd_dvc_mod_get(struct rsnd_priv *priv, int id); |
629 | 633 | ||
634 | #ifdef DEBUG | ||
635 | void rsnd_mod_make_sure(struct rsnd_mod *mod, enum rsnd_mod_type type); | ||
636 | #define rsnd_mod_confirm_ssi(mssi) rsnd_mod_make_sure(mssi, RSND_MOD_SSI) | ||
637 | #define rsnd_mod_confirm_src(msrc) rsnd_mod_make_sure(msrc, RSND_MOD_SRC) | ||
638 | #define rsnd_mod_confirm_dvc(mdvc) rsnd_mod_make_sure(mdvc, RSND_MOD_DVC) | ||
639 | #else | ||
640 | #define rsnd_mod_confirm_ssi(mssi) | ||
641 | #define rsnd_mod_confirm_src(msrc) | ||
642 | #define rsnd_mod_confirm_dvc(mdvc) | ||
643 | #endif | ||
644 | |||
630 | #endif | 645 | #endif |