/[openvortex]/alsa/pci/au88x0/au88x0_eq.c
ViewVC logotype

Diff of /alsa/pci/au88x0/au88x0_eq.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.2 by mjander, Thu Jul 3 04:40:01 2003 UTC revision 1.3 by mjander, Fri Jul 4 03:33:02 2003 UTC
# Line 340  void vortex_EqHw_SetLevels(vortex_t *vor Line 340  void vortex_EqHw_SetLevels(vortex_t *vor
340    
341  void vortex_EqHw_GetLevels(vortex_t *vortex, u16 a[]) {  void vortex_EqHw_GetLevels(vortex_t *vortex, u16 a[]) {
342          eqhw_t *eqhw = &(vortex->eq.this04);          eqhw_t *eqhw = &(vortex->eq.this04);
343          int edi, ebx=0;          int ebx;
344                    
345          if (eqhw->this04 < 0)          if (eqhw->this04 < 0)
346                  return;                  return;
347                    
348          edi = 0x2b024;          ebx = 0;
349          do {          do {
350                  a[ebx] = hwread(vortex->mmio, edi);                  a[ebx] = hwread(vortex->mmio, 0x2b024 + ebx*0x30);
                 edi += 0x30;  
351                  ebx++;                  ebx++;
352          } while (ebx < eqhw->this04);          } while (ebx < eqhw->this04);
353                    
354          a[eqhw->this04] = hwread(vortex->mmio, 0x2b3cc);          a[eqhw->this04] = hwread(vortex->mmio, 0x2b3cc);
355          a[eqhw->this04+1] = hwread(vortex->mmio, 0x2b3d8);          a[eqhw->this04+1] = hwread(vortex->mmio, 0x2b3d8);
356                    
357          if ((eqhw->this04+2) < ((eqhw->this04*2)+2)) {          ebx = 0;
358                  edi = 0x2afc4 + (((eqhw->this04+2)*3) << 4);          do {
359                  do {                  a[ebx+(eqhw->this04+2)] = hwread(vortex->mmio, 0x2b204 + ebx*0x30);
360                          a[ebx+(eqhw->this04+1)] = hwread(vortex->mmio, edi);                  ebx++;
361                          edi += 0x30;          } while (ebx < eqhw->this04);
362                          ebx++;          
                 } while (ebx < (2+(eqhw->this04*2)));  
         }  
363          a[2+(eqhw->this04*2)] = hwread(vortex->mmio, 0x2b3e4);          a[2+(eqhw->this04*2)] = hwread(vortex->mmio, 0x2b3e4);
364          a[3+(eqhw->this04*2)] = hwread(vortex->mmio, 0x2b3f0);          a[3+(eqhw->this04*2)] = hwread(vortex->mmio, 0x2b3f0);
365  }  }
# Line 510  int  vortex_Eqlzr_GetAllBands(vortex_t * Line 507  int  vortex_Eqlzr_GetAllBands(vortex_t *
507          eqlzr_t *eq = &(vortex->eq);          eqlzr_t *eq = &(vortex->eq);
508          int si=0;          int si=0;
509                    
510          if (eq->this10)          if (eq->this10 == 0)
511                  return 1;                  return 1;
512                    
513          {          {
# Line 528  int  vortex_Eqlzr_SetAllBandsFromActiveC Line 525  int  vortex_Eqlzr_SetAllBandsFromActiveC
525          eqlzr_t *eq = &(vortex->eq);          eqlzr_t *eq = &(vortex->eq);
526                    
527          vortex_EqHw_SetLeftGainsTarget(vortex, eq->this130);          vortex_EqHw_SetLeftGainsTarget(vortex, eq->this130);
528          vortex_EqHw_SetRightGainsTarget(vortex, &(eq->this130[(eq->this10)*2]));          vortex_EqHw_SetRightGainsTarget(vortex, &(eq->this130[eq->this10]));
529                    
530          return 0;          return 0;
531  }  }
# Line 537  int  vortex_Eqlzr_SetAllBands(vortex_t * Line 534  int  vortex_Eqlzr_SetAllBands(vortex_t *
534          eqlzr_t *eq = &(vortex->eq);          eqlzr_t *eq = &(vortex->eq);
535          int i;          int i;
536                    
537          if ((eq->this10) || ((eq->this24)*2 != count))          if (((eq->this10)*2 != count) || (eq->this28 == 0))
538                  return 1;                  return 1;
539                    
540          if (0 < count) {          if (0 < count) {
541                  for (i=0; i<count; i++)                  for (i=0; i<count; i++) {
542                          eq->this130[i] = gains[i];                          eq->this130[i] = gains[i];
543                    }
544          }          }
545          if (eq->this54)          if (eq->this54)
546                  return 0;                  return 0;
# Line 566  void vortex_Eqlzr_SetBypass(vortex_t *vo Line 564  void vortex_Eqlzr_SetBypass(vortex_t *vo
564          eqlzr_t *eq = &(vortex->eq);          eqlzr_t *eq = &(vortex->eq);
565                    
566          if ((eq->this28) && (bp == 0)) {          if ((eq->this28) && (bp == 0)) {
567                          vortex_Eqlzr_SetAllBandsFromActiveCoeffSet(vortex);                  vortex_Eqlzr_SetAllBandsFromActiveCoeffSet(vortex);
568                          vortex_EqHw_SetBypassGain(vortex, eq->this08, eq->this08);                  vortex_EqHw_SetBypassGain(vortex, eq->this08, eq->this08);
569          } else {          } else {
570                  vortex_EqHw_SetLeftGainsTarget(vortex, (u16*)(eq->this14));                  vortex_EqHw_SetLeftGainsTarget(vortex, (u16*)(eq->this14));
571                  vortex_EqHw_SetRightGainsTarget(vortex, (u16*)(eq->this14));                  vortex_EqHw_SetRightGainsTarget(vortex, (u16*)(eq->this14));
# Line 581  void vortex_Eqlzr_ReadAndSetActiveCoefSe Line 579  void vortex_Eqlzr_ReadAndSetActiveCoefSe
579          eqlzr_t *eq = &(vortex->eq);          eqlzr_t *eq = &(vortex->eq);
580                    
581          /* Set EQ BiQuad filter coeficients */          /* Set EQ BiQuad filter coeficients */
582          memcpy(&(eq->coefset), asEqCoefsNormal, sizeof(auxxEqCoeffSet_t));          memcpy(&(eq->coefset), &asEqCoefsNormal, sizeof(auxxEqCoeffSet_t));
583          /* Set EQ Band gain levels. */          /* Set EQ Band gain levels and dump into hardware registers. */
584          memcpy(&(eq->this130), &(eq->coefset) + sizeof(auxxEqCoeffSet_t)-20, sizeof(u16)*20);          vortex_Eqlzr_SetAllBands(vortex, eq_gains_normal, eq->this10*2);        
585  }  }
586    
587  #if 0  #if 0
# Line 629  void vortex_Eqlzr_init(vortex_t *vortex) Line 627  void vortex_Eqlzr_init(vortex_t *vortex)
627          /* Actual init. */          /* Actual init. */
628          vortex_EqHw_ZeroState(vortex);          vortex_EqHw_ZeroState(vortex);
629          vortex_EqHw_SetSampleRate(vortex, 0x11);          vortex_EqHw_SetSampleRate(vortex, 0x11);
         //memset(&(eq->coefset), 0, sizeof(auxxEqCoeffSet_t));  
630          vortex_Eqlzr_ReadAndSetActiveCoefSet(vortex);          vortex_Eqlzr_ReadAndSetActiveCoefSet(vortex);
631                    
632          vortex_EqHw_Program10Band(vortex, &(eq->coefset));          vortex_EqHw_Program10Band(vortex, &(eq->coefset));
# Line 655  static int snd_vortex_eq_get(snd_kcontro Line 652  static int snd_vortex_eq_get(snd_kcontro
652                    
653          vortex_Eqlzr_GetLeftGain(vortex, i, &gainL);          vortex_Eqlzr_GetLeftGain(vortex, i, &gainL);
654          vortex_Eqlzr_GetRightGain(vortex, i, &gainR);          vortex_Eqlzr_GetRightGain(vortex, i, &gainR);
         printk(KERN_INFO "vortex: eq get level[%d] = 0x%x \n", i, gainL);  
655          ucontrol->value.integer.value[0] = gainL;          ucontrol->value.integer.value[0] = gainL;
656          ucontrol->value.integer.value[1] = gainR;          ucontrol->value.integer.value[1] = gainR;
657          return 0;          return 0;
# Line 677  static int snd_vortex_eq_put(snd_kcontro Line 673  static int snd_vortex_eq_put(snd_kcontro
673                  vortex_Eqlzr_SetRightGain(vortex, i, ucontrol->value.integer.value[1]);                  vortex_Eqlzr_SetRightGain(vortex, i, ucontrol->value.integer.value[1]);
674                  changed = 1;                  changed = 1;
675          }          }
         printk(KERN_INFO "vortex eq put level[%d] = 0x%x\n", i, gainL);  
           
676          return changed;          return changed;
677  }  }
678    
# Line 770  int vortex_eq_init(vortex_t *vortex) { Line 764  int vortex_eq_init(vortex_t *vortex) {
764                  return err;                  return err;
765                  vortex->eqctrl[i] = kcontrol;                  vortex->eqctrl[i] = kcontrol;
766          }          }
         printk(KERN_INFO "EQ enabled -%d- \n", sizeof(short));  
767          return 0;          return 0;
768  }  }
769    

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.3

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26