Lines Matching refs:mhi_event
152 struct mhi_event *mhi_event = mhi_cntrl->mhi_event; in mhi_deinit_free_irq() local
154 for (i = 0; i < mhi_cntrl->total_ev_rings; i++, mhi_event++) { in mhi_deinit_free_irq()
155 if (mhi_event->offload_ev) in mhi_deinit_free_irq()
158 free_irq(mhi_cntrl->irq[mhi_event->irq], mhi_event); in mhi_deinit_free_irq()
166 struct mhi_event *mhi_event = mhi_cntrl->mhi_event; in mhi_init_irq_setup() local
189 for (i = 0; i < mhi_cntrl->total_ev_rings; i++, mhi_event++) { in mhi_init_irq_setup()
190 if (mhi_event->offload_ev) in mhi_init_irq_setup()
193 if (mhi_event->irq >= mhi_cntrl->nr_irqs) { in mhi_init_irq_setup()
195 mhi_event->irq); in mhi_init_irq_setup()
200 ret = request_irq(mhi_cntrl->irq[mhi_event->irq], in mhi_init_irq_setup()
203 "mhi", mhi_event); in mhi_init_irq_setup()
206 mhi_cntrl->irq[mhi_event->irq], i); in mhi_init_irq_setup()
210 disable_irq(mhi_cntrl->irq[mhi_event->irq]); in mhi_init_irq_setup()
216 for (--i, --mhi_event; i >= 0; i--, mhi_event--) { in mhi_init_irq_setup()
217 if (mhi_event->offload_ev) in mhi_init_irq_setup()
220 free_irq(mhi_cntrl->irq[mhi_event->irq], mhi_event); in mhi_init_irq_setup()
232 struct mhi_event *mhi_event; in mhi_deinit_dev_ctxt() local
248 mhi_event = mhi_cntrl->mhi_event; in mhi_deinit_dev_ctxt()
249 for (i = 0; i < mhi_cntrl->total_ev_rings; i++, mhi_event++) { in mhi_deinit_dev_ctxt()
250 if (mhi_event->offload_ev) in mhi_deinit_dev_ctxt()
253 ring = &mhi_event->ring; in mhi_deinit_dev_ctxt()
279 struct mhi_event *mhi_event; in mhi_init_dev_ctxt() local
333 mhi_event = mhi_cntrl->mhi_event; in mhi_init_dev_ctxt()
335 mhi_event++) { in mhi_init_dev_ctxt()
336 struct mhi_ring *ring = &mhi_event->ring; in mhi_init_dev_ctxt()
339 if (mhi_event->offload_ev) in mhi_init_dev_ctxt()
345 tmp |= FIELD_PREP(EV_CTX_INTMODT_MASK, mhi_event->intmod); in mhi_init_dev_ctxt()
349 er_ctxt->msivec = cpu_to_le32(mhi_event->irq); in mhi_init_dev_ctxt()
350 mhi_event->db_cfg.db_mode = true; in mhi_init_dev_ctxt()
413 mhi_event = mhi_cntrl->mhi_event + i; in mhi_init_dev_ctxt()
416 for (--i, --mhi_event; i >= 0; i--, mhi_event--) { in mhi_init_dev_ctxt()
417 struct mhi_ring *ring = &mhi_event->ring; in mhi_init_dev_ctxt()
419 if (mhi_event->offload_ev) in mhi_init_dev_ctxt()
445 struct mhi_event *mhi_event; in mhi_init_mmio() local
549 mhi_event = mhi_cntrl->mhi_event; in mhi_init_mmio()
550 for (i = 0; i < mhi_cntrl->total_ev_rings; i++, val += 8, mhi_event++) { in mhi_init_mmio()
551 if (mhi_event->offload_ev) in mhi_init_mmio()
554 mhi_event->ring.db_addr = base + val; in mhi_init_mmio()
668 struct mhi_event *mhi_event; in parse_ev_cfg() local
675 mhi_cntrl->mhi_event = kcalloc(num, sizeof(*mhi_cntrl->mhi_event), in parse_ev_cfg()
677 if (!mhi_cntrl->mhi_event) in parse_ev_cfg()
681 mhi_event = mhi_cntrl->mhi_event; in parse_ev_cfg()
685 mhi_event->er_index = i; in parse_ev_cfg()
686 mhi_event->ring.elements = event_cfg->num_elements; in parse_ev_cfg()
687 mhi_event->intmod = event_cfg->irq_moderation_ms; in parse_ev_cfg()
688 mhi_event->irq = event_cfg->irq; in parse_ev_cfg()
692 mhi_event->chan = event_cfg->channel; in parse_ev_cfg()
693 if (mhi_event->chan >= mhi_cntrl->max_chan) { in parse_ev_cfg()
699 mhi_event->mhi_chan = in parse_ev_cfg()
700 &mhi_cntrl->mhi_chan[mhi_event->chan]; in parse_ev_cfg()
704 mhi_event->priority = 1; in parse_ev_cfg()
706 mhi_event->db_cfg.brstmode = event_cfg->mode; in parse_ev_cfg()
707 if (MHI_INVALID_BRSTMODE(mhi_event->db_cfg.brstmode)) in parse_ev_cfg()
710 if (mhi_event->db_cfg.brstmode == MHI_DB_BRST_ENABLE) in parse_ev_cfg()
711 mhi_event->db_cfg.process_db = mhi_db_brstmode; in parse_ev_cfg()
713 mhi_event->db_cfg.process_db = mhi_db_brstmode_disable; in parse_ev_cfg()
715 mhi_event->data_type = event_cfg->data_type; in parse_ev_cfg()
717 switch (mhi_event->data_type) { in parse_ev_cfg()
719 mhi_event->process_event = mhi_process_data_event_ring; in parse_ev_cfg()
722 mhi_event->process_event = mhi_process_ctrl_ev_ring; in parse_ev_cfg()
729 mhi_event->hw_ring = event_cfg->hardware_event; in parse_ev_cfg()
730 if (mhi_event->hw_ring) in parse_ev_cfg()
735 mhi_event->cl_manage = event_cfg->client_managed; in parse_ev_cfg()
736 mhi_event->offload_ev = event_cfg->offload_channel; in parse_ev_cfg()
737 mhi_event++; in parse_ev_cfg()
744 kfree(mhi_cntrl->mhi_event); in parse_ev_cfg()
906 struct mhi_event *mhi_event; in mhi_register_controller() local
950 mhi_event = mhi_cntrl->mhi_event; in mhi_register_controller()
951 for (i = 0; i < mhi_cntrl->total_ev_rings; i++, mhi_event++) { in mhi_register_controller()
953 if (mhi_event->offload_ev) in mhi_register_controller()
956 mhi_event->mhi_cntrl = mhi_cntrl; in mhi_register_controller()
957 spin_lock_init(&mhi_event->lock); in mhi_register_controller()
958 if (mhi_event->data_type == MHI_ER_CTRL) in mhi_register_controller()
959 tasklet_init(&mhi_event->task, mhi_ctrl_ev_task, in mhi_register_controller()
960 (ulong)mhi_event); in mhi_register_controller()
962 tasklet_init(&mhi_event->task, mhi_ev_task, in mhi_register_controller()
963 (ulong)mhi_event); in mhi_register_controller()
973 mhi_event = &mhi_cntrl->mhi_event[mhi_chan->er_index]; in mhi_register_controller()
974 mhi_chan->intmod = mhi_event->intmod; in mhi_register_controller()
1043 kfree(mhi_cntrl->mhi_event); in mhi_register_controller()
1061 kfree(mhi_cntrl->mhi_event); in mhi_unregister_controller()
1249 struct mhi_event *mhi_event; in mhi_driver_probe() local
1289 mhi_event = &mhi_cntrl->mhi_event[dl_chan->er_index]; in mhi_driver_probe()
1296 if (mhi_event->cl_manage && !mhi_drv->status_cb) in mhi_driver_probe()