Back to home page

OSCL-LXR

 
 

    


0001 /************************************************************************
0002 
0003 This file is part of Echo Digital Audio's generic driver library.
0004 Copyright Echo Digital Audio Corporation (c) 1998 - 2005
0005 All rights reserved
0006 www.echoaudio.com
0007 
0008 This library is free software; you can redistribute it and/or
0009 modify it under the terms of the GNU Lesser General Public
0010 License as published by the Free Software Foundation; either
0011 version 2.1 of the License, or (at your option) any later version.
0012 
0013 This library is distributed in the hope that it will be useful,
0014 but WITHOUT ANY WARRANTY; without even the implied warranty of
0015 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
0016 Lesser General Public License for more details.
0017 
0018 You should have received a copy of the GNU Lesser General Public
0019 License along with this library; if not, write to the Free Software
0020 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
0021 
0022 *************************************************************************
0023 
0024  Translation from C++ and adaptation for use in ALSA-Driver
0025  were made by Giuliano Pochini <pochini@shiny.it>
0026 
0027 *************************************************************************/
0028 
0029 static int update_vmixer_level(struct echoaudio *chip);
0030 static int set_vmixer_gain(struct echoaudio *chip, u16 output,
0031                u16 pipe, int gain);
0032 
0033 
0034 static int init_hw(struct echoaudio *chip, u16 device_id, u16 subdevice_id)
0035 {
0036     int err;
0037 
0038     if (snd_BUG_ON((subdevice_id & 0xfff0) != INDIGO_IOX))
0039         return -ENODEV;
0040 
0041     err = init_dsp_comm_page(chip);
0042     if (err < 0) {
0043         dev_err(chip->card->dev,
0044             "init_hw - could not initialize DSP comm page\n");
0045         return err;
0046     }
0047 
0048     chip->device_id = device_id;
0049     chip->subdevice_id = subdevice_id;
0050     chip->bad_board = true;
0051     chip->dsp_code_to_load = FW_INDIGO_IOX_DSP;
0052     /* Since this card has no ASIC, mark it as loaded so everything
0053        works OK */
0054     chip->asic_loaded = true;
0055     chip->input_clock_types = ECHO_CLOCK_BIT_INTERNAL;
0056 
0057     err = load_firmware(chip);
0058     if (err < 0)
0059         return err;
0060     chip->bad_board = false;
0061 
0062     return err;
0063 }
0064 
0065 
0066 
0067 static int set_mixer_defaults(struct echoaudio *chip)
0068 {
0069     return init_line_levels(chip);
0070 }