Ignore:
Timestamp:
Dec 11, 2005, 5:57:39 PM (20 years ago)
Author:
vladest
Message:

Latest update from ALSA. some intial > 15 interrupts support

Location:
GPL/trunk/alsa-kernel/pci/trident
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • GPL/trunk/alsa-kernel/pci/trident/trident.c

    r33 r34  
    8383        static int dev;
    8484        snd_card_t *card;
    85         trident_t *trident;
     85        struct snd_trident *trident;
    8686        const char *str;
    8787        int err, pcm_dev = 0;
  • GPL/trunk/alsa-kernel/pci/trident/trident_main.c

    r33 r34  
    4444}
    4545
    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);
     46static int snd_trident_pcm_mixer_build(struct snd_trident *trident, struct snd_trident_voice* voice, snd_pcm_substream_t *substream);
     47static int snd_trident_pcm_mixer_free(struct snd_trident *trident, struct snd_trident_voice* voice, snd_pcm_substream_t *substream);
    4848static 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);
     49static int snd_trident_sis_reset(struct snd_trident *trident);
    5450
    5551/*
     
    5955
    6056#if 0
    61 static void snd_trident_print_voice_regs(trident_t *trident, int voice)
     57static void snd_trident_print_voice_regs(struct snd_trident *trident, int voice)
    6258{
    6359    unsigned int val, tmp;
     
    117113    unsigned short count = 0xffff;
    118114    unsigned long flags;
    119     trident_t *trident = ac97->private_data;
     115    struct snd_trident *trident = ac97->private_data;
    120116
    121117    spin_lock_irqsave(&trident->reg_lock, flags);
     
    176172    unsigned short count = 0xffff;
    177173    unsigned long flags;
    178     trident_t *trident = ac97->private_data;
     174    struct snd_trident *trident = ac97->private_data;
    179175
    180176    data = ((unsigned long) wdata) << 16;
     
    227223
    228224/*---------------------------------------------------------------------------
    229  void snd_trident_enable_eso(trident_t *trident)
     225 void snd_trident_enable_eso(struct snd_trident *trident)
    230226
    231227 Description: This routine will enable end of loop interrupts.
     
    238234 ---------------------------------------------------------------------------*/
    239235
    240 static void snd_trident_enable_eso(trident_t * trident)
     236static void snd_trident_enable_eso(struct snd_trident * trident)
    241237{
    242238    unsigned int val;
     
    251247
    252248/*---------------------------------------------------------------------------
    253  void snd_trident_disable_eso(trident_t *trident)
     249 void snd_trident_disable_eso(struct snd_trident *trident)
    254250
    255251 Description: This routine will disable end of loop interrupts.
     
    265261 ---------------------------------------------------------------------------*/
    266262
    267 static void snd_trident_disable_eso(trident_t * trident)
     263static void snd_trident_disable_eso(struct snd_trident * trident)
    268264{
    269265    unsigned int tmp;
     
    276272
    277273/*---------------------------------------------------------------------------
    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)
    279275
    280276 Description: Start a voice, any channel 0 thru 63.
     
    289285 ---------------------------------------------------------------------------*/
    290286
    291 void snd_trident_start_voice(trident_t * trident, unsigned int voice)
     287void snd_trident_start_voice(struct snd_trident * trident, unsigned int voice)
    292288{
    293289    unsigned int mask = 1 << (voice & 0x1f);
     
    298294
    299295/*---------------------------------------------------------------------------
    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)
    301297
    302298 Description: Stop a voice, any channel 0 thru 63.
     
    311307 ---------------------------------------------------------------------------*/
    312308
    313 void snd_trident_stop_voice(trident_t * trident, unsigned int voice)
     309void snd_trident_stop_voice(struct snd_trident * trident, unsigned int voice)
    314310{
    315311    unsigned int mask = 1 << (voice & 0x1f);
     
    320316
    321317/*---------------------------------------------------------------------------
    322  int snd_trident_allocate_pcm_channel(trident_t *trident)
     318 int snd_trident_allocate_pcm_channel(struct snd_trident *trident)
    323319
    324320 Description: Allocate hardware channel in Bank B (32-63).
     
    330326 ---------------------------------------------------------------------------*/
    331327
    332 static int snd_trident_allocate_pcm_channel(trident_t * trident)
     328static int snd_trident_allocate_pcm_channel(struct snd_trident * trident)
    333329{
    334330    int idx;
     
    358354 ---------------------------------------------------------------------------*/
    359355
    360 static void snd_trident_free_pcm_channel(trident_t *trident, int channel)
     356static void snd_trident_free_pcm_channel(struct snd_trident *trident, int channel)
    361357{
    362358    if (channel < 32 || channel > 63)
     
    380376 ---------------------------------------------------------------------------*/
    381377
    382 static int snd_trident_allocate_synth_channel(trident_t * trident)
     378static int snd_trident_allocate_synth_channel(struct snd_trident * trident)
    383379{
    384380    int idx;
     
    406402 ---------------------------------------------------------------------------*/
    407403
    408 static void snd_trident_free_synth_channel(trident_t *trident, int channel)
     404static void snd_trident_free_synth_channel(struct snd_trident *trident, int channel)
    409405{
    410406    if (channel < 0 || channel > 31)
     
    429425 ---------------------------------------------------------------------------*/
    430426
    431 void snd_trident_write_voice_regs(trident_t * trident,
    432                                   snd_trident_voice_t * voice)
     427void snd_trident_write_voice_regs(struct snd_trident * trident,
     428                                  struct snd_trident_voice* voice)
    433429{
    434430    unsigned int FmcRvolCvol;
     
    501497 ---------------------------------------------------------------------------*/
    502498
    503 static void snd_trident_write_cso_reg(trident_t * trident, snd_trident_voice_t * voice, unsigned int CSO)
     499static void snd_trident_write_cso_reg(struct snd_trident * trident, struct snd_trident_voice* voice, unsigned int CSO)
    504500{
    505501    voice->CSO = CSO;
     
    524520 ---------------------------------------------------------------------------*/
    525521
    526 static void snd_trident_write_eso_reg(trident_t * trident, snd_trident_voice_t * voice, unsigned int ESO)
     522static void snd_trident_write_eso_reg(struct snd_trident * trident, struct snd_trident_voice* voice, unsigned int ESO)
    527523{
    528524    voice->ESO = ESO;
     
    547543 ---------------------------------------------------------------------------*/
    548544
    549 static void snd_trident_write_vol_reg(trident_t * trident, snd_trident_voice_t * voice, unsigned int Vol)
     545static void snd_trident_write_vol_reg(struct snd_trident * trident, struct snd_trident_voice* voice, unsigned int Vol)
    550546{
    551547    voice->Vol = Vol;
     
    575571 ---------------------------------------------------------------------------*/
    576572
    577 static void snd_trident_write_pan_reg(trident_t * trident, snd_trident_voice_t * voice, unsigned int Pan)
     573static void snd_trident_write_pan_reg(struct snd_trident * trident, struct snd_trident_voice* voice, unsigned int Pan)
    578574{
    579575    voice->Pan = Pan;
     
    594590 ---------------------------------------------------------------------------*/
    595591
    596 static void snd_trident_write_rvol_reg(trident_t * trident, snd_trident_voice_t * voice, unsigned int RVol)
     592static void snd_trident_write_rvol_reg(struct snd_trident * trident, struct snd_trident_voice* voice, unsigned int RVol)
    597593{
    598594    voice->RVol = RVol;
     
    614610 ---------------------------------------------------------------------------*/
    615611
    616 static void snd_trident_write_cvol_reg(trident_t * trident, snd_trident_voice_t * voice, unsigned int CVol)
     612static void snd_trident_write_cvol_reg(struct snd_trident * trident, struct snd_trident_voice* voice, unsigned int CVol)
    617613{
    618614    voice->CVol = CVol;
     
    774770                                 snd_pcm_hw_params_t * hw_params)
    775771{
    776     trident_t *trident = snd_pcm_substream_chip(substream);
     772    struct snd_trident *trident = snd_pcm_substream_chip(substream);
    777773    snd_pcm_runtime_t *runtime = substream->runtime;
    778     snd_trident_voice_t *voice = (snd_trident_voice_t *) runtime->private_data;
     774    struct snd_trident_voice*voice = (struct snd_trident_voice*) runtime->private_data;
    779775    int err;
    780776
     
    808804                                snd_pcm_hw_params_t * hw_params)
    809805{
    810     trident_t *trident = snd_pcm_substream_chip(substream);
     806    struct snd_trident *trident = snd_pcm_substream_chip(substream);
    811807    snd_pcm_runtime_t *runtime = substream->runtime;
    812     snd_trident_voice_t *voice = (snd_trident_voice_t *) runtime->private_data;
    813     snd_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;
    814810
    815811    /* voice management */
     
    869865static int snd_trident_hw_free(snd_pcm_substream_t * substream)
    870866{
    871     trident_t *trident = snd_pcm_substream_chip(substream);
     867    struct snd_trident *trident = snd_pcm_substream_chip(substream);
    872868    snd_pcm_runtime_t *runtime = substream->runtime;
    873     snd_trident_voice_t *voice = (snd_trident_voice_t *) runtime->private_data;
    874     snd_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;
    875871
    876872    if (trident->tlb.entries) {
     
    901897static int snd_trident_playback_prepare(snd_pcm_substream_t * substream)
    902898{
    903     trident_t *trident = snd_pcm_substream_chip(substream);
     899    struct snd_trident *trident = snd_pcm_substream_chip(substream);
    904900    snd_pcm_runtime_t *runtime = substream->runtime;
    905     snd_trident_voice_t *voice = (snd_trident_voice_t *) runtime->private_data;
    906     snd_trident_voice_t *evoice = voice->extra;
    907     snd_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];
    908904
    909905    spin_lock_irq(&trident->reg_lock);
     
    10041000static int snd_trident_capture_prepare(snd_pcm_substream_t * substream)
    10051001{
    1006     trident_t *trident = snd_pcm_substream_chip(substream);
     1002    struct snd_trident *trident = snd_pcm_substream_chip(substream);
    10071003    snd_pcm_runtime_t *runtime = substream->runtime;
    1008     snd_trident_voice_t *voice = (snd_trident_voice_t *) runtime->private_data;
     1004    struct snd_trident_voice*voice = (struct snd_trident_voice*) runtime->private_data;
    10091005    unsigned int val, ESO_bytes;
    10101006
     
    11181114static int snd_trident_si7018_capture_hw_free(snd_pcm_substream_t * substream)
    11191115{
    1120     trident_t *trident = snd_pcm_substream_chip(substream);
     1116    struct snd_trident *trident = snd_pcm_substream_chip(substream);
    11211117    snd_pcm_runtime_t *runtime = substream->runtime;
    1122     snd_trident_voice_t *voice = (snd_trident_voice_t *) runtime->private_data;
    1123     snd_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;
    11241120
    11251121    snd_pcm_lib_free_pages(substream);
     
    11441140static int snd_trident_si7018_capture_prepare(snd_pcm_substream_t * substream)
    11451141{
    1146     trident_t *trident = snd_pcm_substream_chip(substream);
     1142    struct snd_trident *trident = snd_pcm_substream_chip(substream);
    11471143    snd_pcm_runtime_t *runtime = substream->runtime;
    1148     snd_trident_voice_t *voice = (snd_trident_voice_t *) runtime->private_data;
    1149     snd_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;
    11501146
    11511147    spin_lock_irq(&trident->reg_lock);
     
    12141210static int snd_trident_foldback_prepare(snd_pcm_substream_t * substream)
    12151211{
    1216     trident_t *trident = snd_pcm_substream_chip(substream);
     1212    struct snd_trident *trident = snd_pcm_substream_chip(substream);
    12171213    snd_pcm_runtime_t *runtime = substream->runtime;
    1218     snd_trident_voice_t *voice = (snd_trident_voice_t *) runtime->private_data;
    1219     snd_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;
    12201216
    12211217    spin_lock_irq(&trident->reg_lock);
     
    12931289                                       snd_pcm_hw_params_t * hw_params)
    12941290{
    1295     trident_t *trident = snd_pcm_substream_chip(substream);
     1291    struct snd_trident *trident = snd_pcm_substream_chip(substream);
    12961292    unsigned int old_bits = 0, change = 0;
    12971293    int err;
     
    13571353static int snd_trident_spdif_prepare(snd_pcm_substream_t * substream)
    13581354{
    1359     trident_t *trident = snd_pcm_substream_chip(substream);
     1355    struct snd_trident *trident = snd_pcm_substream_chip(substream);
    13601356    snd_pcm_runtime_t *runtime = substream->runtime;
    1361     snd_trident_voice_t *voice = (snd_trident_voice_t *) runtime->private_data;
    1362     snd_trident_voice_t *evoice = voice->extra;
    1363     snd_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];
    13641360    unsigned int RESO, LBAO;
    13651361    unsigned int temp;
     
    14981494
    14991495{
    1500     trident_t *trident = snd_pcm_substream_chip(substream);
     1496    struct snd_trident *trident = snd_pcm_substream_chip(substream);
    15011497    struct list_head *pos;
    15021498    snd_pcm_substream_t *s;
    15031499    unsigned int what, whati, capture_flag, spdif_flag;
    1504     snd_trident_voice_t *voice, *evoice;
     1500    struct snd_trident_voice*voice, *evoice;
    15051501    unsigned int val, go;
    15061502
     
    15241520    snd_pcm_group_for_each(pos, substream) {
    15251521        s = snd_pcm_group_substream_entry(pos);
    1526         if ((trident_t *) snd_pcm_substream_chip(s) == trident) {
    1527             voice = (snd_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;
    15281524            evoice = voice->extra;
    15291525            what |= 1 << (voice->number & 0x1f);
     
    15941590static snd_pcm_uframes_t snd_trident_playback_pointer(snd_pcm_substream_t * substream)
    15951591{
    1596     trident_t *trident = snd_pcm_substream_chip(substream);
     1592    struct snd_trident *trident = snd_pcm_substream_chip(substream);
    15971593    snd_pcm_runtime_t *runtime = substream->runtime;
    1598     snd_trident_voice_t *voice = (snd_trident_voice_t *) runtime->private_data;
     1594    struct snd_trident_voice*voice = (struct snd_trident_voice*) runtime->private_data;
    15991595    unsigned int cso;
    16001596
     
    16331629static snd_pcm_uframes_t snd_trident_capture_pointer(snd_pcm_substream_t * substream)
    16341630{
    1635     trident_t *trident = snd_pcm_substream_chip(substream);
     1631    struct snd_trident *trident = snd_pcm_substream_chip(substream);
    16361632    snd_pcm_runtime_t *runtime = substream->runtime;
    1637     snd_trident_voice_t *voice = (snd_trident_voice_t *) runtime->private_data;
     1633    struct snd_trident_voice*voice = (struct snd_trident_voice*) runtime->private_data;
    16381634    unsigned int result;
    16391635
     
    16631659static snd_pcm_uframes_t snd_trident_spdif_pointer(snd_pcm_substream_t * substream)
    16641660{
    1665     trident_t *trident = snd_pcm_substream_chip(substream);
     1661    struct snd_trident *trident = snd_pcm_substream_chip(substream);
    16661662    snd_pcm_runtime_t *runtime = substream->runtime;
    1667     snd_trident_voice_t *voice = (snd_trident_voice_t *) runtime->private_data;
     1663    struct snd_trident_voice*voice = (struct snd_trident_voice*) runtime->private_data;
    16681664    unsigned int result;
    16691665
     
    17971793static void snd_trident_pcm_free_substream(snd_pcm_runtime_t *runtime)
    17981794{
    1799     snd_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;
    18011797
    18021798    if (voice) {
     
    18081804static int snd_trident_playback_open(snd_pcm_substream_t * substream)
    18091805{
    1810     trident_t *trident = snd_pcm_substream_chip(substream);
     1806    struct snd_trident *trident = snd_pcm_substream_chip(substream);
    18111807    snd_pcm_runtime_t *runtime = substream->runtime;
    1812     snd_trident_voice_t *voice;
     1808    struct snd_trident_voice*voice;
    18131809
    18141810    voice = snd_trident_alloc_voice(trident, SNDRV_TRIDENT_VOICE_TYPE_PCM, 0, 0);
     
    18361832static int snd_trident_playback_close(snd_pcm_substream_t * substream)
    18371833{
    1838     trident_t *trident = snd_pcm_substream_chip(substream);
     1834    struct snd_trident *trident = snd_pcm_substream_chip(substream);
    18391835    snd_pcm_runtime_t *runtime = substream->runtime;
    1840     snd_trident_voice_t *voice = (snd_trident_voice_t *) runtime->private_data;
     1836    struct snd_trident_voice*voice = (struct snd_trident_voice*) runtime->private_data;
    18411837
    18421838    snd_trident_pcm_mixer_free(trident, voice, substream);
     
    18571853static int snd_trident_spdif_open(snd_pcm_substream_t * substream)
    18581854{
    1859     trident_t *trident = snd_pcm_substream_chip(substream);
    1860     snd_trident_voice_t *voice;
     1855    struct snd_trident *trident = snd_pcm_substream_chip(substream);
     1856    struct snd_trident_voice*voice;
    18611857    snd_pcm_runtime_t *runtime = substream->runtime;
    18621858
     
    18981894static int snd_trident_spdif_close(snd_pcm_substream_t * substream)
    18991895{
    1900     trident_t *trident = snd_pcm_substream_chip(substream);
     1896    struct snd_trident *trident = snd_pcm_substream_chip(substream);
    19011897    unsigned int temp;
    19021898
     
    19361932static int snd_trident_capture_open(snd_pcm_substream_t * substream)
    19371933{
    1938     trident_t *trident = snd_pcm_substream_chip(substream);
    1939     snd_trident_voice_t *voice;
     1934    struct snd_trident *trident = snd_pcm_substream_chip(substream);
     1935    struct snd_trident_voice*voice;
    19401936    snd_pcm_runtime_t *runtime = substream->runtime;
    19411937
     
    19801976static int snd_trident_foldback_open(snd_pcm_substream_t * substream)
    19811977{
    1982     trident_t *trident = snd_pcm_substream_chip(substream);
    1983     snd_trident_voice_t *voice;
     1978    struct snd_trident *trident = snd_pcm_substream_chip(substream);
     1979    struct snd_trident_voice*voice;
    19841980    snd_pcm_runtime_t *runtime = substream->runtime;
    19851981
     
    20072003static int snd_trident_foldback_close(snd_pcm_substream_t * substream)
    20082004{
    2009     trident_t *trident = snd_pcm_substream_chip(substream);
    2010     snd_trident_voice_t *voice;
     2005    struct snd_trident *trident = snd_pcm_substream_chip(substream);
     2006    struct snd_trident_voice*voice;
    20112007    snd_pcm_runtime_t *runtime = substream->runtime;
    2012     voice = (snd_trident_voice_t *) runtime->private_data;
     2008    voice = (struct snd_trident_voice*) runtime->private_data;
    20132009
    20142010    /* stop capture channel */
     
    21252121static void snd_trident_pcm_free(snd_pcm_t *pcm)
    21262122{
    2127     trident_t *trident = pcm->private_data;
     2123    struct snd_trident *trident = pcm->private_data;
    21282124    trident->pcm = NULL;
    21292125    snd_pcm_lib_preallocate_free_for_all(pcm);
     
    21322128static void snd_trident_foldback_pcm_free(snd_pcm_t *pcm)
    21332129{
    2134     trident_t *trident = pcm->private_data;
     2130    struct snd_trident *trident = pcm->private_data;
    21352131    trident->foldback = NULL;
    21362132    snd_pcm_lib_preallocate_free_for_all(pcm);
     
    21392135static void snd_trident_spdif_pcm_free(snd_pcm_t *pcm)
    21402136{
    2141     trident_t *trident = pcm->private_data;
     2137    struct snd_trident *trident = pcm->private_data;
    21422138    trident->spdif = NULL;
    21432139    snd_pcm_lib_preallocate_free_for_all(pcm);
     
    21552151 ---------------------------------------------------------------------------*/
    21562152
    2157 int __devinit snd_trident_pcm(trident_t * trident, int device, snd_pcm_t ** rpcm)
     2153int __devinit snd_trident_pcm(struct snd_trident * trident, int device, snd_pcm_t ** rpcm)
    21582154{
    21592155        snd_pcm_t *pcm;
     
    22132209 ---------------------------------------------------------------------------*/
    22142210
    2215 int __devinit snd_trident_foldback_pcm(trident_t * trident, int device, snd_pcm_t ** rpcm)
     2211int __devinit snd_trident_foldback_pcm(struct snd_trident * trident, int device, snd_pcm_t ** rpcm)
    22162212{
    22172213        snd_pcm_t *foldback;
     
    22712267 ---------------------------------------------------------------------------*/
    22722268
    2273 int __devinit snd_trident_spdif_pcm(trident_t * trident, int device, snd_pcm_t ** rpcm)
     2269int __devinit snd_trident_spdif_pcm(struct snd_trident * trident, int device, snd_pcm_t ** rpcm)
    22742270{
    22752271        snd_pcm_t *spdif;
     
    23212317                                         snd_ctl_elem_value_t * ucontrol)
    23222318{
    2323     trident_t *trident = snd_kcontrol_chip(kcontrol);
     2319    struct snd_trident *trident = snd_kcontrol_chip(kcontrol);
    23242320    unsigned char val;
    23252321
     
    23342330                                         snd_ctl_elem_value_t * ucontrol)
    23352331{
    2336     trident_t *trident = snd_kcontrol_chip(kcontrol);
     2332    struct snd_trident *trident = snd_kcontrol_chip(kcontrol);
    23372333    unsigned char val;
    23382334    int change;
     
    23882384                                         snd_ctl_elem_value_t * ucontrol)
    23892385{
    2390     trident_t *trident = snd_kcontrol_chip(kcontrol);
     2386    struct snd_trident *trident = snd_kcontrol_chip(kcontrol);
    23912387
    23922388    spin_lock_irq(&trident->reg_lock);
     
    24022398                                         snd_ctl_elem_value_t * ucontrol)
    24032399{
    2404     trident_t *trident = snd_kcontrol_chip(kcontrol);
     2400    struct snd_trident *trident = snd_kcontrol_chip(kcontrol);
    24052401    unsigned int val;
    24062402    int change;
     
    24812477                                        snd_ctl_elem_value_t * ucontrol)
    24822478{
    2483     trident_t *trident = snd_kcontrol_chip(kcontrol);
     2479    struct snd_trident *trident = snd_kcontrol_chip(kcontrol);
    24842480
    24852481    spin_lock_irq(&trident->reg_lock);
     
    24952491                                        snd_ctl_elem_value_t * ucontrol)
    24962492{
    2497     trident_t *trident = snd_kcontrol_chip(kcontrol);
     2493    struct snd_trident *trident = snd_kcontrol_chip(kcontrol);
    24982494    unsigned int val;
    24992495    int change;
     
    25452541                                        snd_ctl_elem_value_t * ucontrol)
    25462542{
    2547     trident_t *trident = snd_kcontrol_chip(kcontrol);
     2543    struct snd_trident *trident = snd_kcontrol_chip(kcontrol);
    25482544    unsigned char val;
    25492545
     
    25582554                                        snd_ctl_elem_value_t * ucontrol)
    25592555{
    2560     trident_t *trident = snd_kcontrol_chip(kcontrol);
     2556    struct snd_trident *trident = snd_kcontrol_chip(kcontrol);
    25612557    unsigned char val;
    25622558    int change = 0;
     
    26022598                                       snd_ctl_elem_value_t * ucontrol)
    26032599{
    2604     trident_t *trident = snd_kcontrol_chip(kcontrol);
     2600    struct snd_trident *trident = snd_kcontrol_chip(kcontrol);
    26052601    unsigned int val;
    26062602
     
    26142610                                       snd_ctl_elem_value_t * ucontrol)
    26152611{
    2616     trident_t *trident = snd_kcontrol_chip(kcontrol);
     2612    struct snd_trident *trident = snd_kcontrol_chip(kcontrol);
    26172613    unsigned int val;
    26182614    int change = 0;
     
    26592655static int snd_trident_pcm_vol_control_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo)
    26602656{
    2661     trident_t *trident = snd_kcontrol_chip(kcontrol);
     2657    struct snd_trident *trident = snd_kcontrol_chip(kcontrol);
    26622658
    26632659    uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER;
     
    26732669                                           snd_ctl_elem_value_t * ucontrol)
    26742670{
    2675     trident_t *trident = snd_kcontrol_chip(kcontrol);
    2676     snd_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)];
    26772673
    26782674    if (trident->device == TRIDENT_DEVICE_ID_SI7018) {
     
    26872683                                           snd_ctl_elem_value_t * ucontrol)
    26882684{
    2689     trident_t *trident = snd_kcontrol_chip(kcontrol);
    2690     snd_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)];
    26912687    unsigned int val;
    26922688    int change = 0;
     
    27352731                                           snd_ctl_elem_value_t * ucontrol)
    27362732{
    2737     trident_t *trident = snd_kcontrol_chip(kcontrol);
    2738     snd_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)];
    27392735
    27402736    ucontrol->value.integer.value[0] = mix->pan;
     
    27502746                                           snd_ctl_elem_value_t * ucontrol)
    27512747{
    2752     trident_t *trident = snd_kcontrol_chip(kcontrol);
    2753     snd_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)];
    27542750    unsigned char val;
    27552751    int change = 0;
     
    27972793                                            snd_ctl_elem_value_t * ucontrol)
    27982794{
    2799     trident_t *trident = snd_kcontrol_chip(kcontrol);
    2800     snd_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)];
    28012797
    28022798    ucontrol->value.integer.value[0] = 127 - mix->rvol;
     
    28072803                                            snd_ctl_elem_value_t * ucontrol)
    28082804{
    2809     trident_t *trident = snd_kcontrol_chip(kcontrol);
    2810     snd_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)];
    28112807    unsigned short val;
    28122808    int change = 0;
     
    28512847                                            snd_ctl_elem_value_t * ucontrol)
    28522848{
    2853     trident_t *trident = snd_kcontrol_chip(kcontrol);
    2854     snd_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)];
    28552851
    28562852    ucontrol->value.integer.value[0] = 127 - mix->cvol;
     
    28612857                                            snd_ctl_elem_value_t * ucontrol)
    28622858{
    2863     trident_t *trident = snd_kcontrol_chip(kcontrol);
    2864     snd_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)];
    28652861    unsigned short val;
    28662862    int change = 0;
     
    29012897}
    29022898
    2903 static void snd_trident_notify_pcm_change(trident_t *trident, snd_trident_pcm_mixer_t *tmix, int num, int activate)
     2899static void snd_trident_notify_pcm_change(struct snd_trident *trident, struct snd_trident_pcm_mixer*tmix, int num, int activate)
    29042900{
    29052901    snd_trident_notify_pcm_change1(trident->card, trident->ctl_vol, num, activate);
     
    29092905}
    29102906
    2911 static int snd_trident_pcm_mixer_build(trident_t *trident, snd_trident_voice_t *voice, snd_pcm_substream_t *substream)
    2912 {
    2913     snd_trident_pcm_mixer_t *tmix;
     2907static 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;
    29142910
    29152911    snd_assert(trident != NULL && voice != NULL && substream != NULL, return -EINVAL);
     
    29242920}
    29252921
    2926 static int snd_trident_pcm_mixer_free(trident_t *trident, snd_trident_voice_t *voice, snd_pcm_substream_t *substream)
    2927 {
    2928     snd_trident_pcm_mixer_t *tmix;
     2922static 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;
    29292925
    29302926    snd_assert(trident != NULL && substream != NULL, return -EINVAL);
     
    29462942 ---------------------------------------------------------------------------*/
    29472943
    2948 static int __devinit snd_trident_mixer(trident_t * trident, int pcm_spdif_device)
     2944static int __devinit snd_trident_mixer(struct snd_trident * trident, int pcm_spdif_device)
    29492945{
    29502946    ac97_template_t _ac97;
     
    30133009
    30143010    for (idx = 0; idx < 32; idx++) {
    3015         snd_trident_pcm_mixer_t *tmix;
     3011        struct snd_trident_pcm_mixer*tmix;
    30163012
    30173013        tmix = &trident->pcm_mixer[idx];
     
    31073103typedef struct snd_trident_gameport {
    31083104    struct gameport info;
    3109     trident_t *chip;
     3105    struct snd_trident *chip;
    31103106} trident_gameport_t;
    31113107
     
    31133109{
    31143110    trident_gameport_t *gp = (trident_gameport_t *)gameport;
    3115     trident_t *chip;
     3111    struct snd_trident *chip;
    31163112    snd_assert(gp, return 0);
    31173113    chip = gp->chip;
     
    31223118{
    31233119    trident_gameport_t *gp = (trident_gameport_t *)gameport;
    3124     trident_t *chip;
     3120    struct snd_trident *chip;
    31253121    snd_assert(gp, return);
    31263122    chip = gp->chip;
     
    31313127{
    31323128    trident_gameport_t *gp = (trident_gameport_t *)gameport;
    3133     trident_t *chip;
     3129    struct snd_trident *chip;
    31343130    int i;
    31353131
     
    31503146{
    31513147    trident_gameport_t *gp = (trident_gameport_t *)gameport;
    3152     trident_t *chip;
     3148    struct snd_trident *chip;
    31533149    snd_assert(gp, return -1);
    31543150    chip = gp->chip;
     
    31673163}
    31683164
    3169 void __devinit snd_trident_gameport(trident_t *chip)
     3165void __devinit snd_trident_gameport(struct snd_trident *chip)
    31703166{
    31713167    trident_gameport_t *gp;
     
    31883184
    31893185#else
    3190 void __devinit snd_trident_gameport(trident_t *chip)
     3186void __devinit snd_trident_gameport(struct snd_trident *chip)
    31913187{
    31923188}
     
    31963192 * delay for 1 tick
    31973193 */
    3198 inline static void do_delay(trident_t *chip)
     3194inline static void do_delay(struct snd_trident *chip)
    31993195{
    32003196    set_current_state(TASK_UNINTERRUPTIBLE);
     
    32063202 */
    32073203
    3208 static int snd_trident_sis_reset(trident_t *trident)
     3204static int snd_trident_sis_reset(struct snd_trident *trident)
    32093205{
    32103206    unsigned long end_time;
     
    32623258                                  snd_info_buffer_t * buffer)
    32633259{
    3264     trident_t *trident = entry->private_data;
     3260    struct snd_trident *trident = entry->private_data;
    32653261    char *s;
    32663262
     
    33003296}
    33013297
    3302 static void __devinit snd_trident_proc_init(trident_t * trident)
     3298static void __devinit snd_trident_proc_init(struct snd_trident * trident)
    33033299{
    33043300    snd_info_entry_t *entry;
     
    33133309static int snd_trident_dev_free(snd_device_t *device)
    33143310{
    3315     trident_t *trident = device->device_data;
     3311    struct snd_trident *trident = device->device_data;
    33163312    return snd_trident_free(trident);
    33173313}
     
    33293325 ---------------------------------------------------------------------------*/
    33303326
    3331 static int __devinit snd_trident_tlb_alloc(trident_t *trident)
     3327static int __devinit snd_trident_tlb_alloc(struct snd_trident *trident)
    33323328{
    33333329        int i;
     
    33663362                return -ENOMEM;
    33673363
    3368         trident->tlb.memhdr->block_extra_size = sizeof(snd_trident_memblk_arg_t);
     3364        trident->tlb.memhdr->block_extra_size = sizeof(struct snd_trident_memblk_arg);
    33693365        return 0;
    33703366}
     
    33743370 */
    33753371
    3376 static void snd_trident_stop_all_voices(trident_t *trident)
     3372static void snd_trident_stop_all_voices(struct snd_trident *trident)
    33773373{
    33783374    outl(0xffffffff, TRID_REG(trident, T4D_STOP_A));
     
    33823378}
    33833379
    3384 static int snd_trident_4d_dx_init(trident_t *trident)
     3380static int snd_trident_4d_dx_init(struct snd_trident *trident)
    33853381{
    33863382    struct pci_dev *pci = trident->pci;
     
    34223418 * initialize 4D NX chip
    34233419 */
    3424 static int snd_trident_4d_nx_init(trident_t *trident)
     3420static int snd_trident_4d_nx_init(struct snd_trident *trident)
    34253421{
    34263422    struct pci_dev *pci = trident->pci;
     
    34793475 * initialize sis7018 chip
    34803476 */
    3481 static int snd_trident_sis_init(trident_t *trident)
     3477static int snd_trident_sis_init(struct snd_trident *trident)
    34823478{
    34833479    int err;
     
    35153511                                 int pcm_spdif_device,
    35163512                                 int max_wavetable_size,
    3517                                  trident_t ** rtrident)
    3518 {
    3519     trident_t *trident;
     3513                                 struct snd_trident ** rtrident)
     3514{
     3515    struct snd_trident *trident;
    35203516    int i, err;
    3521     snd_trident_voice_t *voice;
    3522     snd_trident_pcm_mixer_t *tmix;
     3517    struct snd_trident_voice*voice;
     3518    struct snd_trident_pcm_mixer*tmix;
    35233519#ifdef TARGET_OS2
    35243520    static snd_device_ops_t ops = {
     
    36273623    snd_trident_enable_eso(trident);
    36283624
    3629     snd_card_set_pm_callback(card, snd_trident_suspend, snd_trident_resume, trident);
    3630 
    36313625    snd_trident_proc_init(trident);
    36323626    if ((err = snd_device_new(card, SNDRV_DEV_LOWLEVEL, trident, &ops)) < 0) {
     
    36503644 ---------------------------------------------------------------------------*/
    36513645
    3652 int snd_trident_free(trident_t *trident)
     3646int snd_trident_free(struct snd_trident *trident)
    36533647{
    36543648#if defined(CONFIG_GAMEPORT) || (defined(MODULE) && defined(CONFIG_GAMEPORT_MODULE))
     
    37023696static irqreturn_t snd_trident_interrupt(int irq, void *dev_id, struct pt_regs *regs)
    37033697{
    3704     trident_t *trident = dev_id;
     3698    struct snd_trident *trident = dev_id;
    37053699    unsigned int audio_int, chn_int, stimer, channel, mask, tmp;
    37063700    int delta;
    3707     snd_trident_voice_t *voice;
     3701    struct snd_trident_voice*voice;
    37083702#ifdef TARGET_OS2
    37093703    int fOurIrq = FALSE;
     
    38213815
    38223816 ---------------------------------------------------------------------------*/
    3823 int snd_trident_attach_synthesizer(trident_t *trident)
     3817int snd_trident_attach_synthesizer(struct snd_trident *trident)
    38243818{
    38253819#ifdef CONFIG_SND_SEQUENCER
    38263820    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) {
    38283822        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;
    38303824    }
    38313825#endif
     
    38333827}
    38343828
    3835 int snd_trident_detach_synthesizer(trident_t *trident)
     3829int snd_trident_detach_synthesizer(struct snd_trident *trident)
    38363830{
    38373831#ifdef CONFIG_SND_SEQUENCER
     
    38443838}
    38453839
    3846 snd_trident_voice_t *snd_trident_alloc_voice(trident_t * trident, int type, int client, int port)
    3847 {
    3848     snd_trident_voice_t *pvoice;
     3840struct snd_trident_voice*snd_trident_alloc_voice(struct snd_trident * trident, int type, int client, int port)
     3841{
     3842    struct snd_trident_voice*pvoice;
    38493843    unsigned long flags;
    38503844    int idx;
     
    38883882}
    38893883
    3890 void snd_trident_free_voice(trident_t * trident, snd_trident_voice_t *voice)
     3884void snd_trident_free_voice(struct snd_trident * trident, struct snd_trident_voice*voice)
    38913885{
    38923886    unsigned long flags;
    3893     void (*private_free)(snd_trident_voice_t *);
     3887    void (*private_free)(struct snd_trident_voice*);
    38943888    void *private_data;
    38953889
     
    39163910}
    39173911
    3918 void snd_trident_clear_voices(trident_t * trident, unsigned short v_min, unsigned short v_max)
     3912void snd_trident_clear_voices(struct snd_trident * trident, unsigned short v_min, unsigned short v_max)
    39193913{
    39203914    unsigned int i, val, mask[2] = { 0, 0 };
     
    39373931
    39383932#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;
     3933int 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;
    39433937
    39443938    trident->in_suspend = 1;
     3939    snd_power_change_state(card, SNDRV_CTL_POWER_D3hot);
    39453940    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);
    39503943
    39513944    snd_ac97_suspend(trident->ac97);
    3952     if (trident->ac97_sec)
    3953         snd_ac97_suspend(trident->ac97_sec);
     3945    snd_ac97_suspend(trident->ac97_sec);
    39543946
    39553947    switch (trident->device) {
     
    39603952        break;
    39613953    }
    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
     3959int 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 */
    39723967
    39733968    switch (trident->device) {
     
    39843979
    39853980    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
    39883983    /* restore some registers */
    39893984    outl(trident->musicvol_wavevol, TRID_REG(trident, T4D_MUSICVOL_WAVEVOL));
     
    39913986    snd_trident_enable_eso(trident);
    39923987
     3988    snd_power_change_state(card, SNDRV_CTL_POWER_D0);
    39933989    trident->in_suspend = 0;
    39943990    return 0;
  • GPL/trunk/alsa-kernel/pci/trident/trident_memory.c

    r33 r34  
    6666
    6767/* 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)
     68static inline void set_tlb_bus(struct snd_trident *trident, int page, unsigned long ptr, dma_addr_t addr)
    6969{
    7070        page <<= 1;
     
    7272        __set_tlb_bus(trident, page+1, ptr + SNDRV_TRIDENT_PAGE_SIZE, addr + SNDRV_TRIDENT_PAGE_SIZE);
    7373}
    74 static inline void set_silent_tlb(trident_t *trident, int page)
     74static inline void set_silent_tlb(struct snd_trident *trident, int page)
    7575{
    7676    page <<= 1;
     
    9797
    9898/* 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)
     99static inline void set_tlb_bus(struct snd_trident *trident, int page, unsigned long ptr, dma_addr_t addr)
    100100{
    101101        int i;
     
    107107        }
    108108}
    109 static inline void set_silent_tlb(trident_t *trident, int page)
     109static inline void set_silent_tlb(struct snd_trident *trident, int page)
    110110{
    111111        int i;
     
    119119
    120120/* calculate buffer pointer from offset address */
    121 inline static void *offset_ptr(trident_t *trident, int offset)
     121inline static void *offset_ptr(struct snd_trident *trident, int offset)
    122122{
    123123        char *ptr;
     
    128128
    129129/* first and last (aligned) pages of memory block */
    130 #define firstpg(blk)    (((snd_trident_memblk_arg_t*)snd_util_memblk_argptr(blk))->first_page)
    131 #define lastpg(blk)     (((snd_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)
    132132
    133133/*
     
    185185 */
    186186static snd_util_memblk_t *
    187 snd_trident_alloc_sg_pages(trident_t *trident, snd_pcm_substream_t *substream)
     187snd_trident_alloc_sg_pages(struct snd_trident *trident, snd_pcm_substream_t *substream)
    188188{
    189189        snd_util_memhdr_t *hdr;
     
    232232 */
    233233static snd_util_memblk_t *
    234 snd_trident_alloc_cont_pages(trident_t *trident, snd_pcm_substream_t *substream)
     234snd_trident_alloc_cont_pages(struct snd_trident *trident, snd_pcm_substream_t *substream)
    235235{
    236236        snd_util_memhdr_t *hdr;
     
    272272 */
    273273snd_util_memblk_t *
    274 snd_trident_alloc_pages(trident_t *trident, snd_pcm_substream_t *substream)
     274snd_trident_alloc_pages(struct snd_trident *trident, snd_pcm_substream_t *substream)
    275275{
    276276        snd_assert(trident != NULL, return NULL);
     
    286286 * release DMA buffer from page table
    287287 */
    288 int snd_trident_free_pages(trident_t *trident, snd_util_memblk_t *blk)
     288int snd_trident_free_pages(struct snd_trident *trident, snd_util_memblk_t *blk)
    289289{
    290290        snd_util_memhdr_t *hdr;
     
    314314/*
    315315 */
    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);
     316static int synth_alloc_pages(struct snd_trident *hw, snd_util_memblk_t *blk);
     317static int synth_free_pages(struct snd_trident *hw, snd_util_memblk_t *blk);
    318318
    319319/*
     
    321321 */
    322322snd_util_memblk_t *
    323 snd_trident_synth_alloc(trident_t *hw, unsigned int size)
     323snd_trident_synth_alloc(struct snd_trident *hw, unsigned int size)
    324324{
    325325        snd_util_memblk_t *blk;
     
    346346 */
    347347int
    348 snd_trident_synth_free(trident_t *hw, snd_util_memblk_t *blk)
     348snd_trident_synth_free(struct snd_trident *hw, snd_util_memblk_t *blk)
    349349{
    350350        snd_util_memhdr_t *hdr = hw->tlb.memhdr;
     
    361361 * reset TLB entry and free kernel page
    362362 */
    363 static void clear_tlb(trident_t *trident, int page)
     363static void clear_tlb(struct snd_trident *trident, int page)
    364364{
    365365        void *ptr = page_to_ptr(trident, page);
     
    403403 * allocate kernel pages and assign them to TLB
    404404 */
    405 static int synth_alloc_pages(trident_t *hw, snd_util_memblk_t *blk)
     405static int synth_alloc_pages(struct snd_trident *hw, snd_util_memblk_t *blk)
    406406{
    407407        int page, first_page, last_page;
     
    439439 * free pages
    440440 */
    441 static int synth_free_pages(trident_t *trident, snd_util_memblk_t *blk)
     441static int synth_free_pages(struct snd_trident *trident, snd_util_memblk_t *blk)
    442442{
    443443        int page, first_page, last_page;
     
    453453 * bzero(blk + offset, size)
    454454 */
    455 int snd_trident_synth_bzero(trident_t *trident, snd_util_memblk_t *blk, int offset, int size)
     455int snd_trident_synth_bzero(struct snd_trident *trident, snd_util_memblk_t *blk, int offset, int size)
    456456{
    457457        int page, nextofs, end_offset, temp, temp1;
     
    476476 * copy_from_user(blk + offset, data, size)
    477477 */
    478 int snd_trident_synth_copy_from_user(trident_t *trident, snd_util_memblk_t *blk, int offset, const char *data, int size)
     478int snd_trident_synth_copy_from_user(struct snd_trident *trident, snd_util_memblk_t *blk, int offset, const char *data, int size)
    479479{
    480480        int page, nextofs, end_offset, temp, temp1;
  • GPL/trunk/alsa-kernel/pci/trident/trident_synth.c

    r33 r34  
    190190 */
    191191
    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 snd_trident_sample_ops_t sample_ops =
     192static void sample_start(struct snd_trident * trident, struct snd_trident_voice * voice, snd_seq_position_t position);
     193static void sample_stop(struct snd_trident * trident, struct snd_trident_voice * voice, int mode);
     194static void sample_freq(struct snd_trident * trident, struct snd_trident_voice * voice, snd_seq_frequency_t freq);
     195static void sample_volume(struct snd_trident * trident, struct snd_trident_voice * voice, snd_seq_ev_volume_t * volume);
     196static void sample_loop(struct snd_trident * trident, struct snd_trident_voice * voice, snd_seq_ev_loop_t * loop);
     197static void sample_pos(struct snd_trident * trident, struct snd_trident_voice * voice, snd_seq_position_t position);
     198static void sample_private1(struct snd_trident * trident, struct snd_trident_voice * voice, unsigned char *data);
     199
     200static struct snd_trident_sample_ops sample_ops =
    201201{
    202202    sample_start,
     
    209209};
    210210
    211 static void snd_trident_simple_init(snd_trident_voice_t * voice)
     211static void snd_trident_simple_init(struct snd_trident_voice * voice)
    212212{
    213213    //voice->handler_wave = interrupt_wave;
     
    218218}
    219219
    220 static void sample_start(trident_t * trident, snd_trident_voice_t * voice, snd_seq_position_t position)
     220static void sample_start(struct snd_trident * trident, struct snd_trident_voice * voice, snd_seq_position_t position)
    221221{
    222222    simple_instrument_t *simple;
     
    303303}
    304304
    305 static void sample_stop(trident_t * trident, snd_trident_voice_t * voice, snd_seq_stop_mode_t mode)
     305static void sample_stop(struct snd_trident * trident, struct snd_trident_voice * voice, int mode)
    306306{
    307307    unsigned long flags;
     
    327327}
    328328
    329 static void sample_freq(trident_t * trident, snd_trident_voice_t * voice, snd_seq_frequency_t freq)
     329static void sample_freq(struct snd_trident * trident, struct snd_trident_voice * voice, snd_seq_frequency_t freq)
    330330{
    331331    unsigned long flags;
     
    353353}
    354354
    355 static void sample_volume(trident_t * trident, snd_trident_voice_t * voice, snd_seq_ev_volume_t * volume)
     355static void sample_volume(struct snd_trident * trident, struct snd_trident_voice * voice, snd_seq_ev_volume_t * volume)
    356356{
    357357    unsigned long flags;
     
    405405}
    406406
    407 static void sample_loop(trident_t * trident, snd_trident_voice_t * voice, snd_seq_ev_loop_t * loop)
     407static void sample_loop(struct snd_trident * trident, struct snd_trident_voice * voice, snd_seq_ev_loop_t * loop)
    408408{
    409409    unsigned long flags;
     
    444444}
    445445
    446 static void sample_pos(trident_t * trident, snd_trident_voice_t * voice, snd_seq_position_t position)
     446static void sample_pos(struct snd_trident * trident, struct snd_trident_voice * voice, snd_seq_position_t position)
    447447{
    448448    unsigned long flags;
     
    494494}
    495495
    496 static void sample_private1(trident_t * trident, snd_trident_voice_t * voice, unsigned char *data)
     496static void sample_private1(struct snd_trident * trident, struct snd_trident_voice * voice, unsigned char *data)
    497497{
    498498}
     
    505505                                         char __user *data, long len, int atomic)
    506506{
    507         trident_t *trident = private_data;
     507        struct snd_trident *trident = private_data;
    508508        int size = instr->size;
    509509        int shift = 0;
     
    559559                                         char *data, long len, int atomic)
    560560{
    561     //trident_t *trident = private_data;
     561    //struct snd_trident *trident = private_data;
    562562    int size = instr->size;
    563563    int shift = 0;
     
    580580                                            int atomic)
    581581{
    582     trident_t *trident = private_data;
     582    struct snd_trident *trident = private_data;
    583583    int size = instr->size;
    584584
     
    611611}
    612612
    613 static void select_instrument(trident_t * trident, snd_trident_voice_t * v)
     613static void select_instrument(struct snd_trident * trident, struct snd_trident_voice * v)
    614614{
    615615    snd_seq_kinstr_t *instr;
     
    628628*/
    629629
    630 static void event_sample(snd_seq_event_t * ev, snd_trident_port_t * p, snd_trident_voice_t * v)
     630static void event_sample(snd_seq_event_t * ev, struct snd_trident_port * p, struct snd_trident_voice * v)
    631631{
    632632    if (v->sample_ops && v->sample_ops->sample_stop)
     
    642642}
    643643
    644 static void event_cluster(snd_seq_event_t * ev, snd_trident_port_t * p, snd_trident_voice_t * v)
     644static void event_cluster(snd_seq_event_t * ev, struct snd_trident_port * p, struct snd_trident_voice * v)
    645645{
    646646    if (v->sample_ops && v->sample_ops->sample_stop)
     
    650650}
    651651
    652 static void event_start(snd_seq_event_t * ev, snd_trident_port_t * p, snd_trident_voice_t * v)
     652static void event_start(snd_seq_event_t * ev, struct snd_trident_port * p, struct snd_trident_voice * v)
    653653{
    654654    if (v->sample_ops && v->sample_ops->sample_start)
     
    656656}
    657657
    658 static void event_stop(snd_seq_event_t * ev, snd_trident_port_t * p, snd_trident_voice_t * v)
     658static void event_stop(snd_seq_event_t * ev, struct snd_trident_port * p, struct snd_trident_voice * v)
    659659{
    660660    if (v->sample_ops && v->sample_ops->sample_stop)
     
    662662}
    663663
    664 static void event_freq(snd_seq_event_t * ev, snd_trident_port_t * p, snd_trident_voice_t * v)
     664static void event_freq(snd_seq_event_t * ev, struct snd_trident_port * p, struct snd_trident_voice * v)
    665665{
    666666    if (v->sample_ops && v->sample_ops->sample_freq)
     
    668668}
    669669
    670 static void event_volume(snd_seq_event_t * ev, snd_trident_port_t * p, snd_trident_voice_t * v)
     670static void event_volume(snd_seq_event_t * ev, struct snd_trident_port * p, struct snd_trident_voice * v)
    671671{
    672672    if (v->sample_ops && v->sample_ops->sample_volume)
     
    674674}
    675675
    676 static void event_loop(snd_seq_event_t * ev, snd_trident_port_t * p, snd_trident_voice_t * v)
     676static void event_loop(snd_seq_event_t * ev, struct snd_trident_port * p, struct snd_trident_voice * v)
    677677{
    678678    if (v->sample_ops && v->sample_ops->sample_loop)
     
    680680}
    681681
    682 static void event_position(snd_seq_event_t * ev, snd_trident_port_t * p, snd_trident_voice_t * v)
     682static void event_position(snd_seq_event_t * ev, struct snd_trident_port * p, struct snd_trident_voice * v)
    683683{
    684684    if (v->sample_ops && v->sample_ops->sample_pos)
     
    686686}
    687687
    688 static void event_private1(snd_seq_event_t * ev, snd_trident_port_t * p, snd_trident_voice_t * v)
     688static void event_private1(snd_seq_event_t * ev, struct snd_trident_port * p, struct snd_trident_voice * v)
    689689{
    690690    if (v->sample_ops && v->sample_ops->sample_private1)
     
    692692}
    693693
    694 typedef void (trident_sample_event_handler_t) (snd_seq_event_t * ev, snd_trident_port_t * p, snd_trident_voice_t * v);
     694typedef void (trident_sample_event_handler_t) (snd_seq_event_t * ev, struct snd_trident_port * p, struct snd_trident_voice * v);
    695695
    696696static trident_sample_event_handler_t *trident_sample_event_handlers[9] =
     
    707707};
    708708
    709 static void snd_trident_sample_event(snd_seq_event_t * ev, snd_trident_port_t * p)
     709static void snd_trident_sample_event(snd_seq_event_t * ev, struct snd_trident_port * p)
    710710{
    711711    int idx, voice;
    712     trident_t *trident = p->trident;
    713     snd_trident_voice_t *v;
     712    struct snd_trident *trident = p->trident;
     713    struct snd_trident_voice *v;
    714714    unsigned long flags;
    715715
     
    734734*/
    735735
    736 static void snd_trident_synth_free_voices(trident_t * trident, int client, int port)
     736static void snd_trident_synth_free_voices(struct snd_trident * trident, int client, int port)
    737737{
    738738    int idx;
    739     snd_trident_voice_t *voice;
     739    struct snd_trident_voice *voice;
    740740
    741741    for (idx = 0; idx < 32; idx++) {
     
    748748static int snd_trident_synth_use(void *private_data, snd_seq_port_subscribe_t * info)
    749749{
    750     snd_trident_port_t *port = (snd_trident_port_t *) private_data;
    751     trident_t *trident = port->trident;
    752     snd_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;
    753753    unsigned int idx;
    754754    unsigned long flags;
     
    787787static int snd_trident_synth_unuse(void *private_data, snd_seq_port_subscribe_t * info)
    788788{
    789     snd_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;
    791791    unsigned long flags;
    792792
     
    801801*/
    802802
    803 static void snd_trident_synth_free_private_instruments(snd_trident_port_t * p, int client)
     803static void snd_trident_synth_free_private_instruments(struct snd_trident_port * p, int client)
    804804{
    805805    snd_seq_instr_header_t ifree;
     
    812812int snd_trident_synth_event_input(snd_seq_event_t * ev, int direct, void *private_data, int atomic, int hop)
    813813{
    814     snd_trident_port_t *p = (snd_trident_port_t *) private_data;
     814    struct snd_trident_port *p = (struct snd_trident_port *) private_data;
    815815
    816816    if (p == NULL)
     
    844844{
    845845    int idx;
    846     trident_t *trident = private_data;
    847     snd_trident_voice_t *pvoice;
     846    struct snd_trident *trident = private_data;
     847    struct snd_trident_voice *pvoice;
    848848    unsigned long flags;
    849849
     
    869869static void snd_trident_synth_free_port(void *private_data)
    870870{
    871     snd_trident_port_t *p = (snd_trident_port_t *) private_data;
     871    struct snd_trident_port *p = (struct snd_trident_port *) private_data;
    872872
    873873    if (p)
     
    875875}
    876876
    877 static int snd_trident_synth_create_port(trident_t * trident, int idx)
    878 {
    879     snd_trident_port_t *p;
    880     snd_seq_port_callback_t callbacks;
     877static 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;
    881881    char name[32];
    882882    char *str;
     
    928928static int snd_trident_synth_new_device(snd_seq_device_t *dev)
    929929{
    930     trident_t *trident;
     930    struct snd_trident *trident;
    931931    int client, i;
    932     snd_seq_client_callback_t callbacks;
     932    struct snd_seq_client_callback callbacks;
    933933    snd_seq_client_info_t cinfo;
    934934    snd_seq_port_subscribe_t sub;
     
    936936    char *str;
    937937
    938     trident = *(trident_t **)SNDRV_SEQ_DEVICE_ARGPTR(dev);
     938    trident = *(struct snd_trident **)SNDRV_SEQ_DEVICE_ARGPTR(dev);
    939939    if (trident == NULL)
    940940        return -EINVAL;
     
    994994static int snd_trident_synth_delete_device(snd_seq_device_t *dev)
    995995{
    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);
    999999    if (trident == NULL)
    10001000        return -EINVAL;
     
    10181018
    10191019    return snd_seq_device_register_driver(SNDRV_SEQ_DEV_ID_TRIDENT, &ops,
    1020                                           sizeof(trident_t*));
     1020                                          sizeof(struct snd_trident*));
    10211021}
    10221022
Note: See TracChangeset for help on using the changeset viewer.