Lines Matching defs:mgr
25 static int pcxhr_sub_init(struct pcxhr_mgr *mgr);
29 static int pcxhr_init_board(struct pcxhr_mgr *mgr)
36 if (mgr->mono_capture)
37 card_streams = mgr->capture_chips * 2;
39 card_streams = mgr->capture_chips;
40 card_streams += mgr->playback_chips * PCXHR_PLAYBACK_STREAMS;
43 pcxhr_enable_dsp(mgr);
46 err = pcxhr_send_msg(mgr, &rmh);
50 if ((rmh.stat[0] & MASK_FIRST_FIELD) < mgr->playback_chips * 2)
54 mgr->capture_chips * 2)
62 dev_dbg(&mgr->pci->dev,
68 rmh.cmd[0] |= mgr->firmware_num;
70 rmh.cmd[1] = (1<<23) + mgr->granularity;
72 err = pcxhr_send_msg(mgr, &rmh);
75 dev_dbg(&mgr->pci->dev,
78 mgr->dsp_version = rmh.stat[0];
80 if (mgr->is_hr_stereo)
81 err = hr222_sub_init(mgr);
83 err = pcxhr_sub_init(mgr);
87 static int pcxhr_sub_init(struct pcxhr_mgr *mgr)
97 err = pcxhr_send_msg(mgr, &rmh);
103 mgr->board_has_analog = 1; /* analog addon board found */
106 err = pcxhr_write_io_num_reg_cont(mgr, REG_CONT_UNMUTE_INPUTS,
113 if (DSP_EXT_CMD_SET(mgr)) {
117 err = pcxhr_send_msg(mgr, &rmh);
121 void pcxhr_reset_board(struct pcxhr_mgr *mgr)
125 if (mgr->dsp_loaded & (1 << PCXHR_FIRMWARE_DSP_MAIN_INDEX)) {
127 if (!mgr->is_hr_stereo) {
131 pcxhr_send_msg(mgr, &rmh);
133 pcxhr_write_io_num_reg_cont(mgr, REG_CONT_UNMUTE_INPUTS,
139 if (mgr->dsp_loaded & (1 << PCXHR_FIRMWARE_DSP_EPRM_INDEX))
140 pcxhr_reset_dsp(mgr);
142 if (mgr->dsp_loaded & (1 << PCXHR_FIRMWARE_XLX_COM_INDEX)) {
143 pcxhr_reset_xilinx_com(mgr);
144 mgr->dsp_loaded = 1;
153 static int pcxhr_dsp_allocate_pipe(struct pcxhr_mgr *mgr,
163 if (mgr->mono_capture)
171 dev_dbg(&mgr->pci->dev, "snd_add_ref_pipe pin(%d) pcm%c0\n",
180 if (DSP_EXT_CMD_SET(mgr)) {
184 err = pcxhr_send_msg(mgr, &rmh);
186 dev_err(&mgr->pci->dev, "error pipe allocation "
199 static int pcxhr_dsp_free_pipe( struct pcxhr_mgr *mgr, struct pcxhr_pipe *pipe)
212 err = pcxhr_set_pipe_state(mgr, playback_mask, capture_mask, 0);
214 dev_err(&mgr->pci->dev, "error stopping pipe!\n");
219 err = pcxhr_send_msg(mgr, &rmh);
221 dev_err(&mgr->pci->dev, "error pipe release "
229 static int pcxhr_config_pipes(struct pcxhr_mgr *mgr)
236 for (i = 0; i < mgr->num_cards; i++) {
237 chip = mgr->chip[i];
240 err = pcxhr_dsp_allocate_pipe( mgr, pipe, 0, i*2);
248 err = pcxhr_dsp_allocate_pipe(mgr, pipe, 1, i*2 + j);
257 static int pcxhr_start_pipes(struct pcxhr_mgr *mgr)
265 for (i = 0; i < mgr->num_cards; i++) {
266 chip = mgr->chip[i];
272 return pcxhr_set_pipe_state(mgr, playback_mask, capture_mask, 1);
276 static int pcxhr_dsp_load(struct pcxhr_mgr *mgr, int index,
281 dev_dbg(&mgr->pci->dev,
286 pcxhr_reset_xilinx_com(mgr);
287 return pcxhr_load_xilinx_binary(mgr, dsp, 0);
290 pcxhr_reset_xilinx_com(mgr);
291 return pcxhr_load_xilinx_binary(mgr, dsp, 1);
294 pcxhr_reset_dsp(mgr);
295 return pcxhr_load_eeprom_binary(mgr, dsp);
298 return pcxhr_load_boot_binary(mgr, dsp);
301 err = pcxhr_load_dsp_binary(mgr, dsp);
306 dev_err(&mgr->pci->dev, "wrong file index\n");
311 err = pcxhr_init_board(mgr);
313 dev_err(&mgr->pci->dev, "pcxhr could not be set up\n");
316 err = pcxhr_config_pipes(mgr);
318 dev_err(&mgr->pci->dev, "pcxhr pipes could not be set up\n");
322 for (card_index = 0; card_index < mgr->num_cards; card_index++) {
323 struct snd_pcxhr *chip = mgr->chip[card_index];
329 if ((err = pcxhr_create_mixer(chip->mgr)) < 0)
335 err = pcxhr_start_pipes(mgr);
337 dev_err(&mgr->pci->dev, "pcxhr pipes could not be started\n");
340 dev_dbg(&mgr->pci->dev,
349 int pcxhr_setup_firmware(struct pcxhr_mgr *mgr)
369 int fw_set = mgr->fw_file_set;
375 if (request_firmware(&fw_entry, path, &mgr->pci->dev)) {
376 dev_err(&mgr->pci->dev,
382 err = pcxhr_dsp_load(mgr, i, fw_entry);
386 mgr->dsp_loaded |= 1 << i;