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

Latest update from ALSA. some intial > 15 interrupts support

File:
1 edited

Legend:

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

    r33 r34  
    312312static int snd_emu10k1_gpr_ctl_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo)
    313313{
    314     snd_emu10k1_fx8010_ctl_t *ctl = (snd_emu10k1_fx8010_ctl_t *)kcontrol->private_value;
     314    struct snd_emu10k1_fx8010_ctl *ctl = (struct snd_emu10k1_fx8010_ctl *)kcontrol->private_value;
    315315
    316316    if (ctl->min == 0 && ctl->max == 1)
     
    326326static int snd_emu10k1_gpr_ctl_get(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol)
    327327{
    328     emu10k1_t *emu = snd_kcontrol_chip(kcontrol);
    329     snd_emu10k1_fx8010_ctl_t *ctl = (snd_emu10k1_fx8010_ctl_t *)kcontrol->private_value;
     328    struct snd_emu10k1 *emu = snd_kcontrol_chip(kcontrol);
     329    struct snd_emu10k1_fx8010_ctl *ctl = (struct snd_emu10k1_fx8010_ctl *)kcontrol->private_value;
    330330    unsigned long flags;
    331331    unsigned int i;
     
    340340static int snd_emu10k1_gpr_ctl_put(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol)
    341341{
    342     emu10k1_t *emu = snd_kcontrol_chip(kcontrol);
    343     snd_emu10k1_fx8010_ctl_t *ctl = (snd_emu10k1_fx8010_ctl_t *)kcontrol->private_value;
     342    struct snd_emu10k1 *emu = snd_kcontrol_chip(kcontrol);
     343    struct snd_emu10k1_fx8010_ctl *ctl = (struct snd_emu10k1_fx8010_ctl *)kcontrol->private_value;
    344344    unsigned long flags;
    345345    unsigned int nval, val;
     
    388388 */
    389389
    390 static void snd_emu10k1_fx8010_interrupt(emu10k1_t *emu)
    391 {
    392     snd_emu10k1_fx8010_irq_t *irq, *nirq;
     390static void snd_emu10k1_fx8010_interrupt(struct snd_emu10k1 *emu)
     391{
     392    struct snd_emu10k1_fx8010_irq *irq, *nirq;
    393393
    394394    irq = emu->fx8010.irq_handlers;
     
    404404}
    405405
    406 int snd_emu10k1_fx8010_register_irq_handler(emu10k1_t *emu,
     406int snd_emu10k1_fx8010_register_irq_handler(struct snd_emu10k1 *emu,
    407407                                            snd_fx8010_irq_handler_t *handler,
    408408                                            unsigned char gpr_running,
    409409                                            void *private_data,
    410                                             snd_emu10k1_fx8010_irq_t **r_irq)
    411 {
    412     snd_emu10k1_fx8010_irq_t *irq;
     410                                            struct snd_emu10k1_fx8010_irq **r_irq)
     411{
     412    struct snd_emu10k1_fx8010_irq *irq;
    413413    unsigned long flags;
    414414
     
    437437}
    438438
    439 int snd_emu10k1_fx8010_unregister_irq_handler(emu10k1_t *emu,
    440                                               snd_emu10k1_fx8010_irq_t *irq)
    441 {
    442     snd_emu10k1_fx8010_irq_t *tmp;
     439int snd_emu10k1_fx8010_unregister_irq_handler(struct snd_emu10k1 *emu,
     440                                              struct snd_emu10k1_fx8010_irq *irq)
     441{
     442    struct snd_emu10k1_fx8010_irq *tmp;
    443443    unsigned long flags;
    444444
     
    496496    snd_emu10k1_audigy_write_op(icode, ptr, op, r, a, x, y)
    497497
    498 void snd_emu10k1_efx_write(emu10k1_t *emu, unsigned int pc, unsigned int data)
     498void snd_emu10k1_efx_write(struct snd_emu10k1 *emu, unsigned int pc, unsigned int data)
    499499{
    500500    pc += emu->audigy ? A_MICROCODEBASE : MICROCODEBASE;
     
    502502}
    503503
    504 unsigned int snd_emu10k1_efx_read(emu10k1_t *emu, unsigned int pc)
     504unsigned int snd_emu10k1_efx_read(struct snd_emu10k1 *emu, unsigned int pc)
    505505{
    506506    pc += emu->audigy ? A_MICROCODEBASE : MICROCODEBASE;
     
    508508}
    509509
    510 static int snd_emu10k1_gpr_poke(emu10k1_t *emu, emu10k1_fx8010_code_t *icode)
     510static int snd_emu10k1_gpr_poke(struct snd_emu10k1 *emu, emu10k1_fx8010_code_t *icode)
    511511{
    512512    int gpr;
     
    523523}
    524524
    525 static int snd_emu10k1_gpr_peek(emu10k1_t *emu, emu10k1_fx8010_code_t *icode)
     525static int snd_emu10k1_gpr_peek(struct snd_emu10k1 *emu, emu10k1_fx8010_code_t *icode)
    526526{
    527527    int gpr;
     
    537537}
    538538
    539 static int snd_emu10k1_tram_poke(emu10k1_t *emu, emu10k1_fx8010_code_t *icode)
     539static int snd_emu10k1_tram_poke(struct snd_emu10k1 *emu, emu10k1_fx8010_code_t *icode)
    540540{
    541541    int tram;
     
    559559}
    560560
    561 static int snd_emu10k1_tram_peek(emu10k1_t *emu, emu10k1_fx8010_code_t *icode)
     561static int snd_emu10k1_tram_peek(struct snd_emu10k1 *emu, emu10k1_fx8010_code_t *icode)
    562562{
    563563    int tram;
     
    581581}
    582582
    583 static int snd_emu10k1_code_poke(emu10k1_t *emu, emu10k1_fx8010_code_t *icode)
     583static int snd_emu10k1_code_poke(struct snd_emu10k1 *emu, emu10k1_fx8010_code_t *icode)
    584584{
    585585    u32 pc, lo, hi;
     
    597597}
    598598
    599 static int snd_emu10k1_code_peek(emu10k1_t *emu, emu10k1_fx8010_code_t *icode)
     599static int snd_emu10k1_code_peek(struct snd_emu10k1 *emu, emu10k1_fx8010_code_t *icode)
    600600{
    601601    u32 pc;
     
    612612}
    613613
    614 static snd_emu10k1_fx8010_ctl_t *snd_emu10k1_look_for_ctl(emu10k1_t *emu, snd_ctl_elem_id_t *id)
    615 {
    616     snd_emu10k1_fx8010_ctl_t *ctl;
     614static struct snd_emu10k1_fx8010_ctl *snd_emu10k1_look_for_ctl(struct snd_emu10k1 *emu, snd_ctl_elem_id_t *id)
     615{
     616    struct snd_emu10k1_fx8010_ctl *ctl;
    617617    snd_kcontrol_t *kcontrol;
    618618    struct list_head *list;
     
    629629}
    630630
    631 static int snd_emu10k1_verify_controls(emu10k1_t *emu, emu10k1_fx8010_code_t *icode)
     631static int snd_emu10k1_verify_controls(struct snd_emu10k1 *emu, emu10k1_fx8010_code_t *icode)
    632632{
    633633    unsigned int i;
     
    684684static void snd_emu10k1_ctl_private_free(snd_kcontrol_t *kctl)
    685685{
    686     snd_emu10k1_fx8010_ctl_t *ctl;
    687 
    688     ctl = (snd_emu10k1_fx8010_ctl_t *)kctl->private_value;
     686    struct snd_emu10k1_fx8010_ctl *ctl;
     687
     688    ctl = (struct snd_emu10k1_fx8010_ctl *)kctl->private_value;
    689689    kctl->private_value = 0;
    690690    list_del(&ctl->list);
     
    692692}
    693693
    694 static int snd_emu10k1_add_controls(emu10k1_t *emu, emu10k1_fx8010_code_t *icode)
     694static int snd_emu10k1_add_controls(struct snd_emu10k1 *emu, emu10k1_fx8010_code_t *icode)
    695695{
    696696    unsigned int i, j;
    697697    emu10k1_fx8010_control_gpr_t *_gctl;
    698698    emu10k1_fx8010_control_gpr_t *gctl;
    699     snd_emu10k1_fx8010_ctl_t *ctl, *nctl;
     699    struct snd_emu10k1_fx8010_ctl *ctl, *nctl;
    700700    snd_kcontrol_new_t knew;
    701701    snd_kcontrol_t *kctl;
     
    742742        nctl->translation = gctl->translation;
    743743        if (ctl == NULL) {
    744             ctl = (snd_emu10k1_fx8010_ctl_t *)kmalloc(sizeof(*ctl), GFP_KERNEL);
     744            ctl = (struct snd_emu10k1_fx8010_ctl *)kmalloc(sizeof(*ctl), GFP_KERNEL);
    745745            if (ctl == NULL) {
    746746                err = -ENOMEM;
     
    773773}
    774774
    775 static int snd_emu10k1_del_controls(emu10k1_t *emu, emu10k1_fx8010_code_t *icode)
     775static int snd_emu10k1_del_controls(struct snd_emu10k1 *emu, emu10k1_fx8010_code_t *icode)
    776776{
    777777    unsigned int i;
    778778    snd_ctl_elem_id_t *_id, id;
    779     snd_emu10k1_fx8010_ctl_t *ctl;
     779    struct snd_emu10k1_fx8010_ctl *ctl;
    780780    snd_card_t *card = emu->card;
    781781
     
    792792}
    793793
    794 static int snd_emu10k1_list_controls(emu10k1_t *emu, emu10k1_fx8010_code_t *icode)
     794static int snd_emu10k1_list_controls(struct snd_emu10k1 *emu, emu10k1_fx8010_code_t *icode)
    795795{
    796796    unsigned int i = 0, j;
     
    798798    emu10k1_fx8010_control_gpr_t *gctl;
    799799    emu10k1_fx8010_control_gpr_t *_gctl;
    800     snd_emu10k1_fx8010_ctl_t *ctl;
     800    struct snd_emu10k1_fx8010_ctl *ctl;
    801801    snd_ctl_elem_id_t *id;
    802802    struct list_head *list;
     
    840840}
    841841
    842 static int snd_emu10k1_icode_poke(emu10k1_t *emu, emu10k1_fx8010_code_t *icode)
     842static int snd_emu10k1_icode_poke(struct snd_emu10k1 *emu, emu10k1_fx8010_code_t *icode)
    843843{
    844844    int err = 0;
     
    871871}
    872872
    873 static int snd_emu10k1_icode_peek(emu10k1_t *emu, emu10k1_fx8010_code_t *icode)
     873static int snd_emu10k1_icode_peek(struct snd_emu10k1 *emu, emu10k1_fx8010_code_t *icode)
    874874{
    875875    int err;
     
    889889}
    890890
    891 static int snd_emu10k1_ipcm_poke(emu10k1_t *emu, emu10k1_fx8010_pcm_t *ipcm)
     891static int snd_emu10k1_ipcm_poke(struct snd_emu10k1 *emu, emu10k1_fx8010_pcm_t *ipcm)
    892892{
    893893    unsigned int i;
    894894    int err = 0;
    895     snd_emu10k1_fx8010_pcm_t *pcm;
     895    struct snd_emu10k1_fx8010_pcm *pcm;
    896896
    897897    if (ipcm->substream >= EMU10K1_FX8010_PCM_COUNT)
     
    934934}
    935935
    936 static int snd_emu10k1_ipcm_peek(emu10k1_t *emu, emu10k1_fx8010_pcm_t *ipcm)
     936static int snd_emu10k1_ipcm_peek(struct snd_emu10k1 *emu, emu10k1_fx8010_pcm_t *ipcm)
    937937{
    938938    unsigned int i;
    939939    int err = 0;
    940     snd_emu10k1_fx8010_pcm_t *pcm;
     940    struct snd_emu10k1_fx8010_pcm *pcm;
    941941
    942942    if (ipcm->substream >= EMU10K1_FX8010_PCM_COUNT)
     
    10191019 */
    10201020
    1021 static int __devinit _snd_emu10k1_audigy_init_efx(emu10k1_t *emu)
     1021static int __devinit _snd_emu10k1_audigy_init_efx(struct snd_emu10k1 *emu)
    10221022{
    10231023    int err, i, z, gpr, nctl;
     
    10351035    INIT_LIST_HEAD(&emu->fx8010.gpr_ctl);
    10361036
    1037     if ((icode = kzalloc(sizeof(*icode), GFP_KERNEL)) == NULL ||
     1037    if ((icode = (emu10k1_fx8010_code_t *)kzalloc(sizeof(*icode), GFP_KERNEL)) == NULL ||
    10381038        (icode->gpr_map = (u_int32_t __user *)kcalloc(512 + 256 + 256 + 2 * 1024, sizeof(u_int32_t), GFP_KERNEL)) == NULL ||
    10391039        (controls = kcalloc(SND_EMU10K1_GPR_CONTROLS, sizeof(*controls), GFP_KERNEL)) == NULL) {
     
    14871487
    14881488
    1489 static int __devinit _snd_emu10k1_init_efx(emu10k1_t *emu)
     1489static int __devinit _snd_emu10k1_init_efx(struct snd_emu10k1 *emu)
    14901490{
    14911491    int err, i, z, gpr, tmp, playback, capture;
     
    15001500    INIT_LIST_HEAD(&emu->fx8010.gpr_ctl);
    15011501
    1502     if ((icode = kzalloc(sizeof(*icode), GFP_KERNEL)) == NULL)
     1502    if ((icode = (emu10k1_fx8010_code_t *)kzalloc(sizeof(*icode), GFP_KERNEL)) == NULL)
    15031503        return -ENOMEM;
    15041504    if ((icode->gpr_map = (u_int32_t __user *)kcalloc(256 + 160 + 160 + 2 * 512, sizeof(u_int32_t), GFP_KERNEL)) == NULL ||
    15051505        (controls = kcalloc(SND_EMU10K1_GPR_CONTROLS, sizeof(emu10k1_fx8010_control_gpr_t), GFP_KERNEL)) == NULL ||
    1506         (ipcm = kzalloc(sizeof(*ipcm), GFP_KERNEL)) == NULL) {
     1506        (ipcm = (emu10k1_fx8010_pcm_t *)kzalloc(sizeof(*ipcm), GFP_KERNEL)) == NULL) {
    15071507        err = -ENOMEM;
    15081508        goto __err;
     
    20502050}
    20512051
    2052 int __devinit snd_emu10k1_init_efx(emu10k1_t *emu)
     2052int __devinit snd_emu10k1_init_efx(struct snd_emu10k1 *emu)
    20532053{
    20542054    if (emu->audigy)
     
    20582058}
    20592059
    2060 void snd_emu10k1_free_efx(emu10k1_t *emu)
     2060void snd_emu10k1_free_efx(struct snd_emu10k1 *emu)
    20612061{
    20622062    /* stop processor */
     
    20682068
    20692069#if 0 // FIXME: who use them?
    2070 int snd_emu10k1_fx8010_tone_control_activate(emu10k1_t *emu, int output)
     2070int snd_emu10k1_fx8010_tone_control_activate(struct snd_emu10k1 *emu, int output)
    20712071{
    20722072    snd_runtime_check(output >= 0 && output < 6, return -EINVAL);
     
    20752075}
    20762076
    2077 int snd_emu10k1_fx8010_tone_control_deactivate(emu10k1_t *emu, int output)
     2077int snd_emu10k1_fx8010_tone_control_deactivate(struct snd_emu10k1 *emu, int output)
    20782078{
    20792079    snd_runtime_check(output >= 0 && output < 6, return -EINVAL);
     
    20832083#endif
    20842084
    2085 int snd_emu10k1_fx8010_tram_setup(emu10k1_t *emu, u32 size)
     2085int snd_emu10k1_fx8010_tram_setup(struct snd_emu10k1 *emu, u32 size)
    20862086{
    20872087    u8 size_reg = 0;
     
    21382138}
    21392139
    2140 static int snd_emu10k1_fx8010_info(emu10k1_t *emu, emu10k1_fx8010_info_t *info)
     2140static int snd_emu10k1_fx8010_info(struct snd_emu10k1 *emu, emu10k1_fx8010_info_t *info)
    21412141{
    21422142    char **fxbus, **extin, **extout;
     
    21662166static int snd_emu10k1_fx8010_ioctl(snd_hwdep_t * hw, struct file *file, unsigned int cmd, unsigned long arg)
    21672167{
    2168     emu10k1_t *emu = hw->private_data;
     2168    struct snd_emu10k1 *emu = hw->private_data;
    21692169    emu10k1_fx8010_info_t *info;
    21702170    emu10k1_fx8010_code_t *icode;
     
    22282228        return res;
    22292229    case SNDRV_EMU10K1_IOCTL_PCM_PEEK:
    2230         ipcm = kzalloc(sizeof(*ipcm), GFP_KERNEL);
     2230        ipcm = (emu10k1_fx8010_pcm_t *)kzalloc(sizeof(*ipcm), GFP_KERNEL);
    22312231        if (ipcm == NULL)
    22322232            return -ENOMEM;
     
    23142314}
    23152315
    2316 int __devinit snd_emu10k1_fx8010_new(emu10k1_t *emu, int device, snd_hwdep_t ** rhwdep)
     2316int __devinit snd_emu10k1_fx8010_new(struct snd_emu10k1 *emu, int device, snd_hwdep_t ** rhwdep)
    23172317{
    23182318    snd_hwdep_t *hw;
Note: See TracChangeset for help on using the changeset viewer.