Ignore:
Timestamp:
May 31, 2007, 6:45:32 AM (18 years ago)
Author:
Brendan Oakley
Message:

Merged to Alsa 0.9.0rc1. Builds.

Location:
GPL/branches/alsa-resync1/alsa-kernel/isa
Files:
29 edited

Legend:

Unmodified
Added
Removed
  • GPL/branches/alsa-resync1/alsa-kernel/isa/ad1816a/ad1816a.c

    r92 r112  
    333333                                            const struct isapnp_card_id *id)
    334334{
    335         static int dev = 0;
     335        static int dev;
    336336        int res;
    337337
  • GPL/branches/alsa-resync1/alsa-kernel/isa/ad1816a/ad1816a_lib.c

    r92 r112  
    2525#include <linux/init.h>
    2626#include <linux/slab.h>
     27#include <linux/ioport.h>
    2728#include <sound/core.h>
    2829#include <sound/ad1816a.h>
  • GPL/branches/alsa-resync1/alsa-kernel/isa/ad1848/ad1848_lib.c

    r92 r112  
    2626#include <linux/delay.h>
    2727#include <linux/slab.h>
     28#include <linux/ioport.h>
    2829#include <sound/core.h>
    2930#include <sound/ad1848.h>
     
    669670                        if (rev & 0x80) {
    670671                                chip->hardware = AD1848_HW_CS4248;
    671                         } else if (rev & 0x0a) {
    672                                 chip->hardware = AD1848_HW_CMI8330;
     672                        } else if ((rev & 0x0f) == 0x0a) {
     673                                snd_ad1848_out(chip, AD1848_MISC_INFO, 0x40);
     674                                for (i = 0; i < 16; ++i) {
     675                                        if (snd_ad1848_in(chip, i) != snd_ad1848_in(chip, i + 16)) {
     676                                                chip->hardware = AD1848_HW_CMI8330;
     677                                                break;
     678                                        }
     679                                }
     680                                snd_ad1848_out(chip, AD1848_MISC_INFO, 0x00);
    673681                        }
    674682                }
  • GPL/branches/alsa-resync1/alsa-kernel/isa/als100.c

    r92 r112  
    354354                                           const struct isapnp_card_id *id)
    355355{
    356         static int dev = 0;
     356        static int dev;
    357357        int res;
    358358
  • GPL/branches/alsa-resync1/alsa-kernel/isa/azt2320.c

    r92 r112  
    139139        /* PRO16V */
    140140        ISAPNP_AZT2320('A','Z','T',0x1008,0x1008,0x2001),
    141         /* --- */
     141        /* Aztech Sound Galaxy 16 */
    142142        ISAPNP_AZT2320('A','Z','T',0x2320,0x0001,0x0002),
    143143        /* Packard Bell Sound III 336 AM/SP */
  • GPL/branches/alsa-resync1/alsa-kernel/isa/cmi8330.c

    r92 r112  
    190190AD1848_SINGLE("Loud Playback Switch", 0, CMI8330_MUTEMUX, 6, 1, 1),
    191191AD1848_DOUBLE("PCM Playback Switch", 0, AD1848_LEFT_OUTPUT, AD1848_RIGHT_OUTPUT, 7, 7, 1, 1),
    192 AD1848_DOUBLE("PCM Playback Volume", 0, AD1848_LEFT_OUTPUT, AD1848_RIGHT_OUTPUT, 0, 0, 63, 0),
     192AD1848_DOUBLE("PCM Playback Volume", 0, AD1848_LEFT_OUTPUT, AD1848_RIGHT_OUTPUT, 0, 0, 63, 1),
    193193AD1848_DOUBLE("Line Playback Switch", 0, CMI8330_MUTEMUX, CMI8330_MUTEMUX, 4, 3, 1, 0),
    194194AD1848_DOUBLE("Line Playback Volume", 0, CMI8330_LINVOL, CMI8330_LINVOL, 4, 0, 15, 0),
     
    464464                                            const struct isapnp_card_id *id)
    465465{
    466         static int dev = 0;
     466        static int dev;
    467467        int res;
    468468
  • GPL/branches/alsa-resync1/alsa-kernel/isa/cs423x/cs4231_lib.c

    r92 r112  
    3333#include <linux/init.h>
    3434#include <linux/slab.h>
     35#include <linux/ioport.h>
    3536#include <sound/core.h>
    3637#include <sound/cs4231.h>
  • GPL/branches/alsa-resync1/alsa-kernel/isa/cs423x/cs4236.c

    r92 r112  
    7171                "{IBM,IntelliStation M Pro},"
    7272                "{Intel,Marlin Spike Mobo CS4235},"
     73                "{Intel PR440FX Onboard},"
    7374                "{Guillemot,MaxiSound 16 PnP},"
    7475                "{NewClear,3D},"
     
    237238        /* some uknown CS4236B */
    238239        ISAPNP_CS4232('C','S','C',0x0b35,0x0000,0x0010,0x0003),
     240        /* Intel PR440FX Onboard sound */
     241        ISAPNP_CS4232('C','S','C',0x0b36,0x0000,0x0010,0x0003),
    239242        /* CS4235 on mainboard without MPU */
    240243        ISAPNP_CS4232_WOMPU('C','S','C',0x1425,0x0100,0x0110),
     
    326329        if (snd_port[dev] != SNDRV_AUTO_PORT)
    327330                isapnp_resource_change(&pdev->resource[0], snd_port[dev], 4);
    328         if (snd_fm_port[dev] != SNDRV_AUTO_PORT)
     331        if (snd_fm_port[dev] != SNDRV_AUTO_PORT && snd_fm_port[dev] >= 0)
    329332                isapnp_resource_change(&pdev->resource[1], snd_fm_port[dev], 4);
    330333        if (snd_sb_port[dev] != SNDRV_AUTO_PORT)
     
    341344        }
    342345        snd_port[dev] = pdev->resource[0].start;
    343         snd_fm_port[dev] = pdev->resource[1].start;
     346        if (snd_fm_port[dev] >= 0)
     347                snd_fm_port[dev] = pdev->resource[1].start;
    344348        snd_sb_port[dev] = pdev->resource[2].start;
    345349        snd_irq[dev] = pdev->irq_resource[0].start;
     
    366370        snd_printdd("isapnp CTRL: control port=0x%lx\n", snd_cport[dev]);
    367371        /* MPU initialization */
    368         if (acard->mpu) {
     372        if (acard->mpu && snd_mpu_port[dev] >= 0) {
    369373                pdev = acard->mpu;
    370374                if (pdev->prepare(pdev) < 0) {
     
    375379                if (snd_mpu_port[dev] != SNDRV_AUTO_PORT)
    376380                        isapnp_resource_change(&pdev->resource[0], snd_mpu_port[dev], 2);
    377                 if (snd_mpu_irq[dev] != SNDRV_AUTO_IRQ)
     381                if (snd_mpu_irq[dev] != SNDRV_AUTO_IRQ && snd_mpu_irq[dev] >= 0)
    378382                        isapnp_resource_change(&pdev->irq_resource[0], snd_mpu_irq[dev], 1);
    379383                if (pdev->activate(pdev)<0) {
     
    383387                } else {
    384388                        snd_mpu_port[dev] = pdev->resource[0].start;
    385                         if (pdev->irq_resource[0].flags & IORESOURCE_IRQ) {
    386                         snd_mpu_irq[dev] = pdev->irq_resource[0].start;
     389                        if ((pdev->irq_resource[0].flags & IORESOURCE_IRQ) &&
     390                            snd_mpu_irq[dev] >= 0) {
     391                                snd_mpu_irq[dev] = pdev->irq_resource[0].start;
    387392                        } else {
    388393                                snd_mpu_irq[dev] = -1;  /* disable interrupt */
     
    538543        }
    539544
    540         if (snd_mpu_irq[dev] >= 0 && snd_mpu_irq[dev] != SNDRV_AUTO_IRQ) {
     545        if (snd_mpu_port[dev] != SNDRV_AUTO_PORT) {
    541546                if (snd_mpu401_uart_new(card, 0, MPU401_HW_CS4232,
    542547                                        snd_mpu_port[dev], 0,
     
    566571                                           const struct isapnp_card_id *id)
    567572{
    568         static int dev = 0;
     573        static int dev;
    569574        int res;
    570575
  • GPL/branches/alsa-resync1/alsa-kernel/isa/dt0197h.c

    r92 r112  
    321321                                            const struct isapnp_card_id *id)
    322322{
    323         static int dev = 0;
     323        static int dev;
    324324        int res;
    325325
  • GPL/branches/alsa-resync1/alsa-kernel/isa/es1688/es1688.c

    r92 r112  
    170170static int __init snd_audiodrive_legacy_auto_probe(unsigned long port)
    171171{
    172         static int dev = 0;
     172        static int dev;
    173173        int res;
    174174       
  • GPL/branches/alsa-resync1/alsa-kernel/isa/es1688/es1688_lib.c

    r92 r112  
    2626#include <linux/delay.h>
    2727#include <linux/slab.h>
     28#include <linux/ioport.h>
    2829#include <sound/core.h>
    2930#include <sound/es1688.h>
  • GPL/branches/alsa-resync1/alsa-kernel/isa/es18xx.c

    r92 r112  
    23812381static int __init snd_audiodrive_probe_legacy_port(unsigned long port)
    23822382{
    2383         static int dev = 0;
     2383        static int dev;
    23842384        int res;
    23852385
     
    24052405                                               const struct isapnp_card_id *id)
    24062406{
    2407         static int dev = 0;
     2407        static int dev;
    24082408        int res;
    24092409
  • GPL/branches/alsa-resync1/alsa-kernel/isa/gus/gus_main.c

    r32 r112  
    1616 *   You should have received a copy of the GNU General Public License
    1717 *   along with this program; if not, write to the Free Software
    18  *   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
     18 *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
    1919 *
    2020 */
    2121
    22 #define SNDRV_MAIN_OBJECT_FILE
    2322#include <sound/driver.h>
     23#include <asm/dma.h>
     24#include <linux/init.h>
     25#include <linux/delay.h>
     26#include <linux/slab.h>
     27#include <linux/ioport.h>
     28#include <sound/core.h>
    2429#include <sound/gus.h>
    2530#include <sound/control.h>
    2631
     32MODULE_AUTHOR("Jaroslav Kysela <perex@suse.cz>");
     33MODULE_DESCRIPTION("Routines for Gravis UltraSound soundcards");
     34MODULE_LICENSE("GPL");
     35
    2736#define chip_t snd_gus_card_t
    2837
    2938static int snd_gus_init_dma_irq(snd_gus_card_t * gus, int latches);
     39
     40static inline void dec_mod_count(struct module *module)
     41{
     42        if (module)
     43                __MOD_DEC_USE_COUNT(module);
     44}
    3045
    3146int snd_gus_use_inc(snd_gus_card_t * gus)
     
    110125        if (gus->gf1.res_port2 == NULL)
    111126                goto __hw_end;
    112 #ifdef CONFIG_SND_SEQUENCER
     127#if defined(CONFIG_SND_SEQUENCER) || defined(CONFIG_SND_SEQUENCER_MODULE)
    113128        if (gus->seq_dev) {
    114129                snd_device_free(gus->card, gus->seq_dev);
     
    119134        snd_gus_init_dma_irq(gus, 0);
    120135      __hw_end:
    121         if (gus->gf1.res_port1)
     136        if (gus->gf1.res_port1) {
    122137                release_resource(gus->gf1.res_port1);
    123         if (gus->gf1.res_port2)
     138                kfree_nocheck(gus->gf1.res_port1);
     139        }
     140        if (gus->gf1.res_port2) {
    124141                release_resource(gus->gf1.res_port2);
     142                kfree_nocheck(gus->gf1.res_port2);
     143        }
    125144        if (gus->gf1.irq >= 0)
    126145                free_irq(gus->gf1.irq, (void *) gus);
     
    440459        if ((err = snd_gus_init_dma_irq(gus, 1)) < 0)
    441460                return err;
    442 #ifdef CONFIG_SND_SEQUENCER
     461#if defined(CONFIG_SND_SEQUENCER) || defined(CONFIG_SND_SEQUENCER_MODULE)
    443462        if (snd_seq_device_new(gus->card, 1, SNDRV_SEQ_DEV_ID_GUS,
    444463                               sizeof(snd_gus_card_t*), &gus->seq_dev) >= 0) {
  • GPL/branches/alsa-resync1/alsa-kernel/isa/gus/gusclassic.c

    r92 r112  
    230230static int __init snd_gusclassic_legacy_auto_probe(unsigned long port)
    231231{
    232         static int dev = 0;
     232        static int dev;
    233233        int res;
    234234
  • GPL/branches/alsa-resync1/alsa-kernel/isa/gus/gusextreme.c

    r92 r112  
    360360static int __init snd_gusextreme_legacy_auto_probe(unsigned long port)
    361361{
    362         static int dev = 0;
     362        static int dev;
    363363        int res;
    364364
  • GPL/branches/alsa-resync1/alsa-kernel/isa/gus/gusmax.c

    r92 r112  
    366366static int __init snd_gusmax_legacy_auto_probe(unsigned long port)
    367367{
    368         static int dev = 0;
     368        static int dev;
    369369        int res;
    370370
  • GPL/branches/alsa-resync1/alsa-kernel/isa/gus/interwave.c

    r92 r112  
    912912static int __init snd_interwave_probe_legacy_port(unsigned long port)
    913913{
    914         static int dev = 0;
     914        static int dev;
    915915        int res;
    916916
     
    936936                                              const struct isapnp_card_id *id)
    937937{
    938         static int dev = 0;
     938        static int dev;
    939939        int res;
    940940
  • GPL/branches/alsa-resync1/alsa-kernel/isa/opl3sa2.c

    r106 r112  
    194194        /* Yamaha OPL3-SA3 (integrated on Intel's Pentium II AL440LX motherboard) */
    195195        ISAPNP_OPL3SA2('Y','M','H',0x0030,0x0021),
    196         /* ??? */
     196        /* Yamaha OPL3-SA2 */
    197197        ISAPNP_OPL3SA2('Y','M','H',0x0800,0x0021),
    198198        /* NeoMagic MagicWave 3DX */
     
    881881                                            const struct isapnp_card_id *id)
    882882{
    883         static int dev = 0;
     883        static int dev;
    884884        int res;
    885885
  • GPL/branches/alsa-resync1/alsa-kernel/isa/sb/emu8000.c

    r32 r112  
    1818 *   You should have received a copy of the GNU General Public License
    1919 *   along with this program; if not, write to the Free Software
    20  *   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
    21  */
    22 
    23 #define SNDRV_MAIN_OBJECT_FILE
     20 *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
     21 */
     22
     23#define __NO_VERSION__
     24#include <sound/driver.h>
     25#include <linux/wait.h>
     26#include <linux/sched.h>
     27#include <linux/slab.h>
     28#include <linux/ioport.h>
     29#include <sound/core.h>
    2430#include <sound/emu8000.h>
    2531#include <sound/emu8000_reg.h>
     32#include <asm/io.h>
     33#include <asm/uaccess.h>
     34#include <linux/init.h>
    2635#include <sound/control.h>
    2736#include <sound/initval.h>
    28 
    29 MODULE_CLASSES("{sound}");
    30 MODULE_AUTHOR("Takashi Iwai, Steve Ratcliffe");
    3137
    3238/*
     
    124130/*
    125131 */
    126 static void /*__init*/
     132static void __init
    127133snd_emu8000_read_wait(emu8000_t *emu)
    128134{
     
    137143/*
    138144 */
    139 static void /*__init*/
     145static void __init
    140146snd_emu8000_write_wait(emu8000_t *emu)
    141147{
     
    151157 * detect a card at the given port
    152158 */
    153 static int /*__init*/
     159static int __init
    154160snd_emu8000_detect(emu8000_t *emu)
    155161{
     
    177183 * intiailize audio channels
    178184 */
    179 static void /*__init*/
     185static void __init
    180186init_audio(emu8000_t *emu)
    181187{
     
    218224 * initialize DMA address
    219225 */
    220 static void /*__init*/
     226static void __init
    221227init_dma(emu8000_t *emu)
    222228{
     
    322328 * is meant to work
    323329 */
    324 static void /*__init*/
     330static void __init
    325331send_array(emu8000_t *emu, unsigned short *data, int size)
    326332{
     
    346352 * initialisation sequence in the adip.
    347353 */
    348 static void /*__init*/
     354static void __init
    349355init_arrays(emu8000_t *emu)
    350356{
     
    373379 * reallocating between read and write.
    374380 */
    375 static void /*__init*/
     381static void __init
    376382size_dram(emu8000_t *emu)
    377383{
     
    499505 * The main initialization routine.
    500506 */
    501 static void /*__init*/
     507static void __init
    502508snd_emu8000_init_hw(emu8000_t *emu)
    503509{
     
    653659        soundfont_chorus_fx_t rec;
    654660        if (mode < SNDRV_EMU8000_CHORUS_PREDEFINED || mode >= SNDRV_EMU8000_CHORUS_NUMBERS) {
    655                 snd_printk("illegal chorus mode %d for uploading\n", mode);
     661                snd_printk(KERN_WARNING "illegal chorus mode %d for uploading\n", mode);
    656662                return -EINVAL;
    657663        }
     
    781787
    782788        if (mode < SNDRV_EMU8000_REVERB_PREDEFINED || mode >= SNDRV_EMU8000_REVERB_NUMBERS) {
    783                 snd_printk("illegal reverb mode %d for uploading\n", mode);
     789                snd_printk(KERN_WARNING "illegal reverb mode %d for uploading\n", mode);
    784790                return -EINVAL;
    785791        }
     
    10851091 * create and attach mixer elements for WaveTable treble/bass controls
    10861092 */
    1087 static int /*__init*/
     1093static int __init
    10881094snd_emu8000_create_mixer(snd_card_t *card, emu8000_t *emu)
    10891095{
     
    11151121static int snd_emu8000_free(emu8000_t *hw)
    11161122{
    1117         if (hw->res_port1)
     1123        if (hw->res_port1) {
    11181124                release_resource(hw->res_port1);
    1119         if (hw->res_port2)
     1125                kfree_nocheck(hw->res_port1);
     1126        }
     1127        if (hw->res_port2) {
    11201128                release_resource(hw->res_port2);
    1121         if (hw->res_port3)
     1129                kfree_nocheck(hw->res_port2);
     1130        }
     1131        if (hw->res_port3) {
    11221132                release_resource(hw->res_port3);
     1133                kfree_nocheck(hw->res_port3);
     1134        }
    11231135        snd_magic_kfree(hw);
    11241136        return 0;
     
    11361148 * initialize and register emu8000 synth device.
    11371149 */
    1138 /*exported*/ int
     1150int __init
    11391151snd_emu8000_new(snd_card_t *card, int index, long port, int seq_ports, snd_seq_device_t **awe_ret)
    11401152{
     
    12131225 */
    12141226
    1215 EXPORT_SYMBOL(snd_emu8000_new);
    12161227EXPORT_SYMBOL(snd_emu8000_poke);
    12171228EXPORT_SYMBOL(snd_emu8000_peek);
     
    12251236EXPORT_SYMBOL(snd_emu8000_update_reverb_mode);
    12261237EXPORT_SYMBOL(snd_emu8000_update_equalizer);
    1227 
    1228 /*
    1229  *  INIT part
    1230  */
    1231 
    1232 static int __init alsa_emu8000_init(void)
    1233 {
    1234         return 0;
    1235 }
    1236 
    1237 static void __exit alsa_emu8000_exit(void)
    1238 {
    1239 }
    1240 
    1241 module_init(alsa_emu8000_init)
    1242 module_exit(alsa_emu8000_exit)
  • GPL/branches/alsa-resync1/alsa-kernel/isa/sb/es968.c

    r92 r112  
    237237                                          const struct isapnp_card_id *id)
    238238{
    239     static int dev = 0;
     239        static int dev;
    240240    int res;
    241241
  • GPL/branches/alsa-resync1/alsa-kernel/isa/sb/sb16.c

    r92 r112  
    589589    static int __init snd_sb16_probe_legacy_port(unsigned long port)
    590590    {
    591         static int dev = 0;
     591        static int dev;
    592592        int res;
    593593
     
    613613                                             const struct isapnp_card_id *id)
    614614    {
    615         static int dev = 0;
     615        static int dev;
    616616        int res;
    617617
  • GPL/branches/alsa-resync1/alsa-kernel/isa/sb/sb16_main.c

    r92 r112  
    210210#define snd_sb16_csp_playback_prepare(chip, runtime)    /*nop*/
    211211#define snd_sb16_csp_capture_prepare(chip, runtime)     /*nop*/
    212 #define snd_sb16_csp_update(chip)               /*nop*/
     212#define snd_sb16_csp_update(chip)                       /*nop*/
    213213#define snd_sb16_csp_playback_open(chip, runtime)       /*nop*/
    214 #define snd_sb16_csp_playback_close(chip)       /*nop*/
     214#define snd_sb16_csp_playback_close(chip)               /*nop*/
    215215#define snd_sb16_csp_capture_open(chip, runtime)        /*nop*/
    216 #define snd_sb16_csp_capture_close(chip)        /*nop*/
     216#define snd_sb16_csp_capture_close(chip)                /*nop*/
    217217#endif
    218218
     
    825825        }
    826826    }
    827     if (chip->dma16 >= 0) {
     827        if (chip->dma16 >= 0 && chip->dma16 != chip->dma8) {
    828828        switch (chip->dma16) {
    829829        case 5:
     
    940940    snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE, &snd_sb16_capture_ops);
    941941
     942        if (chip->dma16 >= 0 && chip->dma8 != chip->dma16)
    942943    snd_ctl_add(card, snd_ctl_new1(&snd_sb16_dma_control, chip));
     944        else
     945                pcm->info_flags = SNDRV_PCM_INFO_HALF_DUPLEX;
    943946
    944947        snd_pcm_lib_preallocate_isa_pages_for_all(pcm, 64*1024, 128*1024);
  • GPL/branches/alsa-resync1/alsa-kernel/isa/sb/sb8.c

    r92 r112  
    2323#include <linux/init.h>
    2424#include <linux/slab.h>
     25#include <linux/ioport.h>
    2526#include <sound/core.h>
    2627#include <sound/sb.h>
     
    183184static int __init snd_card_sb8_legacy_auto_probe(unsigned long port)
    184185{
    185     static int dev = 0;
     186        static int dev;
    186187    int res;
    187188
  • GPL/branches/alsa-resync1/alsa-kernel/isa/sb/sb_common.c

    r92 r112  
    2727#include <linux/init.h>
    2828#include <linux/slab.h>
     29#include <linux/ioport.h>
    2930#include <sound/core.h>
    3031#include <sound/sb.h>
     
    183184        free_dma(chip->dma8);
    184185    }
    185     if (chip->dma16 >= 0) {
     186        if (chip->dma16 >= 0 && chip->dma16 != chip->dma8) {
    186187        disable_dma(chip->dma16);
    187188        free_dma(chip->dma16);
     
    255256    }
    256257    chip->dma8 = dma8;
    257     if (dma16 >= 0 && request_dma(dma16, "SoundBlaster - 16bit")) {
     258        if (dma16 >= 0) {
     259                if (hardware != SB_HW_ALS100 && (dma16 < 5 || dma16 > 7)) {
     260                        /* no duplex */
     261                        dma16 = -1;
     262                } else if (request_dma(dma16, "SoundBlaster - 16bit")) {
    258263        snd_sbdsp_free(chip);
    259264        return -EBUSY;
     265                }
    260266    }
    261267    chip->dma16 = dma16;
  • GPL/branches/alsa-resync1/alsa-kernel/isa/sgalaxy.c

    r92 r112  
    120120        int tmp, tmp1;
    121121
    122         unsigned int flags;
     122        unsigned long flags;
    123123
    124124        if ((tmp = inb(port + 3)) == 0xff)
  • GPL/branches/alsa-resync1/alsa-kernel/isa/wavefront/wavefront.c

    r92 r112  
    5959
    6060MODULE_PARM(snd_index, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
    61 MODULE_PARM_SYNTAX(snd_index, "Index value for WaveFront soundcard.");
     61MODULE_PARM_DESC(snd_index, "Index value for WaveFront soundcard.");
     62MODULE_PARM_SYNTAX(snd_index, SNDRV_INDEX_DESC);
    6263MODULE_PARM(snd_id, "1-" __MODULE_STRING(SNDRV_CARDS) "s");
    6364MODULE_PARM_DESC(snd_id, "ID string for WaveFront soundcard.");
     
    100101MODULE_PARM(snd_use_cs4232_midi, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
    101102MODULE_PARM_DESC(snd_use_cs4232_midi, "Use CS4232 MPU-401 interface (inaccessibly located inside your computer)");
    102 MODULE_PARM_SYNTAX(snd_use_cs4232_midi, SNDRV_ENABLED ",allows use of CS4323 MPU-401 interface");
     103MODULE_PARM_SYNTAX(snd_use_cs4232_midi, SNDRV_ENABLED "," SNDRV_BOOLEAN_FALSE_DESC);
    103104
    104105static snd_card_t *snd_wavefront_cards[SNDRV_CARDS] = SNDRV_DEFAULT_PTR;
     
    702703                                              const struct isapnp_card_id *id)
    703704{
    704         static int dev = 0;
     705        static int dev;
    705706        int res;
    706707
  • GPL/branches/alsa-resync1/alsa-kernel/isa/wavefront/wavefront_fx.c

    r32 r112  
    11/*
    2  *  Copyright (c) 1998-1999 by Paul Barton-Davis <pbd@op.net>
     2 *  Copyright (c) 1998-2002 by Paul Davis <pbd@op.net>
    33 *
    44 *  This program is free software; you can redistribute it and/or modify
     
    1414 *  You should have received a copy of the GNU General Public License
    1515 *  along with this program; if not, write to the Free Software
    16  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
     16 *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
    1717 */
    1818
    19 #define SNDRV_MAIN_OBJECT_FILE
     19#define __NO_VERSION__
    2020#include <sound/driver.h>
     21#include <asm/io.h>
     22#include <linux/init.h>
     23#include <linux/time.h>
     24#include <linux/wait.h>
     25#include <sound/core.h>
    2126#include <sound/snd_wavefront.h>
    2227#include <sound/yss225.h>
    2328#include <sound/initval.h>
    2429
    25 MODULE_AUTHOR("Paul Barton-Davis <pbd@op.net>");
    26 MODULE_DESCRIPTION("ALSA driver for Turtle Beach Tropez+ YSS225 FX Processor");
    27 MODULE_CLASSES("{sound}");
    28 
    2930/* Control bits for the Load Control Register
    3031 */
     
    3334#define FX_MSB_TRANSFER 0x02    /* transfer after DSP MSB byte written */
    3435#define FX_AUTO_INCR    0x04    /* auto-increment DSP address after transfer */
     36
     37static inline void
     38dec_mod_count(struct module *module)
     39{
     40        if (module)
     41                __MOD_DEC_USE_COUNT(module);
     42}
    3543
    3644static int
     
    242250
    243251
    244 int
     252int __init
    245253snd_wavefront_fx_start (snd_wavefront_t *dev)
    246254
     
    699707/* wierd stuff, derived from port I/O tracing with dosemu */
    700708
    701 unsigned char page_zero[] = {
     709static unsigned char page_zero[] __initdata = {
    7027100x01, 0x7c, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf5, 0x00,
    7037110x11, 0x00, 0x20, 0x00, 0x32, 0x00, 0x40, 0x00, 0x13, 0x00, 0x00,
     
    726734};   
    727735
    728 unsigned char page_one[] = {
     736static unsigned char page_one[] __initdata = {
    7297370x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x19, 0x00,
    7307380x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0xd8, 0x00, 0x00,
     
    753761};
    754762
    755 unsigned char page_two[] = {
     763static unsigned char page_two[] __initdata = {
    7567640xc4, 0x00, 0x44, 0x07, 0x44, 0x00, 0x40, 0x25, 0x01, 0x06, 0xc4,
    7577650x07, 0x40, 0x25, 0x01, 0x00, 0x46, 0x46, 0x00, 0x00, 0x00, 0x00,
     
    768776};
    769777
    770 unsigned char page_three[] = {
     778static unsigned char page_three[] __initdata = {
    7717790x07, 0x40, 0x00, 0x00, 0x00, 0x47, 0x00, 0x40, 0x00, 0x40, 0x06,
    7727800x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
     
    783791};
    784792
    785 unsigned char page_four[] = {
     793static unsigned char page_four[] __initdata = {
    7867940x63, 0x03, 0x26, 0x02, 0x2c, 0x00, 0x24, 0x00, 0x2e, 0x02, 0x02,
    7877950x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
     
    798806};
    799807
    800 unsigned char page_six[] = {
     808static unsigned char page_six[] __initdata = {
    8018090x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x04, 0x00, 0x00, 0x06, 0x00,
    8028100x00, 0x08, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x0e,
     
    819827};
    820828
    821 unsigned char page_seven[] = {
     829static unsigned char page_seven[] __initdata = {
    8228300x0f, 0xff, 0x00, 0x00, 0x08, 0x00, 0x08, 0x00, 0x02, 0x00, 0x00,
    8238310x00, 0x00, 0x00, 0x0f, 0xff, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00,
     
    846854};
    847855
    848 unsigned char page_zero_v2[] = {
     856static unsigned char page_zero_v2[] __initdata = {
    8498570x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    8508580x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
     
    858866};
    859867
    860 unsigned char page_one_v2[] = {
     868static unsigned char page_one_v2[] __initdata = {
    8618690x01, 0xc0, 0x01, 0xfa, 0x00, 0x1a, 0x00, 0x00, 0x00, 0x00, 0x00,
    8628700x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
     
    870878};
    871879
    872 unsigned char page_two_v2[] = {
     880static unsigned char page_two_v2[] __initdata = {
    8738810x46, 0x46, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    8748820x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
     
    8778850x00, 0x00, 0x00, 0x00
    878886};
    879 unsigned char page_three_v2[] = {
     887static unsigned char page_three_v2[] __initdata = {
    8808880x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    8818890x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
     
    8848920x00, 0x00, 0x00, 0x00
    885893};
    886 unsigned char page_four_v2[] = {
     894static unsigned char page_four_v2[] __initdata = {
    8878950x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    8888960x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
     
    892900};
    893901
    894 unsigned char page_seven_v2[] = {
     902static unsigned char page_seven_v2[] __initdata = {
    8959030x0f, 0xff, 0x0f, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    8969040x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
     
    9039110x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
    904912};
    905 unsigned char mod_v2[] = {
     913
     914static unsigned char mod_v2[] __initdata = {
    9069150x01, 0x00, 0x02, 0x00, 0x01, 0x01, 0x02, 0x00, 0x01, 0x02, 0x02,
    9079160x00, 0x01, 0x03, 0x02, 0x00, 0x01, 0x04, 0x02, 0x00, 0x01, 0x05,
     
    9339420x06, 0x02, 0x01, 0x01, 0x07, 0x02, 0x01
    934943};
    935 unsigned char coefficients[] = {
     944static unsigned char coefficients[] __initdata = {
    9369450x07, 0x46, 0x00, 0x00, 0x07, 0x49, 0x00, 0x00, 0x00, 0x4b, 0x03,
    9379460x11, 0x00, 0x4d, 0x01, 0x32, 0x07, 0x46, 0x00, 0x00, 0x07, 0x49,
     
    9699780xba
    970979};
    971 unsigned char coefficients2[] = {
     980static unsigned char coefficients2[] __initdata = {
    9729810x07, 0x46, 0x00, 0x00, 0x07, 0x49, 0x00, 0x00, 0x07, 0x45, 0x0f,
    9739820xff, 0x07, 0x48, 0x0f, 0xff, 0x07, 0x7b, 0x04, 0xcc, 0x07, 0x7d,
     
    9769850x07, 0x4a, 0x00, 0x00, 0x07, 0x4c, 0x00, 0x00, 0x07, 0x4e, 0x00, 0x00
    977986};
    978 unsigned char coefficients3[] = {
     987static unsigned char coefficients3[] __initdata = {
    9799880x00, 0x00, 0x00, 0x00, 0x00, 0x28, 0x00, 0x28, 0x00, 0x51, 0x00,
    9809890x51, 0x00, 0x7a, 0x00, 0x7a, 0x00, 0xa3, 0x00, 0xa3, 0x00, 0xcc,
     
    10161025};
    10171026
    1018 EXPORT_SYMBOL(snd_wavefront_fx_start);
    1019 EXPORT_SYMBOL(snd_wavefront_fx_detect);
    1020 EXPORT_SYMBOL(snd_wavefront_fx_ioctl);
    1021 EXPORT_SYMBOL(snd_wavefront_fx_open);
    1022 EXPORT_SYMBOL(snd_wavefront_fx_release);
    1023 
    1024 static int __init alsa_wavefront_fx_init(void)
    1025 {
    1026         return 0;
    1027 }
    1028 
    1029 static void __exit alsa_wavefront_fx_exit(void)
    1030 {
    1031 }
    1032 
    1033 module_init(alsa_wavefront_fx_init)
    1034 module_exit(alsa_wavefront_fx_exit)
  • GPL/branches/alsa-resync1/alsa-kernel/isa/wavefront/wavefront_midi.c

    r32 r112  
    473473}
    474474
    475 int
     475int __init
    476476snd_wavefront_midi_start (snd_wavefront_card_t *card)
    477477
  • GPL/branches/alsa-resync1/alsa-kernel/isa/wavefront/wavefront_synth.c

    r32 r112  
    2121 */
    2222
    23 #define SNDRV_MAIN_OBJECT_FILE
     23#define __NO_VERSION__
    2424#include <sound/driver.h>
     25#include <asm/io.h>
     26#include <linux/interrupt.h>
     27#include <linux/init.h>
     28#include <linux/delay.h>
     29#include <linux/time.h>
     30#include <linux/wait.h>
     31#include <sound/core.h>
    2532#include <sound/snd_wavefront.h>
    2633#include <sound/initval.h>
     
    7885                              start running.
    7986                           */
    80 MODULE_AUTHOR("Paul Barton-Davis <pbd@op.net>");
    81 MODULE_DESCRIPTION("ALSA driver for Turtle Beach WaveFront ICS2215 Synth");
    82 MODULE_CLASSES("{sound}");
    8387MODULE_PARM(wf_raw,"i");
    8488MODULE_PARM_DESC(wf_raw, "if non-zero, assume that we need to boot the OS");
     
    101105MODULE_PARM(osrun_time,"i");
    102106MODULE_PARM_DESC(osrun_time, "how many seconds to wait for the ICS2115 OS");
    103 
    104 /*
    105  *      This sucks, hopefully it'll get standardised
    106  */
    107 
    108 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,2,18) && LINUX_VERSION_CODE < KERNEL_VERSION(2,3,0)
    109 #define loops_per_sec loops_per_jiffy*HZ
    110 #elif LINUX_VERSION_CODE == KERNEL_VERSION(2,4,0) && defined(I_DIRTY_PAGES) /* linux/fs.h */
    111 #define loops_per_sec loops_per_jiffy*HZ
    112 #elif LINUX_VERSION_CODE > KERNEL_VERSION(2,4,0)
    113 #define loops_per_sec loops_per_jiffy*HZ
    114 #endif
    115  
    116 #if defined(__alpha__) || defined(__powerpc__)
    117 #ifdef __SMP__
    118 #define LOOPS_PER_SEC   (cpu_data[smp_processor_id()].loops_per_sec)
    119 #else
    120 #define LOOPS_PER_SEC   (loops_per_sec)
    121 #endif
    122 #endif
    123 
    124 #if defined(__i386__)
    125 #define LOOPS_PER_SEC   (current_cpu_data.loops_per_sec)
    126 #endif
    127107 
    128108/* if WF_DEBUG not defined, no run-time debugging messages will
     
    255235};
    256236
     237static inline void
     238dec_mod_count(struct module *module)
     239{
     240        if (module)
     241                __MOD_DEC_USE_COUNT(module);
     242}
     243
    257244static const char *
    258245wavefront_errorstr (int errnum)
     
    307294{
    308295        int             i;
    309         static int      short_loop_cnt = 0;
    310 
    311         /* Compute the loop count that lets us sleep for about the
    312            right amount of time, cache issues, bus speeds and all
    313            other issues being unequal but largely irrelevant.
    314         */
    315 
    316         if (short_loop_cnt == 0) {
    317                 short_loop_cnt = wait_usecs *
    318                         (LOOPS_PER_SEC / 1000000);
    319         }
    320296
    321297        /* Spin for a short period of time, because >99% of all
     
    323299        */
    324300
    325         for (i = 0; i < short_loop_cnt; i++) {
     301        for (i = 0; i < wait_usecs; i += 5) {
    326302                if (wavefront_status (dev) & mask) {
    327303                        return 1;
    328304                }
     305                udelay(5);
    329306        }
    330307
     
    894871wavefront_send_sample (snd_wavefront_t *dev,
    895872                       wavefront_patch_info *header,
    896                        UINT16 *dataptr,
     873                       u16 *dataptr,
    897874                       int data_is_unsigned)
    898875
     
    907884        */
    908885
    909         UINT16 sample_short;
    910         UINT32 length;
    911         UINT16 *data_end = 0;
     886        u16 sample_short;
     887        u32 length;
     888        u16 *data_end = 0;
    912889        unsigned int i;
    913890        const int max_blksize = 4096/2;
     
    10591036        */
    10601037
    1061         shptr = munge_int32 (*((UINT32 *) &header->hdr.s.sampleStartOffset),
     1038        shptr = munge_int32 (*((u32 *) &header->hdr.s.sampleStartOffset),
    10621039                             shptr, 4);
    1063         shptr = munge_int32 (*((UINT32 *) &header->hdr.s.loopStartOffset),
     1040        shptr = munge_int32 (*((u32 *) &header->hdr.s.loopStartOffset),
    10641041                             shptr, 4);
    1065         shptr = munge_int32 (*((UINT32 *) &header->hdr.s.loopEndOffset),
     1042        shptr = munge_int32 (*((u32 *) &header->hdr.s.loopEndOffset),
    10661043                             shptr, 4);
    1067         shptr = munge_int32 (*((UINT32 *) &header->hdr.s.sampleEndOffset),
     1044        shptr = munge_int32 (*((u32 *) &header->hdr.s.sampleEndOffset),
    10681045                             shptr, 4);
    10691046       
     
    13021279        for (i = 0; i < num_samples; i++) {
    13031280                char d[2];
    1304        
    1305                 if ((d[0] = wavefront_read (dev)) == -1) {
     1281                int val;
     1282       
     1283                if ((val = wavefront_read (dev)) == -1) {
    13061284                        snd_printk ("upload multisample failed "
    13071285                                    "during sample loop.\n");
    13081286                        return -(EIO);
    13091287                }
    1310 
    1311                 if ((d[1] = wavefront_read (dev)) == -1) {
     1288                d[0] = val;
     1289
     1290                if ((val = wavefront_read (dev)) == -1) {
    13121291                        snd_printk ("upload multisample failed "
    13131292                                    "during sample loop.\n");
    13141293                        return -(EIO);
    13151294                }
     1295                d[1] = val;
    13161296       
    13171297                header->hdr.ms.SampleNumber[i] =
     
    14721452
    14731453static void
    1474 process_sample_hdr (UCHAR8 *buf)
     1454process_sample_hdr (u8 *buf)
    14751455
    14761456{
    14771457        wavefront_sample s;
    1478         UCHAR8 *ptr;
     1458        u8 *ptr;
    14791459
    14801460        ptr = buf;
     
    14871467        */
    14881468
    1489         *((UINT32 *) &s.sampleStartOffset) = demunge_int32 (ptr, 4); ptr += 4;
    1490         *((UINT32 *) &s.loopStartOffset) = demunge_int32 (ptr, 4); ptr += 4;
    1491         *((UINT32 *) &s.loopEndOffset) = demunge_int32 (ptr, 4); ptr += 4;
    1492         *((UINT32 *) &s.sampleEndOffset) = demunge_int32 (ptr, 4); ptr += 4;
    1493         *((UINT32 *) &s.FrequencyBias) = demunge_int32 (ptr, 3); ptr += 3;
     1469        *((u32 *) &s.sampleStartOffset) = demunge_int32 (ptr, 4); ptr += 4;
     1470        *((u32 *) &s.loopStartOffset) = demunge_int32 (ptr, 4); ptr += 4;
     1471        *((u32 *) &s.loopEndOffset) = demunge_int32 (ptr, 4); ptr += 4;
     1472        *((u32 *) &s.sampleEndOffset) = demunge_int32 (ptr, 4); ptr += 4;
     1473        *((u32 *) &s.FrequencyBias) = demunge_int32 (ptr, 3); ptr += 3;
    14941474
    14951475        s.SampleResolution = *ptr & 0x3;
     
    15581538
    15591539        case WFC_UPLOAD_PATCH:
    1560                 munge_int32 (*((UINT32 *) wc->wbuf), patchnumbuf, 2);
     1540                munge_int32 (*((u32 *) wc->wbuf), patchnumbuf, 2);
    15611541                memcpy (wc->wbuf, patchnumbuf, 2);
    15621542                break;
     
    17481728*/
    17491729
    1750 int
     1730int __init
    17511731snd_wavefront_interrupt_bits (int irq)
    17521732
     
    17761756}
    17771757
    1778 static void
     1758static void __init
    17791759wavefront_should_cause_interrupt (snd_wavefront_t *dev,
    17801760                                  int val, int port, int timeout)
     
    17911771}
    17921772
    1793 int
    1794 snd_wavefront_detect_irq (snd_wavefront_t *dev)
    1795 
    1796 {
    1797         int i;
    1798         int possible_irqs[] = { 5, 9, 12, 15, -1 };
    1799 
    1800         /* Note: according to the PnP dump, 7 and 11 are possible too, but the
    1801            WaveFront SDK doesn't tell us how to set the card to use them. 
    1802         */
    1803 
    1804         snd_printk ("autodetecting WaveFront IRQ\n");
    1805 
    1806         for (i = 0; possible_irqs[i] > 0; i++) {
    1807                 if (snd_wavefront_check_irq (dev, possible_irqs[i]) == 0) {
    1808                         snd_printk ("autodetected IRQ %d\n",
    1809                                     possible_irqs[i]);
    1810                         return possible_irqs[i];
    1811                 }
    1812         }
    1813 
    1814         return -1;
    1815 }
    1816 
    1817 int
    1818 snd_wavefront_check_irq (snd_wavefront_t *dev, int irq)
    1819 
    1820 {
    1821         int bits;
    1822         unsigned long irq_mask;
    1823         short reported_irq;
    1824 
    1825         bits = snd_wavefront_interrupt_bits (irq);
    1826 
    1827         irq_mask = probe_irq_on ();
    1828 
    1829         outb (0x0, dev->control_port);
    1830         outb (0x80 | 0x40 | bits, dev->data_port);     
    1831         wavefront_should_cause_interrupt(dev, 0x80|0x40|0x10|0x1,
    1832                                          dev->control_port,
    1833                                          (reset_time*HZ)/100);
    1834 
    1835         reported_irq = probe_irq_off (irq_mask);
    1836 
    1837         if (reported_irq == 0) {
    1838                 snd_printk ("No unassigned interrupts detected "
    1839                             "after h/w reset\n");
    1840                 return -1;
    1841         } else if (reported_irq < 0) {
    1842                 snd_printk ("Multiple unassigned interrupts detected "
    1843                             "after h/w reset\n");
    1844                 return -1;
    1845         } else if (reported_irq != irq) {
    1846                 return -1;
    1847         }
    1848 
    1849         return 0; /* OK */
    1850 }
    1851 
    1852 static int
     1773static int __init
    18531774wavefront_reset_to_cleanliness (snd_wavefront_t *dev)
    18541775
     
    20041925#include <linux/fs.h>
    20051926#include <linux/mm.h>
    2006 #include <linux/malloc.h>
     1927#include <linux/slab.h>
    20071928#include <linux/unistd.h>
    20081929#include <asm/uaccess.h>
     
    20101931static int errno;
    20111932
    2012 static int
     1933static int __init
    20131934wavefront_download_firmware (snd_wavefront_t *dev, char *path)
    20141935
     
    21052026
    21062027
    2107 static int
     2028static int __init
    21082029wavefront_do_reset (snd_wavefront_t *dev)
    21092030
     
    21942115}
    21952116
    2196 int
     2117int __init
    21972118snd_wavefront_start (snd_wavefront_t *dev)
    21982119
     
    22362157}
    22372158
    2238 int
     2159int __init
    22392160snd_wavefront_detect (snd_wavefront_card_t *card)
    22402161
     
    22902211        return 0;
    22912212}
    2292 
    2293 EXPORT_SYMBOL(snd_wavefront_synth_ioctl);
    2294 EXPORT_SYMBOL(snd_wavefront_synth_open);
    2295 EXPORT_SYMBOL(snd_wavefront_synth_release);
    2296 EXPORT_SYMBOL(snd_wavefront_internal_interrupt);
    2297 EXPORT_SYMBOL(snd_wavefront_interrupt_bits);
    2298 EXPORT_SYMBOL(snd_wavefront_detect_irq);
    2299 EXPORT_SYMBOL(snd_wavefront_check_irq);
    2300 EXPORT_SYMBOL(snd_wavefront_start);
    2301 EXPORT_SYMBOL(snd_wavefront_detect);
    2302 EXPORT_SYMBOL(snd_wavefront_cmd);
    2303   /* wavefront_midi.c */
    2304 EXPORT_SYMBOL(snd_wavefront_midi_interrupt);
    2305 EXPORT_SYMBOL(snd_wavefront_midi_enable_virtual);
    2306 EXPORT_SYMBOL(snd_wavefront_midi_disable_virtual);
    2307 EXPORT_SYMBOL(snd_wavefront_midi_start);
    2308 EXPORT_SYMBOL(snd_wavefront_midi_input);
    2309 EXPORT_SYMBOL(snd_wavefront_midi_output);
    2310 
    2311 static int __init alsa_wavefront_init(void)
    2312 {
    2313         return 0;
    2314 }
    2315 
    2316 static void __exit alsa_wavefront_exit(void)
    2317 {
    2318 }
    2319 
    2320 module_init(alsa_wavefront_init)
    2321 module_exit(alsa_wavefront_exit)
Note: See TracChangeset for help on using the changeset viewer.