Changeset 83
- Timestamp:
- Sep 25, 2006, 11:09:35 PM (19 years ago)
- Location:
- GPL/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
GPL/trunk/alsa-kernel/pci/ymfpci/ymfpci_main.c
r35 r83 1274 1274 } 1275 1275 1276 static s nd_kcontrol_new_tsnd_ymfpci_spdif_default __devinitdata =1277 { 1278 SNDRV_CTL_ELEM_IFACE_PCM,0,0,1279 SNDRV_CTL_NAME_IEC958("",PLAYBACK,DEFAULT),0,0,0,1280 1281 1282 snd_ymfpci_spdif_default_put,0 1276 static struct snd_kcontrol_new snd_ymfpci_spdif_default __devinitdata = 1277 { 1278 .iface = SNDRV_CTL_ELEM_IFACE_PCM, 1279 .name = SNDRV_CTL_NAME_IEC958("",PLAYBACK,DEFAULT), 1280 .info = snd_ymfpci_spdif_default_info, 1281 .get = snd_ymfpci_spdif_default_get, 1282 .put = snd_ymfpci_spdif_default_put 1283 1283 }; 1284 1284 … … 1302 1302 } 1303 1303 1304 static s nd_kcontrol_new_tsnd_ymfpci_spdif_mask __devinitdata =1305 { 1306 SNDRV_CTL_ELEM_IFACE_MIXER,0,0,1307 SNDRV_CTL_NAME_IEC958("",PLAYBACK,CON_MASK),0,1308 SNDRV_CTL_ELEM_ACCESS_READ,0,1309 1310 snd_ymfpci_spdif_mask_get,0,0 1304 static struct snd_kcontrol_new snd_ymfpci_spdif_mask __devinitdata = 1305 { 1306 .access = SNDRV_CTL_ELEM_ACCESS_READ, 1307 .iface = SNDRV_CTL_ELEM_IFACE_PCM, 1308 .name = SNDRV_CTL_NAME_IEC958("",PLAYBACK,CON_MASK), 1309 .info = snd_ymfpci_spdif_mask_info, 1310 .get = snd_ymfpci_spdif_mask_get, 1311 1311 }; 1312 1312 1313 1313 1314 static int snd_ymfpci_spdif_stream_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo) … … 1348 1349 } 1349 1350 1350 static s nd_kcontrol_new_tsnd_ymfpci_spdif_stream __devinitdata =1351 { 1352 SNDRV_CTL_ELEM_IFACE_PCM,0,0,1353 SNDRV_CTL_NAME_IEC958("",PLAYBACK,PCM_STREAM),0,1354 SNDRV_CTL_ELEM_ACCESS_READWRITE | SNDRV_CTL_ELEM_ACCESS_INACTIVE,0,1355 1356 1357 snd_ymfpci_spdif_stream_put,0 1351 static struct snd_kcontrol_new snd_ymfpci_spdif_stream __devinitdata = 1352 { 1353 .access = SNDRV_CTL_ELEM_ACCESS_READWRITE | SNDRV_CTL_ELEM_ACCESS_INACTIVE, 1354 .iface = SNDRV_CTL_ELEM_IFACE_PCM, 1355 .name = SNDRV_CTL_NAME_IEC958("",PLAYBACK,PCM_STREAM), 1356 .info = snd_ymfpci_spdif_stream_info, 1357 .get = snd_ymfpci_spdif_stream_get, 1358 .put = snd_ymfpci_spdif_stream_put 1358 1359 }; 1360 1359 1361 1360 1362 static int snd_ymfpci_drec_source_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *info) … … 1402 1404 } 1403 1405 1404 static snd_kcontrol_new_t snd_ymfpci_drec_source __devinitdata = { 1405 /* .iface = */ SNDRV_CTL_ELEM_IFACE_MIXER, 0,0, 1406 /* .name = */ "Direct Recording Source", 0, 1407 /* .access = */ SNDRV_CTL_ELEM_ACCESS_READWRITE, 0, 1408 /* .info = */ snd_ymfpci_drec_source_info, 1409 /* .get = */ snd_ymfpci_drec_source_get, 1410 /* .put = */ snd_ymfpci_drec_source_put, 1411 0 1406 static struct snd_kcontrol_new snd_ymfpci_drec_source __devinitdata = { 1407 .access = SNDRV_CTL_ELEM_ACCESS_READWRITE, 1408 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 1409 .name = "Direct Recording Source", 1410 .info = snd_ymfpci_drec_source_info, 1411 .get = snd_ymfpci_drec_source_get, 1412 .put = snd_ymfpci_drec_source_put 1412 1413 }; 1414 1413 1415 /* 1414 1416 * Mixer controls 1415 1417 */ 1416 1418 1419 #define YMFPCI_SINGLE(xname, xindex, reg, shift) \ 1420 { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, .index = xindex, \ 1421 .info = snd_ymfpci_info_single, \ 1422 .get = snd_ymfpci_get_single, .put = snd_ymfpci_put_single, \ 1423 .private_value = ((reg) | ((shift) << 16)) } 1424 1425 #if 0 1417 1426 #define YMFPCI_SINGLE(xname, xindex, reg) \ 1418 1427 { SNDRV_CTL_ELEM_IFACE_MIXER, 0,0, xname, xindex, \ … … 1421 1430 reg } 1422 1431 1432 #endif 1423 1433 static int snd_ymfpci_info_single(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo) 1424 1434 { … … 1481 1491 1482 1492 #define YMFPCI_DOUBLE(xname, xindex, reg) \ 1483 { SNDRV_CTL_ELEM_IFACE_MIXER, 0,0, xname,xindex, \1484 0, 0,snd_ymfpci_info_double, \1485 snd_ymfpci_get_double,snd_ymfpci_put_double, \1486 1493 { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, .index = xindex, \ 1494 .info = snd_ymfpci_info_double, \ 1495 .get = snd_ymfpci_get_double, .put = snd_ymfpci_put_double, \ 1496 .private_value = reg } 1487 1497 1488 1498 static int snd_ymfpci_info_double(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo) … … 1577 1587 } 1578 1588 1579 1580 #define YMFPCI_CONTROLS (sizeof(snd_ymfpci_controls)/sizeof(snd_kcontrol_new_t)) 1581 1582 static snd_kcontrol_new_t snd_ymfpci_controls[] __devinitdata = { 1583 YMFPCI_DOUBLE("Wave Playback Volume", 0, YDSXGR_NATIVEDACOUTVOL), 1584 YMFPCI_DOUBLE("Wave Capture Volume", 0, YDSXGR_NATIVEDACLOOPVOL), 1585 YMFPCI_DOUBLE("Digital Capture Volume", 0, YDSXGR_NATIVEDACINVOL), 1586 YMFPCI_DOUBLE("Digital Capture Volume", 1, YDSXGR_NATIVEADCINVOL), 1587 YMFPCI_DOUBLE("ADC Playback Volume", 0, YDSXGR_PRIADCOUTVOL), 1588 YMFPCI_DOUBLE("ADC Capture Volume", 0, YDSXGR_PRIADCLOOPVOL), 1589 YMFPCI_DOUBLE("ADC Playback Volume", 1, YDSXGR_SECADCOUTVOL), 1590 YMFPCI_DOUBLE("ADC Capture Volume", 1, YDSXGR_SECADCLOOPVOL), 1591 YMFPCI_DOUBLE("FM Legacy Volume", 0, YDSXGR_LEGACYOUTVOL), 1592 YMFPCI_DOUBLE(SNDRV_CTL_NAME_IEC958("AC97 ", PLAYBACK,VOLUME), 0, YDSXGR_ZVOUTVOL), 1593 YMFPCI_DOUBLE(SNDRV_CTL_NAME_IEC958("", CAPTURE,VOLUME), 0, YDSXGR_ZVLOOPVOL), 1594 YMFPCI_DOUBLE(SNDRV_CTL_NAME_IEC958("AC97 ",PLAYBACK,VOLUME), 1, YDSXGR_SPDIFOUTVOL), 1595 YMFPCI_DOUBLE(SNDRV_CTL_NAME_IEC958("",CAPTURE,VOLUME), 1, YDSXGR_SPDIFLOOPVOL), 1596 YMFPCI_SINGLE(SNDRV_CTL_NAME_IEC958("",PLAYBACK,SWITCH), 0, YDSXGR_SPDIFOUTCTRL), 1597 YMFPCI_SINGLE(SNDRV_CTL_NAME_IEC958("",CAPTURE,SWITCH), 0, YDSXGR_SPDIFINCTRL), 1598 { 1599 /*.iface = */SNDRV_CTL_ELEM_IFACE_MIXER,0,0, 1600 /*.name = */"4ch Duplication",0,0,0, 1601 /*.info = */snd_ymfpci_info_dup4ch, 1602 /*.get = */snd_ymfpci_get_dup4ch, 1603 /*.put = */snd_ymfpci_put_dup4ch, 1604 }, 1589 static struct snd_kcontrol_new snd_ymfpci_controls[] __devinitdata = { 1590 YMFPCI_DOUBLE("Wave Playback Volume", 0, YDSXGR_NATIVEDACOUTVOL), 1591 YMFPCI_DOUBLE("Wave Capture Volume", 0, YDSXGR_NATIVEDACLOOPVOL), 1592 YMFPCI_DOUBLE("Digital Capture Volume", 0, YDSXGR_NATIVEDACINVOL), 1593 YMFPCI_DOUBLE("Digital Capture Volume", 1, YDSXGR_NATIVEADCINVOL), 1594 YMFPCI_DOUBLE("ADC Playback Volume", 0, YDSXGR_PRIADCOUTVOL), 1595 YMFPCI_DOUBLE("ADC Capture Volume", 0, YDSXGR_PRIADCLOOPVOL), 1596 YMFPCI_DOUBLE("ADC Playback Volume", 1, YDSXGR_SECADCOUTVOL), 1597 YMFPCI_DOUBLE("ADC Capture Volume", 1, YDSXGR_SECADCLOOPVOL), 1598 YMFPCI_DOUBLE("FM Legacy Volume", 0, YDSXGR_LEGACYOUTVOL), 1599 YMFPCI_DOUBLE(SNDRV_CTL_NAME_IEC958("AC97 ", PLAYBACK,VOLUME), 0, YDSXGR_ZVOUTVOL), 1600 YMFPCI_DOUBLE(SNDRV_CTL_NAME_IEC958("", CAPTURE,VOLUME), 0, YDSXGR_ZVLOOPVOL), 1601 YMFPCI_DOUBLE(SNDRV_CTL_NAME_IEC958("AC97 ",PLAYBACK,VOLUME), 1, YDSXGR_SPDIFOUTVOL), 1602 YMFPCI_DOUBLE(SNDRV_CTL_NAME_IEC958("",CAPTURE,VOLUME), 1, YDSXGR_SPDIFLOOPVOL), 1603 YMFPCI_SINGLE(SNDRV_CTL_NAME_IEC958("",PLAYBACK,SWITCH), 0, YDSXGR_SPDIFOUTCTRL, 0), 1604 YMFPCI_SINGLE(SNDRV_CTL_NAME_IEC958("",CAPTURE,SWITCH), 0, YDSXGR_SPDIFINCTRL, 0), 1605 YMFPCI_SINGLE(SNDRV_CTL_NAME_IEC958("Loop",NONE,NONE), 0, YDSXGR_SPDIFINCTRL, 4), 1606 { 1607 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 1608 .name = "4ch Duplication", 1609 .info = snd_ymfpci_info_dup4ch, 1610 .get = snd_ymfpci_get_dup4ch, 1611 .put = snd_ymfpci_put_dup4ch, 1612 }, 1605 1613 }; 1606 1614 … … 1677 1685 } 1678 1686 1679 static s nd_kcontrol_new_tsnd_ymfpci_rear_shared __devinitdata = {1680 /*.iface = */SNDRV_CTL_ELEM_IFACE_MIXER,0,0,1681 /*.name = */"Shared Rear/Line-In Switch",0,0,0,1682 /*.info = */snd_ymfpci_gpio_sw_info,1683 /*.get = */snd_ymfpci_gpio_sw_get,1684 /*.put = */snd_ymfpci_gpio_sw_put,1685 /*.private_value = */2,1687 static struct snd_kcontrol_new snd_ymfpci_rear_shared __devinitdata = { 1688 .name = "Shared Rear/Line-In Switch", 1689 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 1690 .info = snd_ymfpci_gpio_sw_info, 1691 .get = snd_ymfpci_gpio_sw_get, 1692 .put = snd_ymfpci_gpio_sw_put, 1693 .private_value = 2, 1686 1694 }; 1687 1695 … … 1769 1777 unsigned int idx; 1770 1778 int err; 1771 static ac97_bus_ops_t ops = { 1772 0,snd_ymfpci_codec_write, 1773 snd_ymfpci_codec_read,0,0 1779 1780 static struct snd_ac97_bus_ops ops = { 1781 .write = snd_ymfpci_codec_write, 1782 .read = snd_ymfpci_codec_read, 1774 1783 }; 1775 1784 if ((err = snd_ac97_bus(chip->card, 0, &ops, chip, &chip->ac97_bus)) < 0) … … 1783 1792 return err; 1784 1793 1785 for (idx = 0; idx < YMFPCI_CONTROLS; idx++) { 1794 1795 for (idx = 0; idx < ARRAY_SIZE(snd_ymfpci_controls); idx++) { 1786 1796 if ((err = snd_ctl_add(chip->card, snd_ctl_new1(&snd_ymfpci_controls[idx], chip))) < 0) 1787 1797 return err; … … 2276 2286 ymfpci_t *chip; 2277 2287 int err; 2278 #ifdef TARGET_OS2 2279 static s nd_device_ops_tops = {2280 snd_ymfpci_dev_free,0,0,02288 2289 static struct snd_device_ops ops = { 2290 .dev_free = snd_ymfpci_dev_free, 2281 2291 }; 2282 #else 2283 static snd_device_ops_t ops = { 2284 dev_free: snd_ymfpci_dev_free, 2285 }; 2286 #endif 2292 2287 2293 *rchip = NULL; 2288 2294 … … 2306 2312 2307 2313 // vladest resource workaround 2314 #if 0 2308 2315 if (chip->device_id >= 0x0010) 2309 2316 chip->reg_area_phys = pci_resource_start(pci, 2); 2310 2317 else 2318 #endif 2311 2319 chip->reg_area_phys = pci_resource_start(pci, 0); 2312 2320 2313 chip->reg_area_virt = (unsigned long)ioremap_nocache(chip->reg_area_phys, 0x8000);2321 chip->reg_area_virt = (unsigned long)ioremap_nocache(chip->reg_area_phys, /*0x8000*/pci_resource_len(pci, 0)); 2314 2322 pci_set_master(pci); 2315 2323 2316 if ((chip->res_reg_area = request_mem_region(chip->reg_area_phys, 0x8000, "YMFPCI")) == NULL) {2317 snd_printk("unable to grab memory region 0x%lx-0x%lx\n", chip->reg_area_phys, chip->reg_area_phys + 0x8000- 1);2324 if ((chip->res_reg_area = request_mem_region(chip->reg_area_phys, /*0x8000*/pci_resource_len(pci, 0), "YMFPCI")) == NULL) { 2325 snd_printk("unable to grab memory region 0x%lx-0x%lx\n", chip->reg_area_phys, chip->reg_area_phys + /*0x8000*/pci_resource_len(pci, 0) - 1); 2318 2326 snd_ymfpci_free(chip); 2319 2327 return -EBUSY; -
GPL/trunk/include/version.mak
r82 r83 11 11 BLDLVL_REVISION = 1.1 12 12 BLDLVL_FILEVER = 4 13 BLDLVL_DATETIME = 10.09.2006 17:47:5013 BLDLVL_DATETIME = 25.09.2006 22:56:59 14 14 BLDLVL_MACHINE = VLAD
Note:
See TracChangeset
for help on using the changeset viewer.