diff options
author | Stephen Warren <swarren@nvidia.com> | 2012-04-06 12:30:52 -0400 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2012-04-06 12:36:15 -0400 |
commit | 896637ac1be95a239b68dbe61c12a8a9bc00a9a3 (patch) | |
tree | bd6bfa8f1ecb71d1307634354eb6e674576abd93 /sound/soc/tegra/tegra20_spdif.c | |
parent | ef280d3907cea21b6093802398bbe4193e221a64 (diff) |
ASoC: tegra: complete Tegra->Tegra20 renaming
Rename Tegra20-specific Kconfig variables, module filenames, all internal
symbol names, clocks, and platform devices, to reflect the fact the DAS
and I2S drivers are for a specific HW version.
Signed-off-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound/soc/tegra/tegra20_spdif.c')
-rw-r--r-- | sound/soc/tegra/tegra20_spdif.c | 140 |
1 files changed, 70 insertions, 70 deletions
diff --git a/sound/soc/tegra/tegra20_spdif.c b/sound/soc/tegra/tegra20_spdif.c index ed1fd502ef8d..052bff816c4d 100644 --- a/sound/soc/tegra/tegra20_spdif.c +++ b/sound/soc/tegra/tegra20_spdif.c | |||
@@ -36,105 +36,105 @@ | |||
36 | 36 | ||
37 | #include "tegra20_spdif.h" | 37 | #include "tegra20_spdif.h" |
38 | 38 | ||
39 | #define DRV_NAME "tegra-spdif" | 39 | #define DRV_NAME "tegra20-spdif" |
40 | 40 | ||
41 | static inline void tegra_spdif_write(struct tegra_spdif *spdif, u32 reg, | 41 | static inline void tegra20_spdif_write(struct tegra20_spdif *spdif, u32 reg, |
42 | u32 val) | 42 | u32 val) |
43 | { | 43 | { |
44 | __raw_writel(val, spdif->regs + reg); | 44 | __raw_writel(val, spdif->regs + reg); |
45 | } | 45 | } |
46 | 46 | ||
47 | static inline u32 tegra_spdif_read(struct tegra_spdif *spdif, u32 reg) | 47 | static inline u32 tegra20_spdif_read(struct tegra20_spdif *spdif, u32 reg) |
48 | { | 48 | { |
49 | return __raw_readl(spdif->regs + reg); | 49 | return __raw_readl(spdif->regs + reg); |
50 | } | 50 | } |
51 | 51 | ||
52 | #ifdef CONFIG_DEBUG_FS | 52 | #ifdef CONFIG_DEBUG_FS |
53 | static int tegra_spdif_show(struct seq_file *s, void *unused) | 53 | static int tegra20_spdif_show(struct seq_file *s, void *unused) |
54 | { | 54 | { |
55 | #define REG(r) { r, #r } | 55 | #define REG(r) { r, #r } |
56 | static const struct { | 56 | static const struct { |
57 | int offset; | 57 | int offset; |
58 | const char *name; | 58 | const char *name; |
59 | } regs[] = { | 59 | } regs[] = { |
60 | REG(TEGRA_SPDIF_CTRL), | 60 | REG(TEGRA20_SPDIF_CTRL), |
61 | REG(TEGRA_SPDIF_STATUS), | 61 | REG(TEGRA20_SPDIF_STATUS), |
62 | REG(TEGRA_SPDIF_STROBE_CTRL), | 62 | REG(TEGRA20_SPDIF_STROBE_CTRL), |
63 | REG(TEGRA_SPDIF_DATA_FIFO_CSR), | 63 | REG(TEGRA20_SPDIF_DATA_FIFO_CSR), |
64 | REG(TEGRA_SPDIF_CH_STA_RX_A), | 64 | REG(TEGRA20_SPDIF_CH_STA_RX_A), |
65 | REG(TEGRA_SPDIF_CH_STA_RX_B), | 65 | REG(TEGRA20_SPDIF_CH_STA_RX_B), |
66 | REG(TEGRA_SPDIF_CH_STA_RX_C), | 66 | REG(TEGRA20_SPDIF_CH_STA_RX_C), |
67 | REG(TEGRA_SPDIF_CH_STA_RX_D), | 67 | REG(TEGRA20_SPDIF_CH_STA_RX_D), |
68 | REG(TEGRA_SPDIF_CH_STA_RX_E), | 68 | REG(TEGRA20_SPDIF_CH_STA_RX_E), |
69 | REG(TEGRA_SPDIF_CH_STA_RX_F), | 69 | REG(TEGRA20_SPDIF_CH_STA_RX_F), |
70 | REG(TEGRA_SPDIF_CH_STA_TX_A), | 70 | REG(TEGRA20_SPDIF_CH_STA_TX_A), |
71 | REG(TEGRA_SPDIF_CH_STA_TX_B), | 71 | REG(TEGRA20_SPDIF_CH_STA_TX_B), |
72 | REG(TEGRA_SPDIF_CH_STA_TX_C), | 72 | REG(TEGRA20_SPDIF_CH_STA_TX_C), |
73 | REG(TEGRA_SPDIF_CH_STA_TX_D), | 73 | REG(TEGRA20_SPDIF_CH_STA_TX_D), |
74 | REG(TEGRA_SPDIF_CH_STA_TX_E), | 74 | REG(TEGRA20_SPDIF_CH_STA_TX_E), |
75 | REG(TEGRA_SPDIF_CH_STA_TX_F), | 75 | REG(TEGRA20_SPDIF_CH_STA_TX_F), |
76 | }; | 76 | }; |
77 | #undef REG | 77 | #undef REG |
78 | 78 | ||
79 | struct tegra_spdif *spdif = s->private; | 79 | struct tegra20_spdif *spdif = s->private; |
80 | int i; | 80 | int i; |
81 | 81 | ||
82 | for (i = 0; i < ARRAY_SIZE(regs); i++) { | 82 | for (i = 0; i < ARRAY_SIZE(regs); i++) { |
83 | u32 val = tegra_spdif_read(spdif, regs[i].offset); | 83 | u32 val = tegra20_spdif_read(spdif, regs[i].offset); |
84 | seq_printf(s, "%s = %08x\n", regs[i].name, val); | 84 | seq_printf(s, "%s = %08x\n", regs[i].name, val); |
85 | } | 85 | } |
86 | 86 | ||
87 | return 0; | 87 | return 0; |
88 | } | 88 | } |
89 | 89 | ||
90 | static int tegra_spdif_debug_open(struct inode *inode, struct file *file) | 90 | static int tegra20_spdif_debug_open(struct inode *inode, struct file *file) |
91 | { | 91 | { |
92 | return single_open(file, tegra_spdif_show, inode->i_private); | 92 | return single_open(file, tegra20_spdif_show, inode->i_private); |
93 | } | 93 | } |
94 | 94 | ||
95 | static const struct file_operations tegra_spdif_debug_fops = { | 95 | static const struct file_operations tegra20_spdif_debug_fops = { |
96 | .open = tegra_spdif_debug_open, | 96 | .open = tegra20_spdif_debug_open, |
97 | .read = seq_read, | 97 | .read = seq_read, |
98 | .llseek = seq_lseek, | 98 | .llseek = seq_lseek, |
99 | .release = single_release, | 99 | .release = single_release, |
100 | }; | 100 | }; |
101 | 101 | ||
102 | static void tegra_spdif_debug_add(struct tegra_spdif *spdif) | 102 | static void tegra20_spdif_debug_add(struct tegra20_spdif *spdif) |
103 | { | 103 | { |
104 | spdif->debug = debugfs_create_file(DRV_NAME, S_IRUGO, | 104 | spdif->debug = debugfs_create_file(DRV_NAME, S_IRUGO, |
105 | snd_soc_debugfs_root, spdif, | 105 | snd_soc_debugfs_root, spdif, |
106 | &tegra_spdif_debug_fops); | 106 | &tegra20_spdif_debug_fops); |
107 | } | 107 | } |
108 | 108 | ||
109 | static void tegra_spdif_debug_remove(struct tegra_spdif *spdif) | 109 | static void tegra20_spdif_debug_remove(struct tegra20_spdif *spdif) |
110 | { | 110 | { |
111 | if (spdif->debug) | 111 | if (spdif->debug) |
112 | debugfs_remove(spdif->debug); | 112 | debugfs_remove(spdif->debug); |
113 | } | 113 | } |
114 | #else | 114 | #else |
115 | static inline void tegra_spdif_debug_add(struct tegra_spdif *spdif) | 115 | static inline void tegra20_spdif_debug_add(struct tegra20_spdif *spdif) |
116 | { | 116 | { |
117 | } | 117 | } |
118 | 118 | ||
119 | static inline void tegra_spdif_debug_remove(struct tegra_spdif *spdif) | 119 | static inline void tegra20_spdif_debug_remove(struct tegra20_spdif *spdif) |
120 | { | 120 | { |
121 | } | 121 | } |
122 | #endif | 122 | #endif |
123 | 123 | ||
124 | static int tegra_spdif_hw_params(struct snd_pcm_substream *substream, | 124 | static int tegra20_spdif_hw_params(struct snd_pcm_substream *substream, |
125 | struct snd_pcm_hw_params *params, | 125 | struct snd_pcm_hw_params *params, |
126 | struct snd_soc_dai *dai) | 126 | struct snd_soc_dai *dai) |
127 | { | 127 | { |
128 | struct device *dev = substream->pcm->card->dev; | 128 | struct device *dev = substream->pcm->card->dev; |
129 | struct tegra_spdif *spdif = snd_soc_dai_get_drvdata(dai); | 129 | struct tegra20_spdif *spdif = snd_soc_dai_get_drvdata(dai); |
130 | int ret, spdifclock; | 130 | int ret, spdifclock; |
131 | 131 | ||
132 | spdif->reg_ctrl &= ~TEGRA_SPDIF_CTRL_PACK; | 132 | spdif->reg_ctrl &= ~TEGRA20_SPDIF_CTRL_PACK; |
133 | spdif->reg_ctrl &= ~TEGRA_SPDIF_CTRL_BIT_MODE_MASK; | 133 | spdif->reg_ctrl &= ~TEGRA20_SPDIF_CTRL_BIT_MODE_MASK; |
134 | switch (params_format(params)) { | 134 | switch (params_format(params)) { |
135 | case SNDRV_PCM_FORMAT_S16_LE: | 135 | case SNDRV_PCM_FORMAT_S16_LE: |
136 | spdif->reg_ctrl |= TEGRA_SPDIF_CTRL_PACK; | 136 | spdif->reg_ctrl |= TEGRA20_SPDIF_CTRL_PACK; |
137 | spdif->reg_ctrl |= TEGRA_SPDIF_CTRL_BIT_MODE_16BIT; | 137 | spdif->reg_ctrl |= TEGRA20_SPDIF_CTRL_BIT_MODE_16BIT; |
138 | break; | 138 | break; |
139 | default: | 139 | default: |
140 | return -EINVAL; | 140 | return -EINVAL; |
@@ -175,34 +175,34 @@ static int tegra_spdif_hw_params(struct snd_pcm_substream *substream, | |||
175 | return 0; | 175 | return 0; |
176 | } | 176 | } |
177 | 177 | ||
178 | static void tegra_spdif_start_playback(struct tegra_spdif *spdif) | 178 | static void tegra20_spdif_start_playback(struct tegra20_spdif *spdif) |
179 | { | 179 | { |
180 | spdif->reg_ctrl |= TEGRA_SPDIF_CTRL_TX_EN; | 180 | spdif->reg_ctrl |= TEGRA20_SPDIF_CTRL_TX_EN; |
181 | tegra_spdif_write(spdif, TEGRA_SPDIF_CTRL, spdif->reg_ctrl); | 181 | tegra20_spdif_write(spdif, TEGRA20_SPDIF_CTRL, spdif->reg_ctrl); |
182 | } | 182 | } |
183 | 183 | ||
184 | static void tegra_spdif_stop_playback(struct tegra_spdif *spdif) | 184 | static void tegra20_spdif_stop_playback(struct tegra20_spdif *spdif) |
185 | { | 185 | { |
186 | spdif->reg_ctrl &= ~TEGRA_SPDIF_CTRL_TX_EN; | 186 | spdif->reg_ctrl &= ~TEGRA20_SPDIF_CTRL_TX_EN; |
187 | tegra_spdif_write(spdif, TEGRA_SPDIF_CTRL, spdif->reg_ctrl); | 187 | tegra20_spdif_write(spdif, TEGRA20_SPDIF_CTRL, spdif->reg_ctrl); |
188 | } | 188 | } |
189 | 189 | ||
190 | static int tegra_spdif_trigger(struct snd_pcm_substream *substream, int cmd, | 190 | static int tegra20_spdif_trigger(struct snd_pcm_substream *substream, int cmd, |
191 | struct snd_soc_dai *dai) | 191 | struct snd_soc_dai *dai) |
192 | { | 192 | { |
193 | struct tegra_spdif *spdif = snd_soc_dai_get_drvdata(dai); | 193 | struct tegra20_spdif *spdif = snd_soc_dai_get_drvdata(dai); |
194 | 194 | ||
195 | switch (cmd) { | 195 | switch (cmd) { |
196 | case SNDRV_PCM_TRIGGER_START: | 196 | case SNDRV_PCM_TRIGGER_START: |
197 | case SNDRV_PCM_TRIGGER_PAUSE_RELEASE: | 197 | case SNDRV_PCM_TRIGGER_PAUSE_RELEASE: |
198 | case SNDRV_PCM_TRIGGER_RESUME: | 198 | case SNDRV_PCM_TRIGGER_RESUME: |
199 | clk_enable(spdif->clk_spdif_out); | 199 | clk_enable(spdif->clk_spdif_out); |
200 | tegra_spdif_start_playback(spdif); | 200 | tegra20_spdif_start_playback(spdif); |
201 | break; | 201 | break; |
202 | case SNDRV_PCM_TRIGGER_STOP: | 202 | case SNDRV_PCM_TRIGGER_STOP: |
203 | case SNDRV_PCM_TRIGGER_PAUSE_PUSH: | 203 | case SNDRV_PCM_TRIGGER_PAUSE_PUSH: |
204 | case SNDRV_PCM_TRIGGER_SUSPEND: | 204 | case SNDRV_PCM_TRIGGER_SUSPEND: |
205 | tegra_spdif_stop_playback(spdif); | 205 | tegra20_spdif_stop_playback(spdif); |
206 | clk_disable(spdif->clk_spdif_out); | 206 | clk_disable(spdif->clk_spdif_out); |
207 | break; | 207 | break; |
208 | default: | 208 | default: |
@@ -212,9 +212,9 @@ static int tegra_spdif_trigger(struct snd_pcm_substream *substream, int cmd, | |||
212 | return 0; | 212 | return 0; |
213 | } | 213 | } |
214 | 214 | ||
215 | static int tegra_spdif_probe(struct snd_soc_dai *dai) | 215 | static int tegra20_spdif_probe(struct snd_soc_dai *dai) |
216 | { | 216 | { |
217 | struct tegra_spdif *spdif = snd_soc_dai_get_drvdata(dai); | 217 | struct tegra20_spdif *spdif = snd_soc_dai_get_drvdata(dai); |
218 | 218 | ||
219 | dai->capture_dma_data = NULL; | 219 | dai->capture_dma_data = NULL; |
220 | dai->playback_dma_data = &spdif->playback_dma_data; | 220 | dai->playback_dma_data = &spdif->playback_dma_data; |
@@ -222,14 +222,14 @@ static int tegra_spdif_probe(struct snd_soc_dai *dai) | |||
222 | return 0; | 222 | return 0; |
223 | } | 223 | } |
224 | 224 | ||
225 | static const struct snd_soc_dai_ops tegra_spdif_dai_ops = { | 225 | static const struct snd_soc_dai_ops tegra20_spdif_dai_ops = { |
226 | .hw_params = tegra_spdif_hw_params, | 226 | .hw_params = tegra20_spdif_hw_params, |
227 | .trigger = tegra_spdif_trigger, | 227 | .trigger = tegra20_spdif_trigger, |
228 | }; | 228 | }; |
229 | 229 | ||
230 | static struct snd_soc_dai_driver tegra_spdif_dai = { | 230 | static struct snd_soc_dai_driver tegra20_spdif_dai = { |
231 | .name = DRV_NAME, | 231 | .name = DRV_NAME, |
232 | .probe = tegra_spdif_probe, | 232 | .probe = tegra20_spdif_probe, |
233 | .playback = { | 233 | .playback = { |
234 | .channels_min = 2, | 234 | .channels_min = 2, |
235 | .channels_max = 2, | 235 | .channels_max = 2, |
@@ -237,18 +237,18 @@ static struct snd_soc_dai_driver tegra_spdif_dai = { | |||
237 | SNDRV_PCM_RATE_48000, | 237 | SNDRV_PCM_RATE_48000, |
238 | .formats = SNDRV_PCM_FMTBIT_S16_LE, | 238 | .formats = SNDRV_PCM_FMTBIT_S16_LE, |
239 | }, | 239 | }, |
240 | .ops = &tegra_spdif_dai_ops, | 240 | .ops = &tegra20_spdif_dai_ops, |
241 | }; | 241 | }; |
242 | 242 | ||
243 | static __devinit int tegra_spdif_platform_probe(struct platform_device *pdev) | 243 | static __devinit int tegra20_spdif_platform_probe(struct platform_device *pdev) |
244 | { | 244 | { |
245 | struct tegra_spdif *spdif; | 245 | struct tegra20_spdif *spdif; |
246 | struct resource *mem, *memregion, *dmareq; | 246 | struct resource *mem, *memregion, *dmareq; |
247 | int ret; | 247 | int ret; |
248 | 248 | ||
249 | spdif = kzalloc(sizeof(struct tegra_spdif), GFP_KERNEL); | 249 | spdif = kzalloc(sizeof(struct tegra20_spdif), GFP_KERNEL); |
250 | if (!spdif) { | 250 | if (!spdif) { |
251 | dev_err(&pdev->dev, "Can't allocate tegra_spdif\n"); | 251 | dev_err(&pdev->dev, "Can't allocate tegra20_spdif\n"); |
252 | ret = -ENOMEM; | 252 | ret = -ENOMEM; |
253 | goto exit; | 253 | goto exit; |
254 | } | 254 | } |
@@ -290,12 +290,12 @@ static __devinit int tegra_spdif_platform_probe(struct platform_device *pdev) | |||
290 | goto err_release; | 290 | goto err_release; |
291 | } | 291 | } |
292 | 292 | ||
293 | spdif->playback_dma_data.addr = mem->start + TEGRA_SPDIF_DATA_OUT; | 293 | spdif->playback_dma_data.addr = mem->start + TEGRA20_SPDIF_DATA_OUT; |
294 | spdif->playback_dma_data.wrap = 4; | 294 | spdif->playback_dma_data.wrap = 4; |
295 | spdif->playback_dma_data.width = 32; | 295 | spdif->playback_dma_data.width = 32; |
296 | spdif->playback_dma_data.req_sel = dmareq->start; | 296 | spdif->playback_dma_data.req_sel = dmareq->start; |
297 | 297 | ||
298 | ret = snd_soc_register_dai(&pdev->dev, &tegra_spdif_dai); | 298 | ret = snd_soc_register_dai(&pdev->dev, &tegra20_spdif_dai); |
299 | if (ret) { | 299 | if (ret) { |
300 | dev_err(&pdev->dev, "Could not register DAI: %d\n", ret); | 300 | dev_err(&pdev->dev, "Could not register DAI: %d\n", ret); |
301 | ret = -ENOMEM; | 301 | ret = -ENOMEM; |
@@ -308,7 +308,7 @@ static __devinit int tegra_spdif_platform_probe(struct platform_device *pdev) | |||
308 | goto err_unregister_dai; | 308 | goto err_unregister_dai; |
309 | } | 309 | } |
310 | 310 | ||
311 | tegra_spdif_debug_add(spdif); | 311 | tegra20_spdif_debug_add(spdif); |
312 | 312 | ||
313 | return 0; | 313 | return 0; |
314 | 314 | ||
@@ -326,15 +326,15 @@ exit: | |||
326 | return ret; | 326 | return ret; |
327 | } | 327 | } |
328 | 328 | ||
329 | static int __devexit tegra_spdif_platform_remove(struct platform_device *pdev) | 329 | static int __devexit tegra20_spdif_platform_remove(struct platform_device *pdev) |
330 | { | 330 | { |
331 | struct tegra_spdif *spdif = dev_get_drvdata(&pdev->dev); | 331 | struct tegra20_spdif *spdif = dev_get_drvdata(&pdev->dev); |
332 | struct resource *res; | 332 | struct resource *res; |
333 | 333 | ||
334 | tegra_pcm_platform_unregister(&pdev->dev); | 334 | tegra_pcm_platform_unregister(&pdev->dev); |
335 | snd_soc_unregister_dai(&pdev->dev); | 335 | snd_soc_unregister_dai(&pdev->dev); |
336 | 336 | ||
337 | tegra_spdif_debug_remove(spdif); | 337 | tegra20_spdif_debug_remove(spdif); |
338 | 338 | ||
339 | iounmap(spdif->regs); | 339 | iounmap(spdif->regs); |
340 | 340 | ||
@@ -348,18 +348,18 @@ static int __devexit tegra_spdif_platform_remove(struct platform_device *pdev) | |||
348 | return 0; | 348 | return 0; |
349 | } | 349 | } |
350 | 350 | ||
351 | static struct platform_driver tegra_spdif_driver = { | 351 | static struct platform_driver tegra20_spdif_driver = { |
352 | .driver = { | 352 | .driver = { |
353 | .name = DRV_NAME, | 353 | .name = DRV_NAME, |
354 | .owner = THIS_MODULE, | 354 | .owner = THIS_MODULE, |
355 | }, | 355 | }, |
356 | .probe = tegra_spdif_platform_probe, | 356 | .probe = tegra20_spdif_platform_probe, |
357 | .remove = __devexit_p(tegra_spdif_platform_remove), | 357 | .remove = __devexit_p(tegra20_spdif_platform_remove), |
358 | }; | 358 | }; |
359 | 359 | ||
360 | module_platform_driver(tegra_spdif_driver); | 360 | module_platform_driver(tegra20_spdif_driver); |
361 | 361 | ||
362 | MODULE_AUTHOR("Stephen Warren <swarren@nvidia.com>"); | 362 | MODULE_AUTHOR("Stephen Warren <swarren@nvidia.com>"); |
363 | MODULE_DESCRIPTION("Tegra SPDIF ASoC driver"); | 363 | MODULE_DESCRIPTION("Tegra20 SPDIF ASoC driver"); |
364 | MODULE_LICENSE("GPL"); | 364 | MODULE_LICENSE("GPL"); |
365 | MODULE_ALIAS("platform:" DRV_NAME); | 365 | MODULE_ALIAS("platform:" DRV_NAME); |