Ignore:
Timestamp:
Jul 26, 2007, 7:21:09 AM (18 years ago)
Author:
Brendan Oakley
Message:

Merged to Alsa 0.9.1

File:
1 edited

Legend:

Unmodified
Added
Removed
  • GPL/branches/alsa-resync1/alsa-kernel/pci/sonicvibes.c

    r212 r224  
    2424
    2525#include <sound/driver.h>
    26 #include <asm/io.h>
    2726#include <linux/delay.h>
    2827#include <linux/init.h>
     28#include <linux/interrupt.h>
    2929#include <linux/pci.h>
    3030#include <linux/slab.h>
     31#include <linux/gameport.h>
     32
    3133#include <sound/core.h>
    3234#include <sound/pcm.h>
     
    3739#define SNDRV_GET_ID
    3840#include <sound/initval.h>
    39 #ifndef LINUX_2_2
    40 #include <linux/gameport.h>
    41 #endif
     41
     42#include <asm/io.h>
    4243
    4344MODULE_AUTHOR("Jaroslav Kysela <perex@suse.cz>");
     
    252253
    253254        spinlock_t reg_lock;
    254         snd_info_entry_t *proc_entry;
    255255
    256256        unsigned int p_dma_size;
     
    260260        snd_kcontrol_t *master_volume;
    261261
    262 #ifndef LINUX_2_2
     262#if defined(CONFIG_GAMEPORT) || defined(CONFIG_GAMEPORT_MODULE)
    263263        struct gameport gameport;
    264264#endif
     
    272272MODULE_DEVICE_TABLE(pci, snd_sonic_ids);
    273273
    274 #ifdef TARGET_OS2
    275274static ratden_t sonicvibes_adc_clock = {
    276         4000 * 65536,
    277         48000UL * 65536,
    278         1,
    279         65536,
     275        .num_min = 4000 * 65536,
     276        .num_max = 48000UL * 65536,
     277        .num_step = 1,
     278        .den = 65536,
    280279};
    281280static snd_pcm_hw_constraint_ratdens_t snd_sonicvibes_hw_constraints_adc_clock = {
    282         1,
    283         &sonicvibes_adc_clock,
     281        .nrats = 1,
     282        .rats = &sonicvibes_adc_clock,
    284283};
    285 #else
    286 static ratden_t sonicvibes_adc_clock = {
    287         num_min: 4000 * 65536,
    288         num_max: 48000UL * 65536,
    289         num_step: 1,
    290         den: 65536,
    291 };
    292 static snd_pcm_hw_constraint_ratdens_t snd_sonicvibes_hw_constraints_adc_clock = {
    293         nrats: 1,
    294         rats: &sonicvibes_adc_clock,
    295 };
    296 #endif
    297284
    298285/*
     
    11371124        snd_card_t *card;
    11381125        snd_kcontrol_t *kctl;
    1139         int idx, err;
     1126        unsigned int idx;
     1127        int err;
    11401128
    11411129        snd_assert(sonic != NULL && sonic->card != NULL, return -EINVAL);
     
    11921180        snd_info_entry_t *entry;
    11931181
    1194         if ((entry = snd_info_create_card_entry(sonic->card, "sonicvibes", sonic->card->proc_root)) != NULL) {
    1195                 entry->content = SNDRV_INFO_CONTENT_TEXT;
    1196                 entry->private_data = sonic;
    1197                 entry->mode = S_IFREG | S_IRUGO | S_IWUSR;
    1198                 entry->c.text.read_size = 256;
    1199                 entry->c.text.read = snd_sonicvibes_proc_read;
    1200                 if (snd_info_register(entry) < 0) {
    1201                         snd_info_free_entry(entry);
    1202                         entry = NULL;
    1203                 }
    1204         }
    1205         sonic->proc_entry = entry;
    1206 }
    1207 
    1208 static void snd_sonicvibes_proc_done(sonicvibes_t * sonic)
    1209 {
    1210         if (sonic->proc_entry) {
    1211                 snd_info_unregister(sonic->proc_entry);
    1212                 sonic->proc_entry = NULL;
    1213         }
     1182        if (! snd_card_proc_new(sonic->card, "sonicvibes", &entry))
     1183                snd_info_set_text_ops(entry, sonic, snd_sonicvibes_proc_read);
    12141184}
    12151185
     
    12231193static int snd_sonicvibes_free(sonicvibes_t *sonic)
    12241194{
    1225 #ifndef LINUX_2_2
     1195#if defined(CONFIG_GAMEPORT) || defined(CONFIG_GAMEPORT_MODULE)
    12261196        if (sonic->gameport.io)
    12271197                gameport_unregister_port(&sonic->gameport);
    12281198#endif
    1229         snd_sonicvibes_proc_done(sonic);
    12301199        pci_write_config_dword(sonic->pci, 0x40, sonic->dmaa_port);
    12311200        pci_write_config_dword(sonic->pci, 0x48, sonic->dmac_port);
     
    14551424        snd_card_t *card = sonic->card;
    14561425        snd_rawmidi_str_t *dir;
    1457         int idx, err;
     1426        unsigned int idx;
     1427        int err;
    14581428
    14591429        mpu->private_data = sonic;
     
    15271497                return err;
    15281498        }
    1529 #ifndef LINUX_2_2
     1499#if defined(CONFIG_GAMEPORT) || defined(CONFIG_GAMEPORT_MODULE)
    15301500        sonic->gameport.io = sonic->game_port;
    15311501        gameport_register_port(&sonic->gameport);
Note: See TracChangeset for help on using the changeset viewer.