Changeset 34 for GPL/trunk/alsa-kernel/pci/trident
- Timestamp:
 - Dec 11, 2005, 5:57:39 PM (20 years ago)
 - Location:
 - GPL/trunk/alsa-kernel/pci/trident
 - Files:
 - 
      
- 4 edited
 
- 
          
  trident.c (modified) (1 diff)
 - 
          
  trident_main.c (modified) (108 diffs)
 - 
          
  trident_memory.c (modified) (18 diffs)
 - 
          
  trident_synth.c (modified) (36 diffs)
 
 
Legend:
- Unmodified
 - Added
 - Removed
 
- 
      
GPL/trunk/alsa-kernel/pci/trident/trident.c
r33 r34 83 83 static int dev; 84 84 snd_card_t *card; 85 trident_t *trident;85 struct snd_trident *trident; 86 86 const char *str; 87 87 int err, pcm_dev = 0;  - 
      
GPL/trunk/alsa-kernel/pci/trident/trident_main.c
r33 r34 44 44 } 45 45 46 static int snd_trident_pcm_mixer_build( trident_t *trident, snd_trident_voice_t* voice, snd_pcm_substream_t *substream);47 static int snd_trident_pcm_mixer_free( trident_t *trident, snd_trident_voice_t* voice, snd_pcm_substream_t *substream);46 static int snd_trident_pcm_mixer_build(struct snd_trident *trident, struct snd_trident_voice* voice, snd_pcm_substream_t *substream); 47 static int snd_trident_pcm_mixer_free(struct snd_trident *trident, struct snd_trident_voice* voice, snd_pcm_substream_t *substream); 48 48 static irqreturn_t snd_trident_interrupt(int irq, void *dev_id, struct pt_regs *regs); 49 #ifdef CONFIG_PM 50 static int snd_trident_suspend(snd_card_t *card, unsigned int state); 51 static int snd_trident_resume(snd_card_t *card, unsigned int state); 52 #endif 53 static int snd_trident_sis_reset(trident_t *trident); 49 static int snd_trident_sis_reset(struct snd_trident *trident); 54 50 55 51 /* … … 59 55 60 56 #if 0 61 static void snd_trident_print_voice_regs( trident_t *trident, int voice)57 static void snd_trident_print_voice_regs(struct snd_trident *trident, int voice) 62 58 { 63 59 unsigned int val, tmp; … … 117 113 unsigned short count = 0xffff; 118 114 unsigned long flags; 119 trident_t *trident = ac97->private_data;115 struct snd_trident *trident = ac97->private_data; 120 116 121 117 spin_lock_irqsave(&trident->reg_lock, flags); … … 176 172 unsigned short count = 0xffff; 177 173 unsigned long flags; 178 trident_t *trident = ac97->private_data;174 struct snd_trident *trident = ac97->private_data; 179 175 180 176 data = ((unsigned long) wdata) << 16; … … 227 223 228 224 /*--------------------------------------------------------------------------- 229 void snd_trident_enable_eso( trident_t *trident)225 void snd_trident_enable_eso(struct snd_trident *trident) 230 226 231 227 Description: This routine will enable end of loop interrupts. … … 238 234 ---------------------------------------------------------------------------*/ 239 235 240 static void snd_trident_enable_eso( trident_t * trident)236 static void snd_trident_enable_eso(struct snd_trident * trident) 241 237 { 242 238 unsigned int val; … … 251 247 252 248 /*--------------------------------------------------------------------------- 253 void snd_trident_disable_eso( trident_t *trident)249 void snd_trident_disable_eso(struct snd_trident *trident) 254 250 255 251 Description: This routine will disable end of loop interrupts. … … 265 261 ---------------------------------------------------------------------------*/ 266 262 267 static void snd_trident_disable_eso( trident_t * trident)263 static void snd_trident_disable_eso(struct snd_trident * trident) 268 264 { 269 265 unsigned int tmp; … … 276 272 277 273 /*--------------------------------------------------------------------------- 278 void snd_trident_start_voice( trident_t * trident, unsigned int voice)274 void snd_trident_start_voice(struct snd_trident * trident, unsigned int voice) 279 275 280 276 Description: Start a voice, any channel 0 thru 63. … … 289 285 ---------------------------------------------------------------------------*/ 290 286 291 void snd_trident_start_voice( trident_t * trident, unsigned int voice)287 void snd_trident_start_voice(struct snd_trident * trident, unsigned int voice) 292 288 { 293 289 unsigned int mask = 1 << (voice & 0x1f); … … 298 294 299 295 /*--------------------------------------------------------------------------- 300 void snd_trident_stop_voice( trident_t * trident, unsigned int voice)296 void snd_trident_stop_voice(struct snd_trident * trident, unsigned int voice) 301 297 302 298 Description: Stop a voice, any channel 0 thru 63. … … 311 307 ---------------------------------------------------------------------------*/ 312 308 313 void snd_trident_stop_voice( trident_t * trident, unsigned int voice)309 void snd_trident_stop_voice(struct snd_trident * trident, unsigned int voice) 314 310 { 315 311 unsigned int mask = 1 << (voice & 0x1f); … … 320 316 321 317 /*--------------------------------------------------------------------------- 322 int snd_trident_allocate_pcm_channel( trident_t *trident)318 int snd_trident_allocate_pcm_channel(struct snd_trident *trident) 323 319 324 320 Description: Allocate hardware channel in Bank B (32-63). … … 330 326 ---------------------------------------------------------------------------*/ 331 327 332 static int snd_trident_allocate_pcm_channel( trident_t * trident)328 static int snd_trident_allocate_pcm_channel(struct snd_trident * trident) 333 329 { 334 330 int idx; … … 358 354 ---------------------------------------------------------------------------*/ 359 355 360 static void snd_trident_free_pcm_channel( trident_t *trident, int channel)356 static void snd_trident_free_pcm_channel(struct snd_trident *trident, int channel) 361 357 { 362 358 if (channel < 32 || channel > 63) … … 380 376 ---------------------------------------------------------------------------*/ 381 377 382 static int snd_trident_allocate_synth_channel( trident_t * trident)378 static int snd_trident_allocate_synth_channel(struct snd_trident * trident) 383 379 { 384 380 int idx; … … 406 402 ---------------------------------------------------------------------------*/ 407 403 408 static void snd_trident_free_synth_channel( trident_t *trident, int channel)404 static void snd_trident_free_synth_channel(struct snd_trident *trident, int channel) 409 405 { 410 406 if (channel < 0 || channel > 31) … … 429 425 ---------------------------------------------------------------------------*/ 430 426 431 void snd_trident_write_voice_regs( trident_t * trident,432 s nd_trident_voice_t* voice)427 void snd_trident_write_voice_regs(struct snd_trident * trident, 428 struct snd_trident_voice* voice) 433 429 { 434 430 unsigned int FmcRvolCvol; … … 501 497 ---------------------------------------------------------------------------*/ 502 498 503 static void snd_trident_write_cso_reg( trident_t * trident, snd_trident_voice_t* voice, unsigned int CSO)499 static void snd_trident_write_cso_reg(struct snd_trident * trident, struct snd_trident_voice* voice, unsigned int CSO) 504 500 { 505 501 voice->CSO = CSO; … … 524 520 ---------------------------------------------------------------------------*/ 525 521 526 static void snd_trident_write_eso_reg( trident_t * trident, snd_trident_voice_t* voice, unsigned int ESO)522 static void snd_trident_write_eso_reg(struct snd_trident * trident, struct snd_trident_voice* voice, unsigned int ESO) 527 523 { 528 524 voice->ESO = ESO; … … 547 543 ---------------------------------------------------------------------------*/ 548 544 549 static void snd_trident_write_vol_reg( trident_t * trident, snd_trident_voice_t* voice, unsigned int Vol)545 static void snd_trident_write_vol_reg(struct snd_trident * trident, struct snd_trident_voice* voice, unsigned int Vol) 550 546 { 551 547 voice->Vol = Vol; … … 575 571 ---------------------------------------------------------------------------*/ 576 572 577 static void snd_trident_write_pan_reg( trident_t * trident, snd_trident_voice_t* voice, unsigned int Pan)573 static void snd_trident_write_pan_reg(struct snd_trident * trident, struct snd_trident_voice* voice, unsigned int Pan) 578 574 { 579 575 voice->Pan = Pan; … … 594 590 ---------------------------------------------------------------------------*/ 595 591 596 static void snd_trident_write_rvol_reg( trident_t * trident, snd_trident_voice_t* voice, unsigned int RVol)592 static void snd_trident_write_rvol_reg(struct snd_trident * trident, struct snd_trident_voice* voice, unsigned int RVol) 597 593 { 598 594 voice->RVol = RVol; … … 614 610 ---------------------------------------------------------------------------*/ 615 611 616 static void snd_trident_write_cvol_reg( trident_t * trident, snd_trident_voice_t* voice, unsigned int CVol)612 static void snd_trident_write_cvol_reg(struct snd_trident * trident, struct snd_trident_voice* voice, unsigned int CVol) 617 613 { 618 614 voice->CVol = CVol; … … 774 770 snd_pcm_hw_params_t * hw_params) 775 771 { 776 trident_t *trident = snd_pcm_substream_chip(substream);772 struct snd_trident *trident = snd_pcm_substream_chip(substream); 777 773 snd_pcm_runtime_t *runtime = substream->runtime; 778 s nd_trident_voice_t *voice = (snd_trident_voice_t*) runtime->private_data;774 struct snd_trident_voice*voice = (struct snd_trident_voice*) runtime->private_data; 779 775 int err; 780 776 … … 808 804 snd_pcm_hw_params_t * hw_params) 809 805 { 810 trident_t *trident = snd_pcm_substream_chip(substream);806 struct snd_trident *trident = snd_pcm_substream_chip(substream); 811 807 snd_pcm_runtime_t *runtime = substream->runtime; 812 s nd_trident_voice_t *voice = (snd_trident_voice_t*) runtime->private_data;813 s nd_trident_voice_t*evoice = voice->extra;808 struct snd_trident_voice*voice = (struct snd_trident_voice*) runtime->private_data; 809 struct snd_trident_voice*evoice = voice->extra; 814 810 815 811 /* voice management */ … … 869 865 static int snd_trident_hw_free(snd_pcm_substream_t * substream) 870 866 { 871 trident_t *trident = snd_pcm_substream_chip(substream);867 struct snd_trident *trident = snd_pcm_substream_chip(substream); 872 868 snd_pcm_runtime_t *runtime = substream->runtime; 873 s nd_trident_voice_t *voice = (snd_trident_voice_t*) runtime->private_data;874 s nd_trident_voice_t*evoice = voice ? voice->extra : NULL;869 struct snd_trident_voice*voice = (struct snd_trident_voice*) runtime->private_data; 870 struct snd_trident_voice*evoice = voice ? voice->extra : NULL; 875 871 876 872 if (trident->tlb.entries) { … … 901 897 static int snd_trident_playback_prepare(snd_pcm_substream_t * substream) 902 898 { 903 trident_t *trident = snd_pcm_substream_chip(substream);899 struct snd_trident *trident = snd_pcm_substream_chip(substream); 904 900 snd_pcm_runtime_t *runtime = substream->runtime; 905 s nd_trident_voice_t *voice = (snd_trident_voice_t*) runtime->private_data;906 s nd_trident_voice_t*evoice = voice->extra;907 s nd_trident_pcm_mixer_t*mix = &trident->pcm_mixer[substream->number];901 struct snd_trident_voice*voice = (struct snd_trident_voice*) runtime->private_data; 902 struct snd_trident_voice*evoice = voice->extra; 903 struct snd_trident_pcm_mixer*mix = &trident->pcm_mixer[substream->number]; 908 904 909 905 spin_lock_irq(&trident->reg_lock); … … 1004 1000 static int snd_trident_capture_prepare(snd_pcm_substream_t * substream) 1005 1001 { 1006 trident_t *trident = snd_pcm_substream_chip(substream);1002 struct snd_trident *trident = snd_pcm_substream_chip(substream); 1007 1003 snd_pcm_runtime_t *runtime = substream->runtime; 1008 s nd_trident_voice_t *voice = (snd_trident_voice_t*) runtime->private_data;1004 struct snd_trident_voice*voice = (struct snd_trident_voice*) runtime->private_data; 1009 1005 unsigned int val, ESO_bytes; 1010 1006 … … 1118 1114 static int snd_trident_si7018_capture_hw_free(snd_pcm_substream_t * substream) 1119 1115 { 1120 trident_t *trident = snd_pcm_substream_chip(substream);1116 struct snd_trident *trident = snd_pcm_substream_chip(substream); 1121 1117 snd_pcm_runtime_t *runtime = substream->runtime; 1122 s nd_trident_voice_t *voice = (snd_trident_voice_t*) runtime->private_data;1123 s nd_trident_voice_t*evoice = voice ? voice->extra : NULL;1118 struct snd_trident_voice*voice = (struct snd_trident_voice*) runtime->private_data; 1119 struct snd_trident_voice*evoice = voice ? voice->extra : NULL; 1124 1120 1125 1121 snd_pcm_lib_free_pages(substream); … … 1144 1140 static int snd_trident_si7018_capture_prepare(snd_pcm_substream_t * substream) 1145 1141 { 1146 trident_t *trident = snd_pcm_substream_chip(substream);1142 struct snd_trident *trident = snd_pcm_substream_chip(substream); 1147 1143 snd_pcm_runtime_t *runtime = substream->runtime; 1148 s nd_trident_voice_t *voice = (snd_trident_voice_t*) runtime->private_data;1149 s nd_trident_voice_t*evoice = voice->extra;1144 struct snd_trident_voice*voice = (struct snd_trident_voice*) runtime->private_data; 1145 struct snd_trident_voice*evoice = voice->extra; 1150 1146 1151 1147 spin_lock_irq(&trident->reg_lock); … … 1214 1210 static int snd_trident_foldback_prepare(snd_pcm_substream_t * substream) 1215 1211 { 1216 trident_t *trident = snd_pcm_substream_chip(substream);1212 struct snd_trident *trident = snd_pcm_substream_chip(substream); 1217 1213 snd_pcm_runtime_t *runtime = substream->runtime; 1218 s nd_trident_voice_t *voice = (snd_trident_voice_t*) runtime->private_data;1219 s nd_trident_voice_t*evoice = voice->extra;1214 struct snd_trident_voice*voice = (struct snd_trident_voice*) runtime->private_data; 1215 struct snd_trident_voice*evoice = voice->extra; 1220 1216 1221 1217 spin_lock_irq(&trident->reg_lock); … … 1293 1289 snd_pcm_hw_params_t * hw_params) 1294 1290 { 1295 trident_t *trident = snd_pcm_substream_chip(substream);1291 struct snd_trident *trident = snd_pcm_substream_chip(substream); 1296 1292 unsigned int old_bits = 0, change = 0; 1297 1293 int err; … … 1357 1353 static int snd_trident_spdif_prepare(snd_pcm_substream_t * substream) 1358 1354 { 1359 trident_t *trident = snd_pcm_substream_chip(substream);1355 struct snd_trident *trident = snd_pcm_substream_chip(substream); 1360 1356 snd_pcm_runtime_t *runtime = substream->runtime; 1361 s nd_trident_voice_t *voice = (snd_trident_voice_t*) runtime->private_data;1362 s nd_trident_voice_t*evoice = voice->extra;1363 s nd_trident_pcm_mixer_t*mix = &trident->pcm_mixer[substream->number];1357 struct snd_trident_voice*voice = (struct snd_trident_voice*) runtime->private_data; 1358 struct snd_trident_voice*evoice = voice->extra; 1359 struct snd_trident_pcm_mixer*mix = &trident->pcm_mixer[substream->number]; 1364 1360 unsigned int RESO, LBAO; 1365 1361 unsigned int temp; … … 1498 1494 1499 1495 { 1500 trident_t *trident = snd_pcm_substream_chip(substream);1496 struct snd_trident *trident = snd_pcm_substream_chip(substream); 1501 1497 struct list_head *pos; 1502 1498 snd_pcm_substream_t *s; 1503 1499 unsigned int what, whati, capture_flag, spdif_flag; 1504 s nd_trident_voice_t*voice, *evoice;1500 struct snd_trident_voice*voice, *evoice; 1505 1501 unsigned int val, go; 1506 1502 … … 1524 1520 snd_pcm_group_for_each(pos, substream) { 1525 1521 s = snd_pcm_group_substream_entry(pos); 1526 if (( trident_t *) snd_pcm_substream_chip(s) == trident) {1527 voice = (s nd_trident_voice_t*) s->runtime->private_data;1522 if ((struct snd_trident *) snd_pcm_substream_chip(s) == trident) { 1523 voice = (struct snd_trident_voice*) s->runtime->private_data; 1528 1524 evoice = voice->extra; 1529 1525 what |= 1 << (voice->number & 0x1f); … … 1594 1590 static snd_pcm_uframes_t snd_trident_playback_pointer(snd_pcm_substream_t * substream) 1595 1591 { 1596 trident_t *trident = snd_pcm_substream_chip(substream);1592 struct snd_trident *trident = snd_pcm_substream_chip(substream); 1597 1593 snd_pcm_runtime_t *runtime = substream->runtime; 1598 s nd_trident_voice_t *voice = (snd_trident_voice_t*) runtime->private_data;1594 struct snd_trident_voice*voice = (struct snd_trident_voice*) runtime->private_data; 1599 1595 unsigned int cso; 1600 1596 … … 1633 1629 static snd_pcm_uframes_t snd_trident_capture_pointer(snd_pcm_substream_t * substream) 1634 1630 { 1635 trident_t *trident = snd_pcm_substream_chip(substream);1631 struct snd_trident *trident = snd_pcm_substream_chip(substream); 1636 1632 snd_pcm_runtime_t *runtime = substream->runtime; 1637 s nd_trident_voice_t *voice = (snd_trident_voice_t*) runtime->private_data;1633 struct snd_trident_voice*voice = (struct snd_trident_voice*) runtime->private_data; 1638 1634 unsigned int result; 1639 1635 … … 1663 1659 static snd_pcm_uframes_t snd_trident_spdif_pointer(snd_pcm_substream_t * substream) 1664 1660 { 1665 trident_t *trident = snd_pcm_substream_chip(substream);1661 struct snd_trident *trident = snd_pcm_substream_chip(substream); 1666 1662 snd_pcm_runtime_t *runtime = substream->runtime; 1667 s nd_trident_voice_t *voice = (snd_trident_voice_t*) runtime->private_data;1663 struct snd_trident_voice*voice = (struct snd_trident_voice*) runtime->private_data; 1668 1664 unsigned int result; 1669 1665 … … 1797 1793 static void snd_trident_pcm_free_substream(snd_pcm_runtime_t *runtime) 1798 1794 { 1799 s nd_trident_voice_t *voice = (snd_trident_voice_t*) runtime->private_data;1800 trident_t *trident;1795 struct snd_trident_voice*voice = (struct snd_trident_voice*) runtime->private_data; 1796 struct snd_trident *trident; 1801 1797 1802 1798 if (voice) { … … 1808 1804 static int snd_trident_playback_open(snd_pcm_substream_t * substream) 1809 1805 { 1810 trident_t *trident = snd_pcm_substream_chip(substream);1806 struct snd_trident *trident = snd_pcm_substream_chip(substream); 1811 1807 snd_pcm_runtime_t *runtime = substream->runtime; 1812 s nd_trident_voice_t*voice;1808 struct snd_trident_voice*voice; 1813 1809 1814 1810 voice = snd_trident_alloc_voice(trident, SNDRV_TRIDENT_VOICE_TYPE_PCM, 0, 0); … … 1836 1832 static int snd_trident_playback_close(snd_pcm_substream_t * substream) 1837 1833 { 1838 trident_t *trident = snd_pcm_substream_chip(substream);1834 struct snd_trident *trident = snd_pcm_substream_chip(substream); 1839 1835 snd_pcm_runtime_t *runtime = substream->runtime; 1840 s nd_trident_voice_t *voice = (snd_trident_voice_t*) runtime->private_data;1836 struct snd_trident_voice*voice = (struct snd_trident_voice*) runtime->private_data; 1841 1837 1842 1838 snd_trident_pcm_mixer_free(trident, voice, substream); … … 1857 1853 static int snd_trident_spdif_open(snd_pcm_substream_t * substream) 1858 1854 { 1859 trident_t *trident = snd_pcm_substream_chip(substream);1860 s nd_trident_voice_t*voice;1855 struct snd_trident *trident = snd_pcm_substream_chip(substream); 1856 struct snd_trident_voice*voice; 1861 1857 snd_pcm_runtime_t *runtime = substream->runtime; 1862 1858 … … 1898 1894 static int snd_trident_spdif_close(snd_pcm_substream_t * substream) 1899 1895 { 1900 trident_t *trident = snd_pcm_substream_chip(substream);1896 struct snd_trident *trident = snd_pcm_substream_chip(substream); 1901 1897 unsigned int temp; 1902 1898 … … 1936 1932 static int snd_trident_capture_open(snd_pcm_substream_t * substream) 1937 1933 { 1938 trident_t *trident = snd_pcm_substream_chip(substream);1939 s nd_trident_voice_t*voice;1934 struct snd_trident *trident = snd_pcm_substream_chip(substream); 1935 struct snd_trident_voice*voice; 1940 1936 snd_pcm_runtime_t *runtime = substream->runtime; 1941 1937 … … 1980 1976 static int snd_trident_foldback_open(snd_pcm_substream_t * substream) 1981 1977 { 1982 trident_t *trident = snd_pcm_substream_chip(substream);1983 s nd_trident_voice_t*voice;1978 struct snd_trident *trident = snd_pcm_substream_chip(substream); 1979 struct snd_trident_voice*voice; 1984 1980 snd_pcm_runtime_t *runtime = substream->runtime; 1985 1981 … … 2007 2003 static int snd_trident_foldback_close(snd_pcm_substream_t * substream) 2008 2004 { 2009 trident_t *trident = snd_pcm_substream_chip(substream);2010 s nd_trident_voice_t*voice;2005 struct snd_trident *trident = snd_pcm_substream_chip(substream); 2006 struct snd_trident_voice*voice; 2011 2007 snd_pcm_runtime_t *runtime = substream->runtime; 2012 voice = (s nd_trident_voice_t*) runtime->private_data;2008 voice = (struct snd_trident_voice*) runtime->private_data; 2013 2009 2014 2010 /* stop capture channel */ … … 2125 2121 static void snd_trident_pcm_free(snd_pcm_t *pcm) 2126 2122 { 2127 trident_t *trident = pcm->private_data;2123 struct snd_trident *trident = pcm->private_data; 2128 2124 trident->pcm = NULL; 2129 2125 snd_pcm_lib_preallocate_free_for_all(pcm); … … 2132 2128 static void snd_trident_foldback_pcm_free(snd_pcm_t *pcm) 2133 2129 { 2134 trident_t *trident = pcm->private_data;2130 struct snd_trident *trident = pcm->private_data; 2135 2131 trident->foldback = NULL; 2136 2132 snd_pcm_lib_preallocate_free_for_all(pcm); … … 2139 2135 static void snd_trident_spdif_pcm_free(snd_pcm_t *pcm) 2140 2136 { 2141 trident_t *trident = pcm->private_data;2137 struct snd_trident *trident = pcm->private_data; 2142 2138 trident->spdif = NULL; 2143 2139 snd_pcm_lib_preallocate_free_for_all(pcm); … … 2155 2151 ---------------------------------------------------------------------------*/ 2156 2152 2157 int __devinit snd_trident_pcm( trident_t * trident, int device, snd_pcm_t ** rpcm)2153 int __devinit snd_trident_pcm(struct snd_trident * trident, int device, snd_pcm_t ** rpcm) 2158 2154 { 2159 2155 snd_pcm_t *pcm; … … 2213 2209 ---------------------------------------------------------------------------*/ 2214 2210 2215 int __devinit snd_trident_foldback_pcm( trident_t * trident, int device, snd_pcm_t ** rpcm)2211 int __devinit snd_trident_foldback_pcm(struct snd_trident * trident, int device, snd_pcm_t ** rpcm) 2216 2212 { 2217 2213 snd_pcm_t *foldback; … … 2271 2267 ---------------------------------------------------------------------------*/ 2272 2268 2273 int __devinit snd_trident_spdif_pcm( trident_t * trident, int device, snd_pcm_t ** rpcm)2269 int __devinit snd_trident_spdif_pcm(struct snd_trident * trident, int device, snd_pcm_t ** rpcm) 2274 2270 { 2275 2271 snd_pcm_t *spdif; … … 2321 2317 snd_ctl_elem_value_t * ucontrol) 2322 2318 { 2323 trident_t *trident = snd_kcontrol_chip(kcontrol);2319 struct snd_trident *trident = snd_kcontrol_chip(kcontrol); 2324 2320 unsigned char val; 2325 2321 … … 2334 2330 snd_ctl_elem_value_t * ucontrol) 2335 2331 { 2336 trident_t *trident = snd_kcontrol_chip(kcontrol);2332 struct snd_trident *trident = snd_kcontrol_chip(kcontrol); 2337 2333 unsigned char val; 2338 2334 int change; … … 2388 2384 snd_ctl_elem_value_t * ucontrol) 2389 2385 { 2390 trident_t *trident = snd_kcontrol_chip(kcontrol);2386 struct snd_trident *trident = snd_kcontrol_chip(kcontrol); 2391 2387 2392 2388 spin_lock_irq(&trident->reg_lock); … … 2402 2398 snd_ctl_elem_value_t * ucontrol) 2403 2399 { 2404 trident_t *trident = snd_kcontrol_chip(kcontrol);2400 struct snd_trident *trident = snd_kcontrol_chip(kcontrol); 2405 2401 unsigned int val; 2406 2402 int change; … … 2481 2477 snd_ctl_elem_value_t * ucontrol) 2482 2478 { 2483 trident_t *trident = snd_kcontrol_chip(kcontrol);2479 struct snd_trident *trident = snd_kcontrol_chip(kcontrol); 2484 2480 2485 2481 spin_lock_irq(&trident->reg_lock); … … 2495 2491 snd_ctl_elem_value_t * ucontrol) 2496 2492 { 2497 trident_t *trident = snd_kcontrol_chip(kcontrol);2493 struct snd_trident *trident = snd_kcontrol_chip(kcontrol); 2498 2494 unsigned int val; 2499 2495 int change; … … 2545 2541 snd_ctl_elem_value_t * ucontrol) 2546 2542 { 2547 trident_t *trident = snd_kcontrol_chip(kcontrol);2543 struct snd_trident *trident = snd_kcontrol_chip(kcontrol); 2548 2544 unsigned char val; 2549 2545 … … 2558 2554 snd_ctl_elem_value_t * ucontrol) 2559 2555 { 2560 trident_t *trident = snd_kcontrol_chip(kcontrol);2556 struct snd_trident *trident = snd_kcontrol_chip(kcontrol); 2561 2557 unsigned char val; 2562 2558 int change = 0; … … 2602 2598 snd_ctl_elem_value_t * ucontrol) 2603 2599 { 2604 trident_t *trident = snd_kcontrol_chip(kcontrol);2600 struct snd_trident *trident = snd_kcontrol_chip(kcontrol); 2605 2601 unsigned int val; 2606 2602 … … 2614 2610 snd_ctl_elem_value_t * ucontrol) 2615 2611 { 2616 trident_t *trident = snd_kcontrol_chip(kcontrol);2612 struct snd_trident *trident = snd_kcontrol_chip(kcontrol); 2617 2613 unsigned int val; 2618 2614 int change = 0; … … 2659 2655 static int snd_trident_pcm_vol_control_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo) 2660 2656 { 2661 trident_t *trident = snd_kcontrol_chip(kcontrol);2657 struct snd_trident *trident = snd_kcontrol_chip(kcontrol); 2662 2658 2663 2659 uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER; … … 2673 2669 snd_ctl_elem_value_t * ucontrol) 2674 2670 { 2675 trident_t *trident = snd_kcontrol_chip(kcontrol);2676 s nd_trident_pcm_mixer_t*mix = &trident->pcm_mixer[snd_ctl_get_ioffnum(kcontrol, &ucontrol->id)];2671 struct snd_trident *trident = snd_kcontrol_chip(kcontrol); 2672 struct snd_trident_pcm_mixer*mix = &trident->pcm_mixer[snd_ctl_get_ioffnum(kcontrol, &ucontrol->id)]; 2677 2673 2678 2674 if (trident->device == TRIDENT_DEVICE_ID_SI7018) { … … 2687 2683 snd_ctl_elem_value_t * ucontrol) 2688 2684 { 2689 trident_t *trident = snd_kcontrol_chip(kcontrol);2690 s nd_trident_pcm_mixer_t*mix = &trident->pcm_mixer[snd_ctl_get_ioffnum(kcontrol, &ucontrol->id)];2685 struct snd_trident *trident = snd_kcontrol_chip(kcontrol); 2686 struct snd_trident_pcm_mixer*mix = &trident->pcm_mixer[snd_ctl_get_ioffnum(kcontrol, &ucontrol->id)]; 2691 2687 unsigned int val; 2692 2688 int change = 0; … … 2735 2731 snd_ctl_elem_value_t * ucontrol) 2736 2732 { 2737 trident_t *trident = snd_kcontrol_chip(kcontrol);2738 s nd_trident_pcm_mixer_t*mix = &trident->pcm_mixer[snd_ctl_get_ioffnum(kcontrol, &ucontrol->id)];2733 struct snd_trident *trident = snd_kcontrol_chip(kcontrol); 2734 struct snd_trident_pcm_mixer*mix = &trident->pcm_mixer[snd_ctl_get_ioffnum(kcontrol, &ucontrol->id)]; 2739 2735 2740 2736 ucontrol->value.integer.value[0] = mix->pan; … … 2750 2746 snd_ctl_elem_value_t * ucontrol) 2751 2747 { 2752 trident_t *trident = snd_kcontrol_chip(kcontrol);2753 s nd_trident_pcm_mixer_t*mix = &trident->pcm_mixer[snd_ctl_get_ioffnum(kcontrol, &ucontrol->id)];2748 struct snd_trident *trident = snd_kcontrol_chip(kcontrol); 2749 struct snd_trident_pcm_mixer*mix = &trident->pcm_mixer[snd_ctl_get_ioffnum(kcontrol, &ucontrol->id)]; 2754 2750 unsigned char val; 2755 2751 int change = 0; … … 2797 2793 snd_ctl_elem_value_t * ucontrol) 2798 2794 { 2799 trident_t *trident = snd_kcontrol_chip(kcontrol);2800 s nd_trident_pcm_mixer_t*mix = &trident->pcm_mixer[snd_ctl_get_ioffnum(kcontrol, &ucontrol->id)];2795 struct snd_trident *trident = snd_kcontrol_chip(kcontrol); 2796 struct snd_trident_pcm_mixer*mix = &trident->pcm_mixer[snd_ctl_get_ioffnum(kcontrol, &ucontrol->id)]; 2801 2797 2802 2798 ucontrol->value.integer.value[0] = 127 - mix->rvol; … … 2807 2803 snd_ctl_elem_value_t * ucontrol) 2808 2804 { 2809 trident_t *trident = snd_kcontrol_chip(kcontrol);2810 s nd_trident_pcm_mixer_t*mix = &trident->pcm_mixer[snd_ctl_get_ioffnum(kcontrol, &ucontrol->id)];2805 struct snd_trident *trident = snd_kcontrol_chip(kcontrol); 2806 struct snd_trident_pcm_mixer*mix = &trident->pcm_mixer[snd_ctl_get_ioffnum(kcontrol, &ucontrol->id)]; 2811 2807 unsigned short val; 2812 2808 int change = 0; … … 2851 2847 snd_ctl_elem_value_t * ucontrol) 2852 2848 { 2853 trident_t *trident = snd_kcontrol_chip(kcontrol);2854 s nd_trident_pcm_mixer_t*mix = &trident->pcm_mixer[snd_ctl_get_ioffnum(kcontrol, &ucontrol->id)];2849 struct snd_trident *trident = snd_kcontrol_chip(kcontrol); 2850 struct snd_trident_pcm_mixer*mix = &trident->pcm_mixer[snd_ctl_get_ioffnum(kcontrol, &ucontrol->id)]; 2855 2851 2856 2852 ucontrol->value.integer.value[0] = 127 - mix->cvol; … … 2861 2857 snd_ctl_elem_value_t * ucontrol) 2862 2858 { 2863 trident_t *trident = snd_kcontrol_chip(kcontrol);2864 s nd_trident_pcm_mixer_t*mix = &trident->pcm_mixer[snd_ctl_get_ioffnum(kcontrol, &ucontrol->id)];2859 struct snd_trident *trident = snd_kcontrol_chip(kcontrol); 2860 struct snd_trident_pcm_mixer*mix = &trident->pcm_mixer[snd_ctl_get_ioffnum(kcontrol, &ucontrol->id)]; 2865 2861 unsigned short val; 2866 2862 int change = 0; … … 2901 2897 } 2902 2898 2903 static void snd_trident_notify_pcm_change( trident_t *trident, snd_trident_pcm_mixer_t*tmix, int num, int activate)2899 static void snd_trident_notify_pcm_change(struct snd_trident *trident, struct snd_trident_pcm_mixer*tmix, int num, int activate) 2904 2900 { 2905 2901 snd_trident_notify_pcm_change1(trident->card, trident->ctl_vol, num, activate); … … 2909 2905 } 2910 2906 2911 static int snd_trident_pcm_mixer_build( trident_t *trident, snd_trident_voice_t*voice, snd_pcm_substream_t *substream)2912 { 2913 s nd_trident_pcm_mixer_t*tmix;2907 static int snd_trident_pcm_mixer_build(struct snd_trident *trident, struct snd_trident_voice*voice, snd_pcm_substream_t *substream) 2908 { 2909 struct snd_trident_pcm_mixer*tmix; 2914 2910 2915 2911 snd_assert(trident != NULL && voice != NULL && substream != NULL, return -EINVAL); … … 2924 2920 } 2925 2921 2926 static int snd_trident_pcm_mixer_free( trident_t *trident, snd_trident_voice_t*voice, snd_pcm_substream_t *substream)2927 { 2928 s nd_trident_pcm_mixer_t*tmix;2922 static int snd_trident_pcm_mixer_free(struct snd_trident *trident, struct snd_trident_voice*voice, snd_pcm_substream_t *substream) 2923 { 2924 struct snd_trident_pcm_mixer*tmix; 2929 2925 2930 2926 snd_assert(trident != NULL && substream != NULL, return -EINVAL); … … 2946 2942 ---------------------------------------------------------------------------*/ 2947 2943 2948 static int __devinit snd_trident_mixer( trident_t * trident, int pcm_spdif_device)2944 static int __devinit snd_trident_mixer(struct snd_trident * trident, int pcm_spdif_device) 2949 2945 { 2950 2946 ac97_template_t _ac97; … … 3013 3009 3014 3010 for (idx = 0; idx < 32; idx++) { 3015 s nd_trident_pcm_mixer_t*tmix;3011 struct snd_trident_pcm_mixer*tmix; 3016 3012 3017 3013 tmix = &trident->pcm_mixer[idx]; … … 3107 3103 typedef struct snd_trident_gameport { 3108 3104 struct gameport info; 3109 trident_t *chip;3105 struct snd_trident *chip; 3110 3106 } trident_gameport_t; 3111 3107 … … 3113 3109 { 3114 3110 trident_gameport_t *gp = (trident_gameport_t *)gameport; 3115 trident_t *chip;3111 struct snd_trident *chip; 3116 3112 snd_assert(gp, return 0); 3117 3113 chip = gp->chip; … … 3122 3118 { 3123 3119 trident_gameport_t *gp = (trident_gameport_t *)gameport; 3124 trident_t *chip;3120 struct snd_trident *chip; 3125 3121 snd_assert(gp, return); 3126 3122 chip = gp->chip; … … 3131 3127 { 3132 3128 trident_gameport_t *gp = (trident_gameport_t *)gameport; 3133 trident_t *chip;3129 struct snd_trident *chip; 3134 3130 int i; 3135 3131 … … 3150 3146 { 3151 3147 trident_gameport_t *gp = (trident_gameport_t *)gameport; 3152 trident_t *chip;3148 struct snd_trident *chip; 3153 3149 snd_assert(gp, return -1); 3154 3150 chip = gp->chip; … … 3167 3163 } 3168 3164 3169 void __devinit snd_trident_gameport( trident_t *chip)3165 void __devinit snd_trident_gameport(struct snd_trident *chip) 3170 3166 { 3171 3167 trident_gameport_t *gp; … … 3188 3184 3189 3185 #else 3190 void __devinit snd_trident_gameport( trident_t *chip)3186 void __devinit snd_trident_gameport(struct snd_trident *chip) 3191 3187 { 3192 3188 } … … 3196 3192 * delay for 1 tick 3197 3193 */ 3198 inline static void do_delay( trident_t *chip)3194 inline static void do_delay(struct snd_trident *chip) 3199 3195 { 3200 3196 set_current_state(TASK_UNINTERRUPTIBLE); … … 3206 3202 */ 3207 3203 3208 static int snd_trident_sis_reset( trident_t *trident)3204 static int snd_trident_sis_reset(struct snd_trident *trident) 3209 3205 { 3210 3206 unsigned long end_time; … … 3262 3258 snd_info_buffer_t * buffer) 3263 3259 { 3264 trident_t *trident = entry->private_data;3260 struct snd_trident *trident = entry->private_data; 3265 3261 char *s; 3266 3262 … … 3300 3296 } 3301 3297 3302 static void __devinit snd_trident_proc_init( trident_t * trident)3298 static void __devinit snd_trident_proc_init(struct snd_trident * trident) 3303 3299 { 3304 3300 snd_info_entry_t *entry; … … 3313 3309 static int snd_trident_dev_free(snd_device_t *device) 3314 3310 { 3315 trident_t *trident = device->device_data;3311 struct snd_trident *trident = device->device_data; 3316 3312 return snd_trident_free(trident); 3317 3313 } … … 3329 3325 ---------------------------------------------------------------------------*/ 3330 3326 3331 static int __devinit snd_trident_tlb_alloc( trident_t *trident)3327 static int __devinit snd_trident_tlb_alloc(struct snd_trident *trident) 3332 3328 { 3333 3329 int i; … … 3366 3362 return -ENOMEM; 3367 3363 3368 trident->tlb.memhdr->block_extra_size = sizeof(s nd_trident_memblk_arg_t);3364 trident->tlb.memhdr->block_extra_size = sizeof(struct snd_trident_memblk_arg); 3369 3365 return 0; 3370 3366 } … … 3374 3370 */ 3375 3371 3376 static void snd_trident_stop_all_voices( trident_t *trident)3372 static void snd_trident_stop_all_voices(struct snd_trident *trident) 3377 3373 { 3378 3374 outl(0xffffffff, TRID_REG(trident, T4D_STOP_A)); … … 3382 3378 } 3383 3379 3384 static int snd_trident_4d_dx_init( trident_t *trident)3380 static int snd_trident_4d_dx_init(struct snd_trident *trident) 3385 3381 { 3386 3382 struct pci_dev *pci = trident->pci; … … 3422 3418 * initialize 4D NX chip 3423 3419 */ 3424 static int snd_trident_4d_nx_init( trident_t *trident)3420 static int snd_trident_4d_nx_init(struct snd_trident *trident) 3425 3421 { 3426 3422 struct pci_dev *pci = trident->pci; … … 3479 3475 * initialize sis7018 chip 3480 3476 */ 3481 static int snd_trident_sis_init( trident_t *trident)3477 static int snd_trident_sis_init(struct snd_trident *trident) 3482 3478 { 3483 3479 int err; … … 3515 3511 int pcm_spdif_device, 3516 3512 int max_wavetable_size, 3517 trident_t ** rtrident)3518 { 3519 trident_t *trident;3513 struct snd_trident ** rtrident) 3514 { 3515 struct snd_trident *trident; 3520 3516 int i, err; 3521 s nd_trident_voice_t*voice;3522 s nd_trident_pcm_mixer_t*tmix;3517 struct snd_trident_voice*voice; 3518 struct snd_trident_pcm_mixer*tmix; 3523 3519 #ifdef TARGET_OS2 3524 3520 static snd_device_ops_t ops = { … … 3627 3623 snd_trident_enable_eso(trident); 3628 3624 3629 snd_card_set_pm_callback(card, snd_trident_suspend, snd_trident_resume, trident);3630 3631 3625 snd_trident_proc_init(trident); 3632 3626 if ((err = snd_device_new(card, SNDRV_DEV_LOWLEVEL, trident, &ops)) < 0) { … … 3650 3644 ---------------------------------------------------------------------------*/ 3651 3645 3652 int snd_trident_free( trident_t *trident)3646 int snd_trident_free(struct snd_trident *trident) 3653 3647 { 3654 3648 #if defined(CONFIG_GAMEPORT) || (defined(MODULE) && defined(CONFIG_GAMEPORT_MODULE)) … … 3702 3696 static irqreturn_t snd_trident_interrupt(int irq, void *dev_id, struct pt_regs *regs) 3703 3697 { 3704 trident_t *trident = dev_id;3698 struct snd_trident *trident = dev_id; 3705 3699 unsigned int audio_int, chn_int, stimer, channel, mask, tmp; 3706 3700 int delta; 3707 s nd_trident_voice_t*voice;3701 struct snd_trident_voice*voice; 3708 3702 #ifdef TARGET_OS2 3709 3703 int fOurIrq = FALSE; … … 3821 3815 3822 3816 ---------------------------------------------------------------------------*/ 3823 int snd_trident_attach_synthesizer( trident_t *trident)3817 int snd_trident_attach_synthesizer(struct snd_trident *trident) 3824 3818 { 3825 3819 #ifdef CONFIG_SND_SEQUENCER 3826 3820 if (snd_seq_device_new(trident->card, 1, SNDRV_SEQ_DEV_ID_TRIDENT, 3827 sizeof( trident_t*), &trident->seq_dev) >= 0) {3821 sizeof(struct snd_trident*), &trident->seq_dev) >= 0) { 3828 3822 strcpy(trident->seq_dev->name, "4DWave"); 3829 *( trident_t**)SNDRV_SEQ_DEVICE_ARGPTR(trident->seq_dev) = trident;3823 *(struct snd_trident**)SNDRV_SEQ_DEVICE_ARGPTR(trident->seq_dev) = trident; 3830 3824 } 3831 3825 #endif … … 3833 3827 } 3834 3828 3835 int snd_trident_detach_synthesizer( trident_t *trident)3829 int snd_trident_detach_synthesizer(struct snd_trident *trident) 3836 3830 { 3837 3831 #ifdef CONFIG_SND_SEQUENCER … … 3844 3838 } 3845 3839 3846 s nd_trident_voice_t *snd_trident_alloc_voice(trident_t * trident, int type, int client, int port)3847 { 3848 s nd_trident_voice_t*pvoice;3840 struct snd_trident_voice*snd_trident_alloc_voice(struct snd_trident * trident, int type, int client, int port) 3841 { 3842 struct snd_trident_voice*pvoice; 3849 3843 unsigned long flags; 3850 3844 int idx; … … 3888 3882 } 3889 3883 3890 void snd_trident_free_voice( trident_t * trident, snd_trident_voice_t*voice)3884 void snd_trident_free_voice(struct snd_trident * trident, struct snd_trident_voice*voice) 3891 3885 { 3892 3886 unsigned long flags; 3893 void (*private_free)(s nd_trident_voice_t*);3887 void (*private_free)(struct snd_trident_voice*); 3894 3888 void *private_data; 3895 3889 … … 3916 3910 } 3917 3911 3918 void snd_trident_clear_voices( trident_t * trident, unsigned short v_min, unsigned short v_max)3912 void snd_trident_clear_voices(struct snd_trident * trident, unsigned short v_min, unsigned short v_max) 3919 3913 { 3920 3914 unsigned int i, val, mask[2] = { 0, 0 }; … … 3937 3931 3938 3932 #ifdef CONFIG_PM 3939 3940 static int snd_trident_suspend(snd_card_t *card, unsigned int state) 3941 { 3942 trident_t *trident = card->pm_private_data;3933 int snd_trident_suspend(struct pci_dev *pci, pm_message_t state) 3934 { 3935 struct snd_card *card = pci_get_drvdata(pci); 3936 struct snd_trident *trident = card->private_data; 3943 3937 3944 3938 trident->in_suspend = 1; 3939 snd_power_change_state(card, SNDRV_CTL_POWER_D3hot); 3945 3940 snd_pcm_suspend_all(trident->pcm); 3946 if (trident->foldback) 3947 snd_pcm_suspend_all(trident->foldback); 3948 if (trident->spdif) 3949 snd_pcm_suspend_all(trident->spdif); 3941 snd_pcm_suspend_all(trident->foldback); 3942 snd_pcm_suspend_all(trident->spdif); 3950 3943 3951 3944 snd_ac97_suspend(trident->ac97); 3952 if (trident->ac97_sec) 3953 snd_ac97_suspend(trident->ac97_sec); 3945 snd_ac97_suspend(trident->ac97_sec); 3954 3946 3955 3947 switch (trident->device) { … … 3960 3952 break; 3961 3953 } 3962 return 0; 3963 } 3964 3965 static int snd_trident_resume(snd_card_t *card, unsigned int state) 3966 { 3967 trident_t *trident = card->pm_private_data; 3968 3969 pci_enable_device(trident->pci); 3970 pci_set_dma_mask(trident->pci, 0x3fffffff); /* to be sure */ 3971 pci_set_master(trident->pci); /* to be sure */ 3954 pci_disable_device(pci); 3955 pci_save_state(pci); 3956 return 0; 3957 } 3958 3959 int snd_trident_resume(struct pci_dev *pci) 3960 { 3961 struct snd_card *card = pci_get_drvdata(pci); 3962 struct snd_trident *trident = card->private_data; 3963 3964 pci_restore_state(pci); 3965 pci_enable_device(pci); 3966 pci_set_master(pci); /* to be sure */ 3972 3967 3973 3968 switch (trident->device) { … … 3984 3979 3985 3980 snd_ac97_resume(trident->ac97); 3986 if (trident->ac97_sec)3987 snd_ac97_resume(trident->ac97_sec); 3981 snd_ac97_resume(trident->ac97_sec); 3982 3988 3983 /* restore some registers */ 3989 3984 outl(trident->musicvol_wavevol, TRID_REG(trident, T4D_MUSICVOL_WAVEVOL)); … … 3991 3986 snd_trident_enable_eso(trident); 3992 3987 3988 snd_power_change_state(card, SNDRV_CTL_POWER_D0); 3993 3989 trident->in_suspend = 0; 3994 3990 return 0;  - 
      
GPL/trunk/alsa-kernel/pci/trident/trident_memory.c
r33 r34 66 66 67 67 /* fill TLB entries -- we need to fill two entries */ 68 static inline void set_tlb_bus( trident_t *trident, int page, unsigned long ptr, dma_addr_t addr)68 static inline void set_tlb_bus(struct snd_trident *trident, int page, unsigned long ptr, dma_addr_t addr) 69 69 { 70 70 page <<= 1; … … 72 72 __set_tlb_bus(trident, page+1, ptr + SNDRV_TRIDENT_PAGE_SIZE, addr + SNDRV_TRIDENT_PAGE_SIZE); 73 73 } 74 static inline void set_silent_tlb( trident_t *trident, int page)74 static inline void set_silent_tlb(struct snd_trident *trident, int page) 75 75 { 76 76 page <<= 1; … … 97 97 98 98 /* fill TLB entries -- UNIT_PAGES entries must be filled */ 99 static inline void set_tlb_bus( trident_t *trident, int page, unsigned long ptr, dma_addr_t addr)99 static inline void set_tlb_bus(struct snd_trident *trident, int page, unsigned long ptr, dma_addr_t addr) 100 100 { 101 101 int i; … … 107 107 } 108 108 } 109 static inline void set_silent_tlb( trident_t *trident, int page)109 static inline void set_silent_tlb(struct snd_trident *trident, int page) 110 110 { 111 111 int i; … … 119 119 120 120 /* calculate buffer pointer from offset address */ 121 inline static void *offset_ptr( trident_t *trident, int offset)121 inline static void *offset_ptr(struct snd_trident *trident, int offset) 122 122 { 123 123 char *ptr; … … 128 128 129 129 /* first and last (aligned) pages of memory block */ 130 #define firstpg(blk) (((s nd_trident_memblk_arg_t*)snd_util_memblk_argptr(blk))->first_page)131 #define lastpg(blk) (((s nd_trident_memblk_arg_t*)snd_util_memblk_argptr(blk))->last_page)130 #define firstpg(blk) (((struct snd_trident_memblk_arg*)snd_util_memblk_argptr(blk))->first_page) 131 #define lastpg(blk) (((struct snd_trident_memblk_arg*)snd_util_memblk_argptr(blk))->last_page) 132 132 133 133 /* … … 185 185 */ 186 186 static snd_util_memblk_t * 187 snd_trident_alloc_sg_pages( trident_t *trident, snd_pcm_substream_t *substream)187 snd_trident_alloc_sg_pages(struct snd_trident *trident, snd_pcm_substream_t *substream) 188 188 { 189 189 snd_util_memhdr_t *hdr; … … 232 232 */ 233 233 static snd_util_memblk_t * 234 snd_trident_alloc_cont_pages( trident_t *trident, snd_pcm_substream_t *substream)234 snd_trident_alloc_cont_pages(struct snd_trident *trident, snd_pcm_substream_t *substream) 235 235 { 236 236 snd_util_memhdr_t *hdr; … … 272 272 */ 273 273 snd_util_memblk_t * 274 snd_trident_alloc_pages( trident_t *trident, snd_pcm_substream_t *substream)274 snd_trident_alloc_pages(struct snd_trident *trident, snd_pcm_substream_t *substream) 275 275 { 276 276 snd_assert(trident != NULL, return NULL); … … 286 286 * release DMA buffer from page table 287 287 */ 288 int snd_trident_free_pages( trident_t *trident, snd_util_memblk_t *blk)288 int snd_trident_free_pages(struct snd_trident *trident, snd_util_memblk_t *blk) 289 289 { 290 290 snd_util_memhdr_t *hdr; … … 314 314 /* 315 315 */ 316 static int synth_alloc_pages( trident_t *hw, snd_util_memblk_t *blk);317 static int synth_free_pages( trident_t *hw, snd_util_memblk_t *blk);316 static int synth_alloc_pages(struct snd_trident *hw, snd_util_memblk_t *blk); 317 static int synth_free_pages(struct snd_trident *hw, snd_util_memblk_t *blk); 318 318 319 319 /* … … 321 321 */ 322 322 snd_util_memblk_t * 323 snd_trident_synth_alloc( trident_t *hw, unsigned int size)323 snd_trident_synth_alloc(struct snd_trident *hw, unsigned int size) 324 324 { 325 325 snd_util_memblk_t *blk; … … 346 346 */ 347 347 int 348 snd_trident_synth_free( trident_t *hw, snd_util_memblk_t *blk)348 snd_trident_synth_free(struct snd_trident *hw, snd_util_memblk_t *blk) 349 349 { 350 350 snd_util_memhdr_t *hdr = hw->tlb.memhdr; … … 361 361 * reset TLB entry and free kernel page 362 362 */ 363 static void clear_tlb( trident_t *trident, int page)363 static void clear_tlb(struct snd_trident *trident, int page) 364 364 { 365 365 void *ptr = page_to_ptr(trident, page); … … 403 403 * allocate kernel pages and assign them to TLB 404 404 */ 405 static int synth_alloc_pages( trident_t *hw, snd_util_memblk_t *blk)405 static int synth_alloc_pages(struct snd_trident *hw, snd_util_memblk_t *blk) 406 406 { 407 407 int page, first_page, last_page; … … 439 439 * free pages 440 440 */ 441 static int synth_free_pages( trident_t *trident, snd_util_memblk_t *blk)441 static int synth_free_pages(struct snd_trident *trident, snd_util_memblk_t *blk) 442 442 { 443 443 int page, first_page, last_page; … … 453 453 * bzero(blk + offset, size) 454 454 */ 455 int snd_trident_synth_bzero( trident_t *trident, snd_util_memblk_t *blk, int offset, int size)455 int snd_trident_synth_bzero(struct snd_trident *trident, snd_util_memblk_t *blk, int offset, int size) 456 456 { 457 457 int page, nextofs, end_offset, temp, temp1; … … 476 476 * copy_from_user(blk + offset, data, size) 477 477 */ 478 int snd_trident_synth_copy_from_user( trident_t *trident, snd_util_memblk_t *blk, int offset, const char *data, int size)478 int snd_trident_synth_copy_from_user(struct snd_trident *trident, snd_util_memblk_t *blk, int offset, const char *data, int size) 479 479 { 480 480 int page, nextofs, end_offset, temp, temp1;  - 
      
GPL/trunk/alsa-kernel/pci/trident/trident_synth.c
r33 r34 190 190 */ 191 191 192 static void sample_start( trident_t * trident, snd_trident_voice_t* voice, snd_seq_position_t position);193 static void sample_stop( trident_t * trident, snd_trident_voice_t * voice, snd_seq_stop_mode_t mode);194 static void sample_freq( trident_t * trident, snd_trident_voice_t* voice, snd_seq_frequency_t freq);195 static void sample_volume( trident_t * trident, snd_trident_voice_t* voice, snd_seq_ev_volume_t * volume);196 static void sample_loop( trident_t * trident, snd_trident_voice_t* voice, snd_seq_ev_loop_t * loop);197 static void sample_pos( trident_t * trident, snd_trident_voice_t* voice, snd_seq_position_t position);198 static void sample_private1( trident_t * trident, snd_trident_voice_t* voice, unsigned char *data);199 200 static s nd_trident_sample_ops_tsample_ops =192 static void sample_start(struct snd_trident * trident, struct snd_trident_voice * voice, snd_seq_position_t position); 193 static void sample_stop(struct snd_trident * trident, struct snd_trident_voice * voice, int mode); 194 static void sample_freq(struct snd_trident * trident, struct snd_trident_voice * voice, snd_seq_frequency_t freq); 195 static void sample_volume(struct snd_trident * trident, struct snd_trident_voice * voice, snd_seq_ev_volume_t * volume); 196 static void sample_loop(struct snd_trident * trident, struct snd_trident_voice * voice, snd_seq_ev_loop_t * loop); 197 static void sample_pos(struct snd_trident * trident, struct snd_trident_voice * voice, snd_seq_position_t position); 198 static void sample_private1(struct snd_trident * trident, struct snd_trident_voice * voice, unsigned char *data); 199 200 static struct snd_trident_sample_ops sample_ops = 201 201 { 202 202 sample_start, … … 209 209 }; 210 210 211 static void snd_trident_simple_init(s nd_trident_voice_t* voice)211 static void snd_trident_simple_init(struct snd_trident_voice * voice) 212 212 { 213 213 //voice->handler_wave = interrupt_wave; … … 218 218 } 219 219 220 static void sample_start( trident_t * trident, snd_trident_voice_t* voice, snd_seq_position_t position)220 static void sample_start(struct snd_trident * trident, struct snd_trident_voice * voice, snd_seq_position_t position) 221 221 { 222 222 simple_instrument_t *simple; … … 303 303 } 304 304 305 static void sample_stop( trident_t * trident, snd_trident_voice_t * voice, snd_seq_stop_mode_t mode)305 static void sample_stop(struct snd_trident * trident, struct snd_trident_voice * voice, int mode) 306 306 { 307 307 unsigned long flags; … … 327 327 } 328 328 329 static void sample_freq( trident_t * trident, snd_trident_voice_t* voice, snd_seq_frequency_t freq)329 static void sample_freq(struct snd_trident * trident, struct snd_trident_voice * voice, snd_seq_frequency_t freq) 330 330 { 331 331 unsigned long flags; … … 353 353 } 354 354 355 static void sample_volume( trident_t * trident, snd_trident_voice_t* voice, snd_seq_ev_volume_t * volume)355 static void sample_volume(struct snd_trident * trident, struct snd_trident_voice * voice, snd_seq_ev_volume_t * volume) 356 356 { 357 357 unsigned long flags; … … 405 405 } 406 406 407 static void sample_loop( trident_t * trident, snd_trident_voice_t* voice, snd_seq_ev_loop_t * loop)407 static void sample_loop(struct snd_trident * trident, struct snd_trident_voice * voice, snd_seq_ev_loop_t * loop) 408 408 { 409 409 unsigned long flags; … … 444 444 } 445 445 446 static void sample_pos( trident_t * trident, snd_trident_voice_t* voice, snd_seq_position_t position)446 static void sample_pos(struct snd_trident * trident, struct snd_trident_voice * voice, snd_seq_position_t position) 447 447 { 448 448 unsigned long flags; … … 494 494 } 495 495 496 static void sample_private1( trident_t * trident, snd_trident_voice_t* voice, unsigned char *data)496 static void sample_private1(struct snd_trident * trident, struct snd_trident_voice * voice, unsigned char *data) 497 497 { 498 498 } … … 505 505 char __user *data, long len, int atomic) 506 506 { 507 trident_t *trident = private_data;507 struct snd_trident *trident = private_data; 508 508 int size = instr->size; 509 509 int shift = 0; … … 559 559 char *data, long len, int atomic) 560 560 { 561 // trident_t *trident = private_data;561 //struct snd_trident *trident = private_data; 562 562 int size = instr->size; 563 563 int shift = 0; … … 580 580 int atomic) 581 581 { 582 trident_t *trident = private_data;582 struct snd_trident *trident = private_data; 583 583 int size = instr->size; 584 584 … … 611 611 } 612 612 613 static void select_instrument( trident_t * trident, snd_trident_voice_t* v)613 static void select_instrument(struct snd_trident * trident, struct snd_trident_voice * v) 614 614 { 615 615 snd_seq_kinstr_t *instr; … … 628 628 */ 629 629 630 static void event_sample(snd_seq_event_t * ev, s nd_trident_port_t * p, snd_trident_voice_t* v)630 static void event_sample(snd_seq_event_t * ev, struct snd_trident_port * p, struct snd_trident_voice * v) 631 631 { 632 632 if (v->sample_ops && v->sample_ops->sample_stop) … … 642 642 } 643 643 644 static void event_cluster(snd_seq_event_t * ev, s nd_trident_port_t * p, snd_trident_voice_t* v)644 static void event_cluster(snd_seq_event_t * ev, struct snd_trident_port * p, struct snd_trident_voice * v) 645 645 { 646 646 if (v->sample_ops && v->sample_ops->sample_stop) … … 650 650 } 651 651 652 static void event_start(snd_seq_event_t * ev, s nd_trident_port_t * p, snd_trident_voice_t* v)652 static void event_start(snd_seq_event_t * ev, struct snd_trident_port * p, struct snd_trident_voice * v) 653 653 { 654 654 if (v->sample_ops && v->sample_ops->sample_start) … … 656 656 } 657 657 658 static void event_stop(snd_seq_event_t * ev, s nd_trident_port_t * p, snd_trident_voice_t* v)658 static void event_stop(snd_seq_event_t * ev, struct snd_trident_port * p, struct snd_trident_voice * v) 659 659 { 660 660 if (v->sample_ops && v->sample_ops->sample_stop) … … 662 662 } 663 663 664 static void event_freq(snd_seq_event_t * ev, s nd_trident_port_t * p, snd_trident_voice_t* v)664 static void event_freq(snd_seq_event_t * ev, struct snd_trident_port * p, struct snd_trident_voice * v) 665 665 { 666 666 if (v->sample_ops && v->sample_ops->sample_freq) … … 668 668 } 669 669 670 static void event_volume(snd_seq_event_t * ev, s nd_trident_port_t * p, snd_trident_voice_t* v)670 static void event_volume(snd_seq_event_t * ev, struct snd_trident_port * p, struct snd_trident_voice * v) 671 671 { 672 672 if (v->sample_ops && v->sample_ops->sample_volume) … … 674 674 } 675 675 676 static void event_loop(snd_seq_event_t * ev, s nd_trident_port_t * p, snd_trident_voice_t* v)676 static void event_loop(snd_seq_event_t * ev, struct snd_trident_port * p, struct snd_trident_voice * v) 677 677 { 678 678 if (v->sample_ops && v->sample_ops->sample_loop) … … 680 680 } 681 681 682 static void event_position(snd_seq_event_t * ev, s nd_trident_port_t * p, snd_trident_voice_t* v)682 static void event_position(snd_seq_event_t * ev, struct snd_trident_port * p, struct snd_trident_voice * v) 683 683 { 684 684 if (v->sample_ops && v->sample_ops->sample_pos) … … 686 686 } 687 687 688 static void event_private1(snd_seq_event_t * ev, s nd_trident_port_t * p, snd_trident_voice_t* v)688 static void event_private1(snd_seq_event_t * ev, struct snd_trident_port * p, struct snd_trident_voice * v) 689 689 { 690 690 if (v->sample_ops && v->sample_ops->sample_private1) … … 692 692 } 693 693 694 typedef void (trident_sample_event_handler_t) (snd_seq_event_t * ev, s nd_trident_port_t * p, snd_trident_voice_t* v);694 typedef void (trident_sample_event_handler_t) (snd_seq_event_t * ev, struct snd_trident_port * p, struct snd_trident_voice * v); 695 695 696 696 static trident_sample_event_handler_t *trident_sample_event_handlers[9] = … … 707 707 }; 708 708 709 static void snd_trident_sample_event(snd_seq_event_t * ev, s nd_trident_port_t * p)709 static void snd_trident_sample_event(snd_seq_event_t * ev, struct snd_trident_port * p) 710 710 { 711 711 int idx, voice; 712 trident_t *trident = p->trident;713 s nd_trident_voice_t*v;712 struct snd_trident *trident = p->trident; 713 struct snd_trident_voice *v; 714 714 unsigned long flags; 715 715 … … 734 734 */ 735 735 736 static void snd_trident_synth_free_voices( trident_t * trident, int client, int port)736 static void snd_trident_synth_free_voices(struct snd_trident * trident, int client, int port) 737 737 { 738 738 int idx; 739 s nd_trident_voice_t*voice;739 struct snd_trident_voice *voice; 740 740 741 741 for (idx = 0; idx < 32; idx++) { … … 748 748 static int snd_trident_synth_use(void *private_data, snd_seq_port_subscribe_t * info) 749 749 { 750 s nd_trident_port_t *port = (snd_trident_port_t *) private_data;751 trident_t *trident = port->trident;752 s nd_trident_voice_t*voice;750 struct snd_trident_port *port = (struct snd_trident_port *) private_data; 751 struct snd_trident *trident = port->trident; 752 struct snd_trident_voice *voice; 753 753 unsigned int idx; 754 754 unsigned long flags; … … 787 787 static int snd_trident_synth_unuse(void *private_data, snd_seq_port_subscribe_t * info) 788 788 { 789 s nd_trident_port_t *port = (snd_trident_port_t *) private_data;790 trident_t *trident = port->trident;789 struct snd_trident_port *port = (struct snd_trident_port *) private_data; 790 struct snd_trident *trident = port->trident; 791 791 unsigned long flags; 792 792 … … 801 801 */ 802 802 803 static void snd_trident_synth_free_private_instruments(s nd_trident_port_t * p, int client)803 static void snd_trident_synth_free_private_instruments(struct snd_trident_port * p, int client) 804 804 { 805 805 snd_seq_instr_header_t ifree; … … 812 812 int snd_trident_synth_event_input(snd_seq_event_t * ev, int direct, void *private_data, int atomic, int hop) 813 813 { 814 s nd_trident_port_t *p = (snd_trident_port_t *) private_data;814 struct snd_trident_port *p = (struct snd_trident_port *) private_data; 815 815 816 816 if (p == NULL) … … 844 844 { 845 845 int idx; 846 trident_t *trident = private_data;847 s nd_trident_voice_t*pvoice;846 struct snd_trident *trident = private_data; 847 struct snd_trident_voice *pvoice; 848 848 unsigned long flags; 849 849 … … 869 869 static void snd_trident_synth_free_port(void *private_data) 870 870 { 871 s nd_trident_port_t *p = (snd_trident_port_t *) private_data;871 struct snd_trident_port *p = (struct snd_trident_port *) private_data; 872 872 873 873 if (p) … … 875 875 } 876 876 877 static int snd_trident_synth_create_port( trident_t * trident, int idx)878 { 879 s nd_trident_port_t *p;880 s nd_seq_port_callback_tcallbacks;877 static int snd_trident_synth_create_port(struct snd_trident * trident, int idx) 878 { 879 struct snd_trident_port *p; 880 struct snd_seq_port_callback callbacks; 881 881 char name[32]; 882 882 char *str; … … 928 928 static int snd_trident_synth_new_device(snd_seq_device_t *dev) 929 929 { 930 trident_t *trident;930 struct snd_trident *trident; 931 931 int client, i; 932 s nd_seq_client_callback_tcallbacks;932 struct snd_seq_client_callback callbacks; 933 933 snd_seq_client_info_t cinfo; 934 934 snd_seq_port_subscribe_t sub; … … 936 936 char *str; 937 937 938 trident = *( trident_t **)SNDRV_SEQ_DEVICE_ARGPTR(dev);938 trident = *(struct snd_trident **)SNDRV_SEQ_DEVICE_ARGPTR(dev); 939 939 if (trident == NULL) 940 940 return -EINVAL; … … 994 994 static int snd_trident_synth_delete_device(snd_seq_device_t *dev) 995 995 { 996 trident_t *trident;997 998 trident = *( trident_t **)SNDRV_SEQ_DEVICE_ARGPTR(dev);996 struct snd_trident *trident; 997 998 trident = *(struct snd_trident **)SNDRV_SEQ_DEVICE_ARGPTR(dev); 999 999 if (trident == NULL) 1000 1000 return -EINVAL; … … 1018 1018 1019 1019 return snd_seq_device_register_driver(SNDRV_SEQ_DEV_ID_TRIDENT, &ops, 1020 sizeof( trident_t*));1020 sizeof(struct snd_trident*)); 1021 1021 } 1022 1022  
  Note:
 See   TracChangeset
 for help on using the changeset viewer.
  