diff options
Diffstat (limited to 'sound/pci/ymfpci/ymfpci_main.c')
-rw-r--r-- | sound/pci/ymfpci/ymfpci_main.c | 50 |
1 files changed, 26 insertions, 24 deletions
diff --git a/sound/pci/ymfpci/ymfpci_main.c b/sound/pci/ymfpci/ymfpci_main.c index 3a6f03f9b02f..22056c50fe39 100644 --- a/sound/pci/ymfpci/ymfpci_main.c +++ b/sound/pci/ymfpci/ymfpci_main.c | |||
@@ -25,7 +25,6 @@ | |||
25 | #include <linux/pci.h> | 25 | #include <linux/pci.h> |
26 | #include <linux/sched.h> | 26 | #include <linux/sched.h> |
27 | #include <linux/slab.h> | 27 | #include <linux/slab.h> |
28 | #include <linux/vmalloc.h> | ||
29 | #include <linux/mutex.h> | 28 | #include <linux/mutex.h> |
30 | #include <linux/module.h> | 29 | #include <linux/module.h> |
31 | 30 | ||
@@ -598,7 +597,7 @@ static void snd_ymfpci_pcm_init_voice(struct snd_ymfpci_pcm *ypcm, unsigned int | |||
598 | } | 597 | } |
599 | } | 598 | } |
600 | 599 | ||
601 | static int __devinit snd_ymfpci_ac3_init(struct snd_ymfpci *chip) | 600 | static int snd_ymfpci_ac3_init(struct snd_ymfpci *chip) |
602 | { | 601 | { |
603 | if (snd_dma_alloc_pages(SNDRV_DMA_TYPE_DEV, snd_dma_pci_data(chip->pci), | 602 | if (snd_dma_alloc_pages(SNDRV_DMA_TYPE_DEV, snd_dma_pci_data(chip->pci), |
604 | 4096, &chip->ac3_tmp_base) < 0) | 603 | 4096, &chip->ac3_tmp_base) < 0) |
@@ -1144,7 +1143,7 @@ static struct snd_pcm_ops snd_ymfpci_capture_rec_ops = { | |||
1144 | .pointer = snd_ymfpci_capture_pointer, | 1143 | .pointer = snd_ymfpci_capture_pointer, |
1145 | }; | 1144 | }; |
1146 | 1145 | ||
1147 | int __devinit snd_ymfpci_pcm(struct snd_ymfpci *chip, int device, struct snd_pcm ** rpcm) | 1146 | int snd_ymfpci_pcm(struct snd_ymfpci *chip, int device, struct snd_pcm **rpcm) |
1148 | { | 1147 | { |
1149 | struct snd_pcm *pcm; | 1148 | struct snd_pcm *pcm; |
1150 | int err; | 1149 | int err; |
@@ -1187,7 +1186,7 @@ static struct snd_pcm_ops snd_ymfpci_capture_ac97_ops = { | |||
1187 | .pointer = snd_ymfpci_capture_pointer, | 1186 | .pointer = snd_ymfpci_capture_pointer, |
1188 | }; | 1187 | }; |
1189 | 1188 | ||
1190 | int __devinit snd_ymfpci_pcm2(struct snd_ymfpci *chip, int device, struct snd_pcm ** rpcm) | 1189 | int snd_ymfpci_pcm2(struct snd_ymfpci *chip, int device, struct snd_pcm **rpcm) |
1191 | { | 1190 | { |
1192 | struct snd_pcm *pcm; | 1191 | struct snd_pcm *pcm; |
1193 | int err; | 1192 | int err; |
@@ -1225,7 +1224,8 @@ static struct snd_pcm_ops snd_ymfpci_playback_spdif_ops = { | |||
1225 | .pointer = snd_ymfpci_playback_pointer, | 1224 | .pointer = snd_ymfpci_playback_pointer, |
1226 | }; | 1225 | }; |
1227 | 1226 | ||
1228 | int __devinit snd_ymfpci_pcm_spdif(struct snd_ymfpci *chip, int device, struct snd_pcm ** rpcm) | 1227 | int snd_ymfpci_pcm_spdif(struct snd_ymfpci *chip, int device, |
1228 | struct snd_pcm **rpcm) | ||
1229 | { | 1229 | { |
1230 | struct snd_pcm *pcm; | 1230 | struct snd_pcm *pcm; |
1231 | int err; | 1231 | int err; |
@@ -1270,7 +1270,8 @@ static const struct snd_pcm_chmap_elem surround_map[] = { | |||
1270 | { } | 1270 | { } |
1271 | }; | 1271 | }; |
1272 | 1272 | ||
1273 | int __devinit snd_ymfpci_pcm_4ch(struct snd_ymfpci *chip, int device, struct snd_pcm ** rpcm) | 1273 | int snd_ymfpci_pcm_4ch(struct snd_ymfpci *chip, int device, |
1274 | struct snd_pcm **rpcm) | ||
1274 | { | 1275 | { |
1275 | struct snd_pcm *pcm; | 1276 | struct snd_pcm *pcm; |
1276 | int err; | 1277 | int err; |
@@ -1339,7 +1340,7 @@ static int snd_ymfpci_spdif_default_put(struct snd_kcontrol *kcontrol, | |||
1339 | return change; | 1340 | return change; |
1340 | } | 1341 | } |
1341 | 1342 | ||
1342 | static struct snd_kcontrol_new snd_ymfpci_spdif_default __devinitdata = | 1343 | static struct snd_kcontrol_new snd_ymfpci_spdif_default = |
1343 | { | 1344 | { |
1344 | .iface = SNDRV_CTL_ELEM_IFACE_PCM, | 1345 | .iface = SNDRV_CTL_ELEM_IFACE_PCM, |
1345 | .name = SNDRV_CTL_NAME_IEC958("",PLAYBACK,DEFAULT), | 1346 | .name = SNDRV_CTL_NAME_IEC958("",PLAYBACK,DEFAULT), |
@@ -1367,7 +1368,7 @@ static int snd_ymfpci_spdif_mask_get(struct snd_kcontrol *kcontrol, | |||
1367 | return 0; | 1368 | return 0; |
1368 | } | 1369 | } |
1369 | 1370 | ||
1370 | static struct snd_kcontrol_new snd_ymfpci_spdif_mask __devinitdata = | 1371 | static struct snd_kcontrol_new snd_ymfpci_spdif_mask = |
1371 | { | 1372 | { |
1372 | .access = SNDRV_CTL_ELEM_ACCESS_READ, | 1373 | .access = SNDRV_CTL_ELEM_ACCESS_READ, |
1373 | .iface = SNDRV_CTL_ELEM_IFACE_PCM, | 1374 | .iface = SNDRV_CTL_ELEM_IFACE_PCM, |
@@ -1414,7 +1415,7 @@ static int snd_ymfpci_spdif_stream_put(struct snd_kcontrol *kcontrol, | |||
1414 | return change; | 1415 | return change; |
1415 | } | 1416 | } |
1416 | 1417 | ||
1417 | static struct snd_kcontrol_new snd_ymfpci_spdif_stream __devinitdata = | 1418 | static struct snd_kcontrol_new snd_ymfpci_spdif_stream = |
1418 | { | 1419 | { |
1419 | .access = SNDRV_CTL_ELEM_ACCESS_READWRITE | SNDRV_CTL_ELEM_ACCESS_INACTIVE, | 1420 | .access = SNDRV_CTL_ELEM_ACCESS_READWRITE | SNDRV_CTL_ELEM_ACCESS_INACTIVE, |
1420 | .iface = SNDRV_CTL_ELEM_IFACE_PCM, | 1421 | .iface = SNDRV_CTL_ELEM_IFACE_PCM, |
@@ -1462,7 +1463,7 @@ static int snd_ymfpci_drec_source_put(struct snd_kcontrol *kcontrol, struct snd_ | |||
1462 | return reg != old_reg; | 1463 | return reg != old_reg; |
1463 | } | 1464 | } |
1464 | 1465 | ||
1465 | static struct snd_kcontrol_new snd_ymfpci_drec_source __devinitdata = { | 1466 | static struct snd_kcontrol_new snd_ymfpci_drec_source = { |
1466 | .access = SNDRV_CTL_ELEM_ACCESS_READWRITE, | 1467 | .access = SNDRV_CTL_ELEM_ACCESS_READWRITE, |
1467 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, | 1468 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, |
1468 | .name = "Direct Recording Source", | 1469 | .name = "Direct Recording Source", |
@@ -1632,7 +1633,7 @@ static int snd_ymfpci_put_dup4ch(struct snd_kcontrol *kcontrol, struct snd_ctl_e | |||
1632 | return change; | 1633 | return change; |
1633 | } | 1634 | } |
1634 | 1635 | ||
1635 | static struct snd_kcontrol_new snd_ymfpci_dup4ch __devinitdata = { | 1636 | static struct snd_kcontrol_new snd_ymfpci_dup4ch = { |
1636 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, | 1637 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, |
1637 | .name = "4ch Duplication", | 1638 | .name = "4ch Duplication", |
1638 | .access = SNDRV_CTL_ELEM_ACCESS_READWRITE, | 1639 | .access = SNDRV_CTL_ELEM_ACCESS_READWRITE, |
@@ -1641,7 +1642,7 @@ static struct snd_kcontrol_new snd_ymfpci_dup4ch __devinitdata = { | |||
1641 | .put = snd_ymfpci_put_dup4ch, | 1642 | .put = snd_ymfpci_put_dup4ch, |
1642 | }; | 1643 | }; |
1643 | 1644 | ||
1644 | static struct snd_kcontrol_new snd_ymfpci_controls[] __devinitdata = { | 1645 | static struct snd_kcontrol_new snd_ymfpci_controls[] = { |
1645 | { | 1646 | { |
1646 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, | 1647 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, |
1647 | .name = "Wave Playback Volume", | 1648 | .name = "Wave Playback Volume", |
@@ -1735,7 +1736,7 @@ static int snd_ymfpci_gpio_sw_put(struct snd_kcontrol *kcontrol, struct snd_ctl_ | |||
1735 | return 0; | 1736 | return 0; |
1736 | } | 1737 | } |
1737 | 1738 | ||
1738 | static struct snd_kcontrol_new snd_ymfpci_rear_shared __devinitdata = { | 1739 | static struct snd_kcontrol_new snd_ymfpci_rear_shared = { |
1739 | .name = "Shared Rear/Line-In Switch", | 1740 | .name = "Shared Rear/Line-In Switch", |
1740 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, | 1741 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, |
1741 | .info = snd_ymfpci_gpio_sw_info, | 1742 | .info = snd_ymfpci_gpio_sw_info, |
@@ -1799,7 +1800,7 @@ static int snd_ymfpci_pcm_vol_put(struct snd_kcontrol *kcontrol, | |||
1799 | return 0; | 1800 | return 0; |
1800 | } | 1801 | } |
1801 | 1802 | ||
1802 | static struct snd_kcontrol_new snd_ymfpci_pcm_volume __devinitdata = { | 1803 | static struct snd_kcontrol_new snd_ymfpci_pcm_volume = { |
1803 | .iface = SNDRV_CTL_ELEM_IFACE_PCM, | 1804 | .iface = SNDRV_CTL_ELEM_IFACE_PCM, |
1804 | .name = "PCM Playback Volume", | 1805 | .name = "PCM Playback Volume", |
1805 | .access = SNDRV_CTL_ELEM_ACCESS_READWRITE | | 1806 | .access = SNDRV_CTL_ELEM_ACCESS_READWRITE | |
@@ -1826,7 +1827,7 @@ static void snd_ymfpci_mixer_free_ac97(struct snd_ac97 *ac97) | |||
1826 | chip->ac97 = NULL; | 1827 | chip->ac97 = NULL; |
1827 | } | 1828 | } |
1828 | 1829 | ||
1829 | int __devinit snd_ymfpci_mixer(struct snd_ymfpci *chip, int rear_switch) | 1830 | int snd_ymfpci_mixer(struct snd_ymfpci *chip, int rear_switch) |
1830 | { | 1831 | { |
1831 | struct snd_ac97_template ac97; | 1832 | struct snd_ac97_template ac97; |
1832 | struct snd_kcontrol *kctl; | 1833 | struct snd_kcontrol *kctl; |
@@ -1970,7 +1971,7 @@ static struct snd_timer_hardware snd_ymfpci_timer_hw = { | |||
1970 | .precise_resolution = snd_ymfpci_timer_precise_resolution, | 1971 | .precise_resolution = snd_ymfpci_timer_precise_resolution, |
1971 | }; | 1972 | }; |
1972 | 1973 | ||
1973 | int __devinit snd_ymfpci_timer(struct snd_ymfpci *chip, int device) | 1974 | int snd_ymfpci_timer(struct snd_ymfpci *chip, int device) |
1974 | { | 1975 | { |
1975 | struct snd_timer *timer = NULL; | 1976 | struct snd_timer *timer = NULL; |
1976 | struct snd_timer_id tid; | 1977 | struct snd_timer_id tid; |
@@ -2006,7 +2007,7 @@ static void snd_ymfpci_proc_read(struct snd_info_entry *entry, | |||
2006 | snd_iprintf(buffer, "%04x: %04x\n", i, snd_ymfpci_readl(chip, i)); | 2007 | snd_iprintf(buffer, "%04x: %04x\n", i, snd_ymfpci_readl(chip, i)); |
2007 | } | 2008 | } |
2008 | 2009 | ||
2009 | static int __devinit snd_ymfpci_proc_init(struct snd_card *card, struct snd_ymfpci *chip) | 2010 | static int snd_ymfpci_proc_init(struct snd_card *card, struct snd_ymfpci *chip) |
2010 | { | 2011 | { |
2011 | struct snd_info_entry *entry; | 2012 | struct snd_info_entry *entry; |
2012 | 2013 | ||
@@ -2128,7 +2129,7 @@ static void snd_ymfpci_download_image(struct snd_ymfpci *chip) | |||
2128 | snd_ymfpci_enable_dsp(chip); | 2129 | snd_ymfpci_enable_dsp(chip); |
2129 | } | 2130 | } |
2130 | 2131 | ||
2131 | static int __devinit snd_ymfpci_memalloc(struct snd_ymfpci *chip) | 2132 | static int snd_ymfpci_memalloc(struct snd_ymfpci *chip) |
2132 | { | 2133 | { |
2133 | long size, playback_ctrl_size; | 2134 | long size, playback_ctrl_size; |
2134 | int voice, bank, reg; | 2135 | int voice, bank, reg; |
@@ -2261,7 +2262,7 @@ static int snd_ymfpci_free(struct snd_ymfpci *chip) | |||
2261 | #endif | 2262 | #endif |
2262 | 2263 | ||
2263 | #ifdef CONFIG_PM_SLEEP | 2264 | #ifdef CONFIG_PM_SLEEP |
2264 | vfree(chip->saved_regs); | 2265 | kfree(chip->saved_regs); |
2265 | #endif | 2266 | #endif |
2266 | if (chip->irq >= 0) | 2267 | if (chip->irq >= 0) |
2267 | free_irq(chip->irq, chip); | 2268 | free_irq(chip->irq, chip); |
@@ -2394,10 +2395,10 @@ static int snd_ymfpci_resume(struct device *dev) | |||
2394 | SIMPLE_DEV_PM_OPS(snd_ymfpci_pm, snd_ymfpci_suspend, snd_ymfpci_resume); | 2395 | SIMPLE_DEV_PM_OPS(snd_ymfpci_pm, snd_ymfpci_suspend, snd_ymfpci_resume); |
2395 | #endif /* CONFIG_PM_SLEEP */ | 2396 | #endif /* CONFIG_PM_SLEEP */ |
2396 | 2397 | ||
2397 | int __devinit snd_ymfpci_create(struct snd_card *card, | 2398 | int snd_ymfpci_create(struct snd_card *card, |
2398 | struct pci_dev * pci, | 2399 | struct pci_dev *pci, |
2399 | unsigned short old_legacy_ctrl, | 2400 | unsigned short old_legacy_ctrl, |
2400 | struct snd_ymfpci ** rchip) | 2401 | struct snd_ymfpci **rchip) |
2401 | { | 2402 | { |
2402 | struct snd_ymfpci *chip; | 2403 | struct snd_ymfpci *chip; |
2403 | int err; | 2404 | int err; |
@@ -2471,7 +2472,8 @@ int __devinit snd_ymfpci_create(struct snd_card *card, | |||
2471 | } | 2472 | } |
2472 | 2473 | ||
2473 | #ifdef CONFIG_PM_SLEEP | 2474 | #ifdef CONFIG_PM_SLEEP |
2474 | chip->saved_regs = vmalloc(YDSXGR_NUM_SAVED_REGS * sizeof(u32)); | 2475 | chip->saved_regs = kmalloc(YDSXGR_NUM_SAVED_REGS * sizeof(u32), |
2476 | GFP_KERNEL); | ||
2475 | if (chip->saved_regs == NULL) { | 2477 | if (chip->saved_regs == NULL) { |
2476 | snd_ymfpci_free(chip); | 2478 | snd_ymfpci_free(chip); |
2477 | return -ENOMEM; | 2479 | return -ENOMEM; |