indigodjx_dsp.c 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. /************************************************************************
  2. This file is part of Echo Digital Audio's generic driver library.
  3. Copyright Echo Digital Audio Corporation (c) 1998 - 2005
  4. All rights reserved
  5. www.echoaudio.com
  6. This library is free software; you can redistribute it and/or
  7. modify it under the terms of the GNU Lesser General Public
  8. License as published by the Free Software Foundation; either
  9. version 2.1 of the License, or (at your option) any later version.
  10. This library is distributed in the hope that it will be useful,
  11. but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  13. Lesser General Public License for more details.
  14. You should have received a copy of the GNU Lesser General Public
  15. License along with this library; if not, write to the Free Software
  16. Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  17. *************************************************************************
  18. Translation from C++ and adaptation for use in ALSA-Driver
  19. were made by Giuliano Pochini <pochini@shiny.it>
  20. *************************************************************************/
  21. static int update_vmixer_level(struct echoaudio *chip);
  22. static int set_vmixer_gain(struct echoaudio *chip, u16 output,
  23. u16 pipe, int gain);
  24. static int init_hw(struct echoaudio *chip, u16 device_id, u16 subdevice_id)
  25. {
  26. int err;
  27. if (snd_BUG_ON((subdevice_id & 0xfff0) != INDIGO_DJX))
  28. return -ENODEV;
  29. err = init_dsp_comm_page(chip);
  30. if (err < 0) {
  31. dev_err(chip->card->dev,
  32. "init_hw - could not initialize DSP comm page\n");
  33. return err;
  34. }
  35. chip->device_id = device_id;
  36. chip->subdevice_id = subdevice_id;
  37. chip->bad_board = true;
  38. chip->dsp_code_to_load = FW_INDIGO_DJX_DSP;
  39. /* Since this card has no ASIC, mark it as loaded so everything
  40. works OK */
  41. chip->asic_loaded = true;
  42. chip->input_clock_types = ECHO_CLOCK_BIT_INTERNAL;
  43. err = load_firmware(chip);
  44. if (err < 0)
  45. return err;
  46. chip->bad_board = false;
  47. return err;
  48. }
  49. static int set_mixer_defaults(struct echoaudio *chip)
  50. {
  51. return init_line_levels(chip);
  52. }