Lines Matching refs:chip
32 static int set_professional_spdif(struct echoaudio *chip, char prof);
33 static int update_flags(struct echoaudio *chip);
36 static int init_hw(struct echoaudio *chip, u16 device_id, u16 subdevice_id)
43 err = init_dsp_comm_page(chip);
45 dev_err(chip->card->dev,
50 chip->device_id = device_id;
51 chip->subdevice_id = subdevice_id;
52 chip->bad_board = true;
53 chip->dsp_code_to_load = FW_GINA20_DSP;
54 chip->spdif_status = GD_SPDIF_STATUS_UNDEF;
55 chip->clock_state = GD_CLOCK_UNDEF;
58 chip->asic_loaded = true;
59 chip->input_clock_types = ECHO_CLOCK_BIT_INTERNAL |
62 err = load_firmware(chip);
65 chip->bad_board = false;
72 static int set_mixer_defaults(struct echoaudio *chip)
74 chip->professional_spdif = false;
75 return init_line_levels(chip);
80 static u32 detect_input_clocks(const struct echoaudio *chip)
86 clocks_from_dsp = le32_to_cpu(chip->comm_page->status_clocks);
99 static int load_asic(struct echoaudio *chip)
106 static int set_sample_rate(struct echoaudio *chip, u32 rate)
110 if (wait_handshake(chip))
128 if (chip->clock_state == clock_state)
130 if (spdif_status == chip->spdif_status)
133 chip->comm_page->sample_rate = cpu_to_le32(rate);
134 chip->comm_page->gd_clock_state = clock_state;
135 chip->comm_page->gd_spdif_status = spdif_status;
136 chip->comm_page->gd_resampler_state = 3; /* magic number - should always be 3 */
140 chip->clock_state = clock_state;
142 chip->spdif_status = spdif_status;
143 chip->sample_rate = rate;
145 clear_handshake(chip);
146 return send_vector(chip, DSP_VC_SET_GD_AUDIO_STATE);
151 static int set_input_clock(struct echoaudio *chip, u16 clock)
157 chip->clock_state = GD_CLOCK_UNDEF;
158 chip->spdif_status = GD_SPDIF_STATUS_UNDEF;
159 set_sample_rate(chip, chip->sample_rate);
160 chip->input_clock = clock;
163 chip->comm_page->gd_clock_state = GD_CLOCK_SPDIFIN;
164 chip->comm_page->gd_spdif_status = GD_SPDIF_STATUS_NOCHANGE;
165 clear_handshake(chip);
166 send_vector(chip, DSP_VC_SET_GD_AUDIO_STATE);
167 chip->clock_state = GD_CLOCK_SPDIFIN;
168 chip->input_clock = clock;
180 static int set_input_gain(struct echoaudio *chip, u16 input, int gain)
182 if (snd_BUG_ON(input >= num_busses_in(chip)))
185 if (wait_handshake(chip))
188 chip->input_gain[input] = gain;
190 chip->comm_page->line_in_level[input] = gain;
197 static int update_flags(struct echoaudio *chip)
199 if (wait_handshake(chip))
201 clear_handshake(chip);
202 return send_vector(chip, DSP_VC_UPDATE_FLAGS);
207 static int set_professional_spdif(struct echoaudio *chip, char prof)
210 chip->comm_page->flags |=
213 chip->comm_page->flags &=
215 chip->professional_spdif = prof;
216 return update_flags(chip);