Lines Matching refs:hdm_ch
161 static int try_start_dim_transfer(struct hdm_channel *hdm_ch) in try_start_dim_transfer() argument
164 struct list_head *head = &hdm_ch->pending_list; in try_start_dim_transfer()
169 BUG_ON(!hdm_ch); in try_start_dim_transfer()
170 BUG_ON(!hdm_ch->is_initialized); in try_start_dim_transfer()
178 if (!dim_get_channel_state(&hdm_ch->ch, &st)->ready) { in try_start_dim_transfer()
186 if (dim_dbr_space(&hdm_ch->ch) < buf_size) { in try_start_dim_transfer()
192 if (!dim_enqueue_buffer(&hdm_ch->ch, mbo->bus_address, buf_size)) { in try_start_dim_transfer()
201 list_move_tail(head->next, &hdm_ch->started_list); in try_start_dim_transfer()
264 struct hdm_channel *hdm_ch = dev->hch + ch_idx; in service_done_flag() local
272 BUG_ON(!hdm_ch); in service_done_flag()
273 BUG_ON(!hdm_ch->is_initialized); in service_done_flag()
277 done_buffers = dim_get_channel_state(&hdm_ch->ch, &st)->done_buffers; in service_done_flag()
283 if (!dim_detach_buffers(&hdm_ch->ch, done_buffers)) { in service_done_flag()
289 head = &hdm_ch->started_list; in service_done_flag()
305 if (hdm_ch->data_type == MOST_CH_ASYNC && in service_done_flag()
306 hdm_ch->direction == MOST_CH_RX && in service_done_flag()
311 list_add_tail(&mbo->list, &hdm_ch->pending_list); in service_done_flag()
314 if (hdm_ch->data_type == MOST_CH_CONTROL || in service_done_flag()
315 hdm_ch->data_type == MOST_CH_ASYNC) { in service_done_flag()
456 struct hdm_channel *const hdm_ch = dev->hch + ch_idx; in configure_channel() local
460 if (hdm_ch->is_initialized) in configure_channel()
464 hdm_ch->reset_dbr_size = ccfg->dbr_size ? NULL : &ccfg->dbr_size; in configure_channel()
467 hdm_ch->ch.dbr_size = ccfg->dbr_size; in configure_channel()
473 pr_err("%s: too small buffer size\n", hdm_ch->name); in configure_channel()
479 hdm_ch->name, buf_size, new_size); in configure_channel()
481 hal_ret = dim_init_control(&hdm_ch->ch, is_tx, ch_addr, in configure_channel()
487 pr_err("%s: too small buffer size\n", hdm_ch->name); in configure_channel()
493 hdm_ch->name, buf_size, new_size); in configure_channel()
495 hal_ret = dim_init_async(&hdm_ch->ch, is_tx, ch_addr, in configure_channel()
502 hdm_ch->name); in configure_channel()
508 hdm_ch->name, buf_size, new_size); in configure_channel()
510 hal_ret = dim_init_isoc(&hdm_ch->ch, is_tx, ch_addr, sub_size); in configure_channel()
516 hdm_ch->name); in configure_channel()
522 hdm_ch->name, buf_size, new_size); in configure_channel()
524 hal_ret = dim_init_sync(&hdm_ch->ch, is_tx, ch_addr, sub_size); in configure_channel()
528 hdm_ch->name, ccfg->data_type); in configure_channel()
535 hdm_ch->name, hal_ret, ccfg->data_type, (int)is_tx); in configure_channel()
539 hdm_ch->data_type = ccfg->data_type; in configure_channel()
540 hdm_ch->direction = ccfg->direction; in configure_channel()
541 hdm_ch->is_initialized = true; in configure_channel()
543 if (hdm_ch->data_type == MOST_CH_ASYNC && in configure_channel()
544 hdm_ch->direction == MOST_CH_TX && in configure_channel()
549 ccfg->dbr_size = hdm_ch->ch.dbr_size; in configure_channel()
567 struct hdm_channel *hdm_ch = dev->hch + ch_idx; in enqueue() local
572 if (!hdm_ch->is_initialized) in enqueue()
579 list_add_tail(&mbo->list, &hdm_ch->pending_list); in enqueue()
582 (void)try_start_dim_transfer(hdm_ch); in enqueue()
641 struct hdm_channel *hdm_ch = dev->hch + ch_idx; in poison_channel() local
648 if (!hdm_ch->is_initialized) in poison_channel()
652 hal_ret = dim_destroy_channel(&hdm_ch->ch); in poison_channel()
653 hdm_ch->is_initialized = false; in poison_channel()
658 pr_err("HAL Failed to close channel %s\n", hdm_ch->name); in poison_channel()
662 complete_all_mbos(&hdm_ch->started_list); in poison_channel()
663 complete_all_mbos(&hdm_ch->pending_list); in poison_channel()
664 if (hdm_ch->reset_dbr_size) in poison_channel()
665 *hdm_ch->reset_dbr_size = 0; in poison_channel()
846 struct hdm_channel *hdm_ch = dev->hch + i; in dim2_probe() local
848 INIT_LIST_HEAD(&hdm_ch->pending_list); in dim2_probe()
849 INIT_LIST_HEAD(&hdm_ch->started_list); in dim2_probe()
850 hdm_ch->is_initialized = false; in dim2_probe()
851 snprintf(hdm_ch->name, sizeof(hdm_ch->name), "ca%d", i * 2 + 2); in dim2_probe()
853 cap->name_suffix = hdm_ch->name; in dim2_probe()