Lines Matching +full:eq +full:- +full:level
1 // SPDX-License-Identifier: GPL-2.0-or-later
4 * Aureal Vortex Hardware EQ control/access.
13 * - Debug (testing)
14 * - Test peak visualization support.
22 The Aureal Hardware EQ is found on AU8810 and AU8830 chips only.
39 static void vortex_EqHw_SetTimeConsts(vortex_t * vortex, u16 gain, u16 level) in vortex_EqHw_SetTimeConsts() argument
41 hwwrite(vortex->mmio, 0x2b3c4, gain); in vortex_EqHw_SetTimeConsts()
42 hwwrite(vortex->mmio, 0x2b3c8, level); in vortex_EqHw_SetTimeConsts()
47 /* -(-32768) -> -32768 so we do -(-32768) -> 32767 to make the result positive */ in sign_invert()
48 if (a == (u16)-32768) in sign_invert()
51 return -a; in sign_invert()
56 eqhw_t *eqhw = &(vortex->eq.this04); in vortex_EqHw_SetLeftCoefs()
59 for (n = 0; n < eqhw->this04; n++) { in vortex_EqHw_SetLeftCoefs()
60 hwwrite(vortex->mmio, 0x2b000 + n * 0x30, coefs[i + 0]); in vortex_EqHw_SetLeftCoefs()
61 hwwrite(vortex->mmio, 0x2b004 + n * 0x30, coefs[i + 1]); in vortex_EqHw_SetLeftCoefs()
63 if (eqhw->this08 == 0) { in vortex_EqHw_SetLeftCoefs()
64 hwwrite(vortex->mmio, 0x2b008 + n * 0x30, coefs[i + 2]); in vortex_EqHw_SetLeftCoefs()
65 hwwrite(vortex->mmio, 0x2b00c + n * 0x30, coefs[i + 3]); in vortex_EqHw_SetLeftCoefs()
66 hwwrite(vortex->mmio, 0x2b010 + n * 0x30, coefs[i + 4]); in vortex_EqHw_SetLeftCoefs()
68 hwwrite(vortex->mmio, 0x2b008 + n * 0x30, sign_invert(coefs[2 + i])); in vortex_EqHw_SetLeftCoefs()
69 hwwrite(vortex->mmio, 0x2b00c + n * 0x30, sign_invert(coefs[3 + i])); in vortex_EqHw_SetLeftCoefs()
70 hwwrite(vortex->mmio, 0x2b010 + n * 0x30, sign_invert(coefs[4 + i])); in vortex_EqHw_SetLeftCoefs()
78 eqhw_t *eqhw = &(vortex->eq.this04); in vortex_EqHw_SetRightCoefs()
81 for (n = 0; n < eqhw->this04; n++) { in vortex_EqHw_SetRightCoefs()
82 hwwrite(vortex->mmio, 0x2b1e0 + n * 0x30, coefs[0 + i]); in vortex_EqHw_SetRightCoefs()
83 hwwrite(vortex->mmio, 0x2b1e4 + n * 0x30, coefs[1 + i]); in vortex_EqHw_SetRightCoefs()
85 if (eqhw->this08 == 0) { in vortex_EqHw_SetRightCoefs()
86 hwwrite(vortex->mmio, 0x2b1e8 + n * 0x30, coefs[2 + i]); in vortex_EqHw_SetRightCoefs()
87 hwwrite(vortex->mmio, 0x2b1ec + n * 0x30, coefs[3 + i]); in vortex_EqHw_SetRightCoefs()
88 hwwrite(vortex->mmio, 0x2b1f0 + n * 0x30, coefs[4 + i]); in vortex_EqHw_SetRightCoefs()
90 hwwrite(vortex->mmio, 0x2b1e8 + n * 0x30, sign_invert(coefs[2 + i])); in vortex_EqHw_SetRightCoefs()
91 hwwrite(vortex->mmio, 0x2b1ec + n * 0x30, sign_invert(coefs[3 + i])); in vortex_EqHw_SetRightCoefs()
92 hwwrite(vortex->mmio, 0x2b1f0 + n * 0x30, sign_invert(coefs[4 + i])); in vortex_EqHw_SetRightCoefs()
101 eqhw_t *eqhw = &(vortex->eq.this04); in vortex_EqHw_SetLeftStates()
104 hwwrite(vortex->mmio, 0x2b3fc, a[0]); in vortex_EqHw_SetLeftStates()
105 hwwrite(vortex->mmio, 0x2b400, a[1]); in vortex_EqHw_SetLeftStates()
107 for (ebx = 0; ebx < eqhw->this04; ebx++) { in vortex_EqHw_SetLeftStates()
108 hwwrite(vortex->mmio, 0x2b014 + (i * 0xc), b[i]); in vortex_EqHw_SetLeftStates()
109 hwwrite(vortex->mmio, 0x2b018 + (i * 0xc), b[1 + i]); in vortex_EqHw_SetLeftStates()
110 hwwrite(vortex->mmio, 0x2b01c + (i * 0xc), b[2 + i]); in vortex_EqHw_SetLeftStates()
111 hwwrite(vortex->mmio, 0x2b020 + (i * 0xc), b[3 + i]); in vortex_EqHw_SetLeftStates()
118 eqhw_t *eqhw = &(vortex->eq.this04); in vortex_EqHw_SetRightStates()
121 hwwrite(vortex->mmio, 0x2b404, a[0]); in vortex_EqHw_SetRightStates()
122 hwwrite(vortex->mmio, 0x2b408, a[1]); in vortex_EqHw_SetRightStates()
124 for (ebx = 0; ebx < eqhw->this04; ebx++) { in vortex_EqHw_SetRightStates()
125 hwwrite(vortex->mmio, 0x2b1f4 + (i * 0xc), b[i]); in vortex_EqHw_SetRightStates()
126 hwwrite(vortex->mmio, 0x2b1f8 + (i * 0xc), b[1 + i]); in vortex_EqHw_SetRightStates()
127 hwwrite(vortex->mmio, 0x2b1fc + (i * 0xc), b[2 + i]); in vortex_EqHw_SetRightStates()
128 hwwrite(vortex->mmio, 0x2b200 + (i * 0xc), b[3 + i]); in vortex_EqHw_SetRightStates()
136 *a = hwread(vortex->mmio, 0x2b3c4);
137 *b = hwread(vortex->mmio, 0x2b3c8);
164 eqhw_t *eqhw = &(vortex->eq.this04); in vortex_EqHw_SetBypassGain()
165 if (eqhw->this08 == 0) { in vortex_EqHw_SetBypassGain()
166 hwwrite(vortex->mmio, 0x2b3d4, a); in vortex_EqHw_SetBypassGain()
167 hwwrite(vortex->mmio, 0x2b3ec, b); in vortex_EqHw_SetBypassGain()
169 hwwrite(vortex->mmio, 0x2b3d4, sign_invert(a)); in vortex_EqHw_SetBypassGain()
170 hwwrite(vortex->mmio, 0x2b3ec, sign_invert(b)); in vortex_EqHw_SetBypassGain()
177 hwwrite(vortex->mmio, 0x2b3e0, a); in vortex_EqHw_SetA3DBypassGain()
178 hwwrite(vortex->mmio, 0x2b3f8, b); in vortex_EqHw_SetA3DBypassGain()
185 hwwrite(vortex->mmio, 0x2b3d0, a);
186 hwwrite(vortex->mmio, 0x2b3e8, b);
192 hwwrite(vortex->mmio, 0x2b3dc, a);
193 hwwrite(vortex->mmio, 0x2b3f4, b);
200 hwwrite(vortex->mmio, 0x2b02c + (index * 0x30), b); in vortex_EqHw_SetLeftGainsSingleTarget()
206 hwwrite(vortex->mmio, 0x2b20c + (index * 0x30), b); in vortex_EqHw_SetRightGainsSingleTarget()
211 eqhw_t *eqhw = &(vortex->eq.this04); in vortex_EqHw_SetLeftGainsTarget()
214 for (ebx = 0; ebx < eqhw->this04; ebx++) { in vortex_EqHw_SetLeftGainsTarget()
215 hwwrite(vortex->mmio, 0x2b02c + ebx * 0x30, a[ebx]); in vortex_EqHw_SetLeftGainsTarget()
221 eqhw_t *eqhw = &(vortex->eq.this04); in vortex_EqHw_SetRightGainsTarget()
224 for (ebx = 0; ebx < eqhw->this04; ebx++) { in vortex_EqHw_SetRightGainsTarget()
225 hwwrite(vortex->mmio, 0x2b20c + ebx * 0x30, a[ebx]); in vortex_EqHw_SetRightGainsTarget()
231 eqhw_t *eqhw = &(vortex->eq.this04); in vortex_EqHw_SetLeftGainsCurrent()
234 for (ebx = 0; ebx < eqhw->this04; ebx++) { in vortex_EqHw_SetLeftGainsCurrent()
235 hwwrite(vortex->mmio, 0x2b028 + ebx * 0x30, a[ebx]); in vortex_EqHw_SetLeftGainsCurrent()
241 eqhw_t *eqhw = &(vortex->eq.this04); in vortex_EqHw_SetRightGainsCurrent()
244 for (ebx = 0; ebx < eqhw->this04; ebx++) { in vortex_EqHw_SetRightGainsCurrent()
245 hwwrite(vortex->mmio, 0x2b208 + ebx * 0x30, a[ebx]); in vortex_EqHw_SetRightGainsCurrent()
252 eqhw_t *eqhw = &(vortex->eq.this04);
255 if (eqhw->this04 < 0)
259 a[ebx] = hwread(vortex->mmio, 0x2b02c + ebx * 0x30);
262 while (ebx < eqhw->this04);
267 eqhw_t *eqhw = &(vortex->eq.this04);
270 if (eqhw->this04 < 0)
274 a[ebx] = hwread(vortex->mmio, 0x2b20c + ebx * 0x30);
277 while (ebx < eqhw->this04);
282 eqhw_t *eqhw = &(vortex->eq.this04);
285 if (eqhw->this04 < 0)
289 a[ebx] = hwread(vortex->mmio, 0x2b028 + ebx * 0x30);
292 while (ebx < eqhw->this04);
297 eqhw_t *eqhw = &(vortex->eq.this04);
300 if (eqhw->this04 < 0)
304 a[ebx] = hwread(vortex->mmio, 0x2b208 + ebx * 0x30);
307 while (ebx < eqhw->this04);
311 /* EQ band levels settings */
314 eqhw_t *eqhw = &(vortex->eq.this04); in vortex_EqHw_SetLevels()
318 for (i = 0; i < eqhw->this04; i++) { in vortex_EqHw_SetLevels()
319 hwwrite(vortex->mmio, 0x2b024 + i * VORTEX_BAND_COEFF_SIZE, peaks[i]); in vortex_EqHw_SetLevels()
322 hwwrite(vortex->mmio, 0x2b3cc, peaks[eqhw->this04]); in vortex_EqHw_SetLevels()
323 hwwrite(vortex->mmio, 0x2b3d8, peaks[eqhw->this04 + 1]); in vortex_EqHw_SetLevels()
326 for (i = 0; i < eqhw->this04; i++) { in vortex_EqHw_SetLevels()
327 hwwrite(vortex->mmio, 0x2b204 + i * VORTEX_BAND_COEFF_SIZE, in vortex_EqHw_SetLevels()
328 peaks[i + (eqhw->this04 + 2)]); in vortex_EqHw_SetLevels()
331 hwwrite(vortex->mmio, 0x2b3e4, peaks[2 + (eqhw->this04 * 2)]); in vortex_EqHw_SetLevels()
332 hwwrite(vortex->mmio, 0x2b3f0, peaks[3 + (eqhw->this04 * 2)]); in vortex_EqHw_SetLevels()
338 eqhw_t *eqhw = &(vortex->eq.this04);
341 if (eqhw->this04 < 0)
346 a[ebx] = hwread(vortex->mmio, 0x2b024 + ebx * 0x30);
349 while (ebx < eqhw->this04);
351 a[eqhw->this04] = hwread(vortex->mmio, 0x2b3cc);
352 a[eqhw->this04 + 1] = hwread(vortex->mmio, 0x2b3d8);
356 a[ebx + (eqhw->this04 + 2)] =
357 hwread(vortex->mmio, 0x2b204 + ebx * 0x30);
360 while (ebx < eqhw->this04);
362 a[2 + (eqhw->this04 * 2)] = hwread(vortex->mmio, 0x2b3e4);
363 a[3 + (eqhw->this04 * 2)] = hwread(vortex->mmio, 0x2b3f0);
370 hwwrite(vortex->mmio, 0x2b440, reg); in vortex_EqHw_SetControlReg()
375 hwwrite(vortex->mmio, 0x2b440, ((sr & 0x1f) << 3) | 0xb800); in vortex_EqHw_SetSampleRate()
381 *reg = hwread(vortex->mmio, 0x2b440);
386 *sr = (hwread(vortex->mmio, 0x2b440) >> 3) & 0x1f;
392 hwwrite(vortex->mmio, VORTEX_EQ_CTRL, 0xf001); in vortex_EqHw_Enable()
397 hwwrite(vortex->mmio, VORTEX_EQ_CTRL, 0xf000); in vortex_EqHw_Disable()
405 hwwrite(vortex->mmio, VORTEX_EQ_DEST + (i << 2), 0x0); in vortex_EqHw_ZeroIO()
407 hwwrite(vortex->mmio, VORTEX_EQ_SOURCE + (i << 2), 0x0); in vortex_EqHw_ZeroIO()
414 hwwrite(vortex->mmio, VORTEX_EQ_DEST + (i << 2), 0x0); in vortex_EqHw_ZeroA3DIO()
422 hwwrite(vortex->mmio, 0x2b3c0, 0); in vortex_EqHw_ZeroState()
457 /* Program EQ block as 10 band Equalizer */
464 vortex_EqHw_SetLeftCoefs(vortex, coefset->LeftCoefs); in vortex_EqHw_Program10Band()
465 vortex_EqHw_SetRightCoefs(vortex, coefset->RightCoefs); in vortex_EqHw_Program10Band()
467 vortex_EqHw_SetLeftGainsCurrent(vortex, coefset->LeftGains); in vortex_EqHw_Program10Band()
469 vortex_EqHw_SetRightGainsTarget(vortex, coefset->RightGains); in vortex_EqHw_Program10Band()
470 vortex_EqHw_SetLeftGainsTarget(vortex, coefset->LeftGains); in vortex_EqHw_Program10Band()
472 vortex_EqHw_SetRightGainsCurrent(vortex, coefset->RightGains); in vortex_EqHw_Program10Band()
475 /* Read all EQ peaks. (think VU meter) */
478 eqhw_t *eqhw = &(vortex->eq.this04); in vortex_EqHw_GetTenBandLevels()
481 if (eqhw->this04 <= 0) in vortex_EqHw_GetTenBandLevels()
484 for (i = 0; i < eqhw->this04; i++) in vortex_EqHw_GetTenBandLevels()
485 peaks[i] = hwread(vortex->mmio, 0x2B024 + i * 0x30); in vortex_EqHw_GetTenBandLevels()
486 for (i = 0; i < eqhw->this04; i++) in vortex_EqHw_GetTenBandLevels()
487 peaks[i + eqhw->this04] = in vortex_EqHw_GetTenBandLevels()
488 hwread(vortex->mmio, 0x2B204 + i * 0x30); in vortex_EqHw_GetTenBandLevels()
495 eqlzr_t *eq = &(vortex->eq); in vortex_Eqlzr_GetLeftGain() local
497 if (eq->this28) { in vortex_Eqlzr_GetLeftGain()
498 *gain = eq->this130[index]; in vortex_Eqlzr_GetLeftGain()
506 eqlzr_t *eq = &(vortex->eq); in vortex_Eqlzr_SetLeftGain() local
508 if (eq->this28 == 0) in vortex_Eqlzr_SetLeftGain()
511 eq->this130[index] = gain; in vortex_Eqlzr_SetLeftGain()
512 if (eq->this54) in vortex_Eqlzr_SetLeftGain()
520 eqlzr_t *eq = &(vortex->eq); in vortex_Eqlzr_GetRightGain() local
522 if (eq->this28) { in vortex_Eqlzr_GetRightGain()
523 *gain = eq->this130[index + eq->this10]; in vortex_Eqlzr_GetRightGain()
531 eqlzr_t *eq = &(vortex->eq); in vortex_Eqlzr_SetRightGain() local
533 if (eq->this28 == 0) in vortex_Eqlzr_SetRightGain()
536 eq->this130[index + eq->this10] = gain; in vortex_Eqlzr_SetRightGain()
537 if (eq->this54) in vortex_Eqlzr_SetRightGain()
547 eqlzr_t *eq = &(vortex->eq);
550 if (eq->this10 == 0)
557 (vortex, si, &gains[si + eq->this10]))
561 while (eq->this10 > si) ;
568 eqlzr_t *eq = &(vortex->eq); in vortex_Eqlzr_SetAllBandsFromActiveCoeffSet() local
570 vortex_EqHw_SetLeftGainsTarget(vortex, eq->this130); in vortex_Eqlzr_SetAllBandsFromActiveCoeffSet()
571 vortex_EqHw_SetRightGainsTarget(vortex, &(eq->this130[eq->this10])); in vortex_Eqlzr_SetAllBandsFromActiveCoeffSet()
579 eqlzr_t *eq = &(vortex->eq); in vortex_Eqlzr_SetAllBands() local
582 if (((eq->this10) * 2 != count) || (eq->this28 == 0)) in vortex_Eqlzr_SetAllBands()
586 eq->this130[i] = gains[i]; in vortex_Eqlzr_SetAllBands()
589 if (eq->this54) in vortex_Eqlzr_SetAllBands()
597 eqlzr_t *eq = &(vortex->eq); in vortex_Eqlzr_SetA3dBypassGain() local
600 eq->this58 = a; in vortex_Eqlzr_SetA3dBypassGain()
601 eq->this5c = b; in vortex_Eqlzr_SetA3dBypassGain()
602 if (eq->this54) in vortex_Eqlzr_SetA3dBypassGain()
603 eax = eq->this0e; in vortex_Eqlzr_SetA3dBypassGain()
605 eax = eq->this0a; in vortex_Eqlzr_SetA3dBypassGain()
606 ebx = (eax * eq->this58) >> 0x10; in vortex_Eqlzr_SetA3dBypassGain()
607 eax = (eax * eq->this5c) >> 0x10; in vortex_Eqlzr_SetA3dBypassGain()
613 eqlzr_t *eq = &(vortex->eq); in vortex_Eqlzr_ProgramA3dBypassGain() local
616 if (eq->this54) in vortex_Eqlzr_ProgramA3dBypassGain()
617 eax = eq->this0e; in vortex_Eqlzr_ProgramA3dBypassGain()
619 eax = eq->this0a; in vortex_Eqlzr_ProgramA3dBypassGain()
620 ebx = (eax * eq->this58) >> 0x10; in vortex_Eqlzr_ProgramA3dBypassGain()
621 eax = (eax * eq->this5c) >> 0x10; in vortex_Eqlzr_ProgramA3dBypassGain()
633 eqlzr_t *eq = &(vortex->eq); in vortex_Eqlzr_SetBypass() local
635 if ((eq->this28) && (bp == 0)) { in vortex_Eqlzr_SetBypass()
636 /* EQ enabled */ in vortex_Eqlzr_SetBypass()
638 vortex_EqHw_SetBypassGain(vortex, eq->this08, eq->this08); in vortex_Eqlzr_SetBypass()
640 /* EQ disabled. */ in vortex_Eqlzr_SetBypass()
641 vortex_EqHw_SetLeftGainsTarget(vortex, eq->this14_array); in vortex_Eqlzr_SetBypass()
642 vortex_EqHw_SetRightGainsTarget(vortex, eq->this14_array); in vortex_Eqlzr_SetBypass()
643 vortex_EqHw_SetBypassGain(vortex, eq->this0c, eq->this0c); in vortex_Eqlzr_SetBypass()
650 eqlzr_t *eq = &(vortex->eq); in vortex_Eqlzr_ReadAndSetActiveCoefSet() local
652 /* Set EQ BiQuad filter coeficients */ in vortex_Eqlzr_ReadAndSetActiveCoefSet()
653 memcpy(&(eq->coefset), &asEqCoefsNormal, sizeof(auxxEqCoeffSet_t)); in vortex_Eqlzr_ReadAndSetActiveCoefSet()
654 /* Set EQ Band gain levels and dump into hardware registers. */ in vortex_Eqlzr_ReadAndSetActiveCoefSet()
655 vortex_Eqlzr_SetAllBands(vortex, eq_gains_normal, eq->this10 * 2); in vortex_Eqlzr_ReadAndSetActiveCoefSet()
660 eqlzr_t *eq = &(vortex->eq); in vortex_Eqlzr_GetAllPeaks() local
662 if (eq->this10 == 0) in vortex_Eqlzr_GetAllPeaks()
664 *count = eq->this10 * 2; in vortex_Eqlzr_GetAllPeaks()
672 eqlzr_t *eq = &(vortex->eq);
674 return (&(eq->coefset));
679 eqlzr_t *eq = &(vortex->eq); in vortex_Eqlzr_init() local
682 //eq->this04 = 0; in vortex_Eqlzr_init()
683 eq->this08 = 0; /* Bypass gain with EQ in use. */ in vortex_Eqlzr_init()
684 eq->this0a = 0x5999; in vortex_Eqlzr_init()
685 eq->this0c = 0x5999; /* Bypass gain with EQ disabled. */ in vortex_Eqlzr_init()
686 eq->this0e = 0x5999; in vortex_Eqlzr_init()
688 eq->this10 = 0xa; /* 10 eq frequency bands. */ in vortex_Eqlzr_init()
689 eq->this04.this04 = eq->this10; in vortex_Eqlzr_init()
690 eq->this28 = 0x1; /* if 1 => Allow read access to this130 (gains) */ in vortex_Eqlzr_init()
691 eq->this54 = 0x0; /* if 1 => Dont Allow access to hardware (gains) */ in vortex_Eqlzr_init()
692 eq->this58 = 0xffff; in vortex_Eqlzr_init()
693 eq->this5c = 0xffff; in vortex_Eqlzr_init()
696 memset(eq->this14_array, 0, sizeof(eq->this14_array)); in vortex_Eqlzr_init()
703 vortex_EqHw_Program10Band(vortex, &(eq->coefset)); in vortex_Eqlzr_init()
704 vortex_Eqlzr_SetBypass(vortex, eq->this54); in vortex_Eqlzr_init()
726 eqlzr_t *eq = &(vortex->eq); in snd_vortex_eqtoggle_get() local
727 //int i = kcontrol->private_value; in snd_vortex_eqtoggle_get()
729 ucontrol->value.integer.value[0] = eq->this54 ? 0 : 1; in snd_vortex_eqtoggle_get()
739 eqlzr_t *eq = &(vortex->eq); in snd_vortex_eqtoggle_put() local
740 //int i = kcontrol->private_value; in snd_vortex_eqtoggle_put()
742 eq->this54 = ucontrol->value.integer.value[0] ? 0 : 1; in snd_vortex_eqtoggle_put()
743 vortex_Eqlzr_SetBypass(vortex, eq->this54); in snd_vortex_eqtoggle_put()
750 .name = "EQ Enable",
762 uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER; in snd_vortex_eq_info()
763 uinfo->count = 2; in snd_vortex_eq_info()
764 uinfo->value.integer.min = 0x0000; in snd_vortex_eq_info()
765 uinfo->value.integer.max = 0x7fff; in snd_vortex_eq_info()
773 int i = kcontrol->private_value; in snd_vortex_eq_get()
778 ucontrol->value.integer.value[0] = gainL; in snd_vortex_eq_get()
779 ucontrol->value.integer.value[1] = gainR; in snd_vortex_eq_get()
787 int changed = 0, i = kcontrol->private_value; in snd_vortex_eq_put()
793 if (gainL != ucontrol->value.integer.value[0]) { in snd_vortex_eq_put()
795 ucontrol->value.integer.value[0]); in snd_vortex_eq_put()
798 if (gainR != ucontrol->value.integer.value[1]) { in snd_vortex_eq_put()
800 ucontrol->value.integer.value[1]); in snd_vortex_eq_put()
820 uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER; in snd_vortex_peaks_info()
821 uinfo->count = 20; in snd_vortex_peaks_info()
822 uinfo->value.integer.min = 0x0000; in snd_vortex_peaks_info()
823 uinfo->value.integer.max = 0x7fff; in snd_vortex_peaks_info()
836 dev_err(vortex->card->dev, in snd_vortex_peaks_get()
838 return -1; in snd_vortex_peaks_get()
841 ucontrol->value.integer.value[i] = peaks[i]; in snd_vortex_peaks_get()
848 .name = "EQ Peaks",
854 /* EQ band gain labels. */
878 return -ENOMEM; in vortex_eq_init()
879 kcontrol->private_value = 0; in vortex_eq_init()
880 err = snd_ctl_add(vortex->card, kcontrol); in vortex_eq_init()
884 /* EQ gain controls */ in vortex_eq_init()
888 return -ENOMEM; in vortex_eq_init()
889 snprintf(kcontrol->id.name, sizeof(kcontrol->id.name), in vortex_eq_init()
891 kcontrol->private_value = i; in vortex_eq_init()
892 err = snd_ctl_add(vortex->card, kcontrol); in vortex_eq_init()
895 //vortex->eqctrl[i] = kcontrol; in vortex_eq_init()
897 /* EQ band levels */ in vortex_eq_init()
900 return -ENOMEM; in vortex_eq_init()
901 err = snd_ctl_add(vortex->card, kcontrol); in vortex_eq_init()
911 //FIXME: segfault because vortex->eqctrl[i] == 4 in vortex_eq_free()
914 if (vortex->eqctrl[i]) in vortex_eq_free()
915 snd_ctl_remove(vortex->card, vortex->eqctrl[i]); in vortex_eq_free()