• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Renesas R-Car SRU/SCU/SSIU/SSI support
3  *
4  * Copyright (C) 2013 Renesas Solutions Corp.
5  * Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
6  *
7  * This program is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License version 2 as
9  * published by the Free Software Foundation.
10  */
11 
12 #ifndef RCAR_SND_H
13 #define RCAR_SND_H
14 
15 
16 #define RSND_GEN1_SRU	0
17 #define RSND_GEN1_ADG	1
18 #define RSND_GEN1_SSI	2
19 
20 #define RSND_GEN2_SCU	0
21 #define RSND_GEN2_ADG	1
22 #define RSND_GEN2_SSIU	2
23 #define RSND_GEN2_SSI	3
24 
25 #define RSND_BASE_MAX	4
26 
27 /*
28  * flags
29  *
30  * 0xAB000000
31  *
32  * A : clock sharing settings
33  * B : SSI direction
34  */
35 #define RSND_SSI_CLK_PIN_SHARE		(1 << 31)
36 #define RSND_SSI_NO_BUSIF		(1 << 30) /* SSI+DMA without BUSIF */
37 
38 #define RSND_SSI(_dma_id, _irq, _flags)		\
39 { .dma_id = _dma_id, .irq = _irq, .flags = _flags }
40 #define RSND_SSI_UNUSED \
41 { .dma_id = -1, .irq = -1, .flags = 0 }
42 
43 struct rsnd_ssi_platform_info {
44 	int dma_id;
45 	int irq;
46 	u32 flags;
47 };
48 
49 #define RSND_SRC(rate, _dma_id)						\
50 { .convert_rate = rate, .dma_id = _dma_id, }
51 #define RSND_SRC_UNUSED				\
52 { .convert_rate = 0, .dma_id = -1, }
53 
54 struct rsnd_src_platform_info {
55 	u32 convert_rate; /* sampling rate convert */
56 	int dma_id; /* for Gen2 SCU */
57 	int irq;
58 };
59 
60 /*
61  * flags
62  */
63 struct rsnd_ctu_platform_info {
64 	u32 flags;
65 };
66 
67 struct rsnd_mix_platform_info {
68 	u32 flags;
69 };
70 
71 struct rsnd_dvc_platform_info {
72 	u32 flags;
73 };
74 
75 struct rsnd_dai_path_info {
76 	struct rsnd_ssi_platform_info *ssi;
77 	struct rsnd_src_platform_info *src;
78 	struct rsnd_ctu_platform_info *ctu;
79 	struct rsnd_mix_platform_info *mix;
80 	struct rsnd_dvc_platform_info *dvc;
81 };
82 
83 struct rsnd_dai_platform_info {
84 	struct rsnd_dai_path_info playback;
85 	struct rsnd_dai_path_info capture;
86 };
87 
88 /*
89  * flags
90  *
91  * 0x0000000A
92  *
93  * A : generation
94  */
95 #define RSND_GEN_MASK	(0xF << 0)
96 #define RSND_GEN1	(1 << 0) /* fixme */
97 #define RSND_GEN2	(2 << 0) /* fixme */
98 
99 struct rcar_snd_info {
100 	u32 flags;
101 	struct rsnd_ssi_platform_info *ssi_info;
102 	int ssi_info_nr;
103 	struct rsnd_src_platform_info *src_info;
104 	int src_info_nr;
105 	struct rsnd_ctu_platform_info *ctu_info;
106 	int ctu_info_nr;
107 	struct rsnd_mix_platform_info *mix_info;
108 	int mix_info_nr;
109 	struct rsnd_dvc_platform_info *dvc_info;
110 	int dvc_info_nr;
111 	struct rsnd_dai_platform_info *dai_info;
112 	int dai_info_nr;
113 	int (*start)(int id);
114 	int (*stop)(int id);
115 };
116 
117 #endif
118