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 if ((err = init_dsp_comm_page(chip))) {
44 dev_err(chip->card->dev,
49 chip->device_id = device_id;
50 chip->subdevice_id = subdevice_id;
51 chip->bad_board = true;
52 chip->dsp_code_to_load = FW_GINA20_DSP;
53 chip->spdif_status = GD_SPDIF_STATUS_UNDEF;
54 chip->clock_state = GD_CLOCK_UNDEF;
57 chip->asic_loaded = true;
58 chip->input_clock_types = ECHO_CLOCK_BIT_INTERNAL |
61 if ((err = load_firmware(chip)) < 0)
63 chip->bad_board = false;
70 static int set_mixer_defaults(struct echoaudio *chip)
72 chip->professional_spdif = false;
73 return init_line_levels(chip);
78 static u32 detect_input_clocks(const struct echoaudio *chip)
84 clocks_from_dsp = le32_to_cpu(chip->comm_page->status_clocks);
97 static int load_asic(struct echoaudio *chip)
104 static int set_sample_rate(struct echoaudio *chip, u32 rate)
108 if (wait_handshake(chip))
126 if (chip->clock_state == clock_state)
128 if (spdif_status == chip->spdif_status)
131 chip->comm_page->sample_rate = cpu_to_le32(rate);
132 chip->comm_page->gd_clock_state = clock_state;
133 chip->comm_page->gd_spdif_status = spdif_status;
134 chip->comm_page->gd_resampler_state = 3; /* magic number - should always be 3 */
138 chip->clock_state = clock_state;
140 chip->spdif_status = spdif_status;
141 chip->sample_rate = rate;
143 clear_handshake(chip);
144 return send_vector(chip, DSP_VC_SET_GD_AUDIO_STATE);
149 static int set_input_clock(struct echoaudio *chip, u16 clock)
155 chip->clock_state = GD_CLOCK_UNDEF;
156 chip->spdif_status = GD_SPDIF_STATUS_UNDEF;
157 set_sample_rate(chip, chip->sample_rate);
158 chip->input_clock = clock;
161 chip->comm_page->gd_clock_state = GD_CLOCK_SPDIFIN;
162 chip->comm_page->gd_spdif_status = GD_SPDIF_STATUS_NOCHANGE;
163 clear_handshake(chip);
164 send_vector(chip, DSP_VC_SET_GD_AUDIO_STATE);
165 chip->clock_state = GD_CLOCK_SPDIFIN;
166 chip->input_clock = clock;
178 static int set_input_gain(struct echoaudio *chip, u16 input, int gain)
180 if (snd_BUG_ON(input >= num_busses_in(chip)))
183 if (wait_handshake(chip))
186 chip->input_gain[input] = gain;
188 chip->comm_page->line_in_level[input] = gain;
195 static int update_flags(struct echoaudio *chip)
197 if (wait_handshake(chip))
199 clear_handshake(chip);
200 return send_vector(chip, DSP_VC_UPDATE_FLAGS);
205 static int set_professional_spdif(struct echoaudio *chip, char prof)
208 chip->comm_page->flags |=
211 chip->comm_page->flags &=
213 chip->professional_spdif = prof;
214 return update_flags(chip);