aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/cs5535audio/cs5535audio.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/pci/cs5535audio/cs5535audio.c')
-rw-r--r--sound/pci/cs5535audio/cs5535audio.c74
1 files changed, 37 insertions, 37 deletions
diff --git a/sound/pci/cs5535audio/cs5535audio.c b/sound/pci/cs5535audio/cs5535audio.c
index 3f4379da4d26..189935659a99 100644
--- a/sound/pci/cs5535audio/cs5535audio.c
+++ b/sound/pci/cs5535audio/cs5535audio.c
@@ -53,7 +53,7 @@ static struct pci_device_id snd_cs5535audio_ids[] = {
53 53
54MODULE_DEVICE_TABLE(pci, snd_cs5535audio_ids); 54MODULE_DEVICE_TABLE(pci, snd_cs5535audio_ids);
55 55
56static void wait_till_cmd_acked(cs5535audio_t *cs5535au, unsigned long timeout) 56static void wait_till_cmd_acked(struct cs5535audio *cs5535au, unsigned long timeout)
57{ 57{
58 unsigned int tmp; 58 unsigned int tmp;
59 do { 59 do {
@@ -66,11 +66,11 @@ static void wait_till_cmd_acked(cs5535audio_t *cs5535au, unsigned long timeout)
66 snd_printk(KERN_ERR "Failure writing to cs5535 codec\n"); 66 snd_printk(KERN_ERR "Failure writing to cs5535 codec\n");
67} 67}
68 68
69static unsigned short snd_cs5535audio_codec_read(cs5535audio_t *cs5535au, 69static unsigned short snd_cs5535audio_codec_read(struct cs5535audio *cs5535au,
70 unsigned short reg) 70 unsigned short reg)
71{ 71{
72 unsigned int regdata; 72 unsigned int regdata;
73 int timeout; 73 unsigned int timeout;
74 unsigned int val; 74 unsigned int val;
75 75
76 regdata = ((unsigned int) reg) << 24; 76 regdata = ((unsigned int) reg) << 24;
@@ -93,8 +93,8 @@ static unsigned short snd_cs5535audio_codec_read(cs5535audio_t *cs5535au,
93 return (unsigned short) val; 93 return (unsigned short) val;
94} 94}
95 95
96static void snd_cs5535audio_codec_write(cs5535audio_t *cs5535au, 96static void snd_cs5535audio_codec_write(struct cs5535audio *cs5535au,
97 unsigned short reg, unsigned short val) 97 unsigned short reg, unsigned short val)
98{ 98{
99 unsigned int regdata; 99 unsigned int regdata;
100 100
@@ -108,27 +108,27 @@ static void snd_cs5535audio_codec_write(cs5535audio_t *cs5535au,
108 wait_till_cmd_acked(cs5535au, 50); 108 wait_till_cmd_acked(cs5535au, 50);
109} 109}
110 110
111static void snd_cs5535audio_ac97_codec_write(ac97_t *ac97, 111static void snd_cs5535audio_ac97_codec_write(struct snd_ac97 *ac97,
112 unsigned short reg, unsigned short val) 112 unsigned short reg, unsigned short val)
113{ 113{
114 cs5535audio_t *cs5535au = ac97->private_data; 114 struct cs5535audio *cs5535au = ac97->private_data;
115 snd_cs5535audio_codec_write(cs5535au, reg, val); 115 snd_cs5535audio_codec_write(cs5535au, reg, val);
116} 116}
117 117
118static unsigned short snd_cs5535audio_ac97_codec_read(ac97_t *ac97, 118static unsigned short snd_cs5535audio_ac97_codec_read(struct snd_ac97 *ac97,
119 unsigned short reg) 119 unsigned short reg)
120{ 120{
121 cs5535audio_t *cs5535au = ac97->private_data; 121 struct cs5535audio *cs5535au = ac97->private_data;
122 return snd_cs5535audio_codec_read(cs5535au, reg); 122 return snd_cs5535audio_codec_read(cs5535au, reg);
123} 123}
124 124
125static int snd_cs5535audio_mixer(cs5535audio_t *cs5535au) 125static int snd_cs5535audio_mixer(struct cs5535audio *cs5535au)
126{ 126{
127 snd_card_t *card = cs5535au->card; 127 struct snd_card *card = cs5535au->card;
128 ac97_bus_t *pbus; 128 struct snd_ac97_bus *pbus;
129 ac97_template_t ac97; 129 struct snd_ac97_template ac97;
130 int err; 130 int err;
131 static ac97_bus_ops_t ops = { 131 static struct snd_ac97_bus_ops ops = {
132 .write = snd_cs5535audio_ac97_codec_write, 132 .write = snd_cs5535audio_ac97_codec_write,
133 .read = snd_cs5535audio_ac97_codec_read, 133 .read = snd_cs5535audio_ac97_codec_read,
134 }; 134 };
@@ -149,14 +149,14 @@ static int snd_cs5535audio_mixer(cs5535audio_t *cs5535au)
149 return 0; 149 return 0;
150} 150}
151 151
152static void process_bm0_irq(cs5535audio_t *cs5535au) 152static void process_bm0_irq(struct cs5535audio *cs5535au)
153{ 153{
154 u8 bm_stat; 154 u8 bm_stat;
155 spin_lock(&cs5535au->reg_lock); 155 spin_lock(&cs5535au->reg_lock);
156 bm_stat = cs_readb(cs5535au, ACC_BM0_STATUS); 156 bm_stat = cs_readb(cs5535au, ACC_BM0_STATUS);
157 spin_unlock(&cs5535au->reg_lock); 157 spin_unlock(&cs5535au->reg_lock);
158 if (bm_stat & EOP) { 158 if (bm_stat & EOP) {
159 cs5535audio_dma_t *dma; 159 struct cs5535audio_dma *dma;
160 dma = cs5535au->playback_substream->runtime->private_data; 160 dma = cs5535au->playback_substream->runtime->private_data;
161 snd_pcm_period_elapsed(cs5535au->playback_substream); 161 snd_pcm_period_elapsed(cs5535au->playback_substream);
162 } else { 162 } else {
@@ -165,26 +165,26 @@ static void process_bm0_irq(cs5535audio_t *cs5535au)
165 } 165 }
166} 166}
167 167
168static void process_bm1_irq(cs5535audio_t *cs5535au) 168static void process_bm1_irq(struct cs5535audio *cs5535au)
169{ 169{
170 u8 bm_stat; 170 u8 bm_stat;
171 spin_lock(&cs5535au->reg_lock); 171 spin_lock(&cs5535au->reg_lock);
172 bm_stat = cs_readb(cs5535au, ACC_BM1_STATUS); 172 bm_stat = cs_readb(cs5535au, ACC_BM1_STATUS);
173 spin_unlock(&cs5535au->reg_lock); 173 spin_unlock(&cs5535au->reg_lock);
174 if (bm_stat & EOP) { 174 if (bm_stat & EOP) {
175 cs5535audio_dma_t *dma; 175 struct cs5535audio_dma *dma;
176 dma = cs5535au->capture_substream->runtime->private_data; 176 dma = cs5535au->capture_substream->runtime->private_data;
177 snd_pcm_period_elapsed(cs5535au->capture_substream); 177 snd_pcm_period_elapsed(cs5535au->capture_substream);
178 } 178 }
179} 179}
180 180
181static irqreturn_t snd_cs5535audio_interrupt(int irq, void *dev_id, 181static irqreturn_t snd_cs5535audio_interrupt(int irq, void *dev_id,
182 struct pt_regs *regs) 182 struct pt_regs *regs)
183{ 183{
184 u16 acc_irq_stat; 184 u16 acc_irq_stat;
185 u8 bm_stat; 185 u8 bm_stat;
186 unsigned char count; 186 unsigned char count;
187 cs5535audio_t *cs5535au = dev_id; 187 struct cs5535audio *cs5535au = dev_id;
188 188
189 if (cs5535au == NULL) 189 if (cs5535au == NULL)
190 return IRQ_NONE; 190 return IRQ_NONE;
@@ -235,7 +235,7 @@ static irqreturn_t snd_cs5535audio_interrupt(int irq, void *dev_id,
235 return IRQ_HANDLED; 235 return IRQ_HANDLED;
236} 236}
237 237
238static int snd_cs5535audio_free(cs5535audio_t *cs5535au) 238static int snd_cs5535audio_free(struct cs5535audio *cs5535au)
239{ 239{
240 synchronize_irq(cs5535au->irq); 240 synchronize_irq(cs5535au->irq);
241 pci_set_power_state(cs5535au->pci, 3); 241 pci_set_power_state(cs5535au->pci, 3);
@@ -249,20 +249,20 @@ static int snd_cs5535audio_free(cs5535audio_t *cs5535au)
249 return 0; 249 return 0;
250} 250}
251 251
252static int snd_cs5535audio_dev_free(snd_device_t *device) 252static int snd_cs5535audio_dev_free(struct snd_device *device)
253{ 253{
254 cs5535audio_t *cs5535au = device->device_data; 254 struct cs5535audio *cs5535au = device->device_data;
255 return snd_cs5535audio_free(cs5535au); 255 return snd_cs5535audio_free(cs5535au);
256} 256}
257 257
258static int __devinit snd_cs5535audio_create(snd_card_t *card, 258static int __devinit snd_cs5535audio_create(struct snd_card *card,
259 struct pci_dev *pci, 259 struct pci_dev *pci,
260 cs5535audio_t **rcs5535au) 260 struct cs5535audio **rcs5535au)
261{ 261{
262 cs5535audio_t *cs5535au; 262 struct cs5535audio *cs5535au;
263 263
264 int err; 264 int err;
265 static snd_device_ops_t ops = { 265 static struct snd_device_ops ops = {
266 .dev_free = snd_cs5535audio_dev_free, 266 .dev_free = snd_cs5535audio_dev_free,
267 }; 267 };
268 268
@@ -271,7 +271,7 @@ static int __devinit snd_cs5535audio_create(snd_card_t *card,
271 return err; 271 return err;
272 272
273 if (pci_set_dma_mask(pci, DMA_32BIT_MASK) < 0 || 273 if (pci_set_dma_mask(pci, DMA_32BIT_MASK) < 0 ||
274 pci_set_consistent_dma_mask(pci, DMA_32BIT_MASK) < 0) { 274 pci_set_consistent_dma_mask(pci, DMA_32BIT_MASK) < 0) {
275 printk(KERN_WARNING "unable to get 32bit dma\n"); 275 printk(KERN_WARNING "unable to get 32bit dma\n");
276 err = -ENXIO; 276 err = -ENXIO;
277 goto pcifail; 277 goto pcifail;
@@ -296,7 +296,7 @@ static int __devinit snd_cs5535audio_create(snd_card_t *card,
296 cs5535au->port = pci_resource_start(pci, 0); 296 cs5535au->port = pci_resource_start(pci, 0);
297 297
298 if (request_irq(pci->irq, snd_cs5535audio_interrupt, 298 if (request_irq(pci->irq, snd_cs5535audio_interrupt,
299 SA_INTERRUPT|SA_SHIRQ, "CS5535 Audio", cs5535au)) { 299 SA_INTERRUPT|SA_SHIRQ, "CS5535 Audio", cs5535au)) {
300 snd_printk("unable to grab IRQ %d\n", pci->irq); 300 snd_printk("unable to grab IRQ %d\n", pci->irq);
301 err = -EBUSY; 301 err = -EBUSY;
302 goto sndfail; 302 goto sndfail;
@@ -306,7 +306,7 @@ static int __devinit snd_cs5535audio_create(snd_card_t *card,
306 pci_set_master(pci); 306 pci_set_master(pci);
307 307
308 if ((err = snd_device_new(card, SNDRV_DEV_LOWLEVEL, 308 if ((err = snd_device_new(card, SNDRV_DEV_LOWLEVEL,
309 cs5535au, &ops)) < 0) 309 cs5535au, &ops)) < 0)
310 goto sndfail; 310 goto sndfail;
311 311
312 snd_card_set_dev(card, &pci->dev); 312 snd_card_set_dev(card, &pci->dev);
@@ -324,11 +324,11 @@ pcifail:
324} 324}
325 325
326static int __devinit snd_cs5535audio_probe(struct pci_dev *pci, 326static int __devinit snd_cs5535audio_probe(struct pci_dev *pci,
327 const struct pci_device_id *pci_id) 327 const struct pci_device_id *pci_id)
328{ 328{
329 static int dev; 329 static int dev;
330 snd_card_t *card; 330 struct snd_card *card;
331 cs5535audio_t *cs5535au; 331 struct cs5535audio *cs5535au;
332 int err; 332 int err;
333 333
334 if (dev >= SNDRV_CARDS) 334 if (dev >= SNDRV_CARDS)