aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/maestro3.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2005-11-17 09:05:09 -0500
committerJaroslav Kysela <perex@suse.cz>2006-01-03 06:19:41 -0500
commit3470c29dbde2aa8320acb29a654b5a72756ee58b (patch)
treeb97f5a716ceeb2b803cf752d9e123990247cc134 /sound/pci/maestro3.c
parent6b75a9d8b6c794d4c41d1b875c3e8e920b09e151 (diff)
[ALSA] Remove xxx_t typedefs: PCI Maestro3
Modules: Maestro3 driver Remove xxx_t typedefs from the PCI Maestro3 driver. Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/maestro3.c')
-rw-r--r--sound/pci/maestro3.c223
1 files changed, 111 insertions, 112 deletions
diff --git a/sound/pci/maestro3.c b/sound/pci/maestro3.c
index ede7a75bfe08..9878595abe34 100644
--- a/sound/pci/maestro3.c
+++ b/sound/pci/maestro3.c
@@ -767,9 +767,6 @@ MODULE_PARM_DESC(amp_gpio, "GPIO pin number for external amp. (default = -1)");
767/* 767/*
768 */ 768 */
769 769
770typedef struct snd_m3_dma m3_dma_t;
771typedef struct snd_m3 m3_t;
772
773/* quirk lists */ 770/* quirk lists */
774struct m3_quirk { 771struct m3_quirk {
775 const char *name; /* device name */ 772 const char *name; /* device name */
@@ -791,11 +788,10 @@ struct m3_list {
791 int max; 788 int max;
792}; 789};
793 790
794struct snd_m3_dma { 791struct m3_dma {
795 792
796 int number; 793 int number;
797 m3_t *chip; 794 struct snd_pcm_substream *substream;
798 snd_pcm_substream_t *substream;
799 795
800 struct assp_instance { 796 struct assp_instance {
801 unsigned short code, data; 797 unsigned short code, data;
@@ -821,16 +817,16 @@ struct snd_m3_dma {
821 817
822struct snd_m3 { 818struct snd_m3 {
823 819
824 snd_card_t *card; 820 struct snd_card *card;
825 821
826 unsigned long iobase; 822 unsigned long iobase;
827 823
828 int irq; 824 int irq;
829 unsigned int allegro_flag : 1; 825 unsigned int allegro_flag : 1;
830 826
831 ac97_t *ac97; 827 struct snd_ac97 *ac97;
832 828
833 snd_pcm_t *pcm; 829 struct snd_pcm *pcm;
834 830
835 struct pci_dev *pci; 831 struct pci_dev *pci;
836 struct m3_quirk *quirk; 832 struct m3_quirk *quirk;
@@ -851,17 +847,17 @@ struct snd_m3 {
851 int amp_gpio; 847 int amp_gpio;
852 848
853 /* midi */ 849 /* midi */
854 snd_rawmidi_t *rmidi; 850 struct snd_rawmidi *rmidi;
855 851
856 /* pcm streams */ 852 /* pcm streams */
857 int num_substreams; 853 int num_substreams;
858 m3_dma_t *substreams; 854 struct m3_dma *substreams;
859 855
860 spinlock_t reg_lock; 856 spinlock_t reg_lock;
861 spinlock_t ac97_lock; 857 spinlock_t ac97_lock;
862 858
863 snd_kcontrol_t *master_switch; 859 struct snd_kcontrol *master_switch;
864 snd_kcontrol_t *master_volume; 860 struct snd_kcontrol *master_volume;
865 struct tasklet_struct hwvol_tq; 861 struct tasklet_struct hwvol_tq;
866 862
867#ifdef CONFIG_PM 863#ifdef CONFIG_PM
@@ -1021,22 +1017,22 @@ static struct m3_hv_quirk m3_hv_quirk_list[] = {
1021 * lowlevel functions 1017 * lowlevel functions
1022 */ 1018 */
1023 1019
1024static inline void snd_m3_outw(m3_t *chip, u16 value, unsigned long reg) 1020static inline void snd_m3_outw(struct snd_m3 *chip, u16 value, unsigned long reg)
1025{ 1021{
1026 outw(value, chip->iobase + reg); 1022 outw(value, chip->iobase + reg);
1027} 1023}
1028 1024
1029static inline u16 snd_m3_inw(m3_t *chip, unsigned long reg) 1025static inline u16 snd_m3_inw(struct snd_m3 *chip, unsigned long reg)
1030{ 1026{
1031 return inw(chip->iobase + reg); 1027 return inw(chip->iobase + reg);
1032} 1028}
1033 1029
1034static inline void snd_m3_outb(m3_t *chip, u8 value, unsigned long reg) 1030static inline void snd_m3_outb(struct snd_m3 *chip, u8 value, unsigned long reg)
1035{ 1031{
1036 outb(value, chip->iobase + reg); 1032 outb(value, chip->iobase + reg);
1037} 1033}
1038 1034
1039static inline u8 snd_m3_inb(m3_t *chip, unsigned long reg) 1035static inline u8 snd_m3_inb(struct snd_m3 *chip, unsigned long reg)
1040{ 1036{
1041 return inb(chip->iobase + reg); 1037 return inb(chip->iobase + reg);
1042} 1038}
@@ -1045,28 +1041,28 @@ static inline u8 snd_m3_inb(m3_t *chip, unsigned long reg)
1045 * access 16bit words to the code or data regions of the dsp's memory. 1041 * access 16bit words to the code or data regions of the dsp's memory.
1046 * index addresses 16bit words. 1042 * index addresses 16bit words.
1047 */ 1043 */
1048static u16 snd_m3_assp_read(m3_t *chip, u16 region, u16 index) 1044static u16 snd_m3_assp_read(struct snd_m3 *chip, u16 region, u16 index)
1049{ 1045{
1050 snd_m3_outw(chip, region & MEMTYPE_MASK, DSP_PORT_MEMORY_TYPE); 1046 snd_m3_outw(chip, region & MEMTYPE_MASK, DSP_PORT_MEMORY_TYPE);
1051 snd_m3_outw(chip, index, DSP_PORT_MEMORY_INDEX); 1047 snd_m3_outw(chip, index, DSP_PORT_MEMORY_INDEX);
1052 return snd_m3_inw(chip, DSP_PORT_MEMORY_DATA); 1048 return snd_m3_inw(chip, DSP_PORT_MEMORY_DATA);
1053} 1049}
1054 1050
1055static void snd_m3_assp_write(m3_t *chip, u16 region, u16 index, u16 data) 1051static void snd_m3_assp_write(struct snd_m3 *chip, u16 region, u16 index, u16 data)
1056{ 1052{
1057 snd_m3_outw(chip, region & MEMTYPE_MASK, DSP_PORT_MEMORY_TYPE); 1053 snd_m3_outw(chip, region & MEMTYPE_MASK, DSP_PORT_MEMORY_TYPE);
1058 snd_m3_outw(chip, index, DSP_PORT_MEMORY_INDEX); 1054 snd_m3_outw(chip, index, DSP_PORT_MEMORY_INDEX);
1059 snd_m3_outw(chip, data, DSP_PORT_MEMORY_DATA); 1055 snd_m3_outw(chip, data, DSP_PORT_MEMORY_DATA);
1060} 1056}
1061 1057
1062static void snd_m3_assp_halt(m3_t *chip) 1058static void snd_m3_assp_halt(struct snd_m3 *chip)
1063{ 1059{
1064 chip->reset_state = snd_m3_inb(chip, DSP_PORT_CONTROL_REG_B) & ~REGB_STOP_CLOCK; 1060 chip->reset_state = snd_m3_inb(chip, DSP_PORT_CONTROL_REG_B) & ~REGB_STOP_CLOCK;
1065 msleep(10); 1061 msleep(10);
1066 snd_m3_outb(chip, chip->reset_state & ~REGB_ENABLE_RESET, DSP_PORT_CONTROL_REG_B); 1062 snd_m3_outb(chip, chip->reset_state & ~REGB_ENABLE_RESET, DSP_PORT_CONTROL_REG_B);
1067} 1063}
1068 1064
1069static void snd_m3_assp_continue(m3_t *chip) 1065static void snd_m3_assp_continue(struct snd_m3 *chip)
1070{ 1066{
1071 snd_m3_outb(chip, chip->reset_state | REGB_ENABLE_RESET, DSP_PORT_CONTROL_REG_B); 1067 snd_m3_outb(chip, chip->reset_state | REGB_ENABLE_RESET, DSP_PORT_CONTROL_REG_B);
1072} 1068}
@@ -1080,7 +1076,7 @@ static void snd_m3_assp_continue(m3_t *chip)
1080 * by the binary code images. 1076 * by the binary code images.
1081 */ 1077 */
1082 1078
1083static int snd_m3_add_list(m3_t *chip, struct m3_list *list, u16 val) 1079static int snd_m3_add_list(struct snd_m3 *chip, struct m3_list *list, u16 val)
1084{ 1080{
1085 snd_m3_assp_write(chip, MEMTYPE_INTERNAL_DATA, 1081 snd_m3_assp_write(chip, MEMTYPE_INTERNAL_DATA,
1086 list->mem_addr + list->curlen, 1082 list->mem_addr + list->curlen,
@@ -1088,7 +1084,7 @@ static int snd_m3_add_list(m3_t *chip, struct m3_list *list, u16 val)
1088 return list->curlen++; 1084 return list->curlen++;
1089} 1085}
1090 1086
1091static void snd_m3_remove_list(m3_t *chip, struct m3_list *list, int index) 1087static void snd_m3_remove_list(struct snd_m3 *chip, struct m3_list *list, int index)
1092{ 1088{
1093 u16 val; 1089 u16 val;
1094 int lastindex = list->curlen - 1; 1090 int lastindex = list->curlen - 1;
@@ -1108,7 +1104,7 @@ static void snd_m3_remove_list(m3_t *chip, struct m3_list *list, int index)
1108 list->curlen--; 1104 list->curlen--;
1109} 1105}
1110 1106
1111static void snd_m3_inc_timer_users(m3_t *chip) 1107static void snd_m3_inc_timer_users(struct snd_m3 *chip)
1112{ 1108{
1113 chip->timer_users++; 1109 chip->timer_users++;
1114 if (chip->timer_users != 1) 1110 if (chip->timer_users != 1)
@@ -1127,7 +1123,7 @@ static void snd_m3_inc_timer_users(m3_t *chip)
1127 HOST_INT_CTRL); 1123 HOST_INT_CTRL);
1128} 1124}
1129 1125
1130static void snd_m3_dec_timer_users(m3_t *chip) 1126static void snd_m3_dec_timer_users(struct snd_m3 *chip)
1131{ 1127{
1132 chip->timer_users--; 1128 chip->timer_users--;
1133 if (chip->timer_users > 0) 1129 if (chip->timer_users > 0)
@@ -1151,7 +1147,8 @@ static void snd_m3_dec_timer_users(m3_t *chip)
1151 */ 1147 */
1152 1148
1153/* spinlock held! */ 1149/* spinlock held! */
1154static int snd_m3_pcm_start(m3_t *chip, m3_dma_t *s, snd_pcm_substream_t *subs) 1150static int snd_m3_pcm_start(struct snd_m3 *chip, struct m3_dma *s,
1151 struct snd_pcm_substream *subs)
1155{ 1152{
1156 if (! s || ! subs) 1153 if (! s || ! subs)
1157 return -EINVAL; 1154 return -EINVAL;
@@ -1167,7 +1164,7 @@ static int snd_m3_pcm_start(m3_t *chip, m3_dma_t *s, snd_pcm_substream_t *subs)
1167 chip->dacs_active); 1164 chip->dacs_active);
1168 break; 1165 break;
1169 case SNDRV_PCM_STREAM_CAPTURE: 1166 case SNDRV_PCM_STREAM_CAPTURE:
1170 snd_m3_assp_write(s->chip, MEMTYPE_INTERNAL_DATA, 1167 snd_m3_assp_write(chip, MEMTYPE_INTERNAL_DATA,
1171 KDATA_ADC1_REQUEST, 1); 1168 KDATA_ADC1_REQUEST, 1);
1172 snd_m3_assp_write(chip, MEMTYPE_INTERNAL_DATA, 1169 snd_m3_assp_write(chip, MEMTYPE_INTERNAL_DATA,
1173 s->inst.data + CDATA_INSTANCE_READY, 1); 1170 s->inst.data + CDATA_INSTANCE_READY, 1);
@@ -1177,7 +1174,8 @@ static int snd_m3_pcm_start(m3_t *chip, m3_dma_t *s, snd_pcm_substream_t *subs)
1177} 1174}
1178 1175
1179/* spinlock held! */ 1176/* spinlock held! */
1180static int snd_m3_pcm_stop(m3_t *chip, m3_dma_t *s, snd_pcm_substream_t *subs) 1177static int snd_m3_pcm_stop(struct snd_m3 *chip, struct m3_dma *s,
1178 struct snd_pcm_substream *subs)
1181{ 1179{
1182 if (! s || ! subs) 1180 if (! s || ! subs)
1183 return -EINVAL; 1181 return -EINVAL;
@@ -1201,10 +1199,10 @@ static int snd_m3_pcm_stop(m3_t *chip, m3_dma_t *s, snd_pcm_substream_t *subs)
1201} 1199}
1202 1200
1203static int 1201static int
1204snd_m3_pcm_trigger(snd_pcm_substream_t *subs, int cmd) 1202snd_m3_pcm_trigger(struct snd_pcm_substream *subs, int cmd)
1205{ 1203{
1206 m3_t *chip = snd_pcm_substream_chip(subs); 1204 struct snd_m3 *chip = snd_pcm_substream_chip(subs);
1207 m3_dma_t *s = (m3_dma_t*)subs->runtime->private_data; 1205 struct m3_dma *s = subs->runtime->private_data;
1208 int err = -EINVAL; 1206 int err = -EINVAL;
1209 1207
1210 snd_assert(s != NULL, return -ENXIO); 1208 snd_assert(s != NULL, return -ENXIO);
@@ -1238,10 +1236,10 @@ snd_m3_pcm_trigger(snd_pcm_substream_t *subs, int cmd)
1238 * setup 1236 * setup
1239 */ 1237 */
1240static void 1238static void
1241snd_m3_pcm_setup1(m3_t *chip, m3_dma_t *s, snd_pcm_substream_t *subs) 1239snd_m3_pcm_setup1(struct snd_m3 *chip, struct m3_dma *s, struct snd_pcm_substream *subs)
1242{ 1240{
1243 int dsp_in_size, dsp_out_size, dsp_in_buffer, dsp_out_buffer; 1241 int dsp_in_size, dsp_out_size, dsp_in_buffer, dsp_out_buffer;
1244 snd_pcm_runtime_t *runtime = subs->runtime; 1242 struct snd_pcm_runtime *runtime = subs->runtime;
1245 1243
1246 if (subs->stream == SNDRV_PCM_STREAM_PLAYBACK) { 1244 if (subs->stream == SNDRV_PCM_STREAM_PLAYBACK) {
1247 dsp_in_size = MINISRC_IN_BUFFER_SIZE - (0x20 * 2); 1245 dsp_in_size = MINISRC_IN_BUFFER_SIZE - (0x20 * 2);
@@ -1323,7 +1321,8 @@ snd_m3_pcm_setup1(m3_t *chip, m3_dma_t *s, snd_pcm_substream_t *subs)
1323 dsp_out_buffer); 1321 dsp_out_buffer);
1324} 1322}
1325 1323
1326static void snd_m3_pcm_setup2(m3_t *chip, m3_dma_t *s, snd_pcm_runtime_t *runtime) 1324static void snd_m3_pcm_setup2(struct snd_m3 *chip, struct m3_dma *s,
1325 struct snd_pcm_runtime *runtime)
1327{ 1326{
1328 u32 freq; 1327 u32 freq;
1329 1328
@@ -1389,7 +1388,8 @@ static struct play_vals {
1389 1388
1390/* the mode passed should be already shifted and masked */ 1389/* the mode passed should be already shifted and masked */
1391static void 1390static void
1392snd_m3_playback_setup(m3_t *chip, m3_dma_t *s, snd_pcm_substream_t *subs) 1391snd_m3_playback_setup(struct snd_m3 *chip, struct m3_dma *s,
1392 struct snd_pcm_substream *subs)
1393{ 1393{
1394 unsigned int i; 1394 unsigned int i;
1395 1395
@@ -1455,7 +1455,7 @@ static struct rec_vals {
1455}; 1455};
1456 1456
1457static void 1457static void
1458snd_m3_capture_setup(m3_t *chip, m3_dma_t *s, snd_pcm_substream_t *subs) 1458snd_m3_capture_setup(struct snd_m3 *chip, struct m3_dma *s, struct snd_pcm_substream *subs)
1459{ 1459{
1460 unsigned int i; 1460 unsigned int i;
1461 1461
@@ -1481,10 +1481,10 @@ snd_m3_capture_setup(m3_t *chip, m3_dma_t *s, snd_pcm_substream_t *subs)
1481 s->inst.data + rv[i].addr, rv[i].val); 1481 s->inst.data + rv[i].addr, rv[i].val);
1482} 1482}
1483 1483
1484static int snd_m3_pcm_hw_params(snd_pcm_substream_t * substream, 1484static int snd_m3_pcm_hw_params(struct snd_pcm_substream *substream,
1485 snd_pcm_hw_params_t * hw_params) 1485 struct snd_pcm_hw_params *hw_params)
1486{ 1486{
1487 m3_dma_t *s = (m3_dma_t*) substream->runtime->private_data; 1487 struct m3_dma *s = substream->runtime->private_data;
1488 int err; 1488 int err;
1489 1489
1490 if ((err = snd_pcm_lib_malloc_pages(substream, params_buffer_bytes(hw_params))) < 0) 1490 if ((err = snd_pcm_lib_malloc_pages(substream, params_buffer_bytes(hw_params))) < 0)
@@ -1498,24 +1498,24 @@ static int snd_m3_pcm_hw_params(snd_pcm_substream_t * substream,
1498 return 0; 1498 return 0;
1499} 1499}
1500 1500
1501static int snd_m3_pcm_hw_free(snd_pcm_substream_t * substream) 1501static int snd_m3_pcm_hw_free(struct snd_pcm_substream *substream)
1502{ 1502{
1503 m3_dma_t *s; 1503 struct m3_dma *s;
1504 1504
1505 if (substream->runtime->private_data == NULL) 1505 if (substream->runtime->private_data == NULL)
1506 return 0; 1506 return 0;
1507 s = (m3_dma_t*) substream->runtime->private_data; 1507 s = substream->runtime->private_data;
1508 snd_pcm_lib_free_pages(substream); 1508 snd_pcm_lib_free_pages(substream);
1509 s->buffer_addr = 0; 1509 s->buffer_addr = 0;
1510 return 0; 1510 return 0;
1511} 1511}
1512 1512
1513static int 1513static int
1514snd_m3_pcm_prepare(snd_pcm_substream_t *subs) 1514snd_m3_pcm_prepare(struct snd_pcm_substream *subs)
1515{ 1515{
1516 m3_t *chip = snd_pcm_substream_chip(subs); 1516 struct snd_m3 *chip = snd_pcm_substream_chip(subs);
1517 snd_pcm_runtime_t *runtime = subs->runtime; 1517 struct snd_pcm_runtime *runtime = subs->runtime;
1518 m3_dma_t *s = (m3_dma_t*)runtime->private_data; 1518 struct m3_dma *s = runtime->private_data;
1519 1519
1520 snd_assert(s != NULL, return -ENXIO); 1520 snd_assert(s != NULL, return -ENXIO);
1521 1521
@@ -1546,7 +1546,7 @@ snd_m3_pcm_prepare(snd_pcm_substream_t *subs)
1546 * get current pointer 1546 * get current pointer
1547 */ 1547 */
1548static unsigned int 1548static unsigned int
1549snd_m3_get_pointer(m3_t *chip, m3_dma_t *s, snd_pcm_substream_t *subs) 1549snd_m3_get_pointer(struct snd_m3 *chip, struct m3_dma *s, struct snd_pcm_substream *subs)
1550{ 1550{
1551 u16 hi = 0, lo = 0; 1551 u16 hi = 0, lo = 0;
1552 int retry = 10; 1552 int retry = 10;
@@ -1571,11 +1571,11 @@ snd_m3_get_pointer(m3_t *chip, m3_dma_t *s, snd_pcm_substream_t *subs)
1571} 1571}
1572 1572
1573static snd_pcm_uframes_t 1573static snd_pcm_uframes_t
1574snd_m3_pcm_pointer(snd_pcm_substream_t * subs) 1574snd_m3_pcm_pointer(struct snd_pcm_substream *subs)
1575{ 1575{
1576 m3_t *chip = snd_pcm_substream_chip(subs); 1576 struct snd_m3 *chip = snd_pcm_substream_chip(subs);
1577 unsigned int ptr; 1577 unsigned int ptr;
1578 m3_dma_t *s = (m3_dma_t*)subs->runtime->private_data; 1578 struct m3_dma *s = subs->runtime->private_data;
1579 snd_assert(s != NULL, return 0); 1579 snd_assert(s != NULL, return 0);
1580 1580
1581 spin_lock(&chip->reg_lock); 1581 spin_lock(&chip->reg_lock);
@@ -1587,9 +1587,9 @@ snd_m3_pcm_pointer(snd_pcm_substream_t * subs)
1587 1587
1588/* update pointer */ 1588/* update pointer */
1589/* spinlock held! */ 1589/* spinlock held! */
1590static void snd_m3_update_ptr(m3_t *chip, m3_dma_t *s) 1590static void snd_m3_update_ptr(struct snd_m3 *chip, struct m3_dma *s)
1591{ 1591{
1592 snd_pcm_substream_t *subs = s->substream; 1592 struct snd_pcm_substream *subs = s->substream;
1593 unsigned int hwptr; 1593 unsigned int hwptr;
1594 int diff; 1594 int diff;
1595 1595
@@ -1610,7 +1610,7 @@ static void snd_m3_update_ptr(m3_t *chip, m3_dma_t *s)
1610 1610
1611static void snd_m3_update_hw_volume(unsigned long private_data) 1611static void snd_m3_update_hw_volume(unsigned long private_data)
1612{ 1612{
1613 m3_t *chip = (m3_t *) private_data; 1613 struct snd_m3 *chip = (struct snd_m3 *) private_data;
1614 int x, val; 1614 int x, val;
1615 unsigned long flags; 1615 unsigned long flags;
1616 1616
@@ -1673,7 +1673,7 @@ static void snd_m3_update_hw_volume(unsigned long private_data)
1673static irqreturn_t 1673static irqreturn_t
1674snd_m3_interrupt(int irq, void *dev_id, struct pt_regs *regs) 1674snd_m3_interrupt(int irq, void *dev_id, struct pt_regs *regs)
1675{ 1675{
1676 m3_t *chip = dev_id; 1676 struct snd_m3 *chip = dev_id;
1677 u8 status; 1677 u8 status;
1678 int i; 1678 int i;
1679 1679
@@ -1698,7 +1698,7 @@ snd_m3_interrupt(int irq, void *dev_id, struct pt_regs *regs)
1698 /* update adc/dac info if it was a timer int */ 1698 /* update adc/dac info if it was a timer int */
1699 spin_lock(&chip->reg_lock); 1699 spin_lock(&chip->reg_lock);
1700 for (i = 0; i < chip->num_substreams; i++) { 1700 for (i = 0; i < chip->num_substreams; i++) {
1701 m3_dma_t *s = &chip->substreams[i]; 1701 struct m3_dma *s = &chip->substreams[i];
1702 if (s->running) 1702 if (s->running)
1703 snd_m3_update_ptr(chip, s); 1703 snd_m3_update_ptr(chip, s);
1704 } 1704 }
@@ -1722,7 +1722,7 @@ snd_m3_interrupt(int irq, void *dev_id, struct pt_regs *regs)
1722/* 1722/*
1723 */ 1723 */
1724 1724
1725static snd_pcm_hardware_t snd_m3_playback = 1725static struct snd_pcm_hardware snd_m3_playback =
1726{ 1726{
1727 .info = (SNDRV_PCM_INFO_MMAP | 1727 .info = (SNDRV_PCM_INFO_MMAP |
1728 SNDRV_PCM_INFO_INTERLEAVED | 1728 SNDRV_PCM_INFO_INTERLEAVED |
@@ -1743,7 +1743,7 @@ static snd_pcm_hardware_t snd_m3_playback =
1743 .periods_max = 1024, 1743 .periods_max = 1024,
1744}; 1744};
1745 1745
1746static snd_pcm_hardware_t snd_m3_capture = 1746static struct snd_pcm_hardware snd_m3_capture =
1747{ 1747{
1748 .info = (SNDRV_PCM_INFO_MMAP | 1748 .info = (SNDRV_PCM_INFO_MMAP |
1749 SNDRV_PCM_INFO_INTERLEAVED | 1749 SNDRV_PCM_INFO_INTERLEAVED |
@@ -1769,10 +1769,10 @@ static snd_pcm_hardware_t snd_m3_capture =
1769 */ 1769 */
1770 1770
1771static int 1771static int
1772snd_m3_substream_open(m3_t *chip, snd_pcm_substream_t *subs) 1772snd_m3_substream_open(struct snd_m3 *chip, struct snd_pcm_substream *subs)
1773{ 1773{
1774 int i; 1774 int i;
1775 m3_dma_t *s; 1775 struct m3_dma *s;
1776 1776
1777 spin_lock_irq(&chip->reg_lock); 1777 spin_lock_irq(&chip->reg_lock);
1778 for (i = 0; i < chip->num_substreams; i++) { 1778 for (i = 0; i < chip->num_substreams; i++) {
@@ -1802,9 +1802,9 @@ __found:
1802} 1802}
1803 1803
1804static void 1804static void
1805snd_m3_substream_close(m3_t *chip, snd_pcm_substream_t *subs) 1805snd_m3_substream_close(struct snd_m3 *chip, struct snd_pcm_substream *subs)
1806{ 1806{
1807 m3_dma_t *s = (m3_dma_t*) subs->runtime->private_data; 1807 struct m3_dma *s = subs->runtime->private_data;
1808 1808
1809 if (s == NULL) 1809 if (s == NULL)
1810 return; /* not opened properly */ 1810 return; /* not opened properly */
@@ -1824,10 +1824,10 @@ snd_m3_substream_close(m3_t *chip, snd_pcm_substream_t *subs)
1824} 1824}
1825 1825
1826static int 1826static int
1827snd_m3_playback_open(snd_pcm_substream_t *subs) 1827snd_m3_playback_open(struct snd_pcm_substream *subs)
1828{ 1828{
1829 m3_t *chip = snd_pcm_substream_chip(subs); 1829 struct snd_m3 *chip = snd_pcm_substream_chip(subs);
1830 snd_pcm_runtime_t *runtime = subs->runtime; 1830 struct snd_pcm_runtime *runtime = subs->runtime;
1831 int err; 1831 int err;
1832 1832
1833 if ((err = snd_m3_substream_open(chip, subs)) < 0) 1833 if ((err = snd_m3_substream_open(chip, subs)) < 0)
@@ -1840,19 +1840,19 @@ snd_m3_playback_open(snd_pcm_substream_t *subs)
1840} 1840}
1841 1841
1842static int 1842static int
1843snd_m3_playback_close(snd_pcm_substream_t *subs) 1843snd_m3_playback_close(struct snd_pcm_substream *subs)
1844{ 1844{
1845 m3_t *chip = snd_pcm_substream_chip(subs); 1845 struct snd_m3 *chip = snd_pcm_substream_chip(subs);
1846 1846
1847 snd_m3_substream_close(chip, subs); 1847 snd_m3_substream_close(chip, subs);
1848 return 0; 1848 return 0;
1849} 1849}
1850 1850
1851static int 1851static int
1852snd_m3_capture_open(snd_pcm_substream_t *subs) 1852snd_m3_capture_open(struct snd_pcm_substream *subs)
1853{ 1853{
1854 m3_t *chip = snd_pcm_substream_chip(subs); 1854 struct snd_m3 *chip = snd_pcm_substream_chip(subs);
1855 snd_pcm_runtime_t *runtime = subs->runtime; 1855 struct snd_pcm_runtime *runtime = subs->runtime;
1856 int err; 1856 int err;
1857 1857
1858 if ((err = snd_m3_substream_open(chip, subs)) < 0) 1858 if ((err = snd_m3_substream_open(chip, subs)) < 0)
@@ -1865,9 +1865,9 @@ snd_m3_capture_open(snd_pcm_substream_t *subs)
1865} 1865}
1866 1866
1867static int 1867static int
1868snd_m3_capture_close(snd_pcm_substream_t *subs) 1868snd_m3_capture_close(struct snd_pcm_substream *subs)
1869{ 1869{
1870 m3_t *chip = snd_pcm_substream_chip(subs); 1870 struct snd_m3 *chip = snd_pcm_substream_chip(subs);
1871 1871
1872 snd_m3_substream_close(chip, subs); 1872 snd_m3_substream_close(chip, subs);
1873 return 0; 1873 return 0;
@@ -1877,7 +1877,7 @@ snd_m3_capture_close(snd_pcm_substream_t *subs)
1877 * create pcm instance 1877 * create pcm instance
1878 */ 1878 */
1879 1879
1880static snd_pcm_ops_t snd_m3_playback_ops = { 1880static struct snd_pcm_ops snd_m3_playback_ops = {
1881 .open = snd_m3_playback_open, 1881 .open = snd_m3_playback_open,
1882 .close = snd_m3_playback_close, 1882 .close = snd_m3_playback_close,
1883 .ioctl = snd_pcm_lib_ioctl, 1883 .ioctl = snd_pcm_lib_ioctl,
@@ -1888,7 +1888,7 @@ static snd_pcm_ops_t snd_m3_playback_ops = {
1888 .pointer = snd_m3_pcm_pointer, 1888 .pointer = snd_m3_pcm_pointer,
1889}; 1889};
1890 1890
1891static snd_pcm_ops_t snd_m3_capture_ops = { 1891static struct snd_pcm_ops snd_m3_capture_ops = {
1892 .open = snd_m3_capture_open, 1892 .open = snd_m3_capture_open,
1893 .close = snd_m3_capture_close, 1893 .close = snd_m3_capture_close,
1894 .ioctl = snd_pcm_lib_ioctl, 1894 .ioctl = snd_pcm_lib_ioctl,
@@ -1900,9 +1900,9 @@ static snd_pcm_ops_t snd_m3_capture_ops = {
1900}; 1900};
1901 1901
1902static int __devinit 1902static int __devinit
1903snd_m3_pcm(m3_t * chip, int device) 1903snd_m3_pcm(struct snd_m3 * chip, int device)
1904{ 1904{
1905 snd_pcm_t *pcm; 1905 struct snd_pcm *pcm;
1906 int err; 1906 int err;
1907 1907
1908 err = snd_pcm_new(chip->card, chip->card->driver, device, 1908 err = snd_pcm_new(chip->card, chip->card->driver, device,
@@ -1933,7 +1933,7 @@ snd_m3_pcm(m3_t * chip, int device)
1933 * Wait for the ac97 serial bus to be free. 1933 * Wait for the ac97 serial bus to be free.
1934 * return nonzero if the bus is still busy. 1934 * return nonzero if the bus is still busy.
1935 */ 1935 */
1936static int snd_m3_ac97_wait(m3_t *chip) 1936static int snd_m3_ac97_wait(struct snd_m3 *chip)
1937{ 1937{
1938 int i = 10000; 1938 int i = 10000;
1939 1939
@@ -1947,9 +1947,9 @@ static int snd_m3_ac97_wait(m3_t *chip)
1947} 1947}
1948 1948
1949static unsigned short 1949static unsigned short
1950snd_m3_ac97_read(ac97_t *ac97, unsigned short reg) 1950snd_m3_ac97_read(struct snd_ac97 *ac97, unsigned short reg)
1951{ 1951{
1952 m3_t *chip = ac97->private_data; 1952 struct snd_m3 *chip = ac97->private_data;
1953 unsigned long flags; 1953 unsigned long flags;
1954 unsigned short data; 1954 unsigned short data;
1955 1955
@@ -1965,9 +1965,9 @@ snd_m3_ac97_read(ac97_t *ac97, unsigned short reg)
1965} 1965}
1966 1966
1967static void 1967static void
1968snd_m3_ac97_write(ac97_t *ac97, unsigned short reg, unsigned short val) 1968snd_m3_ac97_write(struct snd_ac97 *ac97, unsigned short reg, unsigned short val)
1969{ 1969{
1970 m3_t *chip = ac97->private_data; 1970 struct snd_m3 *chip = ac97->private_data;
1971 unsigned long flags; 1971 unsigned long flags;
1972 1972
1973 if (snd_m3_ac97_wait(chip)) 1973 if (snd_m3_ac97_wait(chip))
@@ -1994,7 +1994,7 @@ static void snd_m3_remote_codec_config(int io, int isremote)
1994/* 1994/*
1995 * hack, returns non zero on err 1995 * hack, returns non zero on err
1996 */ 1996 */
1997static int snd_m3_try_read_vendor(m3_t *chip) 1997static int snd_m3_try_read_vendor(struct snd_m3 *chip)
1998{ 1998{
1999 u16 ret; 1999 u16 ret;
2000 2000
@@ -2011,7 +2011,7 @@ static int snd_m3_try_read_vendor(m3_t *chip)
2011 return (ret == 0) || (ret == 0xffff); 2011 return (ret == 0) || (ret == 0xffff);
2012} 2012}
2013 2013
2014static void snd_m3_ac97_reset(m3_t *chip) 2014static void snd_m3_ac97_reset(struct snd_m3 *chip)
2015{ 2015{
2016 u16 dir; 2016 u16 dir;
2017 int delay1 = 0, delay2 = 0, i; 2017 int delay1 = 0, delay2 = 0, i;
@@ -2078,13 +2078,13 @@ static void snd_m3_ac97_reset(m3_t *chip)
2078#endif 2078#endif
2079} 2079}
2080 2080
2081static int __devinit snd_m3_mixer(m3_t *chip) 2081static int __devinit snd_m3_mixer(struct snd_m3 *chip)
2082{ 2082{
2083 ac97_bus_t *pbus; 2083 struct snd_ac97_bus *pbus;
2084 ac97_template_t ac97; 2084 struct snd_ac97_template ac97;
2085 snd_ctl_elem_id_t id; 2085 struct snd_ctl_elem_id id;
2086 int err; 2086 int err;
2087 static ac97_bus_ops_t ops = { 2087 static struct snd_ac97_bus_ops ops = {
2088 .write = snd_m3_ac97_write, 2088 .write = snd_m3_ac97_write,
2089 .read = snd_m3_ac97_read, 2089 .read = snd_m3_ac97_read,
2090 }; 2090 };
@@ -2254,7 +2254,7 @@ static u16 minisrc_lpf[MINISRC_LPF_LEN] __devinitdata = {
2254 0X1023, 0X1AA9, 0X0B60, 0XEFDD, 0X186F 2254 0X1023, 0X1AA9, 0X0B60, 0XEFDD, 0X186F
2255}; 2255};
2256 2256
2257static void __devinit snd_m3_assp_init(m3_t *chip) 2257static void __devinit snd_m3_assp_init(struct snd_m3 *chip)
2258{ 2258{
2259 unsigned int i; 2259 unsigned int i;
2260 2260
@@ -2343,7 +2343,7 @@ static void __devinit snd_m3_assp_init(m3_t *chip)
2343} 2343}
2344 2344
2345 2345
2346static int __devinit snd_m3_assp_client_init(m3_t *chip, m3_dma_t *s, int index) 2346static int __devinit snd_m3_assp_client_init(struct snd_m3 *chip, struct m3_dma *s, int index)
2347{ 2347{
2348 int data_bytes = 2 * ( MINISRC_TMP_BUFFER_SIZE / 2 + 2348 int data_bytes = 2 * ( MINISRC_TMP_BUFFER_SIZE / 2 +
2349 MINISRC_IN_BUFFER_SIZE / 2 + 2349 MINISRC_IN_BUFFER_SIZE / 2 +
@@ -2389,7 +2389,7 @@ static int __devinit snd_m3_assp_client_init(m3_t *chip, m3_dma_t *s, int index)
2389 * this needs more magic for 4 speaker, but.. 2389 * this needs more magic for 4 speaker, but..
2390 */ 2390 */
2391static void 2391static void
2392snd_m3_amp_enable(m3_t *chip, int enable) 2392snd_m3_amp_enable(struct snd_m3 *chip, int enable)
2393{ 2393{
2394 int io = chip->iobase; 2394 int io = chip->iobase;
2395 u16 gpo, polarity; 2395 u16 gpo, polarity;
@@ -2413,7 +2413,7 @@ snd_m3_amp_enable(m3_t *chip, int enable)
2413} 2413}
2414 2414
2415static int 2415static int
2416snd_m3_chip_init(m3_t *chip) 2416snd_m3_chip_init(struct snd_m3 *chip)
2417{ 2417{
2418 struct pci_dev *pcidev = chip->pci; 2418 struct pci_dev *pcidev = chip->pci;
2419 unsigned long io = chip->iobase; 2419 unsigned long io = chip->iobase;
@@ -2486,7 +2486,7 @@ snd_m3_chip_init(m3_t *chip)
2486} 2486}
2487 2487
2488static void 2488static void
2489snd_m3_enable_ints(m3_t *chip) 2489snd_m3_enable_ints(struct snd_m3 *chip)
2490{ 2490{
2491 unsigned long io = chip->iobase; 2491 unsigned long io = chip->iobase;
2492 unsigned short val; 2492 unsigned short val;
@@ -2504,9 +2504,9 @@ snd_m3_enable_ints(m3_t *chip)
2504/* 2504/*
2505 */ 2505 */
2506 2506
2507static int snd_m3_free(m3_t *chip) 2507static int snd_m3_free(struct snd_m3 *chip)
2508{ 2508{
2509 m3_dma_t *s; 2509 struct m3_dma *s;
2510 int i; 2510 int i;
2511 2511
2512 if (chip->substreams) { 2512 if (chip->substreams) {
@@ -2530,7 +2530,7 @@ static int snd_m3_free(m3_t *chip)
2530 2530
2531 if (chip->irq >= 0) { 2531 if (chip->irq >= 0) {
2532 synchronize_irq(chip->irq); 2532 synchronize_irq(chip->irq);
2533 free_irq(chip->irq, (void *)chip); 2533 free_irq(chip->irq, chip);
2534 } 2534 }
2535 2535
2536 if (chip->iobase) 2536 if (chip->iobase)
@@ -2546,9 +2546,9 @@ static int snd_m3_free(m3_t *chip)
2546 * APM support 2546 * APM support
2547 */ 2547 */
2548#ifdef CONFIG_PM 2548#ifdef CONFIG_PM
2549static int m3_suspend(snd_card_t *card, pm_message_t state) 2549static int m3_suspend(struct snd_card *card, pm_message_t state)
2550{ 2550{
2551 m3_t *chip = card->pm_private_data; 2551 struct snd_m3 *chip = card->pm_private_data;
2552 int i, index; 2552 int i, index;
2553 2553
2554 if (chip->suspend_mem == NULL) 2554 if (chip->suspend_mem == NULL)
@@ -2578,9 +2578,9 @@ static int m3_suspend(snd_card_t *card, pm_message_t state)
2578 return 0; 2578 return 0;
2579} 2579}
2580 2580
2581static int m3_resume(snd_card_t *card) 2581static int m3_resume(struct snd_card *card)
2582{ 2582{
2583 m3_t *chip = card->pm_private_data; 2583 struct snd_m3 *chip = card->pm_private_data;
2584 int i, index; 2584 int i, index;
2585 2585
2586 if (chip->suspend_mem == NULL) 2586 if (chip->suspend_mem == NULL)
@@ -2625,23 +2625,23 @@ static int m3_resume(snd_card_t *card)
2625/* 2625/*
2626 */ 2626 */
2627 2627
2628static int snd_m3_dev_free(snd_device_t *device) 2628static int snd_m3_dev_free(struct snd_device *device)
2629{ 2629{
2630 m3_t *chip = device->device_data; 2630 struct snd_m3 *chip = device->device_data;
2631 return snd_m3_free(chip); 2631 return snd_m3_free(chip);
2632} 2632}
2633 2633
2634static int __devinit 2634static int __devinit
2635snd_m3_create(snd_card_t *card, struct pci_dev *pci, 2635snd_m3_create(struct snd_card *card, struct pci_dev *pci,
2636 int enable_amp, 2636 int enable_amp,
2637 int amp_gpio, 2637 int amp_gpio,
2638 m3_t **chip_ret) 2638 struct snd_m3 **chip_ret)
2639{ 2639{
2640 m3_t *chip; 2640 struct snd_m3 *chip;
2641 int i, err; 2641 int i, err;
2642 struct m3_quirk *quirk; 2642 struct m3_quirk *quirk;
2643 struct m3_hv_quirk *hv_quirk; 2643 struct m3_hv_quirk *hv_quirk;
2644 static snd_device_ops_t ops = { 2644 static struct snd_device_ops ops = {
2645 .dev_free = snd_m3_dev_free, 2645 .dev_free = snd_m3_dev_free,
2646 }; 2646 };
2647 2647
@@ -2710,13 +2710,13 @@ snd_m3_create(snd_card_t *card, struct pci_dev *pci,
2710 chip->amp_gpio = GPO_EXT_AMP_M3; 2710 chip->amp_gpio = GPO_EXT_AMP_M3;
2711 2711
2712 chip->num_substreams = NR_DSPS; 2712 chip->num_substreams = NR_DSPS;
2713 chip->substreams = kmalloc(sizeof(m3_dma_t) * chip->num_substreams, GFP_KERNEL); 2713 chip->substreams = kcalloc(chip->num_substreams, sizeof(struct m3_dma),
2714 GFP_KERNEL);
2714 if (chip->substreams == NULL) { 2715 if (chip->substreams == NULL) {
2715 kfree(chip); 2716 kfree(chip);
2716 pci_disable_device(pci); 2717 pci_disable_device(pci);
2717 return -ENOMEM; 2718 return -ENOMEM;
2718 } 2719 }
2719 memset(chip->substreams, 0, sizeof(m3_dma_t) * chip->num_substreams);
2720 2720
2721 if ((err = pci_request_regions(pci, card->driver)) < 0) { 2721 if ((err = pci_request_regions(pci, card->driver)) < 0) {
2722 snd_m3_free(chip); 2722 snd_m3_free(chip);
@@ -2737,7 +2737,7 @@ snd_m3_create(snd_card_t *card, struct pci_dev *pci,
2737 tasklet_init(&chip->hwvol_tq, snd_m3_update_hw_volume, (unsigned long)chip); 2737 tasklet_init(&chip->hwvol_tq, snd_m3_update_hw_volume, (unsigned long)chip);
2738 2738
2739 if (request_irq(pci->irq, snd_m3_interrupt, SA_INTERRUPT|SA_SHIRQ, 2739 if (request_irq(pci->irq, snd_m3_interrupt, SA_INTERRUPT|SA_SHIRQ,
2740 card->driver, (void *)chip)) { 2740 card->driver, chip)) {
2741 snd_printk(KERN_ERR "unable to grab IRQ %d\n", pci->irq); 2741 snd_printk(KERN_ERR "unable to grab IRQ %d\n", pci->irq);
2742 snd_m3_free(chip); 2742 snd_m3_free(chip);
2743 return -ENOMEM; 2743 return -ENOMEM;
@@ -2761,8 +2761,7 @@ snd_m3_create(snd_card_t *card, struct pci_dev *pci,
2761 return err; 2761 return err;
2762 2762
2763 for (i = 0; i < chip->num_substreams; i++) { 2763 for (i = 0; i < chip->num_substreams; i++) {
2764 m3_dma_t *s = &chip->substreams[i]; 2764 struct m3_dma *s = &chip->substreams[i];
2765 s->chip = chip;
2766 if ((err = snd_m3_assp_client_init(chip, s, i)) < 0) 2765 if ((err = snd_m3_assp_client_init(chip, s, i)) < 0)
2767 return err; 2766 return err;
2768 } 2767 }
@@ -2786,8 +2785,8 @@ static int __devinit
2786snd_m3_probe(struct pci_dev *pci, const struct pci_device_id *pci_id) 2785snd_m3_probe(struct pci_dev *pci, const struct pci_device_id *pci_id)
2787{ 2786{
2788 static int dev; 2787 static int dev;
2789 snd_card_t *card; 2788 struct snd_card *card;
2790 m3_t *chip; 2789 struct snd_m3 *chip;
2791 int err; 2790 int err;
2792 2791
2793 /* don't pick up modems */ 2792 /* don't pick up modems */