• Home
  • Raw
  • Download

Lines Matching refs:mgr

72 static int mixart_set_pipe_state(struct mixart_mgr *mgr,  in mixart_set_pipe_state()  argument
90 dev_err(&mgr->pci->dev, in mixart_set_pipe_state()
104 err = snd_mixart_send_msg_wait_notif(mgr, &request, system_msg_uid); in mixart_set_pipe_state()
106 dev_err(&mgr->pci->dev, in mixart_set_pipe_state()
126 err = snd_mixart_send_msg(mgr, &request, sizeof(group_state_resp), &group_state_resp); in mixart_set_pipe_state()
128 dev_err(&mgr->pci->dev, in mixart_set_pipe_state()
139 err = snd_mixart_send_msg(mgr, &request, sizeof(group_state_resp), &group_state_resp); in mixart_set_pipe_state()
141 dev_err(&mgr->pci->dev, in mixart_set_pipe_state()
154 err = snd_mixart_send_msg(mgr, &request, sizeof(stat), &stat); in mixart_set_pipe_state()
156 dev_err(&mgr->pci->dev, in mixart_set_pipe_state()
171 static int mixart_set_clock(struct mixart_mgr *mgr, in mixart_set_clock() argument
189 dev_err(&mgr->pci->dev, in mixart_set_clock()
203 dev_dbg(&mgr->pci->dev, "mixart_set_clock to %d kHz\n", rate); in mixart_set_clock()
206 request.uid = mgr->uid_console_manager; in mixart_set_clock()
210 err = snd_mixart_send_msg(mgr, &request, sizeof(clock_prop_resp), &clock_prop_resp); in mixart_set_clock()
212 dev_err(&mgr->pci->dev, in mixart_set_clock()
302 flowinfo = (struct mixart_flowinfo *)chip->mgr->flowinfo.area; in snd_mixart_add_ref_pipe()
303 …flowinfo[j].bufferinfo_array_phy_address = (u32)chip->mgr->bufferinfo.addr + (j * sizeof(struct mi… in snd_mixart_add_ref_pipe()
306 bufferinfo = (struct mixart_bufferinfo *)chip->mgr->bufferinfo.area; in snd_mixart_add_ref_pipe()
317 err = snd_mixart_send_msg(chip->mgr, &request, sizeof(buf->sgroup_resp), &buf->sgroup_resp); in snd_mixart_add_ref_pipe()
341 int snd_mixart_kill_ref_pipe(struct mixart_mgr *mgr, in snd_mixart_kill_ref_pipe() argument
360 err = mixart_set_clock( mgr, pipe, 0); in snd_mixart_kill_ref_pipe()
362 dev_err(&mgr->pci->dev, in snd_mixart_kill_ref_pipe()
367 err = mixart_set_pipe_state(mgr, pipe, 0); in snd_mixart_kill_ref_pipe()
369 dev_err(&mgr->pci->dev, "error stopping pipe!\n"); in snd_mixart_kill_ref_pipe()
378 err = snd_mixart_send_msg(mgr, &request, sizeof(delete_resp), &delete_resp); in snd_mixart_kill_ref_pipe()
380 dev_err(&mgr->pci->dev, in snd_mixart_kill_ref_pipe()
422 return snd_mixart_send_msg_nonblock(chip->mgr, &request); in mixart_set_stream_state()
473 static int mixart_sync_nonblock_events(struct mixart_mgr *mgr) in mixart_sync_nonblock_events() argument
476 while (atomic_read(&mgr->msg_processed) > 0) { in mixart_sync_nonblock_events()
478 dev_err(&mgr->pci->dev, in mixart_sync_nonblock_events()
499 mixart_sync_nonblock_events(chip->mgr); in snd_mixart_prepare()
503 if(chip->mgr->ref_count_rate == 1) in snd_mixart_prepare()
504 chip->mgr->sample_rate = subs->runtime->rate; in snd_mixart_prepare()
508 if( mixart_set_clock(chip->mgr, stream->pipe, subs->runtime->rate) ) in snd_mixart_prepare()
531 stream_param.sampling_freq = chip->mgr->sample_rate; in mixart_set_format()
589 err = snd_mixart_send_msg(chip->mgr, &request, sizeof(resp), &resp); in mixart_set_format()
607 struct mixart_mgr *mgr = chip->mgr; in snd_mixart_hw_params() local
619 mutex_lock(&mgr->setup_mutex); in snd_mixart_hw_params()
635 mutex_unlock(&mgr->setup_mutex); in snd_mixart_hw_params()
649 bufferinfo = (struct mixart_bufferinfo *)chip->mgr->bufferinfo.area; in snd_mixart_hw_params()
660 mutex_unlock(&mgr->setup_mutex); in snd_mixart_hw_params()
669 mixart_sync_nonblock_events(chip->mgr); in snd_mixart_hw_free()
724 struct mixart_mgr *mgr = chip->mgr; in snd_mixart_playback_open() local
732 mutex_lock(&mgr->setup_mutex); in snd_mixart_playback_open()
767 err = mixart_set_pipe_state(chip->mgr, pipe, 1); in snd_mixart_playback_open()
770 snd_mixart_kill_ref_pipe(chip->mgr, pipe, 0); in snd_mixart_playback_open()
787 if(mgr->ref_count_rate++) { in snd_mixart_playback_open()
788 if(mgr->sample_rate) { in snd_mixart_playback_open()
789 runtime->hw.rate_min = runtime->hw.rate_max = mgr->sample_rate; in snd_mixart_playback_open()
794 mutex_unlock(&mgr->setup_mutex); in snd_mixart_playback_open()
803 struct mixart_mgr *mgr = chip->mgr; in snd_mixart_capture_open() local
811 mutex_lock(&mgr->setup_mutex); in snd_mixart_capture_open()
848 err = mixart_set_pipe_state(chip->mgr, pipe, 1); in snd_mixart_capture_open()
851 snd_mixart_kill_ref_pipe(chip->mgr, pipe, 0); in snd_mixart_capture_open()
868 if(mgr->ref_count_rate++) { in snd_mixart_capture_open()
869 if(mgr->sample_rate) { in snd_mixart_capture_open()
870 runtime->hw.rate_min = runtime->hw.rate_max = mgr->sample_rate; in snd_mixart_capture_open()
875 mutex_unlock(&mgr->setup_mutex); in snd_mixart_capture_open()
885 struct mixart_mgr *mgr = chip->mgr; in snd_mixart_close() local
888 mutex_lock(&mgr->setup_mutex); in snd_mixart_close()
894 if(--mgr->ref_count_rate == 0) { in snd_mixart_close()
895 mgr->sample_rate = 0; in snd_mixart_close()
899 if (snd_mixart_kill_ref_pipe(mgr, stream->pipe, 0 ) < 0) { in snd_mixart_close()
910 mutex_unlock(&mgr->setup_mutex); in snd_mixart_close()
963 snd_dma_pci_data(chip->mgr->pci), 32*1024, 32*1024); in preallocate_buffers()
1046 static int snd_mixart_create(struct mixart_mgr *mgr, struct snd_card *card, int idx) in snd_mixart_create() argument
1062 chip->mgr = mgr; in snd_mixart_create()
1069 mgr->chip[idx] = chip; in snd_mixart_create()
1081 if(chip->mgr->board_type == MIXART_DAUGHTER_TYPE_AES) { in snd_mixart_create_pcm()
1094 static int snd_mixart_free(struct mixart_mgr *mgr) in snd_mixart_free() argument
1098 for (i = 0; i < mgr->num_cards; i++) { in snd_mixart_free()
1099 if (mgr->chip[i]) in snd_mixart_free()
1100 snd_card_free(mgr->chip[i]->card); in snd_mixart_free()
1104 snd_mixart_exit_mailbox(mgr); in snd_mixart_free()
1107 if (mgr->irq >= 0) in snd_mixart_free()
1108 free_irq(mgr->irq, mgr); in snd_mixart_free()
1111 if(mgr->dsp_loaded) { in snd_mixart_free()
1112 snd_mixart_reset_board(mgr); in snd_mixart_free()
1113 dev_dbg(&mgr->pci->dev, "reset miXart !\n"); in snd_mixart_free()
1118 iounmap(mgr->mem[i].virt); in snd_mixart_free()
1120 pci_release_regions(mgr->pci); in snd_mixart_free()
1123 if(mgr->flowinfo.area) { in snd_mixart_free()
1124 snd_dma_free_pages(&mgr->flowinfo); in snd_mixart_free()
1125 mgr->flowinfo.area = NULL; in snd_mixart_free()
1128 if(mgr->bufferinfo.area) { in snd_mixart_free()
1129 snd_dma_free_pages(&mgr->bufferinfo); in snd_mixart_free()
1130 mgr->bufferinfo.area = NULL; in snd_mixart_free()
1133 pci_disable_device(mgr->pci); in snd_mixart_free()
1134 kfree(mgr); in snd_mixart_free()
1150 struct mixart_mgr *mgr = entry->private_data; in snd_mixart_BA0_read() local
1153 if (copy_to_user_fromio(buf, MIXART_MEM(mgr, pos), count)) in snd_mixart_BA0_read()
1166 struct mixart_mgr *mgr = entry->private_data; in snd_mixart_BA1_read() local
1169 if (copy_to_user_fromio(buf, MIXART_REG(mgr, pos), count)) in snd_mixart_BA1_read()
1192 if (chip->mgr->dsp_loaded & ( 1 << MIXART_MOTHERBOARD_ELF_INDEX)) { in snd_mixart_proc_read()
1194 switch (chip->mgr->board_type ) { in snd_mixart_proc_read()
1205 ref = readl_be( MIXART_MEM( chip->mgr, MIXART_PSEUDOREG_PERF_SYSTEM_LOAD_OFFSET)); in snd_mixart_proc_read()
1208 …u32 mailbox = 100 * readl_be( MIXART_MEM( chip->mgr, MIXART_PSEUDOREG_PERF_MAILBX_LOAD_OFFSET)) … in snd_mixart_proc_read()
1209 …u32 streaming = 100 * readl_be( MIXART_MEM( chip->mgr, MIXART_PSEUDOREG_PERF_STREAM_LOAD_OFFSET)) … in snd_mixart_proc_read()
1210 …u32 interr = 100 * readl_be( MIXART_MEM( chip->mgr, MIXART_PSEUDOREG_PERF_INTERR_LOAD_OFFSET)) … in snd_mixart_proc_read()
1231 entry->private_data = chip->mgr; in snd_mixart_proc_init()
1237 entry->private_data = chip->mgr; in snd_mixart_proc_init()
1252 struct mixart_mgr *mgr; in snd_mixart_probe() local
1281 mgr = kzalloc(sizeof(*mgr), GFP_KERNEL); in snd_mixart_probe()
1282 if (! mgr) { in snd_mixart_probe()
1287 mgr->pci = pci; in snd_mixart_probe()
1288 mgr->irq = -1; in snd_mixart_probe()
1292 kfree(mgr); in snd_mixart_probe()
1297 mgr->mem[i].phys = pci_resource_start(pci, i); in snd_mixart_probe()
1298 mgr->mem[i].virt = pci_ioremap_bar(pci, i); in snd_mixart_probe()
1299 if (!mgr->mem[i].virt) { in snd_mixart_probe()
1301 mgr->mem[i].phys); in snd_mixart_probe()
1302 snd_mixart_free(mgr); in snd_mixart_probe()
1309 KBUILD_MODNAME, mgr)) { in snd_mixart_probe()
1311 snd_mixart_free(mgr); in snd_mixart_probe()
1314 mgr->irq = pci->irq; in snd_mixart_probe()
1316 sprintf(mgr->shortname, "Digigram miXart"); in snd_mixart_probe()
1317 …sprintf(mgr->longname, "%s at 0x%lx & 0x%lx, irq %i", mgr->shortname, mgr->mem[0].phys, mgr->mem[1… in snd_mixart_probe()
1320 mgr->msg_fifo_readptr = 0; in snd_mixart_probe()
1321 mgr->msg_fifo_writeptr = 0; in snd_mixart_probe()
1323 mutex_init(&mgr->lock); in snd_mixart_probe()
1324 mutex_init(&mgr->msg_lock); in snd_mixart_probe()
1325 init_waitqueue_head(&mgr->msg_sleep); in snd_mixart_probe()
1326 atomic_set(&mgr->msg_processed, 0); in snd_mixart_probe()
1329 mutex_init(&mgr->setup_mutex); in snd_mixart_probe()
1332 mgr->num_cards = MIXART_MAX_CARDS; /* 4 FIXME: configurable? */ in snd_mixart_probe()
1333 for (i = 0; i < mgr->num_cards; i++) { in snd_mixart_probe()
1348 snd_mixart_free(mgr); in snd_mixart_probe()
1353 sprintf(card->shortname, "%s [PCM #%d]", mgr->shortname, i); in snd_mixart_probe()
1354 sprintf(card->longname, "%s [PCM #%d]", mgr->longname, i); in snd_mixart_probe()
1356 if ((err = snd_mixart_create(mgr, card, i)) < 0) { in snd_mixart_probe()
1358 snd_mixart_free(mgr); in snd_mixart_probe()
1364 snd_mixart_proc_init(mgr->chip[i]); in snd_mixart_probe()
1368 snd_mixart_free(mgr); in snd_mixart_probe()
1374 mgr->board_type = MIXART_DAUGHTER_TYPE_NONE; in snd_mixart_probe()
1380 size, &mgr->flowinfo) < 0) { in snd_mixart_probe()
1381 snd_mixart_free(mgr); in snd_mixart_probe()
1385 memset(mgr->flowinfo.area, 0, size); in snd_mixart_probe()
1391 size, &mgr->bufferinfo) < 0) { in snd_mixart_probe()
1392 snd_mixart_free(mgr); in snd_mixart_probe()
1396 memset(mgr->bufferinfo.area, 0, size); in snd_mixart_probe()
1399 err = snd_mixart_setup_firmware(mgr); in snd_mixart_probe()
1401 snd_mixart_free(mgr); in snd_mixart_probe()
1405 pci_set_drvdata(pci, mgr); in snd_mixart_probe()