162306a36Sopenharmony_ci/************************************************************************
262306a36Sopenharmony_ci
362306a36Sopenharmony_ciThis file is part of Echo Digital Audio's generic driver library.
462306a36Sopenharmony_ciCopyright Echo Digital Audio Corporation (c) 1998 - 2005
562306a36Sopenharmony_ciAll rights reserved
662306a36Sopenharmony_ciwww.echoaudio.com
762306a36Sopenharmony_ci
862306a36Sopenharmony_ciThis library is free software; you can redistribute it and/or
962306a36Sopenharmony_cimodify it under the terms of the GNU Lesser General Public
1062306a36Sopenharmony_ciLicense as published by the Free Software Foundation; either
1162306a36Sopenharmony_civersion 2.1 of the License, or (at your option) any later version.
1262306a36Sopenharmony_ci
1362306a36Sopenharmony_ciThis library is distributed in the hope that it will be useful,
1462306a36Sopenharmony_cibut WITHOUT ANY WARRANTY; without even the implied warranty of
1562306a36Sopenharmony_ciMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
1662306a36Sopenharmony_ciLesser General Public License for more details.
1762306a36Sopenharmony_ci
1862306a36Sopenharmony_ciYou should have received a copy of the GNU Lesser General Public
1962306a36Sopenharmony_ciLicense along with this library; if not, write to the Free Software
2062306a36Sopenharmony_ciFoundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
2162306a36Sopenharmony_ci
2262306a36Sopenharmony_ci*************************************************************************
2362306a36Sopenharmony_ci
2462306a36Sopenharmony_ci Translation from C++ and adaptation for use in ALSA-Driver
2562306a36Sopenharmony_ci were made by Giuliano Pochini <pochini@shiny.it>
2662306a36Sopenharmony_ci
2762306a36Sopenharmony_ci*************************************************************************/
2862306a36Sopenharmony_ci
2962306a36Sopenharmony_cistatic int update_vmixer_level(struct echoaudio *chip);
3062306a36Sopenharmony_cistatic int set_vmixer_gain(struct echoaudio *chip, u16 output,
3162306a36Sopenharmony_ci			   u16 pipe, int gain);
3262306a36Sopenharmony_ci
3362306a36Sopenharmony_ci
3462306a36Sopenharmony_cistatic int init_hw(struct echoaudio *chip, u16 device_id, u16 subdevice_id)
3562306a36Sopenharmony_ci{
3662306a36Sopenharmony_ci	int err;
3762306a36Sopenharmony_ci
3862306a36Sopenharmony_ci	if (snd_BUG_ON((subdevice_id & 0xfff0) != INDIGO_IOX))
3962306a36Sopenharmony_ci		return -ENODEV;
4062306a36Sopenharmony_ci
4162306a36Sopenharmony_ci	err = init_dsp_comm_page(chip);
4262306a36Sopenharmony_ci	if (err < 0) {
4362306a36Sopenharmony_ci		dev_err(chip->card->dev,
4462306a36Sopenharmony_ci			"init_hw - could not initialize DSP comm page\n");
4562306a36Sopenharmony_ci		return err;
4662306a36Sopenharmony_ci	}
4762306a36Sopenharmony_ci
4862306a36Sopenharmony_ci	chip->device_id = device_id;
4962306a36Sopenharmony_ci	chip->subdevice_id = subdevice_id;
5062306a36Sopenharmony_ci	chip->bad_board = true;
5162306a36Sopenharmony_ci	chip->dsp_code_to_load = FW_INDIGO_IOX_DSP;
5262306a36Sopenharmony_ci	/* Since this card has no ASIC, mark it as loaded so everything
5362306a36Sopenharmony_ci	   works OK */
5462306a36Sopenharmony_ci	chip->asic_loaded = true;
5562306a36Sopenharmony_ci	chip->input_clock_types = ECHO_CLOCK_BIT_INTERNAL;
5662306a36Sopenharmony_ci
5762306a36Sopenharmony_ci	err = load_firmware(chip);
5862306a36Sopenharmony_ci	if (err < 0)
5962306a36Sopenharmony_ci		return err;
6062306a36Sopenharmony_ci	chip->bad_board = false;
6162306a36Sopenharmony_ci
6262306a36Sopenharmony_ci	return err;
6362306a36Sopenharmony_ci}
6462306a36Sopenharmony_ci
6562306a36Sopenharmony_ci
6662306a36Sopenharmony_ci
6762306a36Sopenharmony_cistatic int set_mixer_defaults(struct echoaudio *chip)
6862306a36Sopenharmony_ci{
6962306a36Sopenharmony_ci	return init_line_levels(chip);
7062306a36Sopenharmony_ci}
71