aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/emu10k1/emufx.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/pci/emu10k1/emufx.c')
-rw-r--r--sound/pci/emu10k1/emufx.c52
1 files changed, 20 insertions, 32 deletions
diff --git a/sound/pci/emu10k1/emufx.c b/sound/pci/emu10k1/emufx.c
index 7dba08f0ab8e..4b302d86f5f2 100644
--- a/sound/pci/emu10k1/emufx.c
+++ b/sound/pci/emu10k1/emufx.c
@@ -1519,7 +1519,7 @@ A_OP(icode, &ptr, iMAC0, A_GPR(var), A_GPR(var), A_GPR(vol), A_EXTIN(input))
1519 /* A_PUT_STEREO_OUTPUT(A_EXTOUT_FRONT_L, A_EXTOUT_FRONT_R, playback + SND_EMU10K1_PLAYBACK_CHANNELS); */ 1519 /* A_PUT_STEREO_OUTPUT(A_EXTOUT_FRONT_L, A_EXTOUT_FRONT_R, playback + SND_EMU10K1_PLAYBACK_CHANNELS); */
1520 if (emu->card_capabilities->emu_model) { 1520 if (emu->card_capabilities->emu_model) {
1521 /* EMU1010 Outputs from PCM Front, Rear, Center, LFE, Side */ 1521 /* EMU1010 Outputs from PCM Front, Rear, Center, LFE, Side */
1522 snd_printk("EMU outputs on\n"); 1522 snd_printk(KERN_INFO "EMU outputs on\n");
1523 for (z = 0; z < 8; z++) { 1523 for (z = 0; z < 8; z++) {
1524 if (emu->card_capabilities->ca0108_chip) { 1524 if (emu->card_capabilities->ca0108_chip) {
1525 A_OP(icode, &ptr, iACC3, A3_EMU32OUT(z), A_GPR(playback + SND_EMU10K1_PLAYBACK_CHANNELS + z), A_C_00000000, A_C_00000000); 1525 A_OP(icode, &ptr, iACC3, A3_EMU32OUT(z), A_GPR(playback + SND_EMU10K1_PLAYBACK_CHANNELS + z), A_C_00000000, A_C_00000000);
@@ -1567,7 +1567,7 @@ A_OP(icode, &ptr, iMAC0, A_GPR(var), A_GPR(var), A_GPR(vol), A_EXTIN(input))
1567 1567
1568 if (emu->card_capabilities->emu_model) { 1568 if (emu->card_capabilities->emu_model) {
1569 if (emu->card_capabilities->ca0108_chip) { 1569 if (emu->card_capabilities->ca0108_chip) {
1570 snd_printk("EMU2 inputs on\n"); 1570 snd_printk(KERN_INFO "EMU2 inputs on\n");
1571 for (z = 0; z < 0x10; z++) { 1571 for (z = 0; z < 0x10; z++) {
1572 snd_emu10k1_audigy_dsp_convert_32_to_2x16( icode, &ptr, tmp, 1572 snd_emu10k1_audigy_dsp_convert_32_to_2x16( icode, &ptr, tmp,
1573 bit_shifter16, 1573 bit_shifter16,
@@ -1575,10 +1575,13 @@ A_OP(icode, &ptr, iMAC0, A_GPR(var), A_GPR(var), A_GPR(vol), A_EXTIN(input))
1575 A_FXBUS2(z*2) ); 1575 A_FXBUS2(z*2) );
1576 } 1576 }
1577 } else { 1577 } else {
1578 snd_printk("EMU inputs on\n"); 1578 snd_printk(KERN_INFO "EMU inputs on\n");
1579 /* Capture 16 (originally 8) channels of S32_LE sound */ 1579 /* Capture 16 (originally 8) channels of S32_LE sound */
1580 1580
1581 /* printk("emufx.c: gpr=0x%x, tmp=0x%x\n",gpr, tmp); */ 1581 /*
1582 printk(KERN_DEBUG "emufx.c: gpr=0x%x, tmp=0x%x\n",
1583 gpr, tmp);
1584 */
1582 /* For the EMU1010: How to get 32bit values from the DSP. High 16bits into L, low 16bits into R. */ 1585 /* For the EMU1010: How to get 32bit values from the DSP. High 16bits into L, low 16bits into R. */
1583 /* A_P16VIN(0) is delayed by one sample, 1586 /* A_P16VIN(0) is delayed by one sample,
1584 * so all other A_P16VIN channels will need to also be delayed 1587 * so all other A_P16VIN channels will need to also be delayed
@@ -2490,24 +2493,17 @@ static int snd_emu10k1_fx8010_ioctl(struct snd_hwdep * hw, struct file *file, un
2490 case SNDRV_EMU10K1_IOCTL_CODE_POKE: 2493 case SNDRV_EMU10K1_IOCTL_CODE_POKE:
2491 if (!capable(CAP_SYS_ADMIN)) 2494 if (!capable(CAP_SYS_ADMIN))
2492 return -EPERM; 2495 return -EPERM;
2493 icode = kmalloc(sizeof(*icode), GFP_KERNEL); 2496
2494 if (icode == NULL) 2497 icode = memdup_user(argp, sizeof(*icode));
2495 return -ENOMEM; 2498 if (IS_ERR(icode))
2496 if (copy_from_user(icode, argp, sizeof(*icode))) { 2499 return PTR_ERR(icode);
2497 kfree(icode);
2498 return -EFAULT;
2499 }
2500 res = snd_emu10k1_icode_poke(emu, icode); 2500 res = snd_emu10k1_icode_poke(emu, icode);
2501 kfree(icode); 2501 kfree(icode);
2502 return res; 2502 return res;
2503 case SNDRV_EMU10K1_IOCTL_CODE_PEEK: 2503 case SNDRV_EMU10K1_IOCTL_CODE_PEEK:
2504 icode = kmalloc(sizeof(*icode), GFP_KERNEL); 2504 icode = memdup_user(argp, sizeof(*icode));
2505 if (icode == NULL) 2505 if (IS_ERR(icode))
2506 return -ENOMEM; 2506 return PTR_ERR(icode);
2507 if (copy_from_user(icode, argp, sizeof(*icode))) {
2508 kfree(icode);
2509 return -EFAULT;
2510 }
2511 res = snd_emu10k1_icode_peek(emu, icode); 2507 res = snd_emu10k1_icode_peek(emu, icode);
2512 if (res == 0 && copy_to_user(argp, icode, sizeof(*icode))) { 2508 if (res == 0 && copy_to_user(argp, icode, sizeof(*icode))) {
2513 kfree(icode); 2509 kfree(icode);
@@ -2516,24 +2512,16 @@ static int snd_emu10k1_fx8010_ioctl(struct snd_hwdep * hw, struct file *file, un
2516 kfree(icode); 2512 kfree(icode);
2517 return res; 2513 return res;
2518 case SNDRV_EMU10K1_IOCTL_PCM_POKE: 2514 case SNDRV_EMU10K1_IOCTL_PCM_POKE:
2519 ipcm = kmalloc(sizeof(*ipcm), GFP_KERNEL); 2515 ipcm = memdup_user(argp, sizeof(*ipcm));
2520 if (ipcm == NULL) 2516 if (IS_ERR(ipcm))
2521 return -ENOMEM; 2517 return PTR_ERR(ipcm);
2522 if (copy_from_user(ipcm, argp, sizeof(*ipcm))) {
2523 kfree(ipcm);
2524 return -EFAULT;
2525 }
2526 res = snd_emu10k1_ipcm_poke(emu, ipcm); 2518 res = snd_emu10k1_ipcm_poke(emu, ipcm);
2527 kfree(ipcm); 2519 kfree(ipcm);
2528 return res; 2520 return res;
2529 case SNDRV_EMU10K1_IOCTL_PCM_PEEK: 2521 case SNDRV_EMU10K1_IOCTL_PCM_PEEK:
2530 ipcm = kzalloc(sizeof(*ipcm), GFP_KERNEL); 2522 ipcm = memdup_user(argp, sizeof(*ipcm));
2531 if (ipcm == NULL) 2523 if (IS_ERR(ipcm))
2532 return -ENOMEM; 2524 return PTR_ERR(ipcm);
2533 if (copy_from_user(ipcm, argp, sizeof(*ipcm))) {
2534 kfree(ipcm);
2535 return -EFAULT;
2536 }
2537 res = snd_emu10k1_ipcm_peek(emu, ipcm); 2525 res = snd_emu10k1_ipcm_peek(emu, ipcm);
2538 if (res == 0 && copy_to_user(argp, ipcm, sizeof(*ipcm))) { 2526 if (res == 0 && copy_to_user(argp, ipcm, sizeof(*ipcm))) {
2539 kfree(ipcm); 2527 kfree(ipcm);