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.c251
1 files changed, 132 insertions, 119 deletions
diff --git a/sound/pci/emu10k1/emufx.c b/sound/pci/emu10k1/emufx.c
index 7206c0fa06f2..9bf1cd592199 100644
--- a/sound/pci/emu10k1/emufx.c
+++ b/sound/pci/emu10k1/emufx.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright (c) by Jaroslav Kysela <perex@suse.cz> 2 * Copyright (c) by Jaroslav Kysela <perex@perex.cz>
3 * Creative Labs, Inc. 3 * Creative Labs, Inc.
4 * Routines for effect processor FX8010 4 * Routines for effect processor FX8010
5 * 5 *
@@ -642,10 +642,8 @@ snd_emu10k1_look_for_ctl(struct snd_emu10k1 *emu, struct snd_ctl_elem_id *id)
642{ 642{
643 struct snd_emu10k1_fx8010_ctl *ctl; 643 struct snd_emu10k1_fx8010_ctl *ctl;
644 struct snd_kcontrol *kcontrol; 644 struct snd_kcontrol *kcontrol;
645 struct list_head *list; 645
646 646 list_for_each_entry(ctl, &emu->fx8010.gpr_ctl, list) {
647 list_for_each(list, &emu->fx8010.gpr_ctl) {
648 ctl = emu10k1_gpr_ctl(list);
649 kcontrol = ctl->kcontrol; 647 kcontrol = ctl->kcontrol;
650 if (kcontrol->id.iface == id->iface && 648 if (kcontrol->id.iface == id->iface &&
651 !strcmp(kcontrol->id.name, id->name) && 649 !strcmp(kcontrol->id.name, id->name) &&
@@ -895,14 +893,12 @@ static int snd_emu10k1_list_controls(struct snd_emu10k1 *emu,
895 struct snd_emu10k1_fx8010_control_gpr *gctl; 893 struct snd_emu10k1_fx8010_control_gpr *gctl;
896 struct snd_emu10k1_fx8010_ctl *ctl; 894 struct snd_emu10k1_fx8010_ctl *ctl;
897 struct snd_ctl_elem_id *id; 895 struct snd_ctl_elem_id *id;
898 struct list_head *list;
899 896
900 gctl = kmalloc(sizeof(*gctl), GFP_KERNEL); 897 gctl = kmalloc(sizeof(*gctl), GFP_KERNEL);
901 if (! gctl) 898 if (! gctl)
902 return -ENOMEM; 899 return -ENOMEM;
903 900
904 list_for_each(list, &emu->fx8010.gpr_ctl) { 901 list_for_each_entry(ctl, &emu->fx8010.gpr_ctl, list) {
905 ctl = emu10k1_gpr_ctl(list);
906 total++; 902 total++;
907 if (icode->gpr_list_controls && 903 if (icode->gpr_list_controls &&
908 i < icode->gpr_list_control_count) { 904 i < icode->gpr_list_control_count) {
@@ -1207,7 +1203,7 @@ static int __devinit _snd_emu10k1_audigy_init_efx(struct snd_emu10k1 *emu)
1207 A_OP(icode, &ptr, iMAC0, A_GPR(playback+1), A_C_00000000, A_GPR(gpr+1), A_FXBUS(FXBUS_PCM_RIGHT_FRONT)); 1203 A_OP(icode, &ptr, iMAC0, A_GPR(playback+1), A_C_00000000, A_GPR(gpr+1), A_FXBUS(FXBUS_PCM_RIGHT_FRONT));
1208 snd_emu10k1_init_stereo_control(&controls[nctl++], "PCM Front Playback Volume", gpr, 100); 1204 snd_emu10k1_init_stereo_control(&controls[nctl++], "PCM Front Playback Volume", gpr, 100);
1209 gpr += 2; 1205 gpr += 2;
1210 1206
1211 /* PCM Surround Playback (independent from stereo mix) */ 1207 /* PCM Surround Playback (independent from stereo mix) */
1212 A_OP(icode, &ptr, iMAC0, A_GPR(playback+2), A_C_00000000, A_GPR(gpr), A_FXBUS(FXBUS_PCM_LEFT_REAR)); 1208 A_OP(icode, &ptr, iMAC0, A_GPR(playback+2), A_C_00000000, A_GPR(gpr), A_FXBUS(FXBUS_PCM_LEFT_REAR));
1213 A_OP(icode, &ptr, iMAC0, A_GPR(playback+3), A_C_00000000, A_GPR(gpr+1), A_FXBUS(FXBUS_PCM_RIGHT_REAR)); 1209 A_OP(icode, &ptr, iMAC0, A_GPR(playback+3), A_C_00000000, A_GPR(gpr+1), A_FXBUS(FXBUS_PCM_RIGHT_REAR));
@@ -1267,8 +1263,16 @@ A_OP(icode, &ptr, iMAC0, A_GPR(var), A_GPR(var), A_GPR(vol), A_EXTIN(input))
1267 1263
1268 /* emu1212 DSP 0 and DSP 1 Capture */ 1264 /* emu1212 DSP 0 and DSP 1 Capture */
1269 if (emu->card_capabilities->emu1010) { 1265 if (emu->card_capabilities->emu1010) {
1270 A_OP(icode, &ptr, iMAC0, A_GPR(capture+0), A_GPR(capture+0), A_GPR(gpr), A_P16VIN(0x0)); 1266 if (emu->card_capabilities->ca0108_chip) {
1271 A_OP(icode, &ptr, iMAC0, A_GPR(capture+1), A_GPR(capture+1), A_GPR(gpr+1), A_P16VIN(0x1)); 1267 /* Note:JCD:No longer bit shift lower 16bits to upper 16bits of 32bit value. */
1268 A_OP(icode, &ptr, iMACINT0, A_GPR(tmp), A_C_00000000, A3_EMU32IN(0x0), A_C_00000001);
1269 A_OP(icode, &ptr, iMAC0, A_GPR(capture+0), A_GPR(capture+0), A_GPR(gpr), A_GPR(tmp));
1270 A_OP(icode, &ptr, iMACINT0, A_GPR(tmp), A_C_00000000, A3_EMU32IN(0x1), A_C_00000001);
1271 A_OP(icode, &ptr, iMAC0, A_GPR(capture+1), A_GPR(capture+1), A_GPR(gpr), A_GPR(tmp));
1272 } else {
1273 A_OP(icode, &ptr, iMAC0, A_GPR(capture+0), A_GPR(capture+0), A_GPR(gpr), A_P16VIN(0x0));
1274 A_OP(icode, &ptr, iMAC0, A_GPR(capture+1), A_GPR(capture+1), A_GPR(gpr+1), A_P16VIN(0x1));
1275 }
1272 snd_emu10k1_init_stereo_control(&controls[nctl++], "EMU Capture Volume", gpr, 0); 1276 snd_emu10k1_init_stereo_control(&controls[nctl++], "EMU Capture Volume", gpr, 0);
1273 gpr += 2; 1277 gpr += 2;
1274 } 1278 }
@@ -1516,7 +1520,11 @@ A_OP(icode, &ptr, iMAC0, A_GPR(var), A_GPR(var), A_GPR(vol), A_EXTIN(input))
1516 /* EMU1010 Outputs from PCM Front, Rear, Center, LFE, Side */ 1520 /* EMU1010 Outputs from PCM Front, Rear, Center, LFE, Side */
1517 snd_printk("EMU outputs on\n"); 1521 snd_printk("EMU outputs on\n");
1518 for (z = 0; z < 8; z++) { 1522 for (z = 0; z < 8; z++) {
1519 A_OP(icode, &ptr, iACC3, A_EMU32OUTL(z), A_GPR(playback + SND_EMU10K1_PLAYBACK_CHANNELS + z), A_C_00000000, A_C_00000000); 1523 if (emu->card_capabilities->ca0108_chip) {
1524 A_OP(icode, &ptr, iACC3, A3_EMU32OUT(z), A_GPR(playback + SND_EMU10K1_PLAYBACK_CHANNELS + z), A_C_00000000, A_C_00000000);
1525 } else {
1526 A_OP(icode, &ptr, iACC3, A_EMU32OUTL(z), A_GPR(playback + SND_EMU10K1_PLAYBACK_CHANNELS + z), A_C_00000000, A_C_00000000);
1527 }
1520 } 1528 }
1521 } 1529 }
1522 1530
@@ -1557,106 +1565,116 @@ A_OP(icode, &ptr, iMAC0, A_GPR(var), A_GPR(var), A_GPR(vol), A_EXTIN(input))
1557#endif 1565#endif
1558 1566
1559 if (emu->card_capabilities->emu1010) { 1567 if (emu->card_capabilities->emu1010) {
1560 snd_printk("EMU inputs on\n"); 1568 if (emu->card_capabilities->ca0108_chip) {
1561 /* Capture 16 (originally 8) channels of S32_LE sound */ 1569 snd_printk("EMU2 inputs on\n");
1562 1570 for (z = 0; z < 0x10; z++) {
1563 /* printk("emufx.c: gpr=0x%x, tmp=0x%x\n",gpr, tmp); */ 1571 snd_emu10k1_audigy_dsp_convert_32_to_2x16( icode, &ptr, tmp,
1564 /* For the EMU1010: How to get 32bit values from the DSP. High 16bits into L, low 16bits into R. */ 1572 bit_shifter16,
1565 /* A_P16VIN(0) is delayed by one sample, 1573 A3_EMU32IN(z),
1566 * so all other A_P16VIN channels will need to also be delayed 1574 A_FXBUS2(z*2) );
1567 */ 1575 }
1568 /* Left ADC in. 1 of 2 */ 1576 } else {
1569 snd_emu10k1_audigy_dsp_convert_32_to_2x16( icode, &ptr, tmp, bit_shifter16, A_P16VIN(0x0), A_FXBUS2(0) ); 1577 snd_printk("EMU inputs on\n");
1570 /* Right ADC in 1 of 2 */ 1578 /* Capture 16 (originally 8) channels of S32_LE sound */
1571 gpr_map[gpr++] = 0x00000000; 1579
1572 /* Delaying by one sample: instead of copying the input 1580 /* printk("emufx.c: gpr=0x%x, tmp=0x%x\n",gpr, tmp); */
1573 * value A_P16VIN to output A_FXBUS2 as in the first channel, 1581 /* For the EMU1010: How to get 32bit values from the DSP. High 16bits into L, low 16bits into R. */
1574 * we use an auxiliary register, delaying the value by one 1582 /* A_P16VIN(0) is delayed by one sample,
1575 * sample 1583 * so all other A_P16VIN channels will need to also be delayed
1576 */ 1584 */
1577 snd_emu10k1_audigy_dsp_convert_32_to_2x16( icode, &ptr, tmp, bit_shifter16, A_GPR(gpr - 1), A_FXBUS2(2) ); 1585 /* Left ADC in. 1 of 2 */
1578 A_OP(icode, &ptr, iACC3, A_GPR(gpr - 1), A_P16VIN(0x1), A_C_00000000, A_C_00000000); 1586 snd_emu10k1_audigy_dsp_convert_32_to_2x16( icode, &ptr, tmp, bit_shifter16, A_P16VIN(0x0), A_FXBUS2(0) );
1579 gpr_map[gpr++] = 0x00000000; 1587 /* Right ADC in 1 of 2 */
1580 snd_emu10k1_audigy_dsp_convert_32_to_2x16( icode, &ptr, tmp, bit_shifter16, A_GPR(gpr - 1), A_FXBUS2(4) ); 1588 gpr_map[gpr++] = 0x00000000;
1581 A_OP(icode, &ptr, iACC3, A_GPR(gpr - 1), A_P16VIN(0x2), A_C_00000000, A_C_00000000); 1589 /* Delaying by one sample: instead of copying the input
1582 gpr_map[gpr++] = 0x00000000; 1590 * value A_P16VIN to output A_FXBUS2 as in the first channel,
1583 snd_emu10k1_audigy_dsp_convert_32_to_2x16( icode, &ptr, tmp, bit_shifter16, A_GPR(gpr - 1), A_FXBUS2(6) ); 1591 * we use an auxiliary register, delaying the value by one
1584 A_OP(icode, &ptr, iACC3, A_GPR(gpr - 1), A_P16VIN(0x3), A_C_00000000, A_C_00000000); 1592 * sample
1585 /* For 96kHz mode */ 1593 */
1586 /* Left ADC in. 2 of 2 */ 1594 snd_emu10k1_audigy_dsp_convert_32_to_2x16( icode, &ptr, tmp, bit_shifter16, A_GPR(gpr - 1), A_FXBUS2(2) );
1587 gpr_map[gpr++] = 0x00000000; 1595 A_OP(icode, &ptr, iACC3, A_GPR(gpr - 1), A_P16VIN(0x1), A_C_00000000, A_C_00000000);
1588 snd_emu10k1_audigy_dsp_convert_32_to_2x16( icode, &ptr, tmp, bit_shifter16, A_GPR(gpr - 1), A_FXBUS2(0x8) ); 1596 gpr_map[gpr++] = 0x00000000;
1589 A_OP(icode, &ptr, iACC3, A_GPR(gpr - 1), A_P16VIN(0x4), A_C_00000000, A_C_00000000); 1597 snd_emu10k1_audigy_dsp_convert_32_to_2x16( icode, &ptr, tmp, bit_shifter16, A_GPR(gpr - 1), A_FXBUS2(4) );
1590 /* Right ADC in 2 of 2 */ 1598 A_OP(icode, &ptr, iACC3, A_GPR(gpr - 1), A_P16VIN(0x2), A_C_00000000, A_C_00000000);
1591 gpr_map[gpr++] = 0x00000000; 1599 gpr_map[gpr++] = 0x00000000;
1592 snd_emu10k1_audigy_dsp_convert_32_to_2x16( icode, &ptr, tmp, bit_shifter16, A_GPR(gpr - 1), A_FXBUS2(0xa) ); 1600 snd_emu10k1_audigy_dsp_convert_32_to_2x16( icode, &ptr, tmp, bit_shifter16, A_GPR(gpr - 1), A_FXBUS2(6) );
1593 A_OP(icode, &ptr, iACC3, A_GPR(gpr - 1), A_P16VIN(0x5), A_C_00000000, A_C_00000000); 1601 A_OP(icode, &ptr, iACC3, A_GPR(gpr - 1), A_P16VIN(0x3), A_C_00000000, A_C_00000000);
1594 gpr_map[gpr++] = 0x00000000; 1602 /* For 96kHz mode */
1595 snd_emu10k1_audigy_dsp_convert_32_to_2x16( icode, &ptr, tmp, bit_shifter16, A_GPR(gpr - 1), A_FXBUS2(0xc) ); 1603 /* Left ADC in. 2 of 2 */
1596 A_OP(icode, &ptr, iACC3, A_GPR(gpr - 1), A_P16VIN(0x6), A_C_00000000, A_C_00000000); 1604 gpr_map[gpr++] = 0x00000000;
1597 gpr_map[gpr++] = 0x00000000; 1605 snd_emu10k1_audigy_dsp_convert_32_to_2x16( icode, &ptr, tmp, bit_shifter16, A_GPR(gpr - 1), A_FXBUS2(0x8) );
1598 snd_emu10k1_audigy_dsp_convert_32_to_2x16( icode, &ptr, tmp, bit_shifter16, A_GPR(gpr - 1), A_FXBUS2(0xe) ); 1606 A_OP(icode, &ptr, iACC3, A_GPR(gpr - 1), A_P16VIN(0x4), A_C_00000000, A_C_00000000);
1599 A_OP(icode, &ptr, iACC3, A_GPR(gpr - 1), A_P16VIN(0x7), A_C_00000000, A_C_00000000); 1607 /* Right ADC in 2 of 2 */
1600 /* Pavel Hofman - we still have voices, A_FXBUS2s, and 1608 gpr_map[gpr++] = 0x00000000;
1601 * A_P16VINs available - 1609 snd_emu10k1_audigy_dsp_convert_32_to_2x16( icode, &ptr, tmp, bit_shifter16, A_GPR(gpr - 1), A_FXBUS2(0xa) );
1602 * let's add 8 more capture channels - total of 16 1610 A_OP(icode, &ptr, iACC3, A_GPR(gpr - 1), A_P16VIN(0x5), A_C_00000000, A_C_00000000);
1603 */ 1611 gpr_map[gpr++] = 0x00000000;
1604 gpr_map[gpr++] = 0x00000000; 1612 snd_emu10k1_audigy_dsp_convert_32_to_2x16( icode, &ptr, tmp, bit_shifter16, A_GPR(gpr - 1), A_FXBUS2(0xc) );
1605 snd_emu10k1_audigy_dsp_convert_32_to_2x16(icode, &ptr, tmp, 1613 A_OP(icode, &ptr, iACC3, A_GPR(gpr - 1), A_P16VIN(0x6), A_C_00000000, A_C_00000000);
1606 bit_shifter16, 1614 gpr_map[gpr++] = 0x00000000;
1607 A_GPR(gpr - 1), 1615 snd_emu10k1_audigy_dsp_convert_32_to_2x16( icode, &ptr, tmp, bit_shifter16, A_GPR(gpr - 1), A_FXBUS2(0xe) );
1608 A_FXBUS2(0x10)); 1616 A_OP(icode, &ptr, iACC3, A_GPR(gpr - 1), A_P16VIN(0x7), A_C_00000000, A_C_00000000);
1609 A_OP(icode, &ptr, iACC3, A_GPR(gpr - 1), A_P16VIN(0x8), 1617 /* Pavel Hofman - we still have voices, A_FXBUS2s, and
1610 A_C_00000000, A_C_00000000); 1618 * A_P16VINs available -
1611 gpr_map[gpr++] = 0x00000000; 1619 * let's add 8 more capture channels - total of 16
1612 snd_emu10k1_audigy_dsp_convert_32_to_2x16(icode, &ptr, tmp, 1620 */
1613 bit_shifter16, 1621 gpr_map[gpr++] = 0x00000000;
1614 A_GPR(gpr - 1), 1622 snd_emu10k1_audigy_dsp_convert_32_to_2x16(icode, &ptr, tmp,
1615 A_FXBUS2(0x12)); 1623 bit_shifter16,
1616 A_OP(icode, &ptr, iACC3, A_GPR(gpr - 1), A_P16VIN(0x9), 1624 A_GPR(gpr - 1),
1617 A_C_00000000, A_C_00000000); 1625 A_FXBUS2(0x10));
1618 gpr_map[gpr++] = 0x00000000; 1626 A_OP(icode, &ptr, iACC3, A_GPR(gpr - 1), A_P16VIN(0x8),
1619 snd_emu10k1_audigy_dsp_convert_32_to_2x16(icode, &ptr, tmp, 1627 A_C_00000000, A_C_00000000);
1620 bit_shifter16, 1628 gpr_map[gpr++] = 0x00000000;
1621 A_GPR(gpr - 1), 1629 snd_emu10k1_audigy_dsp_convert_32_to_2x16(icode, &ptr, tmp,
1622 A_FXBUS2(0x14)); 1630 bit_shifter16,
1623 A_OP(icode, &ptr, iACC3, A_GPR(gpr - 1), A_P16VIN(0xa), 1631 A_GPR(gpr - 1),
1624 A_C_00000000, A_C_00000000); 1632 A_FXBUS2(0x12));
1625 gpr_map[gpr++] = 0x00000000; 1633 A_OP(icode, &ptr, iACC3, A_GPR(gpr - 1), A_P16VIN(0x9),
1626 snd_emu10k1_audigy_dsp_convert_32_to_2x16(icode, &ptr, tmp, 1634 A_C_00000000, A_C_00000000);
1627 bit_shifter16, 1635 gpr_map[gpr++] = 0x00000000;
1628 A_GPR(gpr - 1), 1636 snd_emu10k1_audigy_dsp_convert_32_to_2x16(icode, &ptr, tmp,
1629 A_FXBUS2(0x16)); 1637 bit_shifter16,
1630 A_OP(icode, &ptr, iACC3, A_GPR(gpr - 1), A_P16VIN(0xb), 1638 A_GPR(gpr - 1),
1631 A_C_00000000, A_C_00000000); 1639 A_FXBUS2(0x14));
1632 gpr_map[gpr++] = 0x00000000; 1640 A_OP(icode, &ptr, iACC3, A_GPR(gpr - 1), A_P16VIN(0xa),
1633 snd_emu10k1_audigy_dsp_convert_32_to_2x16(icode, &ptr, tmp, 1641 A_C_00000000, A_C_00000000);
1634 bit_shifter16, 1642 gpr_map[gpr++] = 0x00000000;
1635 A_GPR(gpr - 1), 1643 snd_emu10k1_audigy_dsp_convert_32_to_2x16(icode, &ptr, tmp,
1636 A_FXBUS2(0x18)); 1644 bit_shifter16,
1637 A_OP(icode, &ptr, iACC3, A_GPR(gpr - 1), A_P16VIN(0xc), 1645 A_GPR(gpr - 1),
1638 A_C_00000000, A_C_00000000); 1646 A_FXBUS2(0x16));
1639 gpr_map[gpr++] = 0x00000000; 1647 A_OP(icode, &ptr, iACC3, A_GPR(gpr - 1), A_P16VIN(0xb),
1640 snd_emu10k1_audigy_dsp_convert_32_to_2x16(icode, &ptr, tmp, 1648 A_C_00000000, A_C_00000000);
1641 bit_shifter16, 1649 gpr_map[gpr++] = 0x00000000;
1642 A_GPR(gpr - 1), 1650 snd_emu10k1_audigy_dsp_convert_32_to_2x16(icode, &ptr, tmp,
1643 A_FXBUS2(0x1a)); 1651 bit_shifter16,
1644 A_OP(icode, &ptr, iACC3, A_GPR(gpr - 1), A_P16VIN(0xd), 1652 A_GPR(gpr - 1),
1645 A_C_00000000, A_C_00000000); 1653 A_FXBUS2(0x18));
1646 gpr_map[gpr++] = 0x00000000; 1654 A_OP(icode, &ptr, iACC3, A_GPR(gpr - 1), A_P16VIN(0xc),
1647 snd_emu10k1_audigy_dsp_convert_32_to_2x16(icode, &ptr, tmp, 1655 A_C_00000000, A_C_00000000);
1648 bit_shifter16, 1656 gpr_map[gpr++] = 0x00000000;
1649 A_GPR(gpr - 1), 1657 snd_emu10k1_audigy_dsp_convert_32_to_2x16(icode, &ptr, tmp,
1650 A_FXBUS2(0x1c)); 1658 bit_shifter16,
1651 A_OP(icode, &ptr, iACC3, A_GPR(gpr - 1), A_P16VIN(0xe), 1659 A_GPR(gpr - 1),
1652 A_C_00000000, A_C_00000000); 1660 A_FXBUS2(0x1a));
1653 gpr_map[gpr++] = 0x00000000; 1661 A_OP(icode, &ptr, iACC3, A_GPR(gpr - 1), A_P16VIN(0xd),
1654 snd_emu10k1_audigy_dsp_convert_32_to_2x16(icode, &ptr, tmp, 1662 A_C_00000000, A_C_00000000);
1655 bit_shifter16, 1663 gpr_map[gpr++] = 0x00000000;
1656 A_GPR(gpr - 1), 1664 snd_emu10k1_audigy_dsp_convert_32_to_2x16(icode, &ptr, tmp,
1657 A_FXBUS2(0x1e)); 1665 bit_shifter16,
1658 A_OP(icode, &ptr, iACC3, A_GPR(gpr - 1), A_P16VIN(0xf), 1666 A_GPR(gpr - 1),
1659 A_C_00000000, A_C_00000000); 1667 A_FXBUS2(0x1c));
1668 A_OP(icode, &ptr, iACC3, A_GPR(gpr - 1), A_P16VIN(0xe),
1669 A_C_00000000, A_C_00000000);
1670 gpr_map[gpr++] = 0x00000000;
1671 snd_emu10k1_audigy_dsp_convert_32_to_2x16(icode, &ptr, tmp,
1672 bit_shifter16,
1673 A_GPR(gpr - 1),
1674 A_FXBUS2(0x1e));
1675 A_OP(icode, &ptr, iACC3, A_GPR(gpr - 1), A_P16VIN(0xf),
1676 A_C_00000000, A_C_00000000);
1677 }
1660 1678
1661#if 0 1679#if 0
1662 for (z = 4; z < 8; z++) { 1680 for (z = 4; z < 8; z++) {
@@ -2418,14 +2436,13 @@ static void copy_string(char *dst, char *src, char *null, int idx)
2418 strcpy(dst, src); 2436 strcpy(dst, src);
2419} 2437}
2420 2438
2421static int snd_emu10k1_fx8010_info(struct snd_emu10k1 *emu, 2439static void snd_emu10k1_fx8010_info(struct snd_emu10k1 *emu,
2422 struct snd_emu10k1_fx8010_info *info) 2440 struct snd_emu10k1_fx8010_info *info)
2423{ 2441{
2424 char **fxbus, **extin, **extout; 2442 char **fxbus, **extin, **extout;
2425 unsigned short fxbus_mask, extin_mask, extout_mask; 2443 unsigned short fxbus_mask, extin_mask, extout_mask;
2426 int res; 2444 int res;
2427 2445
2428 memset(info, 0, sizeof(info));
2429 info->internal_tram_size = emu->fx8010.itram_size; 2446 info->internal_tram_size = emu->fx8010.itram_size;
2430 info->external_tram_size = emu->fx8010.etram_pages.bytes / 2; 2447 info->external_tram_size = emu->fx8010.etram_pages.bytes / 2;
2431 fxbus = fxbuses; 2448 fxbus = fxbuses;
@@ -2442,7 +2459,6 @@ static int snd_emu10k1_fx8010_info(struct snd_emu10k1 *emu,
2442 for (res = 16; res < 32; res++, extout++) 2459 for (res = 16; res < 32; res++, extout++)
2443 copy_string(info->extout_names[res], extout_mask & (1 << res) ? *extout : NULL, "Unused", res); 2460 copy_string(info->extout_names[res], extout_mask & (1 << res) ? *extout : NULL, "Unused", res);
2444 info->gpr_controls = emu->fx8010.gpr_count; 2461 info->gpr_controls = emu->fx8010.gpr_count;
2445 return 0;
2446} 2462}
2447 2463
2448static int snd_emu10k1_fx8010_ioctl(struct snd_hwdep * hw, struct file *file, unsigned int cmd, unsigned long arg) 2464static int snd_emu10k1_fx8010_ioctl(struct snd_hwdep * hw, struct file *file, unsigned int cmd, unsigned long arg)
@@ -2463,10 +2479,7 @@ static int snd_emu10k1_fx8010_ioctl(struct snd_hwdep * hw, struct file *file, un
2463 info = kmalloc(sizeof(*info), GFP_KERNEL); 2479 info = kmalloc(sizeof(*info), GFP_KERNEL);
2464 if (!info) 2480 if (!info)
2465 return -ENOMEM; 2481 return -ENOMEM;
2466 if ((res = snd_emu10k1_fx8010_info(emu, info)) < 0) { 2482 snd_emu10k1_fx8010_info(emu, info);
2467 kfree(info);
2468 return res;
2469 }
2470 if (copy_to_user(argp, info, sizeof(*info))) { 2483 if (copy_to_user(argp, info, sizeof(*info))) {
2471 kfree(info); 2484 kfree(info);
2472 return -EFAULT; 2485 return -EFAULT;