Lines Matching defs: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)
44 if ((err = init_dsp_comm_page(chip))) {
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;
71 static int set_mixer_defaults(struct echoaudio *chip)
73 chip->professional_spdif = FALSE;
74 return init_line_levels(chip);
79 static u32 detect_input_clocks(const struct echoaudio *chip)
85 clocks_from_dsp = le32_to_cpu(chip->comm_page->status_clocks);
98 static int load_asic(struct echoaudio *chip)
105 static int set_sample_rate(struct echoaudio *chip, u32 rate)
109 if (wait_handshake(chip))
127 if (chip->clock_state == clock_state)
129 if (spdif_status == chip->spdif_status)
132 chip->comm_page->sample_rate = cpu_to_le32(rate);
133 chip->comm_page->gd_clock_state = clock_state;
134 chip->comm_page->gd_spdif_status = spdif_status;
135 chip->comm_page->gd_resampler_state = 3; /* magic number - should always be 3 */
139 chip->clock_state = clock_state;
141 chip->spdif_status = spdif_status;
142 chip->sample_rate = rate;
144 clear_handshake(chip);
145 return send_vector(chip, DSP_VC_SET_GD_AUDIO_STATE);
150 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;
164 chip->comm_page->gd_clock_state = GD_CLOCK_SPDIFIN;
165 chip->comm_page->gd_spdif_status = GD_SPDIF_STATUS_NOCHANGE;
166 clear_handshake(chip);
167 send_vector(chip, DSP_VC_SET_GD_AUDIO_STATE);
168 chip->clock_state = GD_CLOCK_SPDIFIN;
170 chip->input_clock = clock;
182 static int set_input_gain(struct echoaudio *chip, u16 input, int gain)
184 if (snd_BUG_ON(input >= num_busses_in(chip)))
187 if (wait_handshake(chip))
190 chip->input_gain[input] = gain;
192 chip->comm_page->line_in_level[input] = gain;
199 static int update_flags(struct echoaudio *chip)
201 if (wait_handshake(chip))
203 clear_handshake(chip);
204 return send_vector(chip, DSP_VC_UPDATE_FLAGS);
209 static int set_professional_spdif(struct echoaudio *chip, char prof)
213 chip->comm_page->flags |=
216 chip->comm_page->flags &=
218 chip->professional_spdif = prof;
219 return update_flags(chip);