Ignore:
Timestamp:
May 9, 2009, 11:45:26 AM (16 years ago)
Author:
Paul Smedley
Message:

Update alsa-kernel to ALSA 1.0.20 level

Location:
GPL/trunk/alsa-kernel/isa
Files:
19 edited

Legend:

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

    r410 r426  
    157157        struct snd_ad1816a *chip;
    158158        struct snd_opl3 *opl3;
     159        struct snd_timer *timer;
    159160
    160161        error = snd_card_create(index[dev], id[dev], THIS_MODULE,
     
    192193
    193194        if ((error = snd_ad1816a_mixer(chip)) < 0) {
     195                snd_card_free(card);
     196                return error;
     197        }
     198
     199        error = snd_ad1816a_timer(chip, 0, &timer);
     200        if (error < 0) {
    194201                snd_card_free(card);
    195202                return error;
     
    209216                        printk(KERN_ERR PFX "no OPL device at 0x%lx-0x%lx.\n", fm_port[dev], fm_port[dev] + 2);
    210217                } else {
    211                         if ((error = snd_opl3_timer_new(opl3, 1, 2)) < 0) {
    212                                 snd_card_free(card);
    213                                 return error;
    214                         }
    215                         if ((error = snd_opl3_hwdep_new(opl3, 0, 1, NULL)) < 0) {
     218                        error = snd_opl3_hwdep_new(opl3, 0, 1, NULL);
     219                        if (error < 0) {
    216220                                snd_card_free(card);
    217221                                return error;
  • GPL/trunk/alsa-kernel/isa/ad1816a/ad1816a_lib.c

    r399 r426  
    3838                        return 0;
    3939
    40         snd_printk("chip busy.\n");
     40        snd_printk(KERN_WARNING "chip busy.\n");
    4141        return -EBUSY;
    4242}
     
    197197                break;
    198198        default:
    199                 snd_printk("invalid trigger mode 0x%x.\n", what);
     199                snd_printk(KERN_WARNING "invalid trigger mode 0x%x.\n", what);
    200200                error = -EINVAL;
    201201        }
     
    378378};
    379379
    380 #if 0 /* not used now */
    381380static int snd_ad1816a_timer_close(struct snd_timer *timer)
    382381{
     
    443442        .stop =         snd_ad1816a_timer_stop,
    444443};
    445 #endif /* not used now */
    446 
    447444
    448445static int snd_ad1816a_playback_open(struct snd_pcm_substream *substream)
     
    569566        case AD1816A_HW_AD18MAX10: return "AD18max10";
    570567        default:
    571                 snd_printk("Unknown chip version %d:%d.\n",
     568                snd_printk(KERN_WARNING "Unknown chip version %d:%d.\n",
    572569                        chip->version, chip->hardware);
    573570                return "AD1816A - unknown";
     
    688685}
    689686
    690 #if 0 /* not used now */
    691687int __devinit snd_ad1816a_timer(struct snd_ad1816a *chip, int device, struct snd_timer **rtimer)
    692688{
     
    710706        return 0;
    711707}
    712 #endif /* not used now */
    713708
    714709/*
  • GPL/trunk/alsa-kernel/isa/cmi8330.c

    r410 r426  
    3232 *
    3333 *  modprobe -a snd-cmi8330 sbport=0x220 sbirq=5 sbdma8=1
    34  *    sbdma16=5 wssport=0x530 wssirq=11 wssdma=0
     34 *    sbdma16=5 wssport=0x530 wssirq=11 wssdma=0 fmport=0x388
    3535 *
    3636 *  This card has two mixers and two PCM devices.  I've cheesed it such
    3737 *  that recording and playback can be done through the same device.
    38  *  The driver "magically" routes the capturing to the AD1848 codec,
     38 *  The driver "magically" routes the capturing to the CMI8330 codec,
    3939 *  and playback to the SB16 codec.  This allows for full-duplex mode
    4040 *  to some extent.
     
    5252#include <sound/core.h>
    5353#include <sound/wss.h>
     54#include <sound/opl3.h>
     55#include <sound/mpu401.h>
    5456#include <sound/sb.h>
    5557#include <sound/initval.h>
     
    8082static int wssirq[SNDRV_CARDS] = SNDRV_DEFAULT_IRQ;
    8183static int wssdma[SNDRV_CARDS] = SNDRV_DEFAULT_DMA;
     84static long fmport[SNDRV_CARDS] = SNDRV_DEFAULT_PORT;
     85static long mpuport[SNDRV_CARDS] = SNDRV_DEFAULT_PORT;
     86static int mpuirq[SNDRV_CARDS] = SNDRV_DEFAULT_IRQ;
    8287
    8388module_param_array(index, int, NULL, 0444);
     
    108113MODULE_PARM_DESC(wssdma, "DMA for CMI8330 WSS driver.");
    109114
     115module_param_array(fmport, long, NULL, 0444);
     116MODULE_PARM_DESC(fmport, "FM port # for CMI8330 driver.");
     117module_param_array(mpuport, long, NULL, 0444);
     118MODULE_PARM_DESC(mpuport, "MPU-401 port # for CMI8330 driver.");
     119module_param_array(mpuirq, int, NULL, 0444);
     120MODULE_PARM_DESC(mpuirq, "IRQ # for CMI8330 MPU-401 port.");
    110121#ifdef CONFIG_PNP
    111122static int isa_registered;
     
    150161        struct pnp_dev *cap;
    151162        struct pnp_dev *play;
     163        struct pnp_dev *mpu;
    152164#endif
    153165        struct snd_card *card;
     
    166178
    167179static struct pnp_card_device_id snd_cmi8330_pnpids[] = {
    168         { .id = "CMI0001", .devs = { { "@@@0001" }, { "@X@0001" } } },
     180        { .id = "CMI0001", .devs = { { "@@@0001" }, { "@X@0001" }, { "@H@0001" } } },
    169181        { .id = "" }
    170182};
     
    220232WSS_SINGLE("PC Speaker Playback Volume", 0,
    221233                CMI8330_OUTPUTVOL, 3, 3, 0),
    222 WSS_SINGLE("FM Playback Switch", 0,
    223                 CMI8330_RECMUX, 3, 1, 1),
     234WSS_DOUBLE("FM Playback Switch", 0,
     235                CS4231_AUX2_LEFT_INPUT, CS4231_AUX2_RIGHT_INPUT, 7, 7, 1, 1),
     236WSS_DOUBLE("FM Playback Volume", 0,
     237                CS4231_AUX2_LEFT_INPUT, CS4231_AUX2_RIGHT_INPUT, 0, 0, 31, 1),
    224238WSS_SINGLE(SNDRV_CTL_NAME_IEC958("Input ", CAPTURE, SWITCH), 0,
    225239                CMI8330_RMUX3D, 7, 1, 1),
     
    324338                return -EBUSY;
    325339
     340        acard->mpu = pnp_request_card_device(card, id->devs[2].id, NULL);
     341        if (acard->play == NULL)
     342                return -EBUSY;
     343
    326344        pdev = acard->cap;
    327345
    328346        err = pnp_activate_dev(pdev);
    329347        if (err < 0) {
    330                 snd_printk(KERN_ERR "CMI8330/C3D (AD1848) PnP configure failure\n");
     348                snd_printk(KERN_ERR "CMI8330/C3D PnP configure failure\n");
    331349                return -EBUSY;
    332350        }
     
    334352        wssdma[dev] = pnp_dma(pdev, 0);
    335353        wssirq[dev] = pnp_irq(pdev, 0);
     354        fmport[dev] = pnp_port_start(pdev, 1);
    336355
    337356        /* allocate SB16 resources */
     
    348367        sbirq[dev] = pnp_irq(pdev, 0);
    349368
     369        /* allocate MPU-401 resources */
     370        pdev = acard->mpu;
     371
     372        err = pnp_activate_dev(pdev);
     373        if (err < 0) {
     374                snd_printk(KERN_ERR
     375                           "CMI8330/C3D (MPU-401) PnP configure failure\n");
     376                return -EBUSY;
     377        }
     378        mpuport[dev] = pnp_port_start(pdev, 0);
     379        mpuirq[dev] = pnp_irq(pdev, 0);
    350380        return 0;
    351381}
     
    490520        struct snd_cmi8330 *acard;
    491521        int i, err;
     522        struct snd_opl3 *opl3;
    492523
    493524        acard = card->private_data;
     
    497528                             WSS_HW_DETECT, 0, &acard->wss);
    498529        if (err < 0) {
    499                 snd_printk(KERN_ERR PFX "(AD1848) device busy??\n");
     530                snd_printk(KERN_ERR PFX "(CMI8330) device busy??\n");
    500531                return err;
    501532        }
    502533        if (acard->wss->hardware != WSS_HW_CMI8330) {
    503                 snd_printk(KERN_ERR PFX "(AD1848) not found during probe\n");
     534                snd_printk(KERN_ERR PFX "(CMI8330) not found during probe\n");
    504535                return -ENODEV;
    505536        }
     
    532563                snd_printk(KERN_ERR PFX "failed to create pcms\n");
    533564                return err;
     565        }
     566        if (fmport[dev] != SNDRV_AUTO_PORT) {
     567                if (snd_opl3_create(card,
     568                                    fmport[dev], fmport[dev] + 2,
     569                                    OPL3_HW_AUTO, 0, &opl3) < 0) {
     570                        snd_printk(KERN_ERR PFX
     571                                   "no OPL device at 0x%lx-0x%lx ?\n",
     572                                   fmport[dev], fmport[dev] + 2);
     573                } else {
     574                        err = snd_opl3_hwdep_new(opl3, 0, 1, NULL);
     575                        if (err < 0)
     576                                return err;
     577                }
     578        }
     579
     580        if (mpuport[dev] != SNDRV_AUTO_PORT) {
     581                if (snd_mpu401_uart_new(card, 0, MPU401_HW_MPU401,
     582                                        mpuport[dev], 0, mpuirq[dev],
     583                                        IRQF_DISABLED, NULL) < 0)
     584                        printk(KERN_ERR PFX "no MPU-401 device at 0x%lx.\n",
     585                                mpuport[dev]);
    534586        }
    535587
  • GPL/trunk/alsa-kernel/isa/cs423x/cs4236.c

    r410 r426  
    3434MODULE_AUTHOR("Jaroslav Kysela <perex@perex.cz>");
    3535MODULE_LICENSE("GPL");
    36 #ifdef CS4232
    37 MODULE_DESCRIPTION("Cirrus Logic CS4232");
     36MODULE_DESCRIPTION("Cirrus Logic CS4232-9");
    3837MODULE_SUPPORTED_DEVICE("{{Turtle Beach,TBS-2000},"
    3938                "{Turtle Beach,Tropez Plus},"
     
    4140                "{Hewlett Packard,Omnibook 5500},"
    4241                "{TerraTec,Maestro 32/96},"
    43                 "{Philips,PCA70PS}}");
    44 #else
    45 MODULE_DESCRIPTION("Cirrus Logic CS4235-9");
    46 MODULE_SUPPORTED_DEVICE("{{Crystal Semiconductors,CS4235},"
     42                "{Philips,PCA70PS}},"
     43                "{{Crystal Semiconductors,CS4235},"
    4744                "{Crystal Semiconductors,CS4236},"
    4845                "{Crystal Semiconductors,CS4237},"
     
    7168                "{Turtle Beach,Malibu},"
    7269                "{Unknown,Digital PC 5000 Onboard}}");
    73 #endif
    74 
    75 #ifdef CS4232
    76 #define IDENT "CS4232"
    77 #define DEV_NAME "cs4232"
    78 #else
    79 #define IDENT "CS4236+"
    80 #define DEV_NAME "cs4236"
    81 #endif
     70
     71MODULE_ALIAS("snd_cs4232");
     72
     73#define IDENT "CS4232+"
     74#define DEV_NAME "cs4232+"
    8275
    8376static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX;      /* Index 0-MAX */
     
    129122static int isa_registered;
    130123static int pnpc_registered;
    131 #ifdef CS4232
    132124static int pnp_registered;
    133 #endif
    134125#endif /* CONFIG_PNP */
    135126
     
    146137#ifdef CONFIG_PNP
    147138
    148 #ifdef CS4232
    149139/*
    150140 * PNP BIOS
    151141 */
    152 static const struct pnp_device_id snd_cs4232_pnpbiosids[] = {
     142static const struct pnp_device_id snd_cs423x_pnpbiosids[] = {
    153143        { .id = "CSC0100" },
    154144        { .id = "CSC0000" },
     
    158148        { .id = "" }
    159149};
    160 MODULE_DEVICE_TABLE(pnp, snd_cs4232_pnpbiosids);
    161 #endif /* CS4232 */
    162 
    163 #ifdef CS4232
     150MODULE_DEVICE_TABLE(pnp, snd_cs423x_pnpbiosids);
     151
    164152#define CS423X_ISAPNP_DRIVER    "cs4232_isapnp"
    165153static struct pnp_card_device_id snd_cs423x_pnpids[] = {
     
    180168        /* Netfinity 3000 on-board soundcard */
    181169        { .id = "CSCe825", .devs = { { "CSC0100" }, { "CSC0110" }, { "CSC010f" } } },
    182         /* --- */
    183         { .id = "" }    /* end */
    184 };
    185 #else /* CS4236 */
    186 #define CS423X_ISAPNP_DRIVER    "cs4236_isapnp"
    187 static struct pnp_card_device_id snd_cs423x_pnpids[] = {
    188170        /* Intel Marlin Spike Motherboard - CS4235 */
    189171        { .id = "CSC0225", .devs = { { "CSC0000" }, { "CSC0010" }, { "CSC0003" } } },
     
    267249        { .id = "" }    /* end */
    268250};
    269 #endif
    270251
    271252MODULE_DEVICE_TABLE(pnp_card, snd_cs423x_pnpids);
     
    324305}
    325306
    326 #ifdef CS4232
    327 static int __devinit snd_card_cs4232_pnp(int dev, struct snd_card_cs4236 *acard,
    328                                          struct pnp_dev *pdev)
     307static int __devinit snd_card_cs423x_pnp(int dev, struct snd_card_cs4236 *acard,
     308                                         struct pnp_dev *pdev,
     309                                         struct pnp_dev *cdev)
    329310{
    330311        acard->wss = pdev;
    331312        if (snd_cs423x_pnp_init_wss(dev, acard->wss) < 0)
    332313                return -EBUSY;
    333         cport[dev] = -1;
    334         return 0;
    335 }
    336 #endif
     314        if (cdev)
     315                cport[dev] = pnp_port_start(cdev, 0);
     316        else
     317                cport[dev] = -1;
     318        return 0;
     319}
    337320
    338321static int __devinit snd_card_cs423x_pnpc(int dev, struct snd_card_cs4236 *acard,
     
    412395                }
    413396
    414 #ifdef CS4232
    415397        err = snd_wss_create(card, port[dev], cport[dev],
    416398                             irq[dev],
    417399                             dma1[dev], dma2[dev],
    418                              WSS_HW_DETECT, 0, &chip);
     400                             WSS_HW_DETECT3, 0, &chip);
    419401        if (err < 0)
    420402                return err;
    421         acard->chip = chip;
    422 
    423         err = snd_wss_pcm(chip, 0, &pcm);
    424         if (err < 0)
    425                 return err;
    426 
    427         err = snd_wss_mixer(chip);
    428         if (err < 0)
    429                 return err;
    430 
    431 #else /* CS4236 */
    432         err = snd_cs4236_create(card,
    433                                 port[dev], cport[dev],
    434                                 irq[dev], dma1[dev], dma2[dev],
    435                                 WSS_HW_DETECT, 0, &chip);
    436         if (err < 0)
    437                 return err;
    438         acard->chip = chip;
    439 
    440         err = snd_cs4236_pcm(chip, 0, &pcm);
    441         if (err < 0)
    442                 return err;
    443 
    444         err = snd_cs4236_mixer(chip);
    445         if (err < 0)
    446                 return err;
    447 #endif
     403        if (chip->hardware & WSS_HW_CS4236B_MASK) {
     404                snd_wss_free(chip);
     405                err = snd_cs4236_create(card,
     406                                        port[dev], cport[dev],
     407                                        irq[dev], dma1[dev], dma2[dev],
     408                                        WSS_HW_DETECT, 0, &chip);
     409                if (err < 0)
     410                        return err;
     411                acard->chip = chip;
     412
     413                err = snd_cs4236_pcm(chip, 0, &pcm);
     414                if (err < 0)
     415                        return err;
     416
     417                err = snd_cs4236_mixer(chip);
     418                if (err < 0)
     419                        return err;
     420        } else {
     421                acard->chip = chip;
     422                err = snd_wss_pcm(chip, 0, &pcm);
     423                if (err < 0)
     424                        return err;
     425
     426                err = snd_wss_mixer(chip);
     427                if (err < 0)
     428                        return err;
     429        }
    448430        strcpy(card->driver, pcm->name);
    449431        strcpy(card->shortname, pcm->name);
     
    580562
    581563#ifdef CONFIG_PNP
    582 #ifdef CS4232
    583 static int __devinit snd_cs4232_pnpbios_detect(struct pnp_dev *pdev,
     564static int __devinit snd_cs423x_pnpbios_detect(struct pnp_dev *pdev,
    584565                                               const struct pnp_device_id *id)
    585566{
     
    587568        int err;
    588569        struct snd_card *card;
     570        struct pnp_dev *cdev;
     571        char cid[PNP_ID_LEN];
    589572
    590573        if (pnp_device_is_isapnp(pdev))
     
    597580                return -ENODEV;
    598581
     582        /* prepare second id */
     583        strcpy(cid, pdev->id[0].id);
     584        cid[5] = '1';
     585        cdev = NULL;
     586        list_for_each_entry(cdev, &(pdev->protocol->devices), protocol_list) {
     587                if (!strcmp(cdev->id[0].id, cid))
     588                        break;
     589        }
    599590        err = snd_cs423x_card_new(dev, &card);
    600591        if (err < 0)
    601592                return err;
    602         if ((err = snd_card_cs4232_pnp(dev, card->private_data, pdev)) < 0) {
     593        err = snd_card_cs423x_pnp(dev, card->private_data, pdev, cdev);
     594        if (err < 0) {
    603595                printk(KERN_ERR "PnP BIOS detection failed for " IDENT "\n");
    604596                snd_card_free(card);
     
    615607}
    616608
    617 static void __devexit snd_cs4232_pnp_remove(struct pnp_dev * pdev)
     609static void __devexit snd_cs423x_pnp_remove(struct pnp_dev *pdev)
    618610{
    619611        snd_card_free(pnp_get_drvdata(pdev));
     
    622614
    623615#ifdef CONFIG_PM
    624 static int snd_cs4232_pnp_suspend(struct pnp_dev *pdev, pm_message_t state)
     616static int snd_cs423x_pnp_suspend(struct pnp_dev *pdev, pm_message_t state)
    625617{
    626618        return snd_cs423x_suspend(pnp_get_drvdata(pdev));
    627619}
    628620
    629 static int snd_cs4232_pnp_resume(struct pnp_dev *pdev)
     621static int snd_cs423x_pnp_resume(struct pnp_dev *pdev)
    630622{
    631623        return snd_cs423x_resume(pnp_get_drvdata(pdev));
     
    633625#endif
    634626
    635 static struct pnp_driver cs4232_pnp_driver = {
    636         .name = "cs4232-pnpbios",
    637         .id_table = snd_cs4232_pnpbiosids,
    638         .probe = snd_cs4232_pnpbios_detect,
    639         .remove = __devexit_p(snd_cs4232_pnp_remove),
     627static struct pnp_driver cs423x_pnp_driver = {
     628        .name = "cs423x-pnpbios",
     629        .id_table = snd_cs423x_pnpbiosids,
     630        .probe = snd_cs423x_pnpbios_detect,
     631        .remove = __devexit_p(snd_cs423x_pnp_remove),
    640632#ifdef CONFIG_PM
    641         .suspend        = snd_cs4232_pnp_suspend,
    642         .resume         = snd_cs4232_pnp_resume,
     633        .suspend        = snd_cs423x_pnp_suspend,
     634        .resume         = snd_cs423x_pnp_resume,
    643635#endif
    644636};
    645 #endif /* CS4232 */
    646637
    647638static int __devinit snd_cs423x_pnpc_detect(struct pnp_card_link *pcard,
     
    717708        if (!err)
    718709                isa_registered = 1;
    719 #ifdef CS4232
    720         err = pnp_register_driver(&cs4232_pnp_driver);
     710        err = pnp_register_driver(&cs423x_pnp_driver);
    721711        if (!err)
    722712                pnp_registered = 1;
    723 #endif
    724713        err = pnp_register_card_driver(&cs423x_pnpc_driver);
    725714        if (!err)
    726715                pnpc_registered = 1;
    727 #ifdef CS4232
    728716        if (pnp_registered)
    729717                err = 0;
    730 #endif
    731718        if (isa_registered)
    732719                err = 0;
     
    740727        if (pnpc_registered)
    741728                pnp_unregister_card_driver(&cs423x_pnpc_driver);
    742 #ifdef CS4232
    743729        if (pnp_registered)
    744                 pnp_unregister_driver(&cs4232_pnp_driver);
    745 #endif
     730                pnp_unregister_driver(&cs423x_pnp_driver);
    746731        if (isa_registered)
    747732#endif
  • GPL/trunk/alsa-kernel/isa/cs423x/cs4236_lib.c

    r399 r426  
    8888#include <sound/wss.h>
    8989#include <sound/asoundef.h>
    90 
    91 MODULE_AUTHOR("Jaroslav Kysela <perex@perex.cz>");
    92 MODULE_DESCRIPTION("Routines for control of CS4235/4236B/4237B/4238B/4239 chips");
    93 MODULE_LICENSE("GPL");
    9490
    9591/*
     
    287283                hardware = WSS_HW_DETECT3;
    288284        if (cport < 0x100) {
    289                 snd_printk("please, specify control port for CS4236+ chips\n");
     285                snd_printk(KERN_ERR "please, specify control port "
     286                           "for CS4236+ chips\n");
    290287                return -ENODEV;
    291288        }
     
    296293
    297294        if (!(chip->hardware & WSS_HW_CS4236B_MASK)) {
    298                 snd_printk("CS4236+: MODE3 and extended registers not available, hardware=0x%x\n",chip->hardware);
     295                snd_printk(KERN_ERR "CS4236+: MODE3 and extended registers "
     296                           "not available, hardware=0x%x\n", chip->hardware);
    299297                snd_device_free(card, chip);
    300298                return -ENODEV;
     
    304302                int idx;
    305303                for (idx = 0; idx < 8; idx++)
    306                         snd_printk("CD%i = 0x%x\n", idx, inb(chip->cport + idx));
     304                        snd_printk(KERN_DEBUG "CD%i = 0x%x\n",
     305                                   idx, inb(chip->cport + idx));
    307306                for (idx = 0; idx < 9; idx++)
    308                         snd_printk("C%i = 0x%x\n", idx, snd_cs4236_ctrl_in(chip, idx));
     307                        snd_printk(KERN_DEBUG "C%i = 0x%x\n",
     308                                   idx, snd_cs4236_ctrl_in(chip, idx));
    309309        }
    310310#endif
     
    313313        snd_printdd("CS4236: [0x%lx] C1 (version) = 0x%x, ext = 0x%x\n", cport, ver1, ver2);
    314314        if (ver1 != ver2) {
    315                 snd_printk("CS4236+ chip detected, but control port 0x%lx is not valid\n", cport);
     315                snd_printk(KERN_ERR "CS4236+ chip detected, but "
     316                           "control port 0x%lx is not valid\n", cport);
    316317                snd_device_free(card, chip);
    317318                return -ENODEV;
     
    884885        ucontrol->value.integer.value[0] = chip->image[CS4231_ALT_FEATURE_1] & 0x02 ? 1 : 0;
    885886#if 0
    886         printk("get valid: ALT = 0x%x, C3 = 0x%x, C4 = 0x%x, C5 = 0x%x, C6 = 0x%x, C8 = 0x%x\n",
     887        printk(KERN_DEBUG "get valid: ALT = 0x%x, C3 = 0x%x, C4 = 0x%x, "
     888               "C5 = 0x%x, C6 = 0x%x, C8 = 0x%x\n",
    887889                        snd_wss_in(chip, CS4231_ALT_FEATURE_1),
    888890                        snd_cs4236_ctrl_in(chip, 3),
     
    921923
    922924#if 0
    923         printk("set valid: ALT = 0x%x, C3 = 0x%x, C4 = 0x%x, C5 = 0x%x, C6 = 0x%x, C8 = 0x%x\n",
     925        printk(KERN_DEBUG "set valid: ALT = 0x%x, C3 = 0x%x, C4 = 0x%x, "
     926               "C5 = 0x%x, C6 = 0x%x, C8 = 0x%x\n",
    924927                        snd_wss_in(chip, CS4231_ALT_FEATURE_1),
    925928                        snd_cs4236_ctrl_in(chip, 3),
     
    10161019        return 0;
    10171020}
    1018 
    1019 EXPORT_SYMBOL(snd_cs4236_create);
    1020 EXPORT_SYMBOL(snd_cs4236_pcm);
    1021 EXPORT_SYMBOL(snd_cs4236_mixer);
    1022 
    1023 /*
    1024  *  INIT part
    1025  */
    1026 
    1027 static int __init alsa_cs4236_init(void)
    1028 {
    1029         return 0;
    1030 }
    1031 
    1032 static void __exit alsa_cs4236_exit(void)
    1033 {
    1034 }
    1035 
    1036 module_init(alsa_cs4236_init)
    1037 module_exit(alsa_cs4236_exit)
  • GPL/trunk/alsa-kernel/isa/es1688/es1688.c

    r410 r426  
    5050static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE;  /* Enable this card */
    5151static long port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT;     /* 0x220,0x240,0x260 */
     52static long fm_port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT;  /* Usually 0x388 */
    5253static long mpu_port[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = -1};
    5354static int irq[SNDRV_CARDS] = SNDRV_DEFAULT_IRQ;        /* 5,7,9,10 */
     
    6667MODULE_PARM_DESC(mpu_port, "MPU-401 port # for " CRD_NAME " driver.");
    6768module_param_array(irq, int, NULL, 0444);
     69module_param_array(fm_port, long, NULL, 0444);
     70MODULE_PARM_DESC(fm_port, "FM port # for ES1688 driver.");
    6871MODULE_PARM_DESC(irq, "IRQ # for " CRD_NAME " driver.");
    6972module_param_array(mpu_irq, int, NULL, 0444);
     
    144147                chip->port, chip->irq, chip->dma8);
    145148
    146         if (snd_opl3_create(card, chip->port, chip->port + 2,
    147                         OPL3_HW_OPL3, 0, &opl3) < 0)
    148                 dev_warn(dev, "opl3 not detected at 0x%lx\n", chip->port);
    149         else {
    150                 error = snd_opl3_hwdep_new(opl3, 0, 1, NULL);
    151                 if (error < 0)
    152                         goto out;
     149        if (fm_port[n] == SNDRV_AUTO_PORT)
     150                fm_port[n] = port[n];   /* share the same port */
     151
     152        if (fm_port[n] > 0) {
     153                if (snd_opl3_create(card, fm_port[n], fm_port[n] + 2,
     154                                OPL3_HW_OPL3, 0, &opl3) < 0)
     155                        dev_warn(dev,
     156                                 "opl3 not detected at 0x%lx\n", fm_port[n]);
     157                else {
     158                        error = snd_opl3_hwdep_new(opl3, 0, 1, NULL);
     159                        if (error < 0)
     160                                goto out;
     161                }
    153162        }
    154163
  • GPL/trunk/alsa-kernel/isa/es1688/es1688_lib.c

    r399 r426  
    4646                }
    4747#ifdef CONFIG_SND_DEBUG
    48         printk("snd_es1688_dsp_command: timeout (0x%x)\n", val);
     48        printk(KERN_DEBUG "snd_es1688_dsp_command: timeout (0x%x)\n", val);
    4949#endif
    5050        return 0;
     
    168168        switch (chip->version & 0xfff0) {
    169169        case 0x4880:
    170                 snd_printk("[0x%lx] ESS: AudioDrive ES488 detected, but driver is in another place\n", chip->port);
     170                snd_printk(KERN_ERR "[0x%lx] ESS: AudioDrive ES488 detected, "
     171                           "but driver is in another place\n", chip->port);
    171172                return -ENODEV;
    172173        case 0x6880:
     
    174175                break;
    175176        default:
    176                 snd_printk("[0x%lx] ESS: unknown AudioDrive chip with version 0x%x (Jazz16 soundcard?)\n", chip->port, chip->version);
     177                snd_printk(KERN_ERR "[0x%lx] ESS: unknown AudioDrive chip "
     178                           "with version 0x%x (Jazz16 soundcard?)\n",
     179                           chip->port, chip->version);
    177180                return -ENODEV;
    178181        }
     
    224227        }
    225228#if 0
    226         snd_printk("mpu cfg = 0x%x\n", cfg);
     229        snd_printk(KERN_DEBUG "mpu cfg = 0x%x\n", cfg);
    227230#endif
    228231        spin_lock_irqsave(&chip->reg_lock, flags);
     
    238241                irq_bits = irqs[chip->irq & 0x0f];
    239242                if (irq_bits < 0) {
    240                         snd_printk("[0x%lx] ESS: bad IRQ %d for ES1688 chip!!\n", chip->port, chip->irq);
     243                        snd_printk(KERN_ERR "[0x%lx] ESS: bad IRQ %d "
     244                                   "for ES1688 chip!!\n",
     245                                   chip->port, chip->irq);
    241246#if 0
    242247                        irq_bits = 0;
     
    251256                dma = chip->dma8;
    252257                if (dma > 3 || dma == 2) {
    253                         snd_printk("[0x%lx] ESS: bad DMA channel %d for ES1688 chip!!\n", chip->port, dma);
     258                        snd_printk(KERN_ERR "[0x%lx] ESS: bad DMA channel %d "
     259                                   "for ES1688 chip!!\n", chip->port, dma);
    254260#if 0
    255261                        dma_bits = 0;
     
    342348        }
    343349#if 0
    344         printk("trigger: val = 0x%x, value = 0x%x\n", val, value);
    345         printk("trigger: pointer = 0x%x\n", snd_dma_pointer(chip->dma8, chip->dma_size));
     350        printk(KERN_DEBUG "trigger: val = 0x%x, value = 0x%x\n", val, value);
     351        printk(KERN_DEBUG "trigger: pointer = 0x%x\n",
     352               snd_dma_pointer(chip->dma8, chip->dma_size));
    346353#endif
    347354        snd_es1688_write(chip, 0xb8, (val & 0xf0) | value);
  • GPL/trunk/alsa-kernel/isa/gus/gus_dma.c

    r305 r426  
    4646        unsigned int address_high;
    4747
    48         // snd_printk("dma_transfer: addr=0x%x, buf=0x%lx, count=0x%x\n", addr, (long) buf, count);
     48        snd_printdd("dma_transfer: addr=0x%x, buf=0x%lx, count=0x%x\n",
     49                    addr, buf_addr, count);
    4950
    5051        if (gus->gf1.dma1 > 3) {
     
    7879        snd_dma_program(gus->gf1.dma1, buf_addr, count, dma_cmd & SNDRV_GF1_DMA_READ ? DMA_MODE_READ : DMA_MODE_WRITE);
    7980#if 0
    80         snd_printk("address = 0x%x, count = 0x%x, dma_cmd = 0x%x\n", address << 1, count, dma_cmd);
     81        snd_printk(KERN_DEBUG "address = 0x%x, count = 0x%x, dma_cmd = 0x%x\n",
     82                   address << 1, count, dma_cmd);
    8183#endif
    8284        spin_lock_irqsave(&gus->reg_lock, flags);
     
    143145        kfree(block);
    144146#if 0
    145         printk("program dma (IRQ) - addr = 0x%x, buffer = 0x%lx, count = 0x%x, cmd = 0x%x\n", addr, (long) buffer, count, cmd);
     147        snd_printd(KERN_DEBUG "program dma (IRQ) - "
     148                   "addr = 0x%x, buffer = 0x%lx, count = 0x%x, cmd = 0x%x\n",
     149                   block->addr, block->buf_addr, block->count, block->cmd);
    146150#endif
    147151}
     
    204208        *block = *__block;
    205209        block->next = NULL;
    206 #if 0
    207         printk("addr = 0x%x, buffer = 0x%lx, count = 0x%x, cmd = 0x%x\n", block->addr, (long) block->buffer, block->count, block->cmd);
    208 #endif
    209 #if 0
    210         printk("gus->gf1.dma_data_pcm_last = 0x%lx\n", (long)gus->gf1.dma_data_pcm_last);
    211         printk("gus->gf1.dma_data_pcm = 0x%lx\n", (long)gus->gf1.dma_data_pcm);
    212 #endif
     210
     211        snd_printdd("addr = 0x%x, buffer = 0x%lx, count = 0x%x, cmd = 0x%x\n",
     212                    block->addr, (long) block->buffer, block->count,
     213                    block->cmd);
     214
     215        snd_printdd("gus->gf1.dma_data_pcm_last = 0x%lx\n",
     216                    (long)gus->gf1.dma_data_pcm_last);
     217        snd_printdd("gus->gf1.dma_data_pcm = 0x%lx\n",
     218                    (long)gus->gf1.dma_data_pcm);
     219
    213220        spin_lock_irqsave(&gus->dma_lock, flags);
    214221        if (synth) {
  • GPL/trunk/alsa-kernel/isa/gus/gus_irq.c

    r305 r426  
    4242                return IRQ_RETVAL(handled);
    4343        handled = 1;
    44         // snd_printk("IRQ: status = 0x%x\n", status);
     44        /* snd_printk(KERN_DEBUG "IRQ: status = 0x%x\n", status); */
    4545        if (status & 0x02) {
    4646                STAT_ADD(gus->gf1.interrupt_stat_midi_in);
     
    6666                        already |= _current_;   /* mark request */
    6767#if 0
    68                         printk("voice = %i, voice_status = 0x%x, voice_verify = %i\n", voice, voice_status, inb(GUSP(gus, GF1PAGE)));
     68                        printk(KERN_DEBUG "voice = %i, voice_status = 0x%x, "
     69                               "voice_verify = %i\n",
     70                               voice, voice_status, inb(GUSP(gus, GF1PAGE)));
    6971#endif
    7072                        pvoice = &gus->gf1.voices[voice];
  • GPL/trunk/alsa-kernel/isa/gus/gus_pcm.c

    r399 r426  
    8383        count += offset & 31;
    8484        offset &= ~31;
    85         // snd_printk("block change - offset = 0x%x, count = 0x%x\n", offset, count);
     85        /*
     86        snd_printk(KERN_DEBUG "block change - offset = 0x%x, count = 0x%x\n",
     87                   offset, count);
     88        */
    8689        memset(&block, 0, sizeof(block));
    8790        block.cmd = SNDRV_GF1_DMA_IRQ;
     
    136139                end = curr + (pcmp->block_size / runtime->channels);
    137140                end -= snd_pcm_format_width(runtime->format) == 16 ? 2 : 1;
    138                 // snd_printk("init: curr=0x%x, begin=0x%x, end=0x%x, ctrl=0x%x, ramp=0x%x, rate=0x%x\n", curr, begin, end, voice_ctrl, ramp_ctrl, rate);
     141                /*
     142                snd_printk(KERN_DEBUG "init: curr=0x%x, begin=0x%x, end=0x%x, "
     143                           "ctrl=0x%x, ramp=0x%x, rate=0x%x\n",
     144                           curr, begin, end, voice_ctrl, ramp_ctrl, rate);
     145                */
    139146                pan = runtime->channels == 2 ? (!voice ? 1 : 14) : 8;
    140147                vol = !voice ? gus->gf1.pcm_volume_level_left : gus->gf1.pcm_volume_level_right;
     
    206213#if 0
    207214        snd_gf1_select_voice(gus, pvoice->number);
    208         printk("position = 0x%x\n", (snd_gf1_read_addr(gus, SNDRV_GF1_VA_CURRENT, voice_ctrl & 4) >> 4));
     215        printk(KERN_DEBUG "position = 0x%x\n",
     216               (snd_gf1_read_addr(gus, SNDRV_GF1_VA_CURRENT, voice_ctrl & 4) >> 4));
    209217        snd_gf1_select_voice(gus, pcmp->pvoices[1]->number);
    210         printk("position = 0x%x\n", (snd_gf1_read_addr(gus, SNDRV_GF1_VA_CURRENT, voice_ctrl & 4) >> 4));
     218        printk(KERN_DEBUG "position = 0x%x\n",
     219               (snd_gf1_read_addr(gus, SNDRV_GF1_VA_CURRENT, voice_ctrl & 4) >> 4));
    211220        snd_gf1_select_voice(gus, pvoice->number);
    212221#endif
     
    300309        unsigned long flags;
    301310
    302         // printk("poke block; buf = 0x%x, pos = %i, count = %i, port = 0x%x\n", (int)buf, pos, count, gus->gf1.port);
     311        /*
     312        printk(KERN_DEBUG
     313               "poke block; buf = 0x%x, pos = %i, count = %i, port = 0x%x\n",
     314               (int)buf, pos, count, gus->gf1.port);
     315        */
    303316        while (count > 0) {
    304317                len = count;
     
    681694
    682695#if 0
    683         printk("playback.buffer = 0x%lx, gf1.pcm_buffer = 0x%lx\n", (long) pcm->playback.buffer, (long) gus->gf1.pcm_buffer);
     696        printk(KERN_DEBUG "playback.buffer = 0x%lx, gf1.pcm_buffer = 0x%lx\n",
     697               (long) pcm->playback.buffer, (long) gus->gf1.pcm_buffer);
    684698#endif
    685699        if ((err = snd_gf1_dma_init(gus)) < 0)
  • GPL/trunk/alsa-kernel/isa/gus/gus_uart.c

    r305 r426  
    130130        spin_unlock_irqrestore(&gus->uart_cmd_lock, flags);
    131131#if 0
    132         snd_printk("read init - enable = %i, cmd = 0x%x, stat = 0x%x\n", gus->uart_enable, gus->gf1.uart_cmd, snd_gf1_uart_stat(gus));
    133         snd_printk("[0x%x] reg (ctrl/status) = 0x%x, reg (data) = 0x%x (page = 0x%x)\n", gus->gf1.port + 0x100, inb(gus->gf1.port + 0x100), inb(gus->gf1.port + 0x101), inb(gus->gf1.port + 0x102));
     132        snd_printk(KERN_DEBUG
     133                   "read init - enable = %i, cmd = 0x%x, stat = 0x%x\n",
     134                   gus->uart_enable, gus->gf1.uart_cmd, snd_gf1_uart_stat(gus));
     135        snd_printk(KERN_DEBUG
     136                   "[0x%x] reg (ctrl/status) = 0x%x, reg (data) = 0x%x "
     137                   "(page = 0x%x)\n",
     138                   gus->gf1.port + 0x100, inb(gus->gf1.port + 0x100),
     139                   inb(gus->gf1.port + 0x101), inb(gus->gf1.port + 0x102));
    134140#endif
    135141        return 0;
  • GPL/trunk/alsa-kernel/isa/gus/interwave.c

    r410 r426  
    171171
    172172#if 0
    173         printk("i2c_setlines - 0x%lx <- %i,%i\n", port, ctrl, data);
     173        printk(KERN_DEBUG "i2c_setlines - 0x%lx <- %i,%i\n", port, ctrl, data);
    174174#endif
    175175        outb((data << 1) | ctrl, port);
     
    184184        res = inb(port) & 1;
    185185#if 0
    186         printk("i2c_getclockline - 0x%lx -> %i\n", port, res);
     186        printk(KERN_DEBUG "i2c_getclockline - 0x%lx -> %i\n", port, res);
    187187#endif
    188188        return res;
     
    198198        res = (inb(port) & 2) >> 1;
    199199#if 0
    200         printk("i2c_getdataline - 0x%lx -> %i\n", port, res);
     200        printk(KERN_DEBUG "i2c_getdataline - 0x%lx -> %i\n", port, res);
    201201#endif
    202202        return res;
     
    343343                        snd_gf1_poke(gus, local + 1, d + 1);
    344344#if 0
    345                         printk("d = 0x%x, local = 0x%x, local + 1 = 0x%x, idx << 22 = 0x%x\n",
     345                        printk(KERN_DEBUG "d = 0x%x, local = 0x%x, "
     346                               "local + 1 = 0x%x, idx << 22 = 0x%x\n",
    346347                               d,
    347348                               snd_gf1_peek(gus, local),
     
    357358        }
    358359#if 0
    359         printk("sizes: %i %i %i %i\n", sizes[0], sizes[1], sizes[2], sizes[3]);
     360        printk(KERN_DEBUG "sizes: %i %i %i %i\n",
     361               sizes[0], sizes[1], sizes[2], sizes[3]);
    360362#endif
    361363}
     
    411413                    (psizes[1] << 8) | psizes[0];
    412414#if 0
    413                 printk("lmct = 0x%08x\n", lmct);
     415                printk(KERN_DEBUG "lmct = 0x%08x\n", lmct);
    414416#endif
    415417                for (i = 0; i < ARRAY_SIZE(lmc); i++)
    416418                        if (lmct == lmc[i]) {
    417419#if 0
    418                                 printk("found !!! %i\n", i);
     420                                printk(KERN_DEBUG "found !!! %i\n", i);
    419421#endif
    420422                                snd_gf1_write16(gus, SNDRV_GF1_GW_MEMORY_CONFIG, (snd_gf1_look16(gus, SNDRV_GF1_GW_MEMORY_CONFIG) & 0xfff0) | i);
  • GPL/trunk/alsa-kernel/isa/opl3sa2.c

    r410 r426  
    184184#if 0
    185185        outb(0x1d, port);       /* password */
    186         printk("read [0x%lx] = 0x%x\n", port, inb(port));
     186        printk(KERN_DEBUG "read [0x%lx] = 0x%x\n", port, inb(port));
    187187#endif
    188188        outb(reg, chip->port);  /* register */
    189189        result = inb(chip->port + 1);
    190190#if 0
    191         printk("read [0x%lx] = 0x%x [0x%x]\n", port, result, inb(port));
     191        printk(KERN_DEBUG "read [0x%lx] = 0x%x [0x%x]\n",
     192               port, result, inb(port));
    192193#endif
    193194        return result;
     
    238239                return -EBUSY;
    239240        }
    240         // snd_printk("REG 0A = 0x%x\n", snd_opl3sa2_read(chip, 0x0a));
     241        /*
     242        snd_printk(KERN_DEBUG "REG 0A = 0x%x\n",
     243                   snd_opl3sa2_read(chip, 0x0a));
     244        */
    241245        chip->version = 0;
    242246        tmp = snd_opl3sa2_read(chip, OPL3SA2_MISC);
     
    482486OPL3SA2_SINGLE_TLV("Mic Playback Volume", 0, 0x09, 0, 31, 1,
    483487                   db_scale_5bit_12db_max),
     488OPL3SA2_SINGLE("ZV Port Switch", 0, 0x02, 0, 1, 0),
    484489};
    485490
     
    555560static int snd_opl3sa2_suspend(struct snd_card *card, pm_message_t state)
    556561{
    557         struct snd_opl3sa2 *chip = card->private_data;
    558 
    559         snd_power_change_state(card, SNDRV_CTL_POWER_D3hot);
    560         chip->wss->suspend(chip->wss);
    561         /* power down */
    562         snd_opl3sa2_write(chip, OPL3SA2_PM_CTRL, OPL3SA2_PM_D3);
     562        if (card) {
     563                struct snd_opl3sa2 *chip = card->private_data;
     564
     565                snd_power_change_state(card, SNDRV_CTL_POWER_D3hot);
     566                chip->wss->suspend(chip->wss);
     567                /* power down */
     568                snd_opl3sa2_write(chip, OPL3SA2_PM_CTRL, OPL3SA2_PM_D3);
     569        }
    563570
    564571        return 0;
     
    567574static int snd_opl3sa2_resume(struct snd_card *card)
    568575{
    569         struct snd_opl3sa2 *chip = card->private_data;
     576        struct snd_opl3sa2 *chip;
    570577        int i;
    571578
     579        if (!card)
     580                return 0;
     581
     582        chip = card->private_data;
    572583        /* power up */
    573584        snd_opl3sa2_write(chip, OPL3SA2_PM_CTRL, OPL3SA2_PM_D0);
     
    618629        struct snd_opl3sa2 *chip = card->private_data;
    619630        if (chip->irq >= 0)
    620                 free_irq(chip->irq, (void *)chip);
     631                free_irq(chip->irq, card);
    621632        release_and_free_resource(chip->res_port);
    622633}
     
    633644                return err;
    634645        strcpy(card->driver, "OPL3SA2");
    635         strcpy(card->shortname, "Yamaha OPL3-SA2");
     646        strcpy(card->shortname, "Yamaha OPL3-SA");
    636647        chip = card->private_data;
    637648        spin_lock_init(&chip->reg_lock);
  • GPL/trunk/alsa-kernel/isa/opti9xx/opti92x-ad1848.c

    r410 r426  
    253253
    254254        default:
    255                 snd_printk("chip %d not supported\n", hardware);
     255                snd_printk(KERN_ERR "chip %d not supported\n", hardware);
    256256                return -ENODEV;
    257257        }
     
    295295
    296296        default:
    297                 snd_printk("chip %d not supported\n", chip->hardware);
     297                snd_printk(KERN_ERR "chip %d not supported\n", chip->hardware);
    298298        }
    299299
     
    337337
    338338        default:
    339                 snd_printk("chip %d not supported\n", chip->hardware);
     339                snd_printk(KERN_ERR "chip %d not supported\n", chip->hardware);
    340340        }
    341341
     
    413413
    414414        default:
    415                 snd_printk("chip %d not supported\n", chip->hardware);
     415                snd_printk(KERN_ERR "chip %d not supported\n", chip->hardware);
    416416                return -EINVAL;
    417417        }
     
    431431                break;
    432432        default:
    433                 snd_printk("WSS port 0x%lx not valid\n", chip->wss_base);
     433                snd_printk(KERN_WARNING "WSS port 0x%lx not valid\n",
     434                           chip->wss_base);
    434435                goto __skip_base;
    435436        }
     
    456457                break;
    457458        default:
    458                 snd_printk("WSS irq # %d not valid\n", chip->irq);
     459                snd_printk(KERN_WARNING "WSS irq # %d not valid\n", chip->irq);
    459460                goto __skip_resources;
    460461        }
     
    471472                break;
    472473        default:
    473                 snd_printk("WSS dma1 # %d not valid\n", chip->dma1);
     474                snd_printk(KERN_WARNING "WSS dma1 # %d not valid\n",
     475                           chip->dma1);
    474476                goto __skip_resources;
    475477        }
     
    477479#if defined(CS4231) || defined(OPTi93X)
    478480        if (chip->dma1 == chip->dma2) {
    479                 snd_printk("don't want to share dmas\n");
     481                snd_printk(KERN_ERR "don't want to share dmas\n");
    480482                return -EBUSY;
    481483        }
     
    486488                break;
    487489        default:
    488                 snd_printk("WSS dma2 # %d not valid\n", chip->dma2);
     490                snd_printk(KERN_WARNING "WSS dma2 # %d not valid\n",
     491                           chip->dma2);
    489492                goto __skip_resources;
    490493        }
     
    517520                        break;
    518521                default:
    519                         snd_printk("MPU-401 port 0x%lx not valid\n",
     522                        snd_printk(KERN_WARNING
     523                                   "MPU-401 port 0x%lx not valid\n",
    520524                                chip->mpu_port);
    521525                        goto __skip_mpu;
     
    536540                        break;
    537541                default:
    538                         snd_printk("MPU-401 irq # %d not valid\n",
     542                        snd_printk(KERN_WARNING "MPU-401 irq # %d not valid\n",
    539543                                chip->mpu_irq);
    540544                        goto __skip_mpu;
     
    727731                chip->wss_base = snd_legacy_find_free_ioport(possible_ports, 4);
    728732                if (chip->wss_base < 0) {
    729                         snd_printk("unable to find a free WSS port\n");
     733                        snd_printk(KERN_ERR "unable to find a free WSS port\n");
    730734                        return -EBUSY;
    731735                }
     
    816820                }
    817821                if (opl3) {
    818 #ifdef CS4231
    819                         const int t1dev = 1;
    820 #else
    821                         const int t1dev = 0;
    822 #endif
    823                         if ((error = snd_opl3_timer_new(opl3, t1dev, t1dev+1)) < 0)
    824                                 return error;
    825                         if ((error = snd_opl3_hwdep_new(opl3, 0, 1, &synth)) < 0)
     822                        error = snd_opl3_hwdep_new(opl3, 0, 1, &synth);
     823                        if (error < 0)
    826824                                return error;
    827825                }
     
    901899        if (dma2 == SNDRV_AUTO_DMA) {
    902900                if ((dma2 = snd_legacy_find_free_dma(possible_dma2s[dma1 % 4])) < 0) {
    903                         snd_printk("unable to find a free DMA2\n");
     901                        snd_printk(KERN_ERR "unable to find a free DMA2\n");
    904902                        return -EBUSY;
    905903                }
  • GPL/trunk/alsa-kernel/isa/sb/sb16_csp.c

    r399 r426  
    685685static int snd_sb_csp_load_user(struct snd_sb_csp * p, const unsigned char __user *buf, int size, int load_flags)
    686686{
    687         int err = -ENOMEM;
    688         unsigned char *kbuf = kmalloc(size, GFP_KERNEL);
    689         if (kbuf) {
    690                 if (copy_from_user(kbuf, buf, size))
    691                         err = -EFAULT;
    692                 else
    693                         err = snd_sb_csp_load(p, kbuf, size, load_flags);
    694                 kfree(kbuf);
    695         }
     687        int err;
     688        unsigned char *kbuf;
     689
     690        kbuf = memdup_user(buf, size);
     691        if (IS_ERR(kbuf))
     692                return PTR_ERR(kbuf);
     693
     694        err = snd_sb_csp_load(p, kbuf, size, load_flags);
     695
     696        kfree(kbuf);
    696697        return err;
    697698}
  • GPL/trunk/alsa-kernel/isa/sb/sb_mixer.c

    r399 r426  
    183183static int snd_dt019x_input_sw_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo)
    184184{
    185         static char *texts[5] = {
     185        static const char *texts[5] = {
    186186                "CD", "Mic", "Line", "Synth", "Master"
    187187        };
     
    270270
    271271/*
     272 * ALS4000 mono recording control switch
     273 */
     274
     275static int snd_als4k_mono_capture_route_info(struct snd_kcontrol *kcontrol,
     276                                             struct snd_ctl_elem_info *uinfo)
     277{
     278        static const char *texts[3] = {
     279                "L chan only", "R chan only", "L ch/2 + R ch/2"
     280        };
     281
     282        uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED;
     283        uinfo->count = 1;
     284        uinfo->value.enumerated.items = 3;
     285        if (uinfo->value.enumerated.item > 2)
     286                uinfo->value.enumerated.item = 2;
     287        strcpy(uinfo->value.enumerated.name,
     288               texts[uinfo->value.enumerated.item]);
     289        return 0;
     290}
     291
     292static int snd_als4k_mono_capture_route_get(struct snd_kcontrol *kcontrol,
     293                                struct snd_ctl_elem_value *ucontrol)
     294{
     295        struct snd_sb *sb = snd_kcontrol_chip(kcontrol);
     296        unsigned long flags;
     297        unsigned char oval;
     298
     299        spin_lock_irqsave(&sb->mixer_lock, flags);
     300        oval = snd_sbmixer_read(sb, SB_ALS4000_MONO_IO_CTRL);
     301        spin_unlock_irqrestore(&sb->mixer_lock, flags);
     302        oval >>= 6;
     303        if (oval > 2)
     304                oval = 2;
     305
     306        ucontrol->value.enumerated.item[0] = oval;
     307        return 0;
     308}
     309
     310static int snd_als4k_mono_capture_route_put(struct snd_kcontrol *kcontrol,
     311                                struct snd_ctl_elem_value *ucontrol)
     312{
     313        struct snd_sb *sb = snd_kcontrol_chip(kcontrol);
     314        unsigned long flags;
     315        int change;
     316        unsigned char nval, oval;
     317
     318        if (ucontrol->value.enumerated.item[0] > 2)
     319                return -EINVAL;
     320        spin_lock_irqsave(&sb->mixer_lock, flags);
     321        oval = snd_sbmixer_read(sb, SB_ALS4000_MONO_IO_CTRL);
     322
     323        nval = (oval & ~(3 << 6))
     324             | (ucontrol->value.enumerated.item[0] << 6);
     325        change = nval != oval;
     326        if (change)
     327                snd_sbmixer_write(sb, SB_ALS4000_MONO_IO_CTRL, nval);
     328        spin_unlock_irqrestore(&sb->mixer_lock, flags);
     329        return change;
     330}
     331
     332/*
    272333 * SBPRO input multiplexer
    273334 */
     
    275336static int snd_sb8mixer_info_mux(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo)
    276337{
    277         static char *texts[3] = {
     338        static const char *texts[3] = {
    278339                "Mic", "CD", "Line"
    279340        };
     
    442503                        .get = snd_dt019x_input_sw_get,
    443504                        .put = snd_dt019x_input_sw_put,
     505                },
     506                [SB_MIX_MONO_CAPTURE_ALS4K] = {
     507                        .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
     508                        .info = snd_als4k_mono_capture_route_info,
     509                        .get = snd_als4k_mono_capture_route_get,
     510                        .put = snd_als4k_mono_capture_route_put,
    444511                },
    445512        };
     
    637704
    638705static struct sbmix_elem *snd_dt019x_controls[] = {
     706        /* ALS4000 below has some parts which we might be lacking,
     707         * e.g. snd_als4000_ctl_mono_playback_switch - check it! */
    639708        &snd_dt019x_ctl_master_play_vol,
    640709        &snd_dt019x_ctl_pcm_play_vol,
     
    667736 * ALS4000 specific mixer elements
    668737 */
    669 /* FIXME: SB_ALS4000_MONO_IO_CTRL needs output select ctrl! */
    670738static struct sbmix_elem snd_als4000_ctl_master_mono_playback_switch =
    671739        SB_SINGLE("Master Mono Playback Switch", SB_ALS4000_MONO_IO_CTRL, 5, 1);
    672 static struct sbmix_elem snd_als4000_ctl_master_mono_capture_route =
    673         SB_SINGLE("Master Mono Capture Route", SB_ALS4000_MONO_IO_CTRL, 6, 0x03);
    674 /* FIXME: mono playback switch also available on DT019X? */
     740static struct sbmix_elem snd_als4k_ctl_master_mono_capture_route = {
     741                .name = "Master Mono Capture Route",
     742                .type = SB_MIX_MONO_CAPTURE_ALS4K
     743        };
    675744static struct sbmix_elem snd_als4000_ctl_mono_playback_switch =
    676745        SB_SINGLE("Mono Playback Switch", SB_DT019X_OUTPUT_SW2, 0, 1);
    677746static struct sbmix_elem snd_als4000_ctl_mic_20db_boost =
    678747        SB_SINGLE("Mic Boost (+20dB)", SB_ALS4000_MIC_IN_GAIN, 0, 0x03);
    679 static struct sbmix_elem snd_als4000_ctl_mixer_loopback =
    680         SB_SINGLE("Analog Loopback", SB_ALS4000_MIC_IN_GAIN, 7, 0x01);
     748static struct sbmix_elem snd_als4000_ctl_mixer_analog_loopback =
     749        SB_SINGLE("Analog Loopback Switch", SB_ALS4000_MIC_IN_GAIN, 7, 0x01);
     750static struct sbmix_elem snd_als4000_ctl_mixer_digital_loopback =
     751        SB_SINGLE("Digital Loopback Switch",
     752                  SB_ALS4000_CR3_CONFIGURATION, 7, 0x01);
    681753/* FIXME: functionality of 3D controls might be swapped, I didn't find
    682754 * a description of how to identify what is supposed to be what */
     
    695767static struct sbmix_elem snd_als4000_3d_control_poweroff_switch =
    696768        SB_SINGLE("3D PowerOff Switch", SB_ALS4000_3D_TIME_DELAY, 4, 0x01);
     769static struct sbmix_elem snd_als4000_ctl_3db_freq_control_switch =
     770        SB_SINGLE("Master Playback 8kHz / 20kHz LPF Switch",
     771                  SB_ALS4000_FMDAC, 5, 0x01);
    697772#ifdef NOT_AVAILABLE
    698773static struct sbmix_elem snd_als4000_ctl_fmdac =
     
    703778
    704779static struct sbmix_elem *snd_als4000_controls[] = {
    705         &snd_sb16_ctl_master_play_vol,
    706         &snd_dt019x_ctl_pcm_play_switch,
    707         &snd_sb16_ctl_pcm_play_vol,
    708         &snd_sb16_ctl_synth_capture_route,
    709         &snd_dt019x_ctl_synth_play_switch,
    710         &snd_sb16_ctl_synth_play_vol,
    711         &snd_sb16_ctl_cd_capture_route,
    712         &snd_sb16_ctl_cd_play_switch,
    713         &snd_sb16_ctl_cd_play_vol,
    714         &snd_sb16_ctl_line_capture_route,
    715         &snd_sb16_ctl_line_play_switch,
    716         &snd_sb16_ctl_line_play_vol,
    717         &snd_sb16_ctl_mic_capture_route,
    718         &snd_als4000_ctl_mic_20db_boost,
    719         &snd_sb16_ctl_auto_mic_gain,
    720         &snd_sb16_ctl_mic_play_switch,
    721         &snd_sb16_ctl_mic_play_vol,
    722         &snd_sb16_ctl_pc_speaker_vol,
    723         &snd_sb16_ctl_capture_vol,
    724         &snd_sb16_ctl_play_vol,
    725         &snd_als4000_ctl_master_mono_playback_switch,
    726         &snd_als4000_ctl_master_mono_capture_route,
    727         &snd_als4000_ctl_mono_playback_switch,
    728         &snd_als4000_ctl_mixer_loopback,
    729         &snd_als4000_3d_control_switch,
    730         &snd_als4000_3d_control_ratio,
    731         &snd_als4000_3d_control_freq,
    732         &snd_als4000_3d_control_delay,
    733         &snd_als4000_3d_control_poweroff_switch,
     780                                                /* ALS4000a.PDF regs page */
     781        &snd_sb16_ctl_master_play_vol,          /* MX30/31 12 */
     782        &snd_dt019x_ctl_pcm_play_switch,        /* MX4C    16 */
     783        &snd_sb16_ctl_pcm_play_vol,             /* MX32/33 12 */
     784        &snd_sb16_ctl_synth_capture_route,      /* MX3D/3E 14 */
     785        &snd_dt019x_ctl_synth_play_switch,      /* MX4C    16 */
     786        &snd_sb16_ctl_synth_play_vol,           /* MX34/35 12/13 */
     787        &snd_sb16_ctl_cd_capture_route,         /* MX3D/3E 14 */
     788        &snd_sb16_ctl_cd_play_switch,           /* MX3C    14 */
     789        &snd_sb16_ctl_cd_play_vol,              /* MX36/37 13 */
     790        &snd_sb16_ctl_line_capture_route,       /* MX3D/3E 14 */
     791        &snd_sb16_ctl_line_play_switch,         /* MX3C    14 */
     792        &snd_sb16_ctl_line_play_vol,            /* MX38/39 13 */
     793        &snd_sb16_ctl_mic_capture_route,        /* MX3D/3E 14 */
     794        &snd_als4000_ctl_mic_20db_boost,        /* MX4D    16 */
     795        &snd_sb16_ctl_mic_play_switch,          /* MX3C    14 */
     796        &snd_sb16_ctl_mic_play_vol,             /* MX3A    13 */
     797        &snd_sb16_ctl_pc_speaker_vol,           /* MX3B    14 */
     798        &snd_sb16_ctl_capture_vol,              /* MX3F/40 15 */
     799        &snd_sb16_ctl_play_vol,                 /* MX41/42 15 */
     800        &snd_als4000_ctl_master_mono_playback_switch, /* MX4C 16 */
     801        &snd_als4k_ctl_master_mono_capture_route, /* MX4B  16 */
     802        &snd_als4000_ctl_mono_playback_switch,  /* MX4C    16 */
     803        &snd_als4000_ctl_mixer_analog_loopback, /* MX4D    16 */
     804        &snd_als4000_ctl_mixer_digital_loopback, /* CR3    21 */
     805        &snd_als4000_3d_control_switch,          /* MX50   17 */
     806        &snd_als4000_3d_control_ratio,           /* MX50   17 */
     807        &snd_als4000_3d_control_freq,            /* MX50   17 */
     808        &snd_als4000_3d_control_delay,           /* MX51   18 */
     809        &snd_als4000_3d_control_poweroff_switch,        /* MX51    18 */
     810        &snd_als4000_ctl_3db_freq_control_switch,       /* MX4F    17 */
    734811#ifdef NOT_AVAILABLE
    735812        &snd_als4000_ctl_fmdac,
     
    906983
    907984static unsigned char als4000_saved_regs[] = {
     985        /* please verify in dsheet whether regs to be added
     986           are actually real H/W or just dummy */
    908987        SB_DSP4_MASTER_DEV, SB_DSP4_MASTER_DEV + 1,
    909988        SB_DSP4_OUTPUT_SW,
     
    912991        SB_DSP4_SYNTH_DEV, SB_DSP4_SYNTH_DEV + 1,
    913992        SB_DSP4_CD_DEV, SB_DSP4_CD_DEV + 1,
    914         SB_DSP4_MIC_AGC,
    915993        SB_DSP4_MIC_DEV,
    916994        SB_DSP4_SPEAKER_DEV,
     
    920998        SB_ALS4000_MONO_IO_CTRL,
    921999        SB_ALS4000_MIC_IN_GAIN,
     1000        SB_ALS4000_FMDAC,
    9221001        SB_ALS4000_3D_SND_FX,
    9231002        SB_ALS4000_3D_TIME_DELAY,
     1003        SB_ALS4000_CR3_CONFIGURATION,
    9241004};
    9251005
  • GPL/trunk/alsa-kernel/isa/wavefront/wavefront.c

    r410 r426  
    554554#endif
    555555        if (cs4232_pcm_port[dev] == SNDRV_AUTO_PORT) {
    556                 snd_printk("specify CS4232 port\n");
     556                snd_printk(KERN_ERR "specify CS4232 port\n");
    557557                return 0;
    558558        }
    559559        if (ics2115_port[dev] == SNDRV_AUTO_PORT) {
    560                 snd_printk("specify ICS2115 port\n");
     560                snd_printk(KERN_ERR "specify ICS2115 port\n");
    561561                return 0;
    562562        }
  • GPL/trunk/alsa-kernel/isa/wavefront/wavefront_fx.c

    r399 r426  
    3535#define WAIT_IDLE       0xff
    3636
    37 #ifdef CONFIG_SND_WAVEFRONT_FIRMWARE_IN_KERNEL
    38 #include "yss225.c"
    39 static const struct firmware yss225_registers_firmware = {
    40         .data = (u8 *)yss225_registers,
    41         .size = sizeof yss225_registers
    42 };
    43 #endif
    44 
    4537static int
    4638wavefront_fx_idle (snd_wavefront_t *dev)
     
    211203                                return -EIO;
    212204                        }
    213                         page_data = kmalloc(r.data[2] * sizeof(short), GFP_KERNEL);
    214                         if (!page_data)
    215                                 return -ENOMEM;
    216                         if (copy_from_user (page_data,
    217                                             (unsigned char __user *) r.data[3],
    218                                             r.data[2] * sizeof(short))) {
    219                                 kfree(page_data);
    220                                 return -EFAULT;
    221                         }
     205                        page_data = memdup_user((unsigned char __user *)
     206                                                r.data[3],
     207                                                r.data[2] * sizeof(short));
     208                        if (IS_ERR(page_data))
     209                                return PTR_ERR(page_data);
    222210                        pd = page_data;
    223211                }
     
    261249                return 0;
    262250
    263 #ifdef CONFIG_SND_WAVEFRONT_FIRMWARE_IN_KERNEL
    264         firmware = &yss225_registers_firmware;
    265 #else
    266251        err = request_firmware(&firmware, "yamaha/yss225_registers.bin",
    267252                               dev->card->dev);
     
    270255                goto out;
    271256        }
    272 #endif
    273257
    274258        for (i = 0; i + 1 < firmware->size; i += 2) {
     
    293277
    294278out:
    295 #ifndef CONFIG_SND_WAVEFRONT_FIRMWARE_IN_KERNEL
    296279        release_firmware(firmware);
    297 #endif
    298280        return err;
    299281}
    300282
    301 #ifndef CONFIG_SND_WAVEFRONT_FIRMWARE_IN_KERNEL
    302283MODULE_FIRMWARE("yamaha/yss225_registers.bin");
    303 #endif
  • GPL/trunk/alsa-kernel/isa/wavefront/wavefront_synth.c

    r399 r426  
    636636
    637637                if (snd_wavefront_cmd (dev, WFC_IDENTIFY_SAMPLE_TYPE, rbuf, wbuf)) {
    638                         snd_printk("cannot identify sample "
     638                        snd_printk(KERN_WARNING "cannot identify sample "
    639639                                   "type of slot %d\n", i);
    640640                        dev->sample_status[i] = WF_ST_EMPTY;
     
    16681668
    16691669        case WFCTL_WFCMD:
    1670                 wc = kmalloc(sizeof(*wc), GFP_KERNEL);
    1671                 if (! wc)
    1672                         return -ENOMEM;
    1673                 if (copy_from_user (wc, argp, sizeof (*wc)))
    1674                         err = -EFAULT;
    1675                 else if (wavefront_synth_control (acard, wc) < 0)
     1670                wc = memdup_user(argp, sizeof(*wc));
     1671                if (IS_ERR(wc))
     1672                        return PTR_ERR(wc);
     1673
     1674                if (wavefront_synth_control (acard, wc) < 0)
    16761675                        err = -EIO;
    16771676                else if (copy_to_user (argp, wc, sizeof (*wc)))
Note: See TracChangeset for help on using the changeset viewer.