Lines Matching refs:mgr
33 static int mixart_wait_nice_for_register_value(struct mixart_mgr *mgr, in mixart_wait_nice_for_register_value() argument
45 read = readl_be( MIXART_MEM( mgr, offset )); in mixart_wait_nice_for_register_value()
89 static int mixart_load_elf(struct mixart_mgr *mgr, const struct firmware *dsp ) in mixart_load_elf() argument
110 memcpy_toio( MIXART_MEM( mgr, be32_to_cpu(elf_programheader.p_vaddr)), in mixart_load_elf()
128 static int mixart_enum_connectors(struct mixart_mgr *mgr) in mixart_enum_connectors() argument
154 err = snd_mixart_send_msg(mgr, &request, sizeof(*connector), connector); in mixart_enum_connectors()
156 dev_err(&mgr->pci->dev, in mixart_enum_connectors()
166 pipe = &mgr->chip[k/2]->pipe_out_ana; in mixart_enum_connectors()
168 pipe = &mgr->chip[(k-MIXART_FIRST_DIG_AUDIO_ID)/2]->pipe_out_dig; in mixart_enum_connectors()
184 err = snd_mixart_send_msg(mgr, &request, sizeof(*audio_info), audio_info); in mixart_enum_connectors()
186 dev_err(&mgr->pci->dev, in mixart_enum_connectors()
198 err = snd_mixart_send_msg(mgr, &request, sizeof(*connector), connector); in mixart_enum_connectors()
200 dev_err(&mgr->pci->dev, in mixart_enum_connectors()
210 pipe = &mgr->chip[k/2]->pipe_in_ana; in mixart_enum_connectors()
212 pipe = &mgr->chip[(k-MIXART_FIRST_DIG_AUDIO_ID)/2]->pipe_in_dig; in mixart_enum_connectors()
228 err = snd_mixart_send_msg(mgr, &request, sizeof(*audio_info), audio_info); in mixart_enum_connectors()
230 dev_err(&mgr->pci->dev, in mixart_enum_connectors()
246 static int mixart_enum_physio(struct mixart_mgr *mgr) in mixart_enum_physio() argument
264 err = snd_mixart_send_msg(mgr, &request, sizeof(console_mgr), &console_mgr); in mixart_enum_physio()
267 dev_dbg(&mgr->pci->dev, in mixart_enum_physio()
274 mgr->uid_console_manager = console_mgr.uid; in mixart_enum_physio()
281 err = snd_mixart_send_msg(mgr, &request, sizeof(phys_io), &phys_io); in mixart_enum_physio()
283 dev_err(&mgr->pci->dev, in mixart_enum_physio()
293 for(k=0; k<mgr->num_cards; k++) { in mixart_enum_physio()
294 mgr->chip[k]->uid_in_analog_physio = phys_io.uid[k]; in mixart_enum_physio()
295 mgr->chip[k]->uid_out_analog_physio = phys_io.uid[phys_io.nb_uid/2 + k]; in mixart_enum_physio()
302 static int mixart_first_init(struct mixart_mgr *mgr) in mixart_first_init() argument
308 if((err = mixart_enum_connectors(mgr)) < 0) return err; in mixart_first_init()
310 if((err = mixart_enum_physio(mgr)) < 0) return err; in mixart_first_init()
319 err = snd_mixart_send_msg(mgr, &request, sizeof(k), &k); in mixart_first_init()
321 dev_err(&mgr->pci->dev, "error MSG_SYSTEM_SEND_SYNCHRO_CMD\n"); in mixart_first_init()
332 static int mixart_dsp_load(struct mixart_mgr* mgr, int index, const struct firmware *dsp) in mixart_dsp_load() argument
339 status_xilinx = readl_be( MIXART_MEM( mgr,MIXART_PSEUDOREG_MXLX_STATUS_OFFSET )); in mixart_dsp_load()
341 status_elf = readl_be( MIXART_MEM( mgr,MIXART_PSEUDOREG_ELF_STATUS_OFFSET )); in mixart_dsp_load()
343 status_daught = readl_be( MIXART_MEM( mgr,MIXART_PSEUDOREG_DXLX_STATUS_OFFSET )); in mixart_dsp_load()
347 dev_err(&mgr->pci->dev, "miXart is resetting !\n"); in mixart_dsp_load()
356 dev_dbg(&mgr->pci->dev, "xilinx is already loaded !\n"); in mixart_dsp_load()
361 dev_err(&mgr->pci->dev, in mixart_dsp_load()
374 writel_be( 1, MIXART_MEM( mgr, MIXART_PSEUDOREG_MXLX_STATUS_OFFSET )); in mixart_dsp_load()
377 …writel_be( MIXART_MOTHERBOARD_XLX_BASE_ADDRESS, MIXART_MEM( mgr,MIXART_PSEUDOREG_MXLX_BASE_ADDR_OF… in mixart_dsp_load()
379 writel_be( dsp->size, MIXART_MEM( mgr, MIXART_PSEUDOREG_MXLX_SIZE_OFFSET )); in mixart_dsp_load()
382 memcpy_toio( MIXART_MEM( mgr, MIXART_MOTHERBOARD_XLX_BASE_ADDRESS), dsp->data, dsp->size); in mixart_dsp_load()
385 writel_be( 2, MIXART_MEM( mgr, MIXART_PSEUDOREG_MXLX_STATUS_OFFSET )); in mixart_dsp_load()
393 dev_dbg(&mgr->pci->dev, "elf file already loaded !\n"); in mixart_dsp_load()
399 dev_err(&mgr->pci->dev, in mixart_dsp_load()
406 …err = mixart_wait_nice_for_register_value( mgr, MIXART_PSEUDOREG_MXLX_STATUS_OFFSET, 1, 4, 500); /… in mixart_dsp_load()
408 dev_err(&mgr->pci->dev, "xilinx was not loaded or " in mixart_dsp_load()
414 writel_be( 0, MIXART_MEM( mgr, MIXART_PSEUDOREG_BOARDNUMBER ) ); /* set miXart boardnumber to 0 */ in mixart_dsp_load()
415 …writel_be( 0, MIXART_MEM( mgr, MIXART_FLOWTABLE_PTR ) ); /* reset pointer to flow table on… in mixart_dsp_load()
418 writel_be( 1, MIXART_MEM( mgr, MIXART_PSEUDOREG_ELF_STATUS_OFFSET )); in mixart_dsp_load()
421 err = mixart_load_elf( mgr, dsp ); in mixart_dsp_load()
425 writel_be( 2, MIXART_MEM( mgr, MIXART_PSEUDOREG_ELF_STATUS_OFFSET )); in mixart_dsp_load()
428 …err = mixart_wait_nice_for_register_value( mgr, MIXART_PSEUDOREG_ELF_STATUS_OFFSET, 1, 4, 300); /*… in mixart_dsp_load()
430 dev_err(&mgr->pci->dev, "elf could not be started\n"); in mixart_dsp_load()
435 …writel_be( (u32)mgr->flowinfo.addr, MIXART_MEM( mgr, MIXART_FLOWTABLE_PTR ) ); /* give pointer of … in mixart_dsp_load()
444 dev_err(&mgr->pci->dev, "xilinx or elf not " in mixart_dsp_load()
450 …err = mixart_wait_nice_for_register_value( mgr, MIXART_PSEUDOREG_DBRD_PRESENCE_OFFSET, 0, 0, 30); … in mixart_dsp_load()
452 dev_err(&mgr->pci->dev, "error starting elf file\n"); in mixart_dsp_load()
457 …mgr->board_type = (DAUGHTER_TYPE_MASK & readl_be( MIXART_MEM( mgr, MIXART_PSEUDOREG_DBRD_TYPE_OFFS… in mixart_dsp_load()
459 if (mgr->board_type == MIXART_DAUGHTER_TYPE_NONE) in mixart_dsp_load()
463 if (mgr->board_type != MIXART_DAUGHTER_TYPE_AES ) in mixart_dsp_load()
468 dev_err(&mgr->pci->dev, in mixart_dsp_load()
481 writel_be( dsp->size, MIXART_MEM( mgr, MIXART_PSEUDOREG_DXLX_SIZE_OFFSET )); in mixart_dsp_load()
484 writel_be( 1, MIXART_MEM( mgr, MIXART_PSEUDOREG_DXLX_STATUS_OFFSET )); in mixart_dsp_load()
487 …err = mixart_wait_nice_for_register_value( mgr, MIXART_PSEUDOREG_DXLX_STATUS_OFFSET, 1, 2, 30); /*… in mixart_dsp_load()
489 dev_err(&mgr->pci->dev, "daughter board load error\n"); in mixart_dsp_load()
494 val = readl_be( MIXART_MEM( mgr, MIXART_PSEUDOREG_DXLX_BASE_ADDR_OFFSET )); in mixart_dsp_load()
499 memcpy_toio( MIXART_MEM( mgr, val), dsp->data, dsp->size); in mixart_dsp_load()
502 writel_be( 4, MIXART_MEM( mgr, MIXART_PSEUDOREG_DXLX_STATUS_OFFSET )); in mixart_dsp_load()
509 …err = mixart_wait_nice_for_register_value( mgr, MIXART_PSEUDOREG_DXLX_STATUS_OFFSET, 1, 3, 300); /… in mixart_dsp_load()
511 dev_err(&mgr->pci->dev, in mixart_dsp_load()
517 snd_mixart_init_mailbox(mgr); in mixart_dsp_load()
520 err = mixart_first_init(mgr); in mixart_dsp_load()
522 dev_err(&mgr->pci->dev, "miXart could not be set up\n"); in mixart_dsp_load()
527 for (card_index = 0; card_index < mgr->num_cards; card_index++) { in mixart_dsp_load()
528 struct snd_mixart *chip = mgr->chip[card_index]; in mixart_dsp_load()
534 if ((err = snd_mixart_create_mixer(chip->mgr)) < 0) in mixart_dsp_load()
542 dev_dbg(&mgr->pci->dev, in mixart_dsp_load()
549 int snd_mixart_setup_firmware(struct mixart_mgr *mgr) in snd_mixart_setup_firmware() argument
561 if (request_firmware(&fw_entry, path, &mgr->pci->dev)) { in snd_mixart_setup_firmware()
562 dev_err(&mgr->pci->dev, in snd_mixart_setup_firmware()
567 err = mixart_dsp_load(mgr, i, fw_entry); in snd_mixart_setup_firmware()
571 mgr->dsp_loaded |= 1 << i; in snd_mixart_setup_firmware()