xref: /linux/sound/pci/echoaudio/indigoiox_dsp.c (revision 1fd1dc41724319406b0aff221a352a400b0ddfc5)
1 // SPDX-License-Identifier: LGPL-2.1-or-later
2 /************************************************************************
3 
4 This file is part of Echo Digital Audio's generic driver library.
5 Copyright Echo Digital Audio Corporation (c) 1998 - 2005
6 All rights reserved
7 www.echoaudio.com
8 
9  Translation from C++ and adaptation for use in ALSA-Driver
10  were made by Giuliano Pochini <pochini@shiny.it>
11 
12 *************************************************************************/
13 
14 static int update_vmixer_level(struct echoaudio *chip);
15 static int set_vmixer_gain(struct echoaudio *chip, u16 output,
16 			   u16 pipe, int gain);
17 
18 
19 static int init_hw(struct echoaudio *chip, u16 device_id, u16 subdevice_id)
20 {
21 	int err;
22 
23 	if (snd_BUG_ON((subdevice_id & 0xfff0) != INDIGO_IOX))
24 		return -ENODEV;
25 
26 	err = init_dsp_comm_page(chip);
27 	if (err < 0) {
28 		dev_err(chip->card->dev,
29 			"init_hw - could not initialize DSP comm page\n");
30 		return err;
31 	}
32 
33 	chip->device_id = device_id;
34 	chip->subdevice_id = subdevice_id;
35 	chip->bad_board = true;
36 	chip->dsp_code_to_load = FW_INDIGO_IOX_DSP;
37 	/* Since this card has no ASIC, mark it as loaded so everything
38 	   works OK */
39 	chip->asic_loaded = true;
40 	chip->input_clock_types = ECHO_CLOCK_BIT_INTERNAL;
41 
42 	err = load_firmware(chip);
43 	if (err < 0)
44 		return err;
45 	chip->bad_board = false;
46 
47 	return err;
48 }
49 
50 
51 
52 static int set_mixer_defaults(struct echoaudio *chip)
53 {
54 	return init_line_levels(chip);
55 }
56