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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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
Note: See TracChangeset for help on using the changeset viewer.