/* DSP 4.x - SB16 */\r
val = vol & 0xf8;\r
if(ctl == AUDIO_PCM) {\r
- write_mix(MIX_SB16_VOICE_L, vol);\r
- write_mix(MIX_SB16_VOICE_R, vol);\r
+ write_mix(MIX_SB16_VOICE_L, val);\r
+ write_mix(MIX_SB16_VOICE_R, val);\r
} else {\r
- write_mix(MIX_SB16_MASTER_L, vol);\r
- write_mix(MIX_SB16_MASTER_R, vol);\r
+ write_mix(MIX_SB16_MASTER_L, val);\r
+ write_mix(MIX_SB16_MASTER_R, val);\r
}\r
\r
} else if(VER_MAJOR(dsp_ver) >= 3) {\r
}\r
\r
val = read_mix(lreg);\r
- left = (val & 0xf8) | ((val >> 3) & 7); /* duplicate last 3 bits */\r
+ left = (val & 0xf8) | (val >> 5);\r
val = read_mix(rreg);\r
- right = (val & 0xf8) | ((val >> 3) & 7);\r
+ right = (val & 0xf8) | (val >> 5);\r
\r
} else if(VER_MAJOR(dsp_ver) >= 3) {\r
/* DSP 3.x - SBPro */\r
return inp(REG_RDATA);\r
}\r
\r
-static void write_mix(unsigned char val, int reg)\r
+static void write_mix(int reg, unsigned char val)\r
{\r
outp(REG_MIXPORT, reg);\r
outp(REG_MIXDATA, val);\r
}\r
if(!irq) {\r
/* try to force IRQ 5 */\r
- write_mix(2, MIX_SB16_IRQ_SEL); /* bit1 selects irq 5 */\r
+ write_mix(MIX_SB16_IRQ_SEL, 2); /* bit1 selects irq 5 */\r
\r
/* re-read to verify */\r
irqsel = read_mix(MIX_SB16_IRQ_SEL);\r
}\r
\r
if(dma_chan == -1 || dma16_chan == -1) {\r
- write_mix(dmasel, MIX_SB16_DMA_SEL);\r
+ write_mix(MIX_SB16_DMA_SEL, dmasel);\r
\r
/* re-read to verify */\r
tmp = read_mix(MIX_SB16_DMA_SEL);\r