Ignore:
Timestamp:
Apr 21, 2008, 2:52:19 AM (17 years ago)
Author:
Brendan Oakley
Message:

alsa-resync1 branch merged to ALSA 1.0.4

Location:
GPL/branches/alsa-resync1/alsa-kernel/pci
Files:
20 edited

Legend:

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

    r290 r348  
    21612161        unsigned short misc;
    21622162
     2163        patch_ad1881(ac97);
    21632164        ac97->build_ops = &patch_ad1985_build_ops;
    21642165        misc = snd_ac97_read(ac97, AC97_AD_MISC);
  • GPL/branches/alsa-resync1/alsa-kernel/pci/emu10k1/emu10k1.c

    r256 r348  
    101101static struct pci_device_id snd_emu10k1_ids[] = {
    102102    { 0x1102, 0x0002, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },        /* EMU10K1 */
     103#if 0 /* FIXME: not working! */
    103104        { 0x1102, 0x0006, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },    /* Dell OEM version (EMU10K1) */
     105#endif
    104106    { 0x1102, 0x0004, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 1 },        /* Audigy */
    105107    { 0x1102, 0x0008, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 1 },    /* Audigy 2 Value SB0400 */
  • GPL/branches/alsa-resync1/alsa-kernel/pci/emu10k1/emu10k1_callback.c

    r84 r348  
    428428                /* invalidate maps */
    429429                temp = ((unsigned int)hw->silent_page.addr << 1) | MAP_PTI_MASK;
    430 //              temp = ((unsigned int)hw->silent_page_dmaaddr << 1) | MAP_PTI_MASK;
    431430                snd_emu10k1_ptr_write(hw, MAPA, ch, temp);
    432431                snd_emu10k1_ptr_write(hw, MAPB, ch, temp);
  • GPL/branches/alsa-resync1/alsa-kernel/pci/emu10k1/emufx.c

    r207 r348  
    3030
    3131#include <sound/driver.h>
     32#include <linux/pci.h>
    3233#include <linux/delay.h>
    3334#include <linux/slab.h>
  • GPL/branches/alsa-resync1/alsa-kernel/pci/ice1712/aureon.c

    r281 r348  
    410410        unsigned int i;
    411411
    412         if (ice->eeprom.subvendor == VT1724_SUBDEVICE_AUREON51_SKY)
     412        if (ice->eeprom.subvendor == VT1724_SUBDEVICE_AUREON51_SKY) {
    413413                ice->num_total_dacs = 6;
    414         else
     414                ice->num_total_adcs = 6;
     415        } else {
    415416                ice->num_total_dacs = 8;
     417                ice->num_total_adcs = 8;
     418        }
    416419
    417420        /* to remeber the register values */
  • GPL/branches/alsa-resync1/alsa-kernel/pci/ice1712/delta.c

    r300 r348  
    9191                break;
    9292        case ICE1712_SUBDEVICE_AUDIOPHILE:
     93        case ICE1712_SUBDEVICE_DELTA410:
    9394                tmp |= ICE1712_DELTA_AP_CCLK | ICE1712_DELTA_AP_CS_CODEC;
    9495                tmp &= ~ICE1712_DELTA_AP_CS_DIGITAL;
     
    113114                break;
    114115        case ICE1712_SUBDEVICE_AUDIOPHILE:
     116        case ICE1712_SUBDEVICE_DELTA410:
    115117                tmp |= ICE1712_DELTA_AP_CS_DIGITAL;
    116118                break;
     
    512514        case ICE1712_SUBDEVICE_AUDIOPHILE:
    513515                ice->num_total_dacs = 2;
     516                ice->num_total_adcs = 2;
    514517                break;
    515518        case ICE1712_SUBDEVICE_DELTA410:
    516519                ice->num_total_dacs = 8;
     520                ice->num_total_adcs = 2;
    517521                break;
    518522        case ICE1712_SUBDEVICE_DELTA44:
    519523        case ICE1712_SUBDEVICE_DELTA66:
    520524                ice->num_total_dacs = ice->omni ? 8 : 4;
     525                ice->num_total_adcs = ice->omni ? 8 : 4;
    521526                break;
    522527        case ICE1712_SUBDEVICE_DELTA1010:
    523528        case ICE1712_SUBDEVICE_DELTA1010LT:
    524529                ice->num_total_dacs = 8;
     530                ice->num_total_adcs = 8;
    525531                break;
    526532        case ICE1712_SUBDEVICE_VX442:
    527533                ice->num_total_dacs = 4;
     534                ice->num_total_adcs = 4;
    528535                break;
    529536        }
  • GPL/branches/alsa-resync1/alsa-kernel/pci/ice1712/ews.c

    r250 r348  
    407407        case ICE1712_SUBDEVICE_EWX2496:
    408408                ice->num_total_dacs = 2;
     409                ice->num_total_adcs = 2;
    409410                break; 
    410411        case ICE1712_SUBDEVICE_EWS88MT:
    411412        case ICE1712_SUBDEVICE_EWS88MT_NEW:
    412413                ice->num_total_dacs = 8;
     414                ice->num_total_adcs = 8;
    413415                break;
    414416        case ICE1712_SUBDEVICE_EWS88D:
     
    416418        case ICE1712_SUBDEVICE_DMX6FIRE:
    417419                ice->num_total_dacs = 6;
     420                ice->num_total_adcs = 6;
    418421                break;
    419422        }
  • GPL/branches/alsa-resync1/alsa-kernel/pci/ice1712/hoontech.c

    r256 r348  
    154154
    155155        ice->num_total_dacs = 8;
     156        ice->num_total_adcs = 8;
    156157
    157158        ice->hoontech_boxbits[0] =
  • GPL/branches/alsa-resync1/alsa-kernel/pci/ice1712/ice1712.c

    r300 r348  
    8383static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP;              /* Enable this card */
    8484static int omni[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS-1)] = 0};   /* Delta44 & 66 Omni I/O support */
     85static int cs8427_timeout[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS-1)] = 500}; /* CS8427 S/PDIF transciever reset timeout value in msec */
    8586
    8687MODULE_PARM(index, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
     
    9697MODULE_PARM_DESC(omni, "Enable Midiman M-Audio Delta Omni I/O support.");
    9798MODULE_PARM_SYNTAX(omni, SNDRV_ENABLED "," SNDRV_ENABLE_DESC);
     99MODULE_PARM(cs8427_timeout, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
     100MODULE_PARM_DESC(cs8427_timeout, "Define reset timeout for cs8427 chip in msec resolution.");
     101MODULE_PARM_SYNTAX(cs8427_timeout, SNDRV_ENABLED ", allows:{{1,1000}},default=500,skill:advanced");
    98102
    99103#ifndef PCI_VENDOR_ID_ICE
     
    387391        int err;
    388392
    389         if ((err = snd_cs8427_create(ice->i2c, addr, &ice->cs8427)) < 0) {
     393        if ((err = snd_cs8427_create(ice->i2c, addr,
     394                                     (ice->cs8427_timeout * HZ) / 1000,
     395                                     &ice->cs8427)) < 0) {
    390396                snd_printk("CS8427 initialization failed\n");
    391397                return err;
     
    887893        ice->pcm = pcm;
    888894
    889         snd_pcm_lib_preallocate_pci_pages_for_all(ice->pci, pcm, 64*1024, 64*1024);
     895        snd_pcm_lib_preallocate_pages_for_all(pcm, SNDRV_DMA_TYPE_DEV,
     896                                              snd_dma_pci_data(ice->pci), 64*1024, 64*1024);
    890897
    891898        if (rpcm)
     
    923930        ice->pcm_ds = pcm;
    924931
    925         snd_pcm_lib_preallocate_pci_pages_for_all(ice->pci, pcm, 64*1024, 128*1024);
     932        snd_pcm_lib_preallocate_pages_for_all(pcm, SNDRV_DMA_TYPE_DEV,
     933                                              snd_dma_pci_data(ice->pci), 64*1024, 128*1024);
    926934
    927935        if (rpcm)
     
    12701278        strcpy(pcm->name, "ICE1712 multi");
    12711279
    1272         snd_pcm_lib_preallocate_pci_pages_for_all(ice->pci, pcm, 256*1024, 256*1024);
     1280        snd_pcm_lib_preallocate_pages_for_all(pcm, SNDRV_DMA_TYPE_DEV,
     1281                                              snd_dma_pci_data(ice->pci), 256*1024, 256*1024);
    12731282
    12741283        ice->pcm_pro = pcm;
     
    13821391
    13831392
    1384 static snd_kcontrol_new_t snd_ice1712_multi_ctrls[] __devinitdata = {
     1393static snd_kcontrol_new_t snd_ice1712_multi_playback_ctrls[] __devinitdata = {
    13851394        {
    13861395                .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
     
    14011410                .count = 10,
    14021411        },
    1403         {
     1412};
     1413
     1414static snd_kcontrol_new_t snd_ice1712_multi_capture_analog_switch __devinitdata = {
    14041415                .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
    1405                 .name = "Multi Capture Switch",
     1416        .name = "H/W Multi Capture Switch",
    14061417                .info = snd_ice1712_pro_mixer_switch_info,
    14071418                .get = snd_ice1712_pro_mixer_switch_get,
    14081419                .put = snd_ice1712_pro_mixer_switch_put,
    14091420                .private_value = 10,
    1410                 .count = 10,
    1411         },
    1412         {
     1421};
     1422
     1423static snd_kcontrol_new_t snd_ice1712_multi_capture_spdif_switch __devinitdata = {
    14131424                .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
    1414                 .name = "Multi Capture Volume",
     1425        .name = "IEC958 Multi Capture Switch",
     1426        .info = snd_ice1712_pro_mixer_switch_info,
     1427        .get = snd_ice1712_pro_mixer_switch_get,
     1428        .put = snd_ice1712_pro_mixer_switch_put,
     1429        .private_value = 18,
     1430        .count = 2,
     1431};
     1432
     1433static snd_kcontrol_new_t snd_ice1712_multi_capture_analog_volume __devinitdata = {
     1434        .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
     1435        .name = "H/W Multi Capture Volume",
    14151436                .info = snd_ice1712_pro_mixer_volume_info,
    14161437                .get = snd_ice1712_pro_mixer_volume_get,
    14171438                .put = snd_ice1712_pro_mixer_volume_put,
    14181439                .private_value = 10,
    1419                 .count = 10,
    1420         },
     1440};
     1441
     1442static snd_kcontrol_new_t snd_ice1712_multi_capture_spdif_volume __devinitdata = {
     1443        .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
     1444        .name = "IEC958 Multi Capture Volume",
     1445        .info = snd_ice1712_pro_mixer_volume_info,
     1446        .get = snd_ice1712_pro_mixer_volume_get,
     1447        .put = snd_ice1712_pro_mixer_volume_put,
     1448        .private_value = 18,
     1449        .count = 2,
    14211450};
    14221451
     
    14281457
    14291458        /* multi-channel mixer */
    1430         for (idx = 0; idx < ARRAY_SIZE(snd_ice1712_multi_ctrls); idx++) {
    1431                 err = snd_ctl_add(card, snd_ctl_new1(&snd_ice1712_multi_ctrls[idx], ice));
     1459        for (idx = 0; idx < ARRAY_SIZE(snd_ice1712_multi_playback_ctrls); idx++) {
     1460                err = snd_ctl_add(card, snd_ctl_new1(&snd_ice1712_multi_playback_ctrls[idx], ice));
    14321461                if (err < 0)
    14331462                        return err;
    14341463        }
    14351464       
     1465        if (ice->num_total_adcs > 0) {
     1466                snd_kcontrol_new_t tmp = snd_ice1712_multi_capture_analog_switch;
     1467                tmp.count = ice->num_total_adcs;
     1468                err = snd_ctl_add(card, snd_ctl_new1(&tmp, ice));
     1469                if (err < 0)
     1470                        return err;
     1471        }
     1472
     1473        err = snd_ctl_add(card, snd_ctl_new1(&snd_ice1712_multi_capture_spdif_switch, ice));
     1474        if (err < 0)
     1475                return err;
     1476
     1477        if (ice->num_total_adcs > 0) {
     1478                snd_kcontrol_new_t tmp = snd_ice1712_multi_capture_analog_volume;
     1479                tmp.count = ice->num_total_adcs;
     1480                err = snd_ctl_add(card, snd_ctl_new1(&tmp, ice));
     1481                if (err < 0)
     1482                        return err;
     1483        }
     1484
     1485        err = snd_ctl_add(card, snd_ctl_new1(&snd_ice1712_multi_capture_spdif_volume, ice));
     1486        if (err < 0)
     1487                return err;
     1488
    14361489        /* initialize volumes */
    1437         for (idx = 0; idx < 20; idx++) {
     1490        for (idx = 0; idx < 10; idx++) {
    14381491                ice->pro_volumes[idx] = 0x80008000;     /* mute */
    14391492                snd_ice1712_update_volume(ice, idx);
    14401493        }
     1494        for (idx = 10; idx < 10 + ice->num_total_adcs; idx++) {
     1495                ice->pro_volumes[idx] = 0x80008000;     /* mute */
     1496                snd_ice1712_update_volume(ice, idx);
     1497        }
     1498        for (idx = 18; idx < 20; idx++) {
     1499                ice->pro_volumes[idx] = 0x80008000;     /* mute */
     1500                snd_ice1712_update_volume(ice, idx);
     1501        }
    14411502        return 0;
    14421503}
     
    14511512{
    14521513        int err;
     1514        ac97_t ac97;
     1515        ac97_bus_t bus, *pbus;
    14531516
    14541517        if (ice_has_con_ac97(ice)) {
    1455                 ac97_bus_t bus, *pbus;
    1456                 ac97_t ac97;
    14571518                memset(&bus, 0, sizeof(bus));
    14581519                bus.write = snd_ice1712_ac97_write;
     
    14731534
    14741535        if (! (ice->eeprom.data[ICE_EEP1_ACLINK] & ICE1712_CFG_PRO_I2S)) {
    1475                 ac97_bus_t bus, *pbus;
    1476                 ac97_t ac97;
    14771536                memset(&bus, 0, sizeof(bus));
    14781537                bus.write = snd_ice1712_pro_ac97_write;
     
    23502409                                     struct pci_dev *pci,
    23512410                                     int omni,
     2411                                        int cs8427_timeout,
    23522412                                     ice1712_t ** r_ice1712)
    23532413{
     
    23742434                return -ENOMEM;
    23752435        ice->omni = omni ? 1 : 0;
     2436        if (cs8427_timeout < 1)
     2437                cs8427_timeout = 1;
     2438        else if (cs8427_timeout > 1000)
     2439                cs8427_timeout = 1000;
     2440        ice->cs8427_timeout = cs8427_timeout;
    23762441        spin_lock_init(&ice->reg_lock);
    23772442        init_MUTEX(&ice->gpio_mutex);
     
    24932558        strcpy(card->shortname, "ICEnsemble ICE1712");
    24942559       
    2495         if ((err = snd_ice1712_create(card, pci, omni[dev], &ice)) < 0) {
     2560        if ((err = snd_ice1712_create(card, pci, omni[dev], cs8427_timeout[dev], &ice)) < 0) {
    24962561                snd_card_free(card);
    24972562                return err;
  • GPL/branches/alsa-resync1/alsa-kernel/pci/ice1712/ice1712.h

    r300 r348  
    331331        unsigned int vt1724: 1;
    332332        unsigned int num_total_dacs;    /* total DACs */
     333        unsigned int num_total_adcs;    /* total ADCs */
    333334        unsigned char hoontech_boxbits[4];
    334335        unsigned int hoontech_config;
     
    346347        snd_i2c_device_t *cs8404;       /* CS8404A I2C device */
    347348        snd_i2c_device_t *cs8427;       /* CS8427 I2C device */
     349        unsigned int cs8427_timeout;    /* CS8427 reset timeout in HZ/100 */
    348350        snd_i2c_device_t *i2cdevs[2];   /* additional i2c devices */
    349351       
  • GPL/branches/alsa-resync1/alsa-kernel/pci/ice1712/ice1724.c

    r300 r348  
    757757        strcpy(pcm->name, "ICE1724");
    758758
    759         snd_pcm_lib_preallocate_pci_pages_for_all(ice->pci, pcm, 256*1024, 256*1024);
     759        snd_pcm_lib_preallocate_pages_for_all(pcm, SNDRV_DMA_TYPE_DEV,
     760                                              snd_dma_pci_data(ice->pci), 256*1024, 256*1024);
    760761
    761762        ice->pcm_pro = pcm;
     
    911912        strcpy(pcm->name, "ICE1724 IEC958");
    912913
    913         snd_pcm_lib_preallocate_pci_pages_for_all(ice->pci, pcm, 64*1024, 64*1024);
     914        snd_pcm_lib_preallocate_pages_for_all(pcm, SNDRV_DMA_TYPE_DEV,
     915                                              snd_dma_pci_data(ice->pci), 64*1024, 64*1024);
    914916
    915917        ice->pcm = pcm;
     
    10321034        strcpy(pcm->name, "ICE1724 Surround PCM");
    10331035
    1034         snd_pcm_lib_preallocate_pci_pages_for_all(ice->pci, pcm, 64*1024, 64*1024);
     1036        snd_pcm_lib_preallocate_pages_for_all(pcm, SNDRV_DMA_TYPE_DEV,
     1037                                              snd_dma_pci_data(ice->pci), 64*1024, 64*1024);
    10351038
    10361039        ice->pcm_ds = pcm;
  • GPL/branches/alsa-resync1/alsa-kernel/pci/ice1712/revo.c

    r262 r348  
    129129        case VT1724_SUBDEVICE_REVOLUTION71:
    130130                ice->num_total_dacs = 8;
     131                ice->num_total_adcs = 4;
    131132                break;
    132133        default:
  • GPL/branches/alsa-resync1/alsa-kernel/pci/intel8x0.c

    r300 r348  
    108108MODULE_PARM(ac97_quirk, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
    109109MODULE_PARM_DESC(ac97_quirk, "AC'97 workaround for strange hardware.");
    110 MODULE_PARM_SYNTAX(ac97_quirk, SNDRV_ENABLED ",allows:{{-1,3}},dialog:list,default:-1");
     110MODULE_PARM_SYNTAX(ac97_quirk, SNDRV_ENABLED ",allows:{{-1,4}},dialog:list,default:-1");
    111111#ifdef SUPPORT_JOYSTICK
    112112MODULE_PARM(joystick, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
     
    862862
    863863    if ((status & chip->int_sta_mask) == 0) {
    864         static int err_count = 10;
    865864        if (status) {
    866865            /* ack */
     
    29822981        /* workaround for 440MX */
    29832982        if (chip->fix_nocache)
    2984                 fill_nocache(chip->bdbars, chip->bdbars_count * sizeof(u32) * ICH_MAX_FRAGS * 2, 1);
     2983                fill_nocache(chip->bdbars.area, chip->bdbars.bytes, 1);
    29852984    int_sta_masks = 0;
    29862985    for (i = 0; i < chip->bdbars_count; i++) {
     
    32373236    pci_read_config_word(pci, 0xe6, &val);
    32383237#ifdef SUPPORT_JOYSTICK
     3238        val &= ~0x100;
    32393239    if (joystick[dev]) {
    32403240        if (! request_region(ich_gameport.io, 8, "ICH gameport")) {
     
    32493249#endif
    32503250#ifdef SUPPORT_MIDI
     3251        val &= ~0x20;
    32513252    if (mpu_port[dev] > 0) {
    32523253        if (mpu_port[dev] == 0x300 || mpu_port[dev] == 0x330) {
  • GPL/branches/alsa-resync1/alsa-kernel/pci/korg1212/korg1212.c

    r290 r348  
    348348        struct resource *res_iomem2;
    349349
     350        struct snd_dma_device dma_dev;
     351
     352        struct snd_dma_buffer dma_dsp;
     353        struct snd_dma_buffer dma_play;
     354        struct snd_dma_buffer dma_rec;
     355        struct snd_dma_buffer dma_shared;
     356
    350357        u32 dspCodeSize;
    351         u32 dspMemPhy;          // DSP memory block handle (Physical Address)
    352         void * dspMemPtr;       //            block memory (Virtual Address)
    353358
    354359        u32 DataBufsSize;
     
    358363
    359364        KorgSharedBuffer * sharedBufferPtr;
     365
    360366        u32 RecDataPhy;
    361367        u32 PlayDataPhy;
     
    12391245        snd_korg1212_setCardState(korg1212, K1212_STATE_DSP_IN_PROCESS);
    12401246
    1241         memcpy(korg1212->dspMemPtr, dspCode, korg1212->dspCodeSize);
     1247        memcpy(korg1212->dma_dsp.area, dspCode, korg1212->dspCodeSize);
    12421248
    12431249        rc = snd_korg1212_Send1212Command(korg1212, K1212_DB_StartDSPDownload,
    1244                                      UpperWordSwap(korg1212->dspMemPhy),
     1250                                     UpperWordSwap(korg1212->dma_dsp.addr),
    12451251                                     0, 0, 0);
    12461252
     
    21352141        // free up memory resources used for the DSP download.
    21362142        // ----------------------------------------------------
    2137         if (korg1212->dspMemPtr) {
    2138                 snd_free_pci_pages(korg1212->pci, korg1212->dspCodeSize,
    2139                                    korg1212->dspMemPtr, (dma_addr_t)korg1212->dspMemPhy);
    2140                 korg1212->dspMemPhy = 0;
    2141                 korg1212->dspMemPtr = 0;
    2142                 korg1212->dspCodeSize = 0;
     2143        if (korg1212->dma_dsp.area) {
     2144                snd_dma_free_pages(&korg1212->dma_dev, &korg1212->dma_dsp);
     2145                korg1212->dma_dsp.area = NULL;
    21432146        }
    21442147
     
    21482151        // free up memory resources used for the Play/Rec Buffers
    21492152        // ------------------------------------------------------
    2150         if (korg1212->playDataBufsPtr) {
    2151                 snd_free_pci_pages(korg1212->pci, korg1212->DataBufsSize,
    2152                                    korg1212->playDataBufsPtr, (dma_addr_t)korg1212->PlayDataPhy);
    2153                 korg1212->PlayDataPhy = 0;
    2154                 korg1212->playDataBufsPtr = NULL;
    2155         }
    2156 
    2157         if (korg1212->recordDataBufsPtr) {
    2158                 snd_free_pci_pages(korg1212->pci, korg1212->DataBufsSize,
    2159                                    korg1212->recordDataBufsPtr, (dma_addr_t)korg1212->RecDataPhy);
    2160                 korg1212->RecDataPhy = 0;
    2161                 korg1212->recordDataBufsPtr = NULL;
     2153        if (korg1212->dma_play.area) {
     2154                snd_dma_free_pages(&korg1212->dma_dev, &korg1212->dma_play);
     2155                korg1212->dma_play.area = NULL;
     2156        }
     2157
     2158        if (korg1212->dma_rec.area) {
     2159                snd_dma_free_pages(&korg1212->dma_dev, &korg1212->dma_rec);
     2160                korg1212->dma_rec.area = NULL;
    21622161        }
    21632162
     
    21672166        // free up memory resources used for the Shared Buffers
    21682167        // ----------------------------------------------------
    2169         if (korg1212->sharedBufferPtr) {
    2170                 snd_free_pci_pages(korg1212->pci, (u32) sizeof(KorgSharedBuffer),
    2171                                    korg1212->sharedBufferPtr, (dma_addr_t)korg1212->sharedBufferPhy);
    2172                 korg1212->sharedBufferPhy = 0;
    2173                 korg1212->sharedBufferPtr = NULL;
     2168        if (korg1212->dma_shared.area) {
     2169                snd_dma_free_pages(&korg1212->dma_dev, &korg1212->dma_shared);
     2170                korg1212->dma_shared.area = NULL;
    21742171        }
    21752172       
     
    21942191        unsigned int i;
    21952192        unsigned ioport_size, iomem_size, iomem2_size;
    2196         dma_addr_t phys_addr;
    21972193        korg1212_t * korg1212;
    21982194
     
    23332329#endif
    23342330
    2335         korg1212->sharedBufferPtr = (KorgSharedBuffer *) snd_malloc_pci_pages(korg1212->pci, sizeof(KorgSharedBuffer), &phys_addr);
    2336         korg1212->sharedBufferPhy = (unsigned long)phys_addr;
    2337 
    2338         if (korg1212->sharedBufferPtr == NULL) {
     2331        memset(&korg1212->dma_dev, 0, sizeof(korg1212->dma_dev));
     2332        korg1212->dma_dev.type = SNDRV_DMA_TYPE_DEV;
     2333        korg1212->dma_dev.dev = snd_dma_pci_data(korg1212->pci);
     2334
     2335        if (snd_dma_alloc_pages(&korg1212->dma_dev, sizeof(KorgSharedBuffer), &korg1212->dma_shared) < 0) {
    23392336                snd_printk(KERN_ERR "can not allocate shared buffer memory (%Zd bytes)\n", sizeof(KorgSharedBuffer));
    23402337                return -ENOMEM;
    23412338        }
     2339        korg1212->sharedBufferPtr = (KorgSharedBuffer *)korg1212->dma_shared.area;
     2340        korg1212->sharedBufferPhy = korg1212->dma_shared.addr;
    23422341
    23432342#if K1212_DEBUG_LEVEL > 0
     
    23492348        korg1212->DataBufsSize = sizeof(KorgAudioBuffer) * kNumBuffers;
    23502349
    2351         korg1212->playDataBufsPtr = (KorgAudioBuffer *) snd_malloc_pci_pages(korg1212->pci, korg1212->DataBufsSize, &phys_addr);
    2352         korg1212->PlayDataPhy = (u32)phys_addr;
    2353 
    2354         if (korg1212->playDataBufsPtr == NULL) {
     2350        if (snd_dma_alloc_pages(&korg1212->dma_dev, korg1212->DataBufsSize, &korg1212->dma_play) < 0) {
    23552351                snd_printk(KERN_ERR "can not allocate play data buffer memory (%d bytes)\n", korg1212->DataBufsSize);
    23562352                return -ENOMEM;
    23572353        }
     2354        korg1212->playDataBufsPtr = (KorgAudioBuffer *)korg1212->dma_play.area;
     2355        korg1212->PlayDataPhy = korg1212->dma_play.addr;
    23582356
    23592357#if K1212_DEBUG_LEVEL > 0
     
    23622360#endif
    23632361
    2364         korg1212->recordDataBufsPtr = (KorgAudioBuffer *) snd_malloc_pci_pages(korg1212->pci, korg1212->DataBufsSize, &phys_addr);
    2365         korg1212->RecDataPhy = (u32)phys_addr;
    2366 
    2367         if (korg1212->recordDataBufsPtr == NULL) {
     2362        if (snd_dma_alloc_pages(&korg1212->dma_dev, korg1212->DataBufsSize, &korg1212->dma_rec) < 0) {
    23682363                snd_printk(KERN_ERR "can not allocate record data buffer memory (%d bytes)\n", korg1212->DataBufsSize);
    23692364                return -ENOMEM;
    23702365        }
     2366        korg1212->recordDataBufsPtr = (KorgAudioBuffer *)korg1212->dma_rec.area;
     2367        korg1212->RecDataPhy = korg1212->dma_rec.addr;
    23712368
    23722369#if K1212_DEBUG_LEVEL > 0
    23732370        K1212_DEBUG_PRINTK("K1212_DEBUG: Record Data Area = 0x%p (0x%08x), %d bytes\n",
    2374                 korg1212->recordDataBufsPtr, korg1212->RecDataPhy, korg1212->DataBufsSize);
     2371                korg1212->recordDataBufsPtr, korg1212->RecDataBufsPhy, korg1212->DataBufsSize);
    23752372#endif
    23762373
     
    23932390                offsetof(KorgSharedBuffer, AdatTimeCode);
    23942391
    2395         korg1212->dspMemPtr = snd_malloc_pci_pages(korg1212->pci, korg1212->dspCodeSize, &phys_addr);
    2396         korg1212->dspMemPhy = (u32)phys_addr;
    2397 
    2398         if (korg1212->dspMemPtr == NULL) {
     2392        if (snd_dma_alloc_pages(&korg1212->dma_dev, korg1212->dspCodeSize, &korg1212->dma_dsp) < 0) {
    23992393                snd_printk(KERN_ERR "can not allocate dsp code memory (%d bytes)\n", korg1212->dspCodeSize);
    24002394                return -ENOMEM;
     
    24032397#if K1212_DEBUG_LEVEL > 0
    24042398        K1212_DEBUG_PRINTK("K1212_DEBUG: DSP Code area = 0x%p (0x%08x) %d bytes [%s]\n",
    2405                    korg1212->dspMemPtr, korg1212->dspMemPhy, korg1212->dspCodeSize,
     2399                   korg1212->dma_dsp.area, korg1212->dma_dsp.addr, korg1212->dspCodeSize,
    24062400                   stateName[korg1212->cardState]);
    24072401#endif
     
    24262420               "RoutingTablePhy = %08x L[%08x]\n"
    24272421               "AdatTimeCodePhy = %08x L[%08x]\n",
    2428                korg1212->dspMemPhy,       UpperWordSwap(korg1212->dspMemPhy),
     2422               korg1212->dma_dsp.addr,    UpperWordSwap(korg1212->dma_dsp.addr),
    24292423               korg1212->PlayDataPhy,     LowerWordSwap(korg1212->PlayDataPhy),
    24302424               korg1212->RecDataPhy,      LowerWordSwap(korg1212->RecDataPhy),
  • GPL/branches/alsa-resync1/alsa-kernel/pci/rme96.c

    r290 r348  
    17191719        rme96->spdif_pcm->info_flags = 0;
    17201720
    1721         snd_pcm_lib_preallocate_pages_for_all(rme96->spdif_pcm, RME96_BUFFER_SIZE, RME96_BUFFER_SIZE, GFP_KERNEL);
     1721        snd_pcm_lib_preallocate_pages_for_all(rme96->spdif_pcm,
     1722                                              SNDRV_DMA_TYPE_CONTINUOUS,
     1723                                              snd_dma_continuous_data(GFP_KERNEL),
     1724                                              RME96_BUFFER_SIZE,
     1725                                              RME96_BUFFER_SIZE);
    17221726
    17231727        /* set up ALSA pcm device for ADAT */
     
    17391743                rme96->adat_pcm->info_flags = 0;
    17401744
    1741                 snd_pcm_lib_preallocate_pages_for_all(rme96->adat_pcm, RME96_BUFFER_SIZE, RME96_BUFFER_SIZE, GFP_KERNEL);
     1745                snd_pcm_lib_preallocate_pages_for_all(rme96->adat_pcm,
     1746                                                      SNDRV_DMA_TYPE_CONTINUOUS,
     1747                                                      snd_dma_continuous_data(GFP_KERNEL),
     1748                                                      RME96_BUFFER_SIZE,
     1749                                                      RME96_BUFFER_SIZE);
    17421750        }
    17431751
  • GPL/branches/alsa-resync1/alsa-kernel/pci/rme9652/hdsp.c

    r300 r348  
    570570        struct snd_dma_buffer dmbuf;
    571571
    572         snd_dma_device_pci(&pdev, pci, capture);
     572        memset(&pdev, 0, sizeof(pdev));
     573        pdev.type = SNDRV_DMA_TYPE_DEV;
     574        pdev.dev = snd_dma_pci_data(pci);
     575        pdev.id = capture;
    573576        dmbuf.bytes = 0;
    574577        if (! snd_dma_get_reserved(&pdev, &dmbuf)) {
     
    583586static void snd_hammerfall_free_buffer(struct pci_dev *pci, size_t size, void *ptr, dma_addr_t addr, int capture)
    584587{
    585         struct snd_dma_device dev;
    586         snd_dma_device_pci(&dev, pci, capture);
    587         snd_dma_free_reserved(&dev);
     588        struct snd_dma_device pdev;
     589
     590        memset(&pdev, 0, sizeof(pdev));
     591        pdev.type = SNDRV_DMA_TYPE_DEV;
     592        pdev.dev = snd_dma_pci_data(pci);
     593        pdev.id = capture;
     594        snd_dma_free_reserved(&pdev);
    588595}
    589596
  • GPL/branches/alsa-resync1/alsa-kernel/pci/rme9652/rme9652.c

    r290 r348  
    315315        struct snd_dma_buffer dmbuf;
    316316
    317         snd_dma_device_pci(&pdev, pci, capture);
     317        memset(&pdev, 0, sizeof(pdev));
     318        pdev.type = SNDRV_DMA_TYPE_DEV;
     319        pdev.dev = snd_dma_pci_data(pci);
     320        pdev.id = capture;
    318321        dmbuf.bytes = 0;
    319322        if (! snd_dma_get_reserved(&pdev, &dmbuf)) {
     
    328331static void snd_hammerfall_free_buffer(struct pci_dev *pci, size_t size, void *ptr, dma_addr_t addr, int capture)
    329332{
    330         struct snd_dma_device dev;
    331         snd_dma_device_pci(&dev, pci, capture);
    332         snd_dma_free_reserved(&dev);
     333        struct snd_dma_device pdev;
     334
     335        memset(&pdev, 0, sizeof(pdev));
     336        pdev.type = SNDRV_DMA_TYPE_DEV;
     337        pdev.dev = snd_dma_pci_data(pci);
     338        pdev.id = capture;
     339        snd_dma_free_reserved(&pdev);
    333340}
    334341
  • GPL/branches/alsa-resync1/alsa-kernel/pci/sonicvibes.c

    r290 r348  
    891891        sonic->pcm = pcm;
    892892
    893         snd_pcm_lib_preallocate_pci_pages_for_all(sonic->pci, pcm, 64*1024, 128*1024);
     893        snd_pcm_lib_preallocate_pages_for_all(pcm, SNDRV_DMA_TYPE_DEV,
     894                                              snd_dma_pci_data(sonic->pci), 64*1024, 128*1024);
    894895
    895896        if (rpcm)
  • GPL/branches/alsa-resync1/alsa-kernel/pci/trident/trident_main.c

    r290 r348  
    35803580    }
    35813581    trident->irq = pci->irq;
     3582
     3583        memset(&trident->dma_dev, 0, sizeof(trident->dma_dev));
     3584        trident->dma_dev.type = SNDRV_DMA_TYPE_DEV;
     3585        trident->dma_dev.dev = snd_dma_pci_data(pci);
    35823586
    35833587    /* allocate 16k-aligned TLB for NX cards */
  • GPL/branches/alsa-resync1/alsa-kernel/pci/trident/trident_memory.c

    r210 r348  
    8080    __set_tlb_bus(trident, page, (unsigned long)trident->tlb.silent_page.area, trident->tlb.silent_page.addr);
    8181    __set_tlb_bus(trident, page+1, (unsigned long)trident->tlb.silent_page.area, trident->tlb.silent_page.addr);
    82 //      __set_tlb_bus(trident, page, (unsigned long)trident->tlb.silent_page, trident->tlb.silent_page_dmaaddr);
    83 //      __set_tlb_bus(trident, page+1, (unsigned long)trident->tlb.silent_page, trident->tlb.silent_page_dmaaddr);
    8482}
    8583
     
    116114        for (i = 0; i < UNIT_PAGES; i++, page++)
    117115            __set_tlb_bus(trident, page, (unsigned long)trident->tlb.silent_page.area, trident->tlb.silent_page.addr);
    118             //    __set_tlb_bus(trident, page, (unsigned long)trident->tlb.silent_page, trident->tlb.silent_page_dmaaddr);
    119116}
    120117
Note: See TracChangeset for help on using the changeset viewer.