Lines Matching refs:mgr

34 static int mixart_wait_nice_for_register_value(struct mixart_mgr *mgr,  in mixart_wait_nice_for_register_value()  argument
46 read = readl_be( MIXART_MEM( mgr, offset )); in mixart_wait_nice_for_register_value()
90 static int mixart_load_elf(struct mixart_mgr *mgr, const struct firmware *dsp ) in mixart_load_elf() argument
111 memcpy_toio( MIXART_MEM( mgr, be32_to_cpu(elf_programheader.p_vaddr)), in mixart_load_elf()
129 static int mixart_enum_connectors(struct mixart_mgr *mgr) in mixart_enum_connectors() argument
155 err = snd_mixart_send_msg(mgr, &request, sizeof(*connector), connector); in mixart_enum_connectors()
157 dev_err(&mgr->pci->dev, in mixart_enum_connectors()
167 pipe = &mgr->chip[k/2]->pipe_out_ana; in mixart_enum_connectors()
169 pipe = &mgr->chip[(k-MIXART_FIRST_DIG_AUDIO_ID)/2]->pipe_out_dig; in mixart_enum_connectors()
185 err = snd_mixart_send_msg(mgr, &request, sizeof(*audio_info), audio_info); in mixart_enum_connectors()
187 dev_err(&mgr->pci->dev, in mixart_enum_connectors()
199 err = snd_mixart_send_msg(mgr, &request, sizeof(*connector), connector); in mixart_enum_connectors()
201 dev_err(&mgr->pci->dev, in mixart_enum_connectors()
211 pipe = &mgr->chip[k/2]->pipe_in_ana; in mixart_enum_connectors()
213 pipe = &mgr->chip[(k-MIXART_FIRST_DIG_AUDIO_ID)/2]->pipe_in_dig; in mixart_enum_connectors()
229 err = snd_mixart_send_msg(mgr, &request, sizeof(*audio_info), audio_info); in mixart_enum_connectors()
231 dev_err(&mgr->pci->dev, in mixart_enum_connectors()
247 static int mixart_enum_physio(struct mixart_mgr *mgr) in mixart_enum_physio() argument
265 err = snd_mixart_send_msg(mgr, &request, sizeof(console_mgr), &console_mgr); in mixart_enum_physio()
268 dev_dbg(&mgr->pci->dev, in mixart_enum_physio()
275 mgr->uid_console_manager = console_mgr.uid; in mixart_enum_physio()
282 err = snd_mixart_send_msg(mgr, &request, sizeof(phys_io), &phys_io); in mixart_enum_physio()
284 dev_err(&mgr->pci->dev, in mixart_enum_physio()
294 for(k=0; k<mgr->num_cards; k++) { in mixart_enum_physio()
295 mgr->chip[k]->uid_in_analog_physio = phys_io.uid[k]; in mixart_enum_physio()
296 mgr->chip[k]->uid_out_analog_physio = phys_io.uid[phys_io.nb_uid/2 + k]; in mixart_enum_physio()
303 static int mixart_first_init(struct mixart_mgr *mgr) in mixart_first_init() argument
309 err = mixart_enum_connectors(mgr); in mixart_first_init()
313 err = mixart_enum_physio(mgr); in mixart_first_init()
324 err = snd_mixart_send_msg(mgr, &request, sizeof(k), &k); in mixart_first_init()
326 dev_err(&mgr->pci->dev, "error MSG_SYSTEM_SEND_SYNCHRO_CMD\n"); in mixart_first_init()
337 static int mixart_dsp_load(struct mixart_mgr* mgr, int index, const struct firmware *dsp) in mixart_dsp_load() argument
344 status_xilinx = readl_be( MIXART_MEM( mgr,MIXART_PSEUDOREG_MXLX_STATUS_OFFSET )); in mixart_dsp_load()
346 status_elf = readl_be( MIXART_MEM( mgr,MIXART_PSEUDOREG_ELF_STATUS_OFFSET )); in mixart_dsp_load()
348 status_daught = readl_be( MIXART_MEM( mgr,MIXART_PSEUDOREG_DXLX_STATUS_OFFSET )); in mixart_dsp_load()
352 dev_err(&mgr->pci->dev, "miXart is resetting !\n"); in mixart_dsp_load()
361 dev_dbg(&mgr->pci->dev, "xilinx is already loaded !\n"); in mixart_dsp_load()
366 dev_err(&mgr->pci->dev, in mixart_dsp_load()
379 writel_be( 1, MIXART_MEM( mgr, MIXART_PSEUDOREG_MXLX_STATUS_OFFSET )); in mixart_dsp_load()
382 …writel_be( MIXART_MOTHERBOARD_XLX_BASE_ADDRESS, MIXART_MEM( mgr,MIXART_PSEUDOREG_MXLX_BASE_ADDR_OF… in mixart_dsp_load()
384 writel_be( dsp->size, MIXART_MEM( mgr, MIXART_PSEUDOREG_MXLX_SIZE_OFFSET )); in mixart_dsp_load()
387 memcpy_toio( MIXART_MEM( mgr, MIXART_MOTHERBOARD_XLX_BASE_ADDRESS), dsp->data, dsp->size); in mixart_dsp_load()
390 writel_be( 2, MIXART_MEM( mgr, MIXART_PSEUDOREG_MXLX_STATUS_OFFSET )); in mixart_dsp_load()
398 dev_dbg(&mgr->pci->dev, "elf file already loaded !\n"); in mixart_dsp_load()
404 dev_err(&mgr->pci->dev, in mixart_dsp_load()
411 …err = mixart_wait_nice_for_register_value( mgr, MIXART_PSEUDOREG_MXLX_STATUS_OFFSET, 1, 4, 500); /… in mixart_dsp_load()
413 dev_err(&mgr->pci->dev, "xilinx was not loaded or " in mixart_dsp_load()
419 writel_be( 0, MIXART_MEM( mgr, MIXART_PSEUDOREG_BOARDNUMBER ) ); /* set miXart boardnumber to 0 */ in mixart_dsp_load()
420 …writel_be( 0, MIXART_MEM( mgr, MIXART_FLOWTABLE_PTR ) ); /* reset pointer to flow table on… in mixart_dsp_load()
423 writel_be( 1, MIXART_MEM( mgr, MIXART_PSEUDOREG_ELF_STATUS_OFFSET )); in mixart_dsp_load()
426 err = mixart_load_elf( mgr, dsp ); in mixart_dsp_load()
430 writel_be( 2, MIXART_MEM( mgr, MIXART_PSEUDOREG_ELF_STATUS_OFFSET )); in mixart_dsp_load()
433 …err = mixart_wait_nice_for_register_value( mgr, MIXART_PSEUDOREG_ELF_STATUS_OFFSET, 1, 4, 300); /*… in mixart_dsp_load()
435 dev_err(&mgr->pci->dev, "elf could not be started\n"); in mixart_dsp_load()
440 …writel_be( (u32)mgr->flowinfo.addr, MIXART_MEM( mgr, MIXART_FLOWTABLE_PTR ) ); /* give pointer of … in mixart_dsp_load()
449 dev_err(&mgr->pci->dev, "xilinx or elf not " in mixart_dsp_load()
455 …err = mixart_wait_nice_for_register_value( mgr, MIXART_PSEUDOREG_DBRD_PRESENCE_OFFSET, 0, 0, 30); … in mixart_dsp_load()
457 dev_err(&mgr->pci->dev, "error starting elf file\n"); in mixart_dsp_load()
462mgr->board_type = (DAUGHTER_TYPE_MASK & readl_be( MIXART_MEM( mgr, MIXART_PSEUDOREG_DBRD_TYPE_OFFS… in mixart_dsp_load()
464 if (mgr->board_type == MIXART_DAUGHTER_TYPE_NONE) in mixart_dsp_load()
468 if (mgr->board_type != MIXART_DAUGHTER_TYPE_AES ) in mixart_dsp_load()
473 dev_err(&mgr->pci->dev, in mixart_dsp_load()
486 writel_be( dsp->size, MIXART_MEM( mgr, MIXART_PSEUDOREG_DXLX_SIZE_OFFSET )); in mixart_dsp_load()
489 writel_be( 1, MIXART_MEM( mgr, MIXART_PSEUDOREG_DXLX_STATUS_OFFSET )); in mixart_dsp_load()
492 …err = mixart_wait_nice_for_register_value( mgr, MIXART_PSEUDOREG_DXLX_STATUS_OFFSET, 1, 2, 30); /*… in mixart_dsp_load()
494 dev_err(&mgr->pci->dev, "daughter board load error\n"); in mixart_dsp_load()
499 val = readl_be( MIXART_MEM( mgr, MIXART_PSEUDOREG_DXLX_BASE_ADDR_OFFSET )); in mixart_dsp_load()
504 memcpy_toio( MIXART_MEM( mgr, val), dsp->data, dsp->size); in mixart_dsp_load()
507 writel_be( 4, MIXART_MEM( mgr, MIXART_PSEUDOREG_DXLX_STATUS_OFFSET )); in mixart_dsp_load()
514 …err = mixart_wait_nice_for_register_value( mgr, MIXART_PSEUDOREG_DXLX_STATUS_OFFSET, 1, 3, 300); /… in mixart_dsp_load()
516 dev_err(&mgr->pci->dev, in mixart_dsp_load()
522 snd_mixart_init_mailbox(mgr); in mixart_dsp_load()
525 err = mixart_first_init(mgr); in mixart_dsp_load()
527 dev_err(&mgr->pci->dev, "miXart could not be set up\n"); in mixart_dsp_load()
532 for (card_index = 0; card_index < mgr->num_cards; card_index++) { in mixart_dsp_load()
533 struct snd_mixart *chip = mgr->chip[card_index]; in mixart_dsp_load()
540 err = snd_mixart_create_mixer(chip->mgr); in mixart_dsp_load()
550 dev_dbg(&mgr->pci->dev, in mixart_dsp_load()
557 int snd_mixart_setup_firmware(struct mixart_mgr *mgr) in snd_mixart_setup_firmware() argument
569 if (request_firmware(&fw_entry, path, &mgr->pci->dev)) { in snd_mixart_setup_firmware()
570 dev_err(&mgr->pci->dev, in snd_mixart_setup_firmware()
575 err = mixart_dsp_load(mgr, i, fw_entry); in snd_mixart_setup_firmware()
579 mgr->dsp_loaded |= 1 << i; in snd_mixart_setup_firmware()