Lines Matching defs:chip

32 static int read_dsp(struct echoaudio *chip, u32 *data);
33 static int set_professional_spdif(struct echoaudio *chip, char prof);
34 static int load_asic_generic(struct echoaudio *chip, u32 cmd, short asic);
35 static int check_asic_status(struct echoaudio *chip);
36 static int update_flags(struct echoaudio *chip);
39 static int init_hw(struct echoaudio *chip, u16 device_id, u16 subdevice_id)
46 err = init_dsp_comm_page(chip);
48 dev_err(chip->card->dev,
53 chip->device_id = device_id;
54 chip->subdevice_id = subdevice_id;
55 chip->bad_board = true;
56 chip->has_midi = true;
57 chip->dsp_code_to_load = FW_LAYLA20_DSP;
58 chip->input_clock_types =
61 chip->output_clock_types =
64 err = load_firmware(chip);
67 chip->bad_board = false;
74 static int set_mixer_defaults(struct echoaudio *chip)
76 chip->professional_spdif = false;
77 return init_line_levels(chip);
82 static u32 detect_input_clocks(const struct echoaudio *chip)
87 clocks_from_dsp = le32_to_cpu(chip->comm_page->status_clocks);
113 static int check_asic_status(struct echoaudio *chip)
118 chip->asic_loaded = false;
120 send_vector(chip, DSP_VC_TEST_ASIC);
124 if (read_dsp(chip, &asic_status) < 0) {
125 dev_err(chip->card->dev,
132 chip->asic_loaded = true;
143 static int load_asic(struct echoaudio *chip)
147 if (chip->asic_loaded)
150 err = load_asic_generic(chip, DSP_FNC_LOAD_LAYLA_ASIC,
156 return check_asic_status(chip);
161 static int set_sample_rate(struct echoaudio *chip, u32 rate)
168 if (chip->input_clock != ECHO_CLOCK_INTERNAL) {
169 dev_warn(chip->card->dev,
171 chip->comm_page->sample_rate = cpu_to_le32(rate);
172 chip->sample_rate = rate;
176 if (wait_handshake(chip))
179 dev_dbg(chip->card->dev, "set_sample_rate(%d)\n", rate);
180 chip->sample_rate = rate;
181 chip->comm_page->sample_rate = cpu_to_le32(rate);
182 clear_handshake(chip);
183 return send_vector(chip, DSP_VC_SET_LAYLA_SAMPLE_RATE);
188 static int set_input_clock(struct echoaudio *chip, u16 clock_source)
196 rate = chip->sample_rate;
209 dev_err(chip->card->dev,
214 chip->input_clock = clock_source;
216 chip->comm_page->input_clock = cpu_to_le16(clock);
217 clear_handshake(chip);
218 send_vector(chip, DSP_VC_UPDATE_CLOCKS);
221 set_sample_rate(chip, rate);
228 static int set_output_clock(struct echoaudio *chip, u16 clock)
238 dev_err(chip->card->dev, "set_output_clock wrong clock\n");
242 if (wait_handshake(chip))
245 chip->comm_page->output_clock = cpu_to_le16(clock);
246 chip->output_clock = clock;
247 clear_handshake(chip);
248 return send_vector(chip, DSP_VC_UPDATE_CLOCKS);
254 static int set_input_gain(struct echoaudio *chip, u16 input, int gain)
256 if (snd_BUG_ON(input >= num_busses_in(chip)))
259 if (wait_handshake(chip))
262 chip->input_gain[input] = gain;
264 chip->comm_page->line_in_level[input] = gain;
271 static int update_flags(struct echoaudio *chip)
273 if (wait_handshake(chip))
275 clear_handshake(chip);
276 return send_vector(chip, DSP_VC_UPDATE_FLAGS);
281 static int set_professional_spdif(struct echoaudio *chip, char prof)
284 chip->comm_page->flags |=
287 chip->comm_page->flags &=
289 chip->professional_spdif = prof;
290 return update_flags(chip);