aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sound/pci/cs5535audio/cs5535audio.c74
-rw-r--r--sound/pci/cs5535audio/cs5535audio.h44
-rw-r--r--sound/pci/cs5535audio/cs5535audio_pcm.c128
3 files changed, 123 insertions, 123 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)
diff --git a/sound/pci/cs5535audio/cs5535audio.h b/sound/pci/cs5535audio/cs5535audio.h
index 774185e026d4..5e55a1a1ed65 100644
--- a/sound/pci/cs5535audio/cs5535audio.h
+++ b/sound/pci/cs5535audio/cs5535audio.h
@@ -78,46 +78,46 @@
78#define PRD_EOP 0x4000 78#define PRD_EOP 0x4000
79#define PRD_EOT 0x8000 79#define PRD_EOT 0x8000
80 80
81typedef struct _snd_cs5535audio cs5535audio_t;
82typedef struct snd_cs5535audio_dma cs5535audio_dma_t;
83typedef struct snd_cs5535audio_dma_ops cs5535audio_dma_ops_t;
84
85enum { CS5535AUDIO_DMA_PLAYBACK, CS5535AUDIO_DMA_CAPTURE, NUM_CS5535AUDIO_DMAS }; 81enum { CS5535AUDIO_DMA_PLAYBACK, CS5535AUDIO_DMA_CAPTURE, NUM_CS5535AUDIO_DMAS };
86struct snd_cs5535audio_dma_ops { 82
83struct cs5535audio;
84
85struct cs5535audio_dma_ops {
87 int type; 86 int type;
88 void (*enable_dma)(cs5535audio_t *cs5535au); 87 void (*enable_dma)(struct cs5535audio *cs5535au);
89 void (*disable_dma)(cs5535audio_t *cs5535au); 88 void (*disable_dma)(struct cs5535audio *cs5535au);
90 void (*pause_dma)(cs5535audio_t *cs5535au); 89 void (*pause_dma)(struct cs5535audio *cs5535au);
91 void (*setup_prd)(cs5535audio_t *cs5535au, u32 prd_addr); 90 void (*setup_prd)(struct cs5535audio *cs5535au, u32 prd_addr);
92 u32 (*read_dma_pntr)(cs5535audio_t *cs5535au); 91 u32 (*read_dma_pntr)(struct cs5535audio *cs5535au);
93}; 92};
94 93
95typedef struct cs5535audio_dma_desc { 94struct cs5535audio_dma_desc {
96 u32 addr; 95 u32 addr;
97 u16 size; 96 u16 size;
98 u16 ctlreserved; 97 u16 ctlreserved;
99} cs5535audio_dma_desc_t; 98};
100 99
101struct snd_cs5535audio_dma { 100struct cs5535audio_dma {
102 const cs5535audio_dma_ops_t *ops; 101 const struct cs5535audio_dma_ops *ops;
103 struct snd_dma_buffer desc_buf; 102 struct snd_dma_buffer desc_buf;
104 snd_pcm_substream_t *substream; 103 struct snd_pcm_substream *substream;
105 unsigned int buf_addr, buf_bytes; 104 unsigned int buf_addr, buf_bytes;
106 unsigned int period_bytes, periods; 105 unsigned int period_bytes, periods;
107}; 106};
108 107
109struct _snd_cs5535audio { 108struct cs5535audio {
110 snd_card_t *card; 109 struct snd_card *card;
111 ac97_t *ac97; 110 struct snd_ac97 *ac97;
112 int irq; 111 int irq;
113 struct pci_dev *pci; 112 struct pci_dev *pci;
114 unsigned long port; 113 unsigned long port;
115 spinlock_t reg_lock; 114 spinlock_t reg_lock;
116 snd_pcm_substream_t *playback_substream; 115 struct snd_pcm_substream *playback_substream;
117 snd_pcm_substream_t *capture_substream; 116 struct snd_pcm_substream *capture_substream;
118 cs5535audio_dma_t dmas[NUM_CS5535AUDIO_DMAS]; 117 struct cs5535audio_dma dmas[NUM_CS5535AUDIO_DMAS];
119}; 118};
120 119
121int __devinit snd_cs5535audio_pcm(cs5535audio_t *cs5535audio); 120int __devinit snd_cs5535audio_pcm(struct cs5535audio *cs5535audio);
121
122#endif /* __SOUND_CS5535AUDIO_H */ 122#endif /* __SOUND_CS5535AUDIO_H */
123 123
diff --git a/sound/pci/cs5535audio/cs5535audio_pcm.c b/sound/pci/cs5535audio/cs5535audio_pcm.c
index d32b23f202cd..60bb82b2ff47 100644
--- a/sound/pci/cs5535audio/cs5535audio_pcm.c
+++ b/sound/pci/cs5535audio/cs5535audio_pcm.c
@@ -35,7 +35,7 @@
35#include <sound/ac97_codec.h> 35#include <sound/ac97_codec.h>
36#include "cs5535audio.h" 36#include "cs5535audio.h"
37 37
38static snd_pcm_hardware_t snd_cs5535audio_playback = 38static struct snd_pcm_hardware snd_cs5535audio_playback =
39{ 39{
40 .info = ( 40 .info = (
41 SNDRV_PCM_INFO_MMAP | 41 SNDRV_PCM_INFO_MMAP |
@@ -64,7 +64,7 @@ static snd_pcm_hardware_t snd_cs5535audio_playback =
64 .fifo_size = 0, 64 .fifo_size = 0,
65}; 65};
66 66
67static snd_pcm_hardware_t snd_cs5535audio_capture = 67static struct snd_pcm_hardware snd_cs5535audio_capture =
68{ 68{
69 .info = ( 69 .info = (
70 SNDRV_PCM_INFO_MMAP | 70 SNDRV_PCM_INFO_MMAP |
@@ -92,11 +92,11 @@ static snd_pcm_hardware_t snd_cs5535audio_capture =
92 .fifo_size = 0, 92 .fifo_size = 0,
93}; 93};
94 94
95static int snd_cs5535audio_playback_open(snd_pcm_substream_t *substream) 95static int snd_cs5535audio_playback_open(struct snd_pcm_substream *substream)
96{ 96{
97 int err; 97 int err;
98 cs5535audio_t *cs5535au = snd_pcm_substream_chip(substream); 98 struct cs5535audio *cs5535au = snd_pcm_substream_chip(substream);
99 snd_pcm_runtime_t *runtime = substream->runtime; 99 struct snd_pcm_runtime *runtime = substream->runtime;
100 100
101 runtime->hw = snd_cs5535audio_playback; 101 runtime->hw = snd_cs5535audio_playback;
102 cs5535au->playback_substream = substream; 102 cs5535au->playback_substream = substream;
@@ -109,23 +109,23 @@ static int snd_cs5535audio_playback_open(snd_pcm_substream_t *substream)
109 return 0; 109 return 0;
110} 110}
111 111
112static int snd_cs5535audio_playback_close(snd_pcm_substream_t *substream) 112static int snd_cs5535audio_playback_close(struct snd_pcm_substream *substream)
113{ 113{
114 return 0; 114 return 0;
115} 115}
116 116
117#define CS5535AUDIO_DESC_LIST_SIZE \ 117#define CS5535AUDIO_DESC_LIST_SIZE \
118 PAGE_ALIGN(CS5535AUDIO_MAX_DESCRIPTORS * sizeof(cs5535audio_dma_desc_t)) 118 PAGE_ALIGN(CS5535AUDIO_MAX_DESCRIPTORS * sizeof(struct cs5535audio_dma_desc))
119 119
120static int cs5535audio_build_dma_packets(cs5535audio_t *cs5535au, 120static int cs5535audio_build_dma_packets(struct cs5535audio *cs5535au,
121 cs5535audio_dma_t *dma, 121 struct cs5535audio_dma *dma,
122 snd_pcm_substream_t *substream, 122 struct snd_pcm_substream *substream,
123 unsigned int periods, 123 unsigned int periods,
124 unsigned int period_bytes) 124 unsigned int period_bytes)
125{ 125{
126 unsigned int i; 126 unsigned int i;
127 u32 addr, desc_addr, jmpprd_addr; 127 u32 addr, desc_addr, jmpprd_addr;
128 cs5535audio_dma_desc_t *lastdesc; 128 struct cs5535audio_dma_desc *lastdesc;
129 129
130 if (periods > CS5535AUDIO_MAX_DESCRIPTORS) 130 if (periods > CS5535AUDIO_MAX_DESCRIPTORS)
131 return -ENOMEM; 131 return -ENOMEM;
@@ -147,21 +147,21 @@ static int cs5535audio_build_dma_packets(cs5535audio_t *cs5535au,
147 addr = (u32) substream->runtime->dma_addr; 147 addr = (u32) substream->runtime->dma_addr;
148 desc_addr = (u32) dma->desc_buf.addr; 148 desc_addr = (u32) dma->desc_buf.addr;
149 for (i = 0; i < periods; i++) { 149 for (i = 0; i < periods; i++) {
150 cs5535audio_dma_desc_t *desc = 150 struct cs5535audio_dma_desc *desc =
151 &((cs5535audio_dma_desc_t *) dma->desc_buf.area)[i]; 151 &((struct cs5535audio_dma_desc *) dma->desc_buf.area)[i];
152 desc->addr = cpu_to_le32(addr); 152 desc->addr = cpu_to_le32(addr);
153 desc->size = cpu_to_le32(period_bytes); 153 desc->size = cpu_to_le32(period_bytes);
154 desc->ctlreserved = cpu_to_le32(PRD_EOP); 154 desc->ctlreserved = cpu_to_le32(PRD_EOP);
155 desc_addr += sizeof(cs5535audio_dma_desc_t); 155 desc_addr += sizeof(struct cs5535audio_dma_desc);
156 addr += period_bytes; 156 addr += period_bytes;
157 } 157 }
158 /* we reserved one dummy descriptor at the end to do the PRD jump */ 158 /* we reserved one dummy descriptor at the end to do the PRD jump */
159 lastdesc = &((cs5535audio_dma_desc_t *) dma->desc_buf.area)[periods]; 159 lastdesc = &((struct cs5535audio_dma_desc *) dma->desc_buf.area)[periods];
160 lastdesc->addr = cpu_to_le32((u32) dma->desc_buf.addr); 160 lastdesc->addr = cpu_to_le32((u32) dma->desc_buf.addr);
161 lastdesc->size = 0; 161 lastdesc->size = 0;
162 lastdesc->ctlreserved = cpu_to_le32(PRD_JMP); 162 lastdesc->ctlreserved = cpu_to_le32(PRD_JMP);
163 jmpprd_addr = cpu_to_le32(lastdesc->addr + 163 jmpprd_addr = cpu_to_le32(lastdesc->addr +
164 (sizeof(cs5535audio_dma_desc_t)*periods)); 164 (sizeof(struct cs5535audio_dma_desc)*periods));
165 165
166 dma->period_bytes = period_bytes; 166 dma->period_bytes = period_bytes;
167 dma->periods = periods; 167 dma->periods = periods;
@@ -172,71 +172,71 @@ static int cs5535audio_build_dma_packets(cs5535audio_t *cs5535au,
172 return 0; 172 return 0;
173} 173}
174 174
175static void cs5535audio_playback_enable_dma(cs5535audio_t *cs5535au) 175static void cs5535audio_playback_enable_dma(struct cs5535audio *cs5535au)
176{ 176{
177 cs_writeb(cs5535au, ACC_BM0_CMD, BM_CTL_EN); 177 cs_writeb(cs5535au, ACC_BM0_CMD, BM_CTL_EN);
178} 178}
179 179
180static void cs5535audio_playback_disable_dma(cs5535audio_t *cs5535au) 180static void cs5535audio_playback_disable_dma(struct cs5535audio *cs5535au)
181{ 181{
182 cs_writeb(cs5535au, ACC_BM0_CMD, 0); 182 cs_writeb(cs5535au, ACC_BM0_CMD, 0);
183} 183}
184 184
185static void cs5535audio_playback_pause_dma(cs5535audio_t *cs5535au) 185static void cs5535audio_playback_pause_dma(struct cs5535audio *cs5535au)
186{ 186{
187 cs_writeb(cs5535au, ACC_BM0_CMD, BM_CTL_PAUSE); 187 cs_writeb(cs5535au, ACC_BM0_CMD, BM_CTL_PAUSE);
188} 188}
189 189
190static void cs5535audio_playback_setup_prd(cs5535audio_t *cs5535au, 190static void cs5535audio_playback_setup_prd(struct cs5535audio *cs5535au,
191 u32 prd_addr) 191 u32 prd_addr)
192{ 192{
193 cs_writel(cs5535au, ACC_BM0_PRD, prd_addr); 193 cs_writel(cs5535au, ACC_BM0_PRD, prd_addr);
194} 194}
195 195
196static u32 cs5535audio_playback_read_dma_pntr(cs5535audio_t *cs5535au) 196static u32 cs5535audio_playback_read_dma_pntr(struct cs5535audio *cs5535au)
197{ 197{
198 return cs_readl(cs5535au, ACC_BM0_PNTR); 198 return cs_readl(cs5535au, ACC_BM0_PNTR);
199} 199}
200 200
201static void cs5535audio_capture_enable_dma(cs5535audio_t *cs5535au) 201static void cs5535audio_capture_enable_dma(struct cs5535audio *cs5535au)
202{ 202{
203 cs_writeb(cs5535au, ACC_BM1_CMD, BM_CTL_EN); 203 cs_writeb(cs5535au, ACC_BM1_CMD, BM_CTL_EN);
204} 204}
205 205
206static void cs5535audio_capture_disable_dma(cs5535audio_t *cs5535au) 206static void cs5535audio_capture_disable_dma(struct cs5535audio *cs5535au)
207{ 207{
208 cs_writeb(cs5535au, ACC_BM1_CMD, 0); 208 cs_writeb(cs5535au, ACC_BM1_CMD, 0);
209} 209}
210 210
211static void cs5535audio_capture_pause_dma(cs5535audio_t *cs5535au) 211static void cs5535audio_capture_pause_dma(struct cs5535audio *cs5535au)
212{ 212{
213 cs_writeb(cs5535au, ACC_BM1_CMD, BM_CTL_PAUSE); 213 cs_writeb(cs5535au, ACC_BM1_CMD, BM_CTL_PAUSE);
214} 214}
215 215
216static void cs5535audio_capture_setup_prd(cs5535audio_t *cs5535au, 216static void cs5535audio_capture_setup_prd(struct cs5535audio *cs5535au,
217 u32 prd_addr) 217 u32 prd_addr)
218{ 218{
219 cs_writel(cs5535au, ACC_BM1_PRD, prd_addr); 219 cs_writel(cs5535au, ACC_BM1_PRD, prd_addr);
220} 220}
221 221
222static u32 cs5535audio_capture_read_dma_pntr(cs5535audio_t *cs5535au) 222static u32 cs5535audio_capture_read_dma_pntr(struct cs5535audio *cs5535au)
223{ 223{
224 return cs_readl(cs5535au, ACC_BM1_PNTR); 224 return cs_readl(cs5535au, ACC_BM1_PNTR);
225} 225}
226 226
227static void cs5535audio_clear_dma_packets(cs5535audio_t *cs5535au, 227static void cs5535audio_clear_dma_packets(struct cs5535audio *cs5535au,
228 cs5535audio_dma_t *dma, 228 struct cs5535audio_dma *dma,
229 snd_pcm_substream_t *substream) 229 struct snd_pcm_substream *substream)
230{ 230{
231 snd_dma_free_pages(&dma->desc_buf); 231 snd_dma_free_pages(&dma->desc_buf);
232 dma->desc_buf.area = NULL; 232 dma->desc_buf.area = NULL;
233} 233}
234 234
235static int snd_cs5535audio_hw_params(snd_pcm_substream_t *substream, 235static int snd_cs5535audio_hw_params(struct snd_pcm_substream *substream,
236 snd_pcm_hw_params_t *hw_params) 236 struct snd_pcm_hw_params *hw_params)
237{ 237{
238 cs5535audio_t *cs5535au = snd_pcm_substream_chip(substream); 238 struct cs5535audio *cs5535au = snd_pcm_substream_chip(substream);
239 cs5535audio_dma_t *dma = substream->runtime->private_data; 239 struct cs5535audio_dma *dma = substream->runtime->private_data;
240 int err; 240 int err;
241 241
242 err = snd_pcm_lib_malloc_pages(substream, 242 err = snd_pcm_lib_malloc_pages(substream,
@@ -247,31 +247,31 @@ static int snd_cs5535audio_hw_params(snd_pcm_substream_t *substream,
247 dma->buf_bytes = params_buffer_bytes(hw_params); 247 dma->buf_bytes = params_buffer_bytes(hw_params);
248 248
249 err = cs5535audio_build_dma_packets(cs5535au, dma, substream, 249 err = cs5535audio_build_dma_packets(cs5535au, dma, substream,
250 params_periods(hw_params), 250 params_periods(hw_params),
251 params_period_bytes(hw_params)); 251 params_period_bytes(hw_params));
252 return err; 252 return err;
253} 253}
254 254
255static int snd_cs5535audio_hw_free(snd_pcm_substream_t *substream) 255static int snd_cs5535audio_hw_free(struct snd_pcm_substream *substream)
256{ 256{
257 cs5535audio_t *cs5535au = snd_pcm_substream_chip(substream); 257 struct cs5535audio *cs5535au = snd_pcm_substream_chip(substream);
258 cs5535audio_dma_t *dma = substream->runtime->private_data; 258 struct cs5535audio_dma *dma = substream->runtime->private_data;
259 259
260 cs5535audio_clear_dma_packets(cs5535au, dma, substream); 260 cs5535audio_clear_dma_packets(cs5535au, dma, substream);
261 return snd_pcm_lib_free_pages(substream); 261 return snd_pcm_lib_free_pages(substream);
262} 262}
263 263
264static int snd_cs5535audio_playback_prepare(snd_pcm_substream_t *substream) 264static int snd_cs5535audio_playback_prepare(struct snd_pcm_substream *substream)
265{ 265{
266 cs5535audio_t *cs5535au = snd_pcm_substream_chip(substream); 266 struct cs5535audio *cs5535au = snd_pcm_substream_chip(substream);
267 return snd_ac97_set_rate(cs5535au->ac97, AC97_PCM_FRONT_DAC_RATE, 267 return snd_ac97_set_rate(cs5535au->ac97, AC97_PCM_FRONT_DAC_RATE,
268 substream->runtime->rate); 268 substream->runtime->rate);
269} 269}
270 270
271static int snd_cs5535audio_trigger(snd_pcm_substream_t *substream, int cmd) 271static int snd_cs5535audio_trigger(struct snd_pcm_substream *substream, int cmd)
272{ 272{
273 cs5535audio_t *cs5535au = snd_pcm_substream_chip(substream); 273 struct cs5535audio *cs5535au = snd_pcm_substream_chip(substream);
274 cs5535audio_dma_t *dma = substream->runtime->private_data; 274 struct cs5535audio_dma *dma = substream->runtime->private_data;
275 int err = 0; 275 int err = 0;
276 276
277 spin_lock(&cs5535au->reg_lock); 277 spin_lock(&cs5535au->reg_lock);
@@ -297,12 +297,12 @@ static int snd_cs5535audio_trigger(snd_pcm_substream_t *substream, int cmd)
297 return err; 297 return err;
298} 298}
299 299
300static snd_pcm_uframes_t snd_cs5535audio_pcm_pointer(snd_pcm_substream_t 300static snd_pcm_uframes_t snd_cs5535audio_pcm_pointer(struct snd_pcm_substream
301 *substream) 301 *substream)
302{ 302{
303 cs5535audio_t *cs5535au = snd_pcm_substream_chip(substream); 303 struct cs5535audio *cs5535au = snd_pcm_substream_chip(substream);
304 u32 curdma; 304 u32 curdma;
305 cs5535audio_dma_t *dma; 305 struct cs5535audio_dma *dma;
306 306
307 dma = substream->runtime->private_data; 307 dma = substream->runtime->private_data;
308 curdma = dma->ops->read_dma_pntr(cs5535au); 308 curdma = dma->ops->read_dma_pntr(cs5535au);
@@ -320,11 +320,11 @@ static snd_pcm_uframes_t snd_cs5535audio_pcm_pointer(snd_pcm_substream_t
320 return bytes_to_frames(substream->runtime, curdma); 320 return bytes_to_frames(substream->runtime, curdma);
321} 321}
322 322
323static int snd_cs5535audio_capture_open(snd_pcm_substream_t *substream) 323static int snd_cs5535audio_capture_open(struct snd_pcm_substream *substream)
324{ 324{
325 int err; 325 int err;
326 cs5535audio_t *cs5535au = snd_pcm_substream_chip(substream); 326 struct cs5535audio *cs5535au = snd_pcm_substream_chip(substream);
327 snd_pcm_runtime_t *runtime = substream->runtime; 327 struct snd_pcm_runtime *runtime = substream->runtime;
328 328
329 runtime->hw = snd_cs5535audio_capture; 329 runtime->hw = snd_cs5535audio_capture;
330 cs5535au->capture_substream = substream; 330 cs5535au->capture_substream = substream;
@@ -336,19 +336,19 @@ static int snd_cs5535audio_capture_open(snd_pcm_substream_t *substream)
336 return 0; 336 return 0;
337} 337}
338 338
339static int snd_cs5535audio_capture_close(snd_pcm_substream_t *substream) 339static int snd_cs5535audio_capture_close(struct snd_pcm_substream *substream)
340{ 340{
341 return 0; 341 return 0;
342} 342}
343 343
344static int snd_cs5535audio_capture_prepare(snd_pcm_substream_t *substream) 344static int snd_cs5535audio_capture_prepare(struct snd_pcm_substream *substream)
345{ 345{
346 cs5535audio_t *cs5535au = snd_pcm_substream_chip(substream); 346 struct cs5535audio *cs5535au = snd_pcm_substream_chip(substream);
347 return snd_ac97_set_rate(cs5535au->ac97, AC97_PCM_LR_ADC_RATE, 347 return snd_ac97_set_rate(cs5535au->ac97, AC97_PCM_LR_ADC_RATE,
348 substream->runtime->rate); 348 substream->runtime->rate);
349} 349}
350 350
351static snd_pcm_ops_t snd_cs5535audio_playback_ops = { 351static struct snd_pcm_ops snd_cs5535audio_playback_ops = {
352 .open = snd_cs5535audio_playback_open, 352 .open = snd_cs5535audio_playback_open,
353 .close = snd_cs5535audio_playback_close, 353 .close = snd_cs5535audio_playback_close,
354 .ioctl = snd_pcm_lib_ioctl, 354 .ioctl = snd_pcm_lib_ioctl,
@@ -359,7 +359,7 @@ static snd_pcm_ops_t snd_cs5535audio_playback_ops = {
359 .pointer = snd_cs5535audio_pcm_pointer, 359 .pointer = snd_cs5535audio_pcm_pointer,
360}; 360};
361 361
362static snd_pcm_ops_t snd_cs5535audio_capture_ops = { 362static struct snd_pcm_ops snd_cs5535audio_capture_ops = {
363 .open = snd_cs5535audio_capture_open, 363 .open = snd_cs5535audio_capture_open,
364 .close = snd_cs5535audio_capture_close, 364 .close = snd_cs5535audio_capture_close,
365 .ioctl = snd_pcm_lib_ioctl, 365 .ioctl = snd_pcm_lib_ioctl,
@@ -370,7 +370,7 @@ static snd_pcm_ops_t snd_cs5535audio_capture_ops = {
370 .pointer = snd_cs5535audio_pcm_pointer, 370 .pointer = snd_cs5535audio_pcm_pointer,
371}; 371};
372 372
373static cs5535audio_dma_ops_t snd_cs5535audio_playback_dma_ops = { 373static struct cs5535audio_dma_ops snd_cs5535audio_playback_dma_ops = {
374 .type = CS5535AUDIO_DMA_PLAYBACK, 374 .type = CS5535AUDIO_DMA_PLAYBACK,
375 .enable_dma = cs5535audio_playback_enable_dma, 375 .enable_dma = cs5535audio_playback_enable_dma,
376 .disable_dma = cs5535audio_playback_disable_dma, 376 .disable_dma = cs5535audio_playback_disable_dma,
@@ -379,7 +379,7 @@ static cs5535audio_dma_ops_t snd_cs5535audio_playback_dma_ops = {
379 .read_dma_pntr = cs5535audio_playback_read_dma_pntr, 379 .read_dma_pntr = cs5535audio_playback_read_dma_pntr,
380}; 380};
381 381
382static cs5535audio_dma_ops_t snd_cs5535audio_capture_dma_ops = { 382static struct cs5535audio_dma_ops snd_cs5535audio_capture_dma_ops = {
383 .type = CS5535AUDIO_DMA_CAPTURE, 383 .type = CS5535AUDIO_DMA_CAPTURE,
384 .enable_dma = cs5535audio_capture_enable_dma, 384 .enable_dma = cs5535audio_capture_enable_dma,
385 .disable_dma = cs5535audio_capture_disable_dma, 385 .disable_dma = cs5535audio_capture_disable_dma,
@@ -388,9 +388,9 @@ static cs5535audio_dma_ops_t snd_cs5535audio_capture_dma_ops = {
388 .read_dma_pntr = cs5535audio_capture_read_dma_pntr, 388 .read_dma_pntr = cs5535audio_capture_read_dma_pntr,
389}; 389};
390 390
391int __devinit snd_cs5535audio_pcm(cs5535audio_t *cs5535au) 391int __devinit snd_cs5535audio_pcm(struct cs5535audio *cs5535au)
392{ 392{
393 snd_pcm_t *pcm; 393 struct snd_pcm *pcm;
394 int err; 394 int err;
395 395
396 err = snd_pcm_new(cs5535au->card, "CS5535 Audio", 0, 1, 1, &pcm); 396 err = snd_pcm_new(cs5535au->card, "CS5535 Audio", 0, 1, 1, &pcm);