diff options
author | apatard@mandriva.com <apatard@mandriva.com> | 2010-05-31 07:49:14 -0400 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2010-05-31 08:16:37 -0400 |
commit | f9b95980f87f021f8c69646738929189838ad035 (patch) | |
tree | 99ea04355647ccf423786804ddb56131d618c448 /sound/soc/kirkwood/kirkwood.h | |
parent | 492e2bf141478e2c1ce3abfda381f73d1f2108f5 (diff) |
ASoC: kirkwood: Add i2s support
This patch enables support for the i2s controller available on kirkwood
platforms
Signed-off-by: Arnaud Patard <apatard@mandriva.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound/soc/kirkwood/kirkwood.h')
-rw-r--r-- | sound/soc/kirkwood/kirkwood.h | 126 |
1 files changed, 126 insertions, 0 deletions
diff --git a/sound/soc/kirkwood/kirkwood.h b/sound/soc/kirkwood/kirkwood.h new file mode 100644 index 000000000000..b6e4f68d71dd --- /dev/null +++ b/sound/soc/kirkwood/kirkwood.h | |||
@@ -0,0 +1,126 @@ | |||
1 | /* | ||
2 | * kirkwood.h | ||
3 | * | ||
4 | * (c) 2010 Arnaud Patard <apatard@mandriva.com> | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify it | ||
7 | * under the terms of the GNU General Public License as published by the | ||
8 | * Free Software Foundation; either version 2 of the License, or (at your | ||
9 | * option) any later version. | ||
10 | */ | ||
11 | |||
12 | #ifndef _KIRKWOOD_AUDIO_H | ||
13 | #define _KIRKWOOD_AUDIO_H | ||
14 | |||
15 | #define KIRKWOOD_RECORD_WIN 0 | ||
16 | #define KIRKWOOD_PLAYBACK_WIN 1 | ||
17 | #define KIRKWOOD_MAX_AUDIO_WIN 2 | ||
18 | |||
19 | #define KIRKWOOD_AUDIO_WIN_BASE_REG(win) (0xA00 + ((win)<<3)) | ||
20 | #define KIRKWOOD_AUDIO_WIN_CTRL_REG(win) (0xA04 + ((win)<<3)) | ||
21 | |||
22 | |||
23 | #define KIRKWOOD_RECCTL 0x1000 | ||
24 | #define KIRKWOOD_RECCTL_SPDIF_EN (1<<11) | ||
25 | #define KIRKWOOD_RECCTL_I2S_EN (1<<10) | ||
26 | #define KIRKWOOD_RECCTL_PAUSE (1<<9) | ||
27 | #define KIRKWOOD_RECCTL_MUTE (1<<8) | ||
28 | #define KIRKWOOD_RECCTL_BURST_MASK (3<<5) | ||
29 | #define KIRKWOOD_RECCTL_BURST_128 (2<<5) | ||
30 | #define KIRKWOOD_RECCTL_BURST_32 (1<<5) | ||
31 | #define KIRKWOOD_RECCTL_MONO (1<<4) | ||
32 | #define KIRKWOOD_RECCTL_MONO_CHAN_RIGHT (1<<3) | ||
33 | #define KIRKWOOD_RECCTL_MONO_CHAN_LEFT (0<<3) | ||
34 | #define KIRKWOOD_RECCTL_SIZE_MASK (7<<0) | ||
35 | #define KIRKWOOD_RECCTL_SIZE_16 (7<<0) | ||
36 | #define KIRKWOOD_RECCTL_SIZE_16_C (3<<0) | ||
37 | #define KIRKWOOD_RECCTL_SIZE_20 (2<<0) | ||
38 | #define KIRKWOOD_RECCTL_SIZE_24 (1<<0) | ||
39 | #define KIRKWOOD_RECCTL_SIZE_32 (0<<0) | ||
40 | |||
41 | #define KIRKWOOD_REC_BUF_ADDR 0x1004 | ||
42 | #define KIRKWOOD_REC_BUF_SIZE 0x1008 | ||
43 | #define KIRKWOOD_REC_BYTE_COUNT 0x100C | ||
44 | |||
45 | #define KIRKWOOD_PLAYCTL 0x1100 | ||
46 | #define KIRKWOOD_PLAYCTL_PLAY_BUSY (1<<16) | ||
47 | #define KIRKWOOD_PLAYCTL_BURST_MASK (3<<11) | ||
48 | #define KIRKWOOD_PLAYCTL_BURST_128 (2<<11) | ||
49 | #define KIRKWOOD_PLAYCTL_BURST_32 (1<<11) | ||
50 | #define KIRKWOOD_PLAYCTL_PAUSE (1<<9) | ||
51 | #define KIRKWOOD_PLAYCTL_SPDIF_MUTE (1<<8) | ||
52 | #define KIRKWOOD_PLAYCTL_I2S_MUTE (1<<7) | ||
53 | #define KIRKWOOD_PLAYCTL_SPDIF_EN (1<<4) | ||
54 | #define KIRKWOOD_PLAYCTL_I2S_EN (1<<3) | ||
55 | #define KIRKWOOD_PLAYCTL_SIZE_MASK (7<<0) | ||
56 | #define KIRKWOOD_PLAYCTL_SIZE_16 (7<<0) | ||
57 | #define KIRKWOOD_PLAYCTL_SIZE_16_C (3<<0) | ||
58 | #define KIRKWOOD_PLAYCTL_SIZE_20 (2<<0) | ||
59 | #define KIRKWOOD_PLAYCTL_SIZE_24 (1<<0) | ||
60 | #define KIRKWOOD_PLAYCTL_SIZE_32 (0<<0) | ||
61 | |||
62 | #define KIRKWOOD_PLAY_BUF_ADDR 0x1104 | ||
63 | #define KIRKWOOD_PLAY_BUF_SIZE 0x1108 | ||
64 | #define KIRKWOOD_PLAY_BYTE_COUNT 0x110C | ||
65 | |||
66 | #define KIRKWOOD_DCO_CTL 0x1204 | ||
67 | #define KIRKWOOD_DCO_CTL_OFFSET_MASK (0xFFF<<2) | ||
68 | #define KIRKWOOD_DCO_CTL_OFFSET_0 (0x800<<2) | ||
69 | #define KIRKWOOD_DCO_CTL_FREQ_MASK (3<<0) | ||
70 | #define KIRKWOOD_DCO_CTL_FREQ_11 (0<<0) | ||
71 | #define KIRKWOOD_DCO_CTL_FREQ_12 (1<<0) | ||
72 | #define KIRKWOOD_DCO_CTL_FREQ_24 (2<<0) | ||
73 | |||
74 | #define KIRKWOOD_DCO_SPCR_STATUS 0x120c | ||
75 | #define KIRKWOOD_DCO_SPCR_STATUS_DCO_LOCK (1<<16) | ||
76 | |||
77 | #define KIRKWOOD_ERR_CAUSE 0x1300 | ||
78 | #define KIRKWOOD_ERR_MASK 0x1304 | ||
79 | |||
80 | #define KIRKWOOD_INT_CAUSE 0x1308 | ||
81 | #define KIRKWOOD_INT_MASK 0x130C | ||
82 | #define KIRKWOOD_INT_CAUSE_PLAY_BYTES (1<<14) | ||
83 | #define KIRKWOOD_INT_CAUSE_REC_BYTES (1<<13) | ||
84 | #define KIRKWOOD_INT_CAUSE_DMA_PLAY_END (1<<7) | ||
85 | #define KIRKWOOD_INT_CAUSE_DMA_PLAY_3Q (1<<6) | ||
86 | #define KIRKWOOD_INT_CAUSE_DMA_PLAY_HALF (1<<5) | ||
87 | #define KIRKWOOD_INT_CAUSE_DMA_PLAY_1Q (1<<4) | ||
88 | #define KIRKWOOD_INT_CAUSE_DMA_REC_END (1<<3) | ||
89 | #define KIRKWOOD_INT_CAUSE_DMA_REC_3Q (1<<2) | ||
90 | #define KIRKWOOD_INT_CAUSE_DMA_REC_HALF (1<<1) | ||
91 | #define KIRKWOOD_INT_CAUSE_DMA_REC_1Q (1<<0) | ||
92 | |||
93 | #define KIRKWOOD_REC_BYTE_INT_COUNT 0x1310 | ||
94 | #define KIRKWOOD_PLAY_BYTE_INT_COUNT 0x1314 | ||
95 | #define KIRKWOOD_BYTE_INT_COUNT_MASK 0xffffff | ||
96 | |||
97 | #define KIRKWOOD_I2S_PLAYCTL 0x2508 | ||
98 | #define KIRKWOOD_I2S_RECCTL 0x2408 | ||
99 | #define KIRKWOOD_I2S_CTL_JUST_MASK (0xf<<26) | ||
100 | #define KIRKWOOD_I2S_CTL_LJ (0<<26) | ||
101 | #define KIRKWOOD_I2S_CTL_I2S (5<<26) | ||
102 | #define KIRKWOOD_I2S_CTL_RJ (8<<26) | ||
103 | #define KIRKWOOD_I2S_CTL_SIZE_MASK (3<<30) | ||
104 | #define KIRKWOOD_I2S_CTL_SIZE_16 (3<<30) | ||
105 | #define KIRKWOOD_I2S_CTL_SIZE_20 (2<<30) | ||
106 | #define KIRKWOOD_I2S_CTL_SIZE_24 (1<<30) | ||
107 | #define KIRKWOOD_I2S_CTL_SIZE_32 (0<<30) | ||
108 | |||
109 | #define KIRKWOOD_AUDIO_BUF_MAX (16*1024*1024) | ||
110 | |||
111 | /* Theses values come from the marvell alsa driver */ | ||
112 | /* need to find where they come from */ | ||
113 | #define KIRKWOOD_SND_MIN_PERIODS 8 | ||
114 | #define KIRKWOOD_SND_MAX_PERIODS 16 | ||
115 | #define KIRKWOOD_SND_MIN_PERIOD_BYTES 0x4000 | ||
116 | #define KIRKWOOD_SND_MAX_PERIOD_BYTES 0x4000 | ||
117 | |||
118 | struct kirkwood_dma_data { | ||
119 | struct resource *mem; | ||
120 | void __iomem *io; | ||
121 | int irq; | ||
122 | int burst; | ||
123 | struct mbus_dram_target_info *dram; | ||
124 | }; | ||
125 | |||
126 | #endif | ||