18c2ecf20Sopenharmony_ci/************************************************************************ 28c2ecf20Sopenharmony_ci 38c2ecf20Sopenharmony_ciThis file is part of Echo Digital Audio's generic driver library. 48c2ecf20Sopenharmony_ciCopyright Echo Digital Audio Corporation (c) 1998 - 2005 58c2ecf20Sopenharmony_ciAll rights reserved 68c2ecf20Sopenharmony_ciwww.echoaudio.com 78c2ecf20Sopenharmony_ci 88c2ecf20Sopenharmony_ciThis library is free software; you can redistribute it and/or 98c2ecf20Sopenharmony_cimodify it under the terms of the GNU Lesser General Public 108c2ecf20Sopenharmony_ciLicense as published by the Free Software Foundation; either 118c2ecf20Sopenharmony_civersion 2.1 of the License, or (at your option) any later version. 128c2ecf20Sopenharmony_ci 138c2ecf20Sopenharmony_ciThis library is distributed in the hope that it will be useful, 148c2ecf20Sopenharmony_cibut WITHOUT ANY WARRANTY; without even the implied warranty of 158c2ecf20Sopenharmony_ciMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 168c2ecf20Sopenharmony_ciLesser General Public License for more details. 178c2ecf20Sopenharmony_ci 188c2ecf20Sopenharmony_ciYou should have received a copy of the GNU Lesser General Public 198c2ecf20Sopenharmony_ciLicense along with this library; if not, write to the Free Software 208c2ecf20Sopenharmony_ciFoundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 218c2ecf20Sopenharmony_ci 228c2ecf20Sopenharmony_ci************************************************************************* 238c2ecf20Sopenharmony_ci 248c2ecf20Sopenharmony_ci Translation from C++ and adaptation for use in ALSA-Driver 258c2ecf20Sopenharmony_ci were made by Giuliano Pochini <pochini@shiny.it> 268c2ecf20Sopenharmony_ci 278c2ecf20Sopenharmony_ci*************************************************************************/ 288c2ecf20Sopenharmony_ci 298c2ecf20Sopenharmony_cistatic int update_vmixer_level(struct echoaudio *chip); 308c2ecf20Sopenharmony_cistatic int set_vmixer_gain(struct echoaudio *chip, u16 output, 318c2ecf20Sopenharmony_ci u16 pipe, int gain); 328c2ecf20Sopenharmony_ci 338c2ecf20Sopenharmony_ci 348c2ecf20Sopenharmony_cistatic int init_hw(struct echoaudio *chip, u16 device_id, u16 subdevice_id) 358c2ecf20Sopenharmony_ci{ 368c2ecf20Sopenharmony_ci int err; 378c2ecf20Sopenharmony_ci 388c2ecf20Sopenharmony_ci if (snd_BUG_ON((subdevice_id & 0xfff0) != INDIGO_IOX)) 398c2ecf20Sopenharmony_ci return -ENODEV; 408c2ecf20Sopenharmony_ci 418c2ecf20Sopenharmony_ci err = init_dsp_comm_page(chip); 428c2ecf20Sopenharmony_ci if (err < 0) { 438c2ecf20Sopenharmony_ci dev_err(chip->card->dev, 448c2ecf20Sopenharmony_ci "init_hw - could not initialize DSP comm page\n"); 458c2ecf20Sopenharmony_ci return err; 468c2ecf20Sopenharmony_ci } 478c2ecf20Sopenharmony_ci 488c2ecf20Sopenharmony_ci chip->device_id = device_id; 498c2ecf20Sopenharmony_ci chip->subdevice_id = subdevice_id; 508c2ecf20Sopenharmony_ci chip->bad_board = true; 518c2ecf20Sopenharmony_ci chip->dsp_code_to_load = FW_INDIGO_IOX_DSP; 528c2ecf20Sopenharmony_ci /* Since this card has no ASIC, mark it as loaded so everything 538c2ecf20Sopenharmony_ci works OK */ 548c2ecf20Sopenharmony_ci chip->asic_loaded = true; 558c2ecf20Sopenharmony_ci chip->input_clock_types = ECHO_CLOCK_BIT_INTERNAL; 568c2ecf20Sopenharmony_ci 578c2ecf20Sopenharmony_ci err = load_firmware(chip); 588c2ecf20Sopenharmony_ci if (err < 0) 598c2ecf20Sopenharmony_ci return err; 608c2ecf20Sopenharmony_ci chip->bad_board = false; 618c2ecf20Sopenharmony_ci 628c2ecf20Sopenharmony_ci return err; 638c2ecf20Sopenharmony_ci} 648c2ecf20Sopenharmony_ci 658c2ecf20Sopenharmony_ci 668c2ecf20Sopenharmony_ci 678c2ecf20Sopenharmony_cistatic int set_mixer_defaults(struct echoaudio *chip) 688c2ecf20Sopenharmony_ci{ 698c2ecf20Sopenharmony_ci return init_line_levels(chip); 708c2ecf20Sopenharmony_ci} 71