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