Lines Matching refs:mgr
38 static int pcxhr_sub_init(struct pcxhr_mgr *mgr);
42 static int pcxhr_init_board(struct pcxhr_mgr *mgr) in pcxhr_init_board() argument
49 if (mgr->mono_capture) in pcxhr_init_board()
50 card_streams = mgr->capture_chips * 2; in pcxhr_init_board()
52 card_streams = mgr->capture_chips; in pcxhr_init_board()
53 card_streams += mgr->playback_chips * PCXHR_PLAYBACK_STREAMS; in pcxhr_init_board()
56 pcxhr_enable_dsp(mgr); in pcxhr_init_board()
59 err = pcxhr_send_msg(mgr, &rmh); in pcxhr_init_board()
63 if ((rmh.stat[0] & MASK_FIRST_FIELD) < mgr->playback_chips * 2) in pcxhr_init_board()
67 mgr->capture_chips * 2) in pcxhr_init_board()
75 dev_dbg(&mgr->pci->dev, in pcxhr_init_board()
81 rmh.cmd[0] |= mgr->firmware_num; in pcxhr_init_board()
83 rmh.cmd[1] = (1<<23) + mgr->granularity; in pcxhr_init_board()
85 err = pcxhr_send_msg(mgr, &rmh); in pcxhr_init_board()
88 dev_dbg(&mgr->pci->dev, in pcxhr_init_board()
91 mgr->dsp_version = rmh.stat[0]; in pcxhr_init_board()
93 if (mgr->is_hr_stereo) in pcxhr_init_board()
94 err = hr222_sub_init(mgr); in pcxhr_init_board()
96 err = pcxhr_sub_init(mgr); in pcxhr_init_board()
100 static int pcxhr_sub_init(struct pcxhr_mgr *mgr) in pcxhr_sub_init() argument
110 err = pcxhr_send_msg(mgr, &rmh); in pcxhr_sub_init()
116 mgr->board_has_analog = 1; /* analog addon board found */ in pcxhr_sub_init()
119 err = pcxhr_write_io_num_reg_cont(mgr, REG_CONT_UNMUTE_INPUTS, in pcxhr_sub_init()
126 if (DSP_EXT_CMD_SET(mgr)) { in pcxhr_sub_init()
130 err = pcxhr_send_msg(mgr, &rmh); in pcxhr_sub_init()
134 void pcxhr_reset_board(struct pcxhr_mgr *mgr) in pcxhr_reset_board() argument
138 if (mgr->dsp_loaded & (1 << PCXHR_FIRMWARE_DSP_MAIN_INDEX)) { in pcxhr_reset_board()
140 if (!mgr->is_hr_stereo) { in pcxhr_reset_board()
144 pcxhr_send_msg(mgr, &rmh); in pcxhr_reset_board()
146 pcxhr_write_io_num_reg_cont(mgr, REG_CONT_UNMUTE_INPUTS, in pcxhr_reset_board()
152 if (mgr->dsp_loaded & (1 << PCXHR_FIRMWARE_DSP_EPRM_INDEX)) in pcxhr_reset_board()
153 pcxhr_reset_dsp(mgr); in pcxhr_reset_board()
155 if (mgr->dsp_loaded & (1 << PCXHR_FIRMWARE_XLX_COM_INDEX)) { in pcxhr_reset_board()
156 pcxhr_reset_xilinx_com(mgr); in pcxhr_reset_board()
157 mgr->dsp_loaded = 1; in pcxhr_reset_board()
166 static int pcxhr_dsp_allocate_pipe(struct pcxhr_mgr *mgr, in pcxhr_dsp_allocate_pipe() argument
176 if (mgr->mono_capture) in pcxhr_dsp_allocate_pipe()
184 dev_dbg(&mgr->pci->dev, "snd_add_ref_pipe pin(%d) pcm%c0\n", in pcxhr_dsp_allocate_pipe()
193 if (DSP_EXT_CMD_SET(mgr)) { in pcxhr_dsp_allocate_pipe()
197 err = pcxhr_send_msg(mgr, &rmh); in pcxhr_dsp_allocate_pipe()
199 dev_err(&mgr->pci->dev, "error pipe allocation " in pcxhr_dsp_allocate_pipe()
212 static int pcxhr_dsp_free_pipe( struct pcxhr_mgr *mgr, struct pcxhr_pipe *pipe)
225 err = pcxhr_set_pipe_state(mgr, playback_mask, capture_mask, 0);
227 dev_err(&mgr->pci->dev, "error stopping pipe!\n");
232 err = pcxhr_send_msg(mgr, &rmh);
234 dev_err(&mgr->pci->dev, "error pipe release "
242 static int pcxhr_config_pipes(struct pcxhr_mgr *mgr) in pcxhr_config_pipes() argument
249 for (i = 0; i < mgr->num_cards; i++) { in pcxhr_config_pipes()
250 chip = mgr->chip[i]; in pcxhr_config_pipes()
253 err = pcxhr_dsp_allocate_pipe( mgr, pipe, 0, i*2); in pcxhr_config_pipes()
261 err = pcxhr_dsp_allocate_pipe(mgr, pipe, 1, i*2 + j); in pcxhr_config_pipes()
270 static int pcxhr_start_pipes(struct pcxhr_mgr *mgr) in pcxhr_start_pipes() argument
278 for (i = 0; i < mgr->num_cards; i++) { in pcxhr_start_pipes()
279 chip = mgr->chip[i]; in pcxhr_start_pipes()
285 return pcxhr_set_pipe_state(mgr, playback_mask, capture_mask, 1); in pcxhr_start_pipes()
289 static int pcxhr_dsp_load(struct pcxhr_mgr *mgr, int index, in pcxhr_dsp_load() argument
294 dev_dbg(&mgr->pci->dev, in pcxhr_dsp_load()
299 pcxhr_reset_xilinx_com(mgr); in pcxhr_dsp_load()
300 return pcxhr_load_xilinx_binary(mgr, dsp, 0); in pcxhr_dsp_load()
303 pcxhr_reset_xilinx_com(mgr); in pcxhr_dsp_load()
304 return pcxhr_load_xilinx_binary(mgr, dsp, 1); in pcxhr_dsp_load()
307 pcxhr_reset_dsp(mgr); in pcxhr_dsp_load()
308 return pcxhr_load_eeprom_binary(mgr, dsp); in pcxhr_dsp_load()
311 return pcxhr_load_boot_binary(mgr, dsp); in pcxhr_dsp_load()
314 err = pcxhr_load_dsp_binary(mgr, dsp); in pcxhr_dsp_load()
319 dev_err(&mgr->pci->dev, "wrong file index\n"); in pcxhr_dsp_load()
324 err = pcxhr_init_board(mgr); in pcxhr_dsp_load()
326 dev_err(&mgr->pci->dev, "pcxhr could not be set up\n"); in pcxhr_dsp_load()
329 err = pcxhr_config_pipes(mgr); in pcxhr_dsp_load()
331 dev_err(&mgr->pci->dev, "pcxhr pipes could not be set up\n"); in pcxhr_dsp_load()
335 for (card_index = 0; card_index < mgr->num_cards; card_index++) { in pcxhr_dsp_load()
336 struct snd_pcxhr *chip = mgr->chip[card_index]; in pcxhr_dsp_load()
342 if ((err = pcxhr_create_mixer(chip->mgr)) < 0) in pcxhr_dsp_load()
348 err = pcxhr_start_pipes(mgr); in pcxhr_dsp_load()
350 dev_err(&mgr->pci->dev, "pcxhr pipes could not be started\n"); in pcxhr_dsp_load()
353 dev_dbg(&mgr->pci->dev, in pcxhr_dsp_load()
362 int pcxhr_setup_firmware(struct pcxhr_mgr *mgr) in pcxhr_setup_firmware() argument
382 int fw_set = mgr->fw_file_set; in pcxhr_setup_firmware()
388 if (request_firmware(&fw_entry, path, &mgr->pci->dev)) { in pcxhr_setup_firmware()
389 dev_err(&mgr->pci->dev, in pcxhr_setup_firmware()
395 err = pcxhr_dsp_load(mgr, i, fw_entry); in pcxhr_setup_firmware()
399 mgr->dsp_loaded |= 1 << i; in pcxhr_setup_firmware()