/* 0x0a */ "PCM Capture Left",
/* 0x0b */ "PCM Capture Right",
/* 0x0c */ "MIC Capture",
- /* 0x0d */ NULL,
- /* 0x0e */ NULL,
+ /* 0x0d */ "AC97 Surround Left",
+ /* 0x0e */ "AC97 Surround Right",
/* 0x0f */ NULL,
/* 0x10 */ NULL,
/* 0x11 */ "Analog Center",
static int snd_emu10k1_verify_controls(emu10k1_t *emu, emu10k1_fx8010_code_t *icode)
{
unsigned int i;
- snd_ctl_elem_id_t *_id, id;
- emu10k1_fx8010_control_gpr_t *_gctl, gctl;
+ snd_ctl_elem_id_t __user *_id;
+ snd_ctl_elem_id_t id;
+ emu10k1_fx8010_control_gpr_t __user *_gctl;
+ emu10k1_fx8010_control_gpr_t gctl;
for (i = 0, _id = icode->gpr_del_controls;
i < icode->gpr_del_control_count; i++, _id++) {
static void snd_emu10k1_add_controls(emu10k1_t *emu, emu10k1_fx8010_code_t *icode)
{
unsigned int i, j;
- emu10k1_fx8010_control_gpr_t *_gctl, gctl;
+ emu10k1_fx8010_control_gpr_t __user *_gctl;
+ emu10k1_fx8010_control_gpr_t gctl;
snd_emu10k1_fx8010_ctl_t *ctl, nctl;
snd_kcontrol_new_t knew;
snd_kcontrol_t *kctl;
static void snd_emu10k1_del_controls(emu10k1_t *emu, emu10k1_fx8010_code_t *icode)
{
unsigned int i;
- snd_ctl_elem_id_t *_id, id;
+ snd_ctl_elem_id_t id;
+ snd_ctl_elem_id_t __user *_id;
snd_emu10k1_fx8010_ctl_t *ctl;
snd_card_t *card = emu->card;
{
unsigned int i = 0, j;
unsigned int total = 0;
- emu10k1_fx8010_control_gpr_t *_gctl, gctl;
+ emu10k1_fx8010_control_gpr_t gctl;
+ emu10k1_fx8010_control_gpr_t __user *_gctl;
snd_emu10k1_fx8010_ctl_t *ctl;
snd_ctl_elem_id_t *id;
struct list_head *list;
for (z = 0; z < 2; z++)
OP(icode, &ptr, iACC3, EXTOUT(EXTOUT_REAR_L + z), GPR(playback + SND_EMU10K1_PLAYBACK_CHANNELS + 2 + z), C_00000000, C_00000000);
- if (emu->fx8010.extout_mask & (1<<EXTOUT_CENTER)) {
+ if (emu->fx8010.extout_mask & ((1<<EXTOUT_AC97_REAR_L)|(1<<EXTOUT_AC97_REAR_R)))
+ for (z = 0; z < 2; z++)
+ OP(icode, &ptr, iACC3, EXTOUT(EXTOUT_AC97_REAR_L + z), GPR(playback + SND_EMU10K1_PLAYBACK_CHANNELS + 2 + z), C_00000000, C_00000000);
+
+ if (emu->fx8010.extout_mask & (1<<EXTOUT_AC97_CENTER)) {
#ifndef EMU10K1_CENTER_LFE_FROM_FRONT
- OP(icode, &ptr, iACC3, EXTOUT(EXTOUT_CENTER), GPR(playback + SND_EMU10K1_PLAYBACK_CHANNELS + 4), C_00000000, C_00000000);
+ OP(icode, &ptr, iACC3, EXTOUT(EXTOUT_AC97_CENTER), GPR(playback + SND_EMU10K1_PLAYBACK_CHANNELS + 4), C_00000000, C_00000000);
OP(icode, &ptr, iACC3, EXTOUT(EXTOUT_ACENTER), GPR(playback + SND_EMU10K1_PLAYBACK_CHANNELS + 4), C_00000000, C_00000000);
#else
- OP(icode, &ptr, iACC3, EXTOUT(EXTOUT_CENTER), GPR(playback + SND_EMU10K1_PLAYBACK_CHANNELS + 0), C_00000000, C_00000000);
+ OP(icode, &ptr, iACC3, EXTOUT(EXTOUT_AC97_CENTER), GPR(playback + SND_EMU10K1_PLAYBACK_CHANNELS + 0), C_00000000, C_00000000);
OP(icode, &ptr, iACC3, EXTOUT(EXTOUT_ACENTER), GPR(playback + SND_EMU10K1_PLAYBACK_CHANNELS + 0), C_00000000, C_00000000);
#endif
}
- if (emu->fx8010.extout_mask & (1<<EXTOUT_LFE)) {
+ if (emu->fx8010.extout_mask & (1<<EXTOUT_AC97_LFE)) {
#ifndef EMU10K1_CENTER_LFE_FROM_FRONT
- OP(icode, &ptr, iACC3, EXTOUT(EXTOUT_LFE), GPR(playback + SND_EMU10K1_PLAYBACK_CHANNELS + 5), C_00000000, C_00000000);
+ OP(icode, &ptr, iACC3, EXTOUT(EXTOUT_AC97_LFE), GPR(playback + SND_EMU10K1_PLAYBACK_CHANNELS + 5), C_00000000, C_00000000);
OP(icode, &ptr, iACC3, EXTOUT(EXTOUT_ALFE), GPR(playback + SND_EMU10K1_PLAYBACK_CHANNELS + 5), C_00000000, C_00000000);
#else
- OP(icode, &ptr, iACC3, EXTOUT(EXTOUT_LFE), GPR(playback + SND_EMU10K1_PLAYBACK_CHANNELS + 1), C_00000000, C_00000000);
+ OP(icode, &ptr, iACC3, EXTOUT(EXTOUT_AC97_LFE), GPR(playback + SND_EMU10K1_PLAYBACK_CHANNELS + 1), C_00000000, C_00000000);
OP(icode, &ptr, iACC3, EXTOUT(EXTOUT_ALFE), GPR(playback + SND_EMU10K1_PLAYBACK_CHANNELS + 1), C_00000000, C_00000000);
#endif
}
emu10k1_fx8010_code_t *icode;
emu10k1_fx8010_pcm_t *ipcm;
unsigned int addr;
+ void __user *argp = (void __user *)arg;
int res;
switch (cmd) {
kfree(info);
return res;
}
- if (copy_to_user((void *)arg, info, sizeof(*info))) {
+ if (copy_to_user(argp, info, sizeof(*info))) {
kfree(info);
return -EFAULT;
}
icode = (emu10k1_fx8010_code_t *)kmalloc(sizeof(*icode), GFP_KERNEL);
if (icode == NULL)
return -ENOMEM;
- if (copy_from_user(icode, (void *)arg, sizeof(*icode))) {
+ if (copy_from_user(icode, argp, sizeof(*icode))) {
kfree(icode);
return -EFAULT;
}
icode = (emu10k1_fx8010_code_t *)kmalloc(sizeof(*icode), GFP_KERNEL);
if (icode == NULL)
return -ENOMEM;
- if (copy_from_user(icode, (void *)arg, sizeof(*icode))) {
+ if (copy_from_user(icode, argp, sizeof(*icode))) {
kfree(icode);
return -EFAULT;
}
res = snd_emu10k1_icode_peek(emu, icode);
- if (res == 0 && copy_to_user((void *)arg, icode, sizeof(*icode))) {
+ if (res == 0 && copy_to_user(argp, icode, sizeof(*icode))) {
kfree(icode);
return -EFAULT;
}
ipcm = (emu10k1_fx8010_pcm_t *)kmalloc(sizeof(*ipcm), GFP_KERNEL);
if (ipcm == NULL)
return -ENOMEM;
- if (copy_from_user(ipcm, (void *)arg, sizeof(*ipcm))) {
+ if (copy_from_user(ipcm, argp, sizeof(*ipcm))) {
kfree(ipcm);
return -EFAULT;
}
ipcm = (emu10k1_fx8010_pcm_t *)snd_kcalloc(sizeof(*ipcm), GFP_KERNEL);
if (ipcm == NULL)
return -ENOMEM;
- if (copy_from_user(ipcm, (void *)arg, sizeof(*ipcm))) {
+ if (copy_from_user(ipcm, argp, sizeof(*ipcm))) {
kfree(ipcm);
return -EFAULT;
}
res = snd_emu10k1_ipcm_peek(emu, ipcm);
- if (res == 0 && copy_to_user((void *)arg, ipcm, sizeof(*ipcm))) {
+ if (res == 0 && copy_to_user(argp, ipcm, sizeof(*ipcm))) {
kfree(ipcm);
return -EFAULT;
}
return -EINVAL;
if (!capable(CAP_SYS_ADMIN))
return -EPERM;
- if (get_user(addr, (unsigned int *)arg))
+ if (get_user(addr, (unsigned int __user *)argp))
return -EFAULT;
down(&emu->fx8010.lock);
res = snd_emu10k1_fx8010_tram_setup(emu, addr);
case SNDRV_EMU10K1_IOCTL_SINGLE_STEP:
if (!capable(CAP_SYS_ADMIN))
return -EPERM;
- if (get_user(addr, (unsigned int *)arg))
+ if (get_user(addr, (unsigned int __user *)argp))
return -EFAULT;
if (addr > 0x1ff)
return -EINVAL;
addr = snd_emu10k1_ptr_read(emu, A_DBG, 0);
else
addr = snd_emu10k1_ptr_read(emu, DBG, 0);
- if (put_user(addr, (unsigned int *)arg))
+ if (put_user(addr, (unsigned int __user *)argp))
return -EFAULT;
return 0;
}