• Home
  • Raw
  • Download

Lines Matching refs:mgr

59 static int mixart_set_pipe_state(struct mixart_mgr *mgr,  in mixart_set_pipe_state()  argument
77 dev_err(&mgr->pci->dev, in mixart_set_pipe_state()
91 err = snd_mixart_send_msg_wait_notif(mgr, &request, system_msg_uid); in mixart_set_pipe_state()
93 dev_err(&mgr->pci->dev, in mixart_set_pipe_state()
113 err = snd_mixart_send_msg(mgr, &request, sizeof(group_state_resp), &group_state_resp); in mixart_set_pipe_state()
115 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()
141 err = snd_mixart_send_msg(mgr, &request, sizeof(stat), &stat); in mixart_set_pipe_state()
143 dev_err(&mgr->pci->dev, in mixart_set_pipe_state()
158 static int mixart_set_clock(struct mixart_mgr *mgr, in mixart_set_clock() argument
177 dev_err(&mgr->pci->dev, in mixart_set_clock()
191 dev_dbg(&mgr->pci->dev, "mixart_set_clock to %d kHz\n", rate); in mixart_set_clock()
194 request.uid = mgr->uid_console_manager; in mixart_set_clock()
198 err = snd_mixart_send_msg(mgr, &request, sizeof(clock_prop_resp), &clock_prop_resp); in mixart_set_clock()
200 dev_err(&mgr->pci->dev, in mixart_set_clock()
290 flowinfo = (struct mixart_flowinfo *)chip->mgr->flowinfo.area; in snd_mixart_add_ref_pipe()
291 …flowinfo[j].bufferinfo_array_phy_address = (u32)chip->mgr->bufferinfo.addr + (j * sizeof(struct mi… in snd_mixart_add_ref_pipe()
294 bufferinfo = (struct mixart_bufferinfo *)chip->mgr->bufferinfo.area; in snd_mixart_add_ref_pipe()
305 err = snd_mixart_send_msg(chip->mgr, &request, sizeof(buf->sgroup_resp), &buf->sgroup_resp); in snd_mixart_add_ref_pipe()
329 int snd_mixart_kill_ref_pipe(struct mixart_mgr *mgr, in snd_mixart_kill_ref_pipe() argument
348 err = mixart_set_clock( mgr, pipe, 0); in snd_mixart_kill_ref_pipe()
350 dev_err(&mgr->pci->dev, in snd_mixart_kill_ref_pipe()
355 err = mixart_set_pipe_state(mgr, pipe, 0); in snd_mixart_kill_ref_pipe()
357 dev_err(&mgr->pci->dev, "error stopping pipe!\n"); in snd_mixart_kill_ref_pipe()
366 err = snd_mixart_send_msg(mgr, &request, sizeof(delete_resp), &delete_resp); in snd_mixart_kill_ref_pipe()
368 dev_err(&mgr->pci->dev, in snd_mixart_kill_ref_pipe()
410 return snd_mixart_send_msg_nonblock(chip->mgr, &request); in mixart_set_stream_state()
461 static int mixart_sync_nonblock_events(struct mixart_mgr *mgr) in mixart_sync_nonblock_events() argument
464 while (atomic_read(&mgr->msg_processed) > 0) { in mixart_sync_nonblock_events()
466 dev_err(&mgr->pci->dev, in mixart_sync_nonblock_events()
487 mixart_sync_nonblock_events(chip->mgr); in snd_mixart_prepare()
491 if(chip->mgr->ref_count_rate == 1) in snd_mixart_prepare()
492 chip->mgr->sample_rate = subs->runtime->rate; in snd_mixart_prepare()
496 if( mixart_set_clock(chip->mgr, stream->pipe, subs->runtime->rate) ) in snd_mixart_prepare()
519 stream_param.sampling_freq = chip->mgr->sample_rate; in mixart_set_format()
577 err = snd_mixart_send_msg(chip->mgr, &request, sizeof(resp), &resp); in mixart_set_format()
595 struct mixart_mgr *mgr = chip->mgr; in snd_mixart_hw_params() local
607 mutex_lock(&mgr->setup_mutex); in snd_mixart_hw_params()
623 mutex_unlock(&mgr->setup_mutex); in snd_mixart_hw_params()
634 bufferinfo = (struct mixart_bufferinfo *)chip->mgr->bufferinfo.area; in snd_mixart_hw_params()
645 mutex_unlock(&mgr->setup_mutex); in snd_mixart_hw_params()
653 mixart_sync_nonblock_events(chip->mgr); in snd_mixart_hw_free()
708 struct mixart_mgr *mgr = chip->mgr; in snd_mixart_playback_open() local
716 mutex_lock(&mgr->setup_mutex); in snd_mixart_playback_open()
751 err = mixart_set_pipe_state(chip->mgr, pipe, 1); in snd_mixart_playback_open()
754 snd_mixart_kill_ref_pipe(chip->mgr, pipe, 0); in snd_mixart_playback_open()
771 if(mgr->ref_count_rate++) { in snd_mixart_playback_open()
772 if(mgr->sample_rate) { in snd_mixart_playback_open()
773 runtime->hw.rate_min = runtime->hw.rate_max = mgr->sample_rate; in snd_mixart_playback_open()
778 mutex_unlock(&mgr->setup_mutex); in snd_mixart_playback_open()
787 struct mixart_mgr *mgr = chip->mgr; in snd_mixart_capture_open() local
795 mutex_lock(&mgr->setup_mutex); in snd_mixart_capture_open()
832 err = mixart_set_pipe_state(chip->mgr, pipe, 1); in snd_mixart_capture_open()
835 snd_mixart_kill_ref_pipe(chip->mgr, pipe, 0); in snd_mixart_capture_open()
852 if(mgr->ref_count_rate++) { in snd_mixart_capture_open()
853 if(mgr->sample_rate) { in snd_mixart_capture_open()
854 runtime->hw.rate_min = runtime->hw.rate_max = mgr->sample_rate; in snd_mixart_capture_open()
859 mutex_unlock(&mgr->setup_mutex); in snd_mixart_capture_open()
869 struct mixart_mgr *mgr = chip->mgr; in snd_mixart_close() local
872 mutex_lock(&mgr->setup_mutex); in snd_mixart_close()
878 if(--mgr->ref_count_rate == 0) { in snd_mixart_close()
879 mgr->sample_rate = 0; in snd_mixart_close()
883 if (snd_mixart_kill_ref_pipe(mgr, stream->pipe, 0 ) < 0) { in snd_mixart_close()
894 mutex_unlock(&mgr->setup_mutex); in snd_mixart_close()
945 &chip->mgr->pci->dev, in preallocate_buffers()
1029 static int snd_mixart_create(struct mixart_mgr *mgr, struct snd_card *card, int idx) in snd_mixart_create() argument
1043 chip->mgr = mgr; in snd_mixart_create()
1044 card->sync_irq = mgr->irq; in snd_mixart_create()
1051 mgr->chip[idx] = chip; in snd_mixart_create()
1063 if(chip->mgr->board_type == MIXART_DAUGHTER_TYPE_AES) { in snd_mixart_create_pcm()
1076 static int snd_mixart_free(struct mixart_mgr *mgr) in snd_mixart_free() argument
1080 for (i = 0; i < mgr->num_cards; i++) { in snd_mixart_free()
1081 if (mgr->chip[i]) in snd_mixart_free()
1082 snd_card_free(mgr->chip[i]->card); in snd_mixart_free()
1086 snd_mixart_exit_mailbox(mgr); in snd_mixart_free()
1089 if (mgr->irq >= 0) in snd_mixart_free()
1090 free_irq(mgr->irq, mgr); in snd_mixart_free()
1093 if(mgr->dsp_loaded) { in snd_mixart_free()
1094 snd_mixart_reset_board(mgr); in snd_mixart_free()
1095 dev_dbg(&mgr->pci->dev, "reset miXart !\n"); in snd_mixart_free()
1100 iounmap(mgr->mem[i].virt); in snd_mixart_free()
1102 pci_release_regions(mgr->pci); in snd_mixart_free()
1105 if(mgr->flowinfo.area) { in snd_mixart_free()
1106 snd_dma_free_pages(&mgr->flowinfo); in snd_mixart_free()
1107 mgr->flowinfo.area = NULL; in snd_mixart_free()
1110 if(mgr->bufferinfo.area) { in snd_mixart_free()
1111 snd_dma_free_pages(&mgr->bufferinfo); in snd_mixart_free()
1112 mgr->bufferinfo.area = NULL; in snd_mixart_free()
1115 pci_disable_device(mgr->pci); in snd_mixart_free()
1116 kfree(mgr); in snd_mixart_free()
1132 struct mixart_mgr *mgr = entry->private_data; in snd_mixart_BA0_read() local
1135 if (copy_to_user_fromio(buf, MIXART_MEM(mgr, pos), count)) in snd_mixart_BA0_read()
1148 struct mixart_mgr *mgr = entry->private_data; in snd_mixart_BA1_read() local
1151 if (copy_to_user_fromio(buf, MIXART_REG(mgr, pos), count)) in snd_mixart_BA1_read()
1174 if (chip->mgr->dsp_loaded & ( 1 << MIXART_MOTHERBOARD_ELF_INDEX)) { in snd_mixart_proc_read()
1176 switch (chip->mgr->board_type ) { in snd_mixart_proc_read()
1187 ref = readl_be( MIXART_MEM( chip->mgr, MIXART_PSEUDOREG_PERF_SYSTEM_LOAD_OFFSET)); in snd_mixart_proc_read()
1190 …u32 mailbox = 100 * readl_be( MIXART_MEM( chip->mgr, MIXART_PSEUDOREG_PERF_MAILBX_LOAD_OFFSET)) … in snd_mixart_proc_read()
1191 …u32 streaming = 100 * readl_be( MIXART_MEM( chip->mgr, MIXART_PSEUDOREG_PERF_STREAM_LOAD_OFFSET)) … in snd_mixart_proc_read()
1192 …u32 interr = 100 * readl_be( MIXART_MEM( chip->mgr, MIXART_PSEUDOREG_PERF_INTERR_LOAD_OFFSET)) … in snd_mixart_proc_read()
1211 entry->private_data = chip->mgr; in snd_mixart_proc_init()
1217 entry->private_data = chip->mgr; in snd_mixart_proc_init()
1232 struct mixart_mgr *mgr; in snd_mixart_probe() local
1261 mgr = kzalloc(sizeof(*mgr), GFP_KERNEL); in snd_mixart_probe()
1262 if (! mgr) { in snd_mixart_probe()
1267 mgr->pci = pci; in snd_mixart_probe()
1268 mgr->irq = -1; in snd_mixart_probe()
1272 kfree(mgr); in snd_mixart_probe()
1277 mgr->mem[i].phys = pci_resource_start(pci, i); in snd_mixart_probe()
1278 mgr->mem[i].virt = pci_ioremap_bar(pci, i); in snd_mixart_probe()
1279 if (!mgr->mem[i].virt) { in snd_mixart_probe()
1281 mgr->mem[i].phys); in snd_mixart_probe()
1282 snd_mixart_free(mgr); in snd_mixart_probe()
1289 KBUILD_MODNAME, mgr)) { in snd_mixart_probe()
1291 snd_mixart_free(mgr); in snd_mixart_probe()
1294 mgr->irq = pci->irq; in snd_mixart_probe()
1297 mgr->msg_fifo_readptr = 0; in snd_mixart_probe()
1298 mgr->msg_fifo_writeptr = 0; in snd_mixart_probe()
1300 mutex_init(&mgr->lock); in snd_mixart_probe()
1301 mutex_init(&mgr->msg_lock); in snd_mixart_probe()
1302 init_waitqueue_head(&mgr->msg_sleep); in snd_mixart_probe()
1303 atomic_set(&mgr->msg_processed, 0); in snd_mixart_probe()
1306 mutex_init(&mgr->setup_mutex); in snd_mixart_probe()
1309 mgr->num_cards = MIXART_MAX_CARDS; /* 4 FIXME: configurable? */ in snd_mixart_probe()
1310 for (i = 0; i < mgr->num_cards; i++) { in snd_mixart_probe()
1325 snd_mixart_free(mgr); in snd_mixart_probe()
1334 mgr->mem[0].phys, mgr->mem[1].phys, mgr->irq, i); in snd_mixart_probe()
1336 if ((err = snd_mixart_create(mgr, card, i)) < 0) { in snd_mixart_probe()
1338 snd_mixart_free(mgr); in snd_mixart_probe()
1344 snd_mixart_proc_init(mgr->chip[i]); in snd_mixart_probe()
1348 snd_mixart_free(mgr); in snd_mixart_probe()
1354 mgr->board_type = MIXART_DAUGHTER_TYPE_NONE; in snd_mixart_probe()
1360 size, &mgr->flowinfo) < 0) { in snd_mixart_probe()
1361 snd_mixart_free(mgr); in snd_mixart_probe()
1365 memset(mgr->flowinfo.area, 0, size); in snd_mixart_probe()
1371 size, &mgr->bufferinfo) < 0) { in snd_mixart_probe()
1372 snd_mixart_free(mgr); in snd_mixart_probe()
1376 memset(mgr->bufferinfo.area, 0, size); in snd_mixart_probe()
1379 err = snd_mixart_setup_firmware(mgr); in snd_mixart_probe()
1381 snd_mixart_free(mgr); in snd_mixart_probe()
1385 pci_set_drvdata(pci, mgr); in snd_mixart_probe()