Lines Matching refs:mhi_dev
31 struct device *dev = &mhi_cntrl->mhi_dev->dev; in mhi_ep_send_event()
118 struct device *dev = &mhi_cntrl->mhi_dev->dev; in mhi_ep_process_cmd_ring()
181 if (!(ch_id % 2) && !mhi_chan->mhi_dev) { in mhi_ep_process_cmd_ring()
209 mhi_chan->xfer_cb(mhi_chan->mhi_dev, &result); in mhi_ep_process_cmd_ring()
243 mhi_chan->xfer_cb(mhi_chan->mhi_dev, &result); in mhi_ep_process_cmd_ring()
276 bool mhi_ep_queue_is_empty(struct mhi_ep_device *mhi_dev, enum dma_data_direction dir) in mhi_ep_queue_is_empty() argument
278 struct mhi_ep_chan *mhi_chan = (dir == DMA_FROM_DEVICE) ? mhi_dev->dl_chan : in mhi_ep_queue_is_empty()
279 mhi_dev->ul_chan; in mhi_ep_queue_is_empty()
280 struct mhi_ep_cntrl *mhi_cntrl = mhi_dev->mhi_cntrl; in mhi_ep_queue_is_empty()
293 struct device *dev = &mhi_cntrl->mhi_dev->dev; in mhi_ep_read_channel()
333 dev_err(&mhi_chan->mhi_dev->dev, "Error reading from channel\n"); in mhi_ep_read_channel()
363 dev_err(&mhi_chan->mhi_dev->dev, in mhi_ep_read_channel()
379 dev_err(&mhi_chan->mhi_dev->dev, in mhi_ep_read_channel()
412 dev_err(&mhi_chan->mhi_dev->dev, "Client driver not available\n"); in mhi_ep_process_ch_ring()
419 mhi_chan->xfer_cb(mhi_chan->mhi_dev, &result); in mhi_ep_process_ch_ring()
429 dev_err(&mhi_chan->mhi_dev->dev, "Failed to read channel\n"); in mhi_ep_process_ch_ring()
435 mhi_chan->xfer_cb(mhi_chan->mhi_dev, &result); in mhi_ep_process_ch_ring()
440 } while (!mhi_ep_queue_is_empty(mhi_chan->mhi_dev, DMA_TO_DEVICE)); in mhi_ep_process_ch_ring()
449 int mhi_ep_queue_skb(struct mhi_ep_device *mhi_dev, struct sk_buff *skb) in mhi_ep_queue_skb() argument
451 struct mhi_ep_cntrl *mhi_cntrl = mhi_dev->mhi_cntrl; in mhi_ep_queue_skb()
452 struct mhi_ep_chan *mhi_chan = mhi_dev->dl_chan; in mhi_ep_queue_skb()
453 struct device *dev = &mhi_chan->mhi_dev->dev; in mhi_ep_queue_skb()
477 if (mhi_ep_queue_is_empty(mhi_dev, DMA_FROM_DEVICE)) { in mhi_ep_queue_skb()
533 struct device *dev = &mhi_cntrl->mhi_dev->dev; in mhi_ep_cache_host_cfg()
641 struct device *dev = &mhi_cntrl->mhi_dev->dev; in mhi_ep_enable()
682 struct device *dev = &mhi_cntrl->mhi_dev->dev; in mhi_ep_cmd_ring_worker()
715 struct device *dev = &mhi_cntrl->mhi_dev->dev; in mhi_ep_ch_ring_worker()
782 struct device *dev = &mhi_cntrl->mhi_dev->dev; in mhi_ep_state_worker()
900 struct device *dev = &mhi_cntrl->mhi_dev->dev; in mhi_ep_irq()
953 mhi_chan->xfer_cb(mhi_chan->mhi_dev, &result); in mhi_ep_abort_transfer()
963 device_for_each_child(&mhi_cntrl->mhi_dev->dev, NULL, mhi_ep_destroy_device); in mhi_ep_abort_transfer()
1028 struct device *dev = &mhi_cntrl->mhi_dev->dev; in mhi_ep_handle_syserr()
1043 struct device *dev = &mhi_cntrl->mhi_dev->dev; in mhi_ep_power_up()
1114 if (!mhi_chan->mhi_dev) in mhi_ep_suspend_channels()
1125 dev_dbg(&mhi_chan->mhi_dev->dev, "Suspending channel\n"); in mhi_ep_suspend_channels()
1144 if (!mhi_chan->mhi_dev) in mhi_ep_resume_channels()
1155 dev_dbg(&mhi_chan->mhi_dev->dev, "Resuming channel\n"); in mhi_ep_resume_channels()
1167 struct mhi_ep_device *mhi_dev = to_mhi_ep_device(dev); in mhi_ep_release_device() local
1169 if (mhi_dev->dev_type == MHI_DEVICE_CONTROLLER) in mhi_ep_release_device()
1170 mhi_dev->mhi_cntrl->mhi_dev = NULL; in mhi_ep_release_device()
1177 if (mhi_dev->ul_chan) in mhi_ep_release_device()
1178 mhi_dev->ul_chan->mhi_dev = NULL; in mhi_ep_release_device()
1180 if (mhi_dev->dl_chan) in mhi_ep_release_device()
1181 mhi_dev->dl_chan->mhi_dev = NULL; in mhi_ep_release_device()
1183 kfree(mhi_dev); in mhi_ep_release_device()
1189 struct mhi_ep_device *mhi_dev; in mhi_ep_alloc_device() local
1192 mhi_dev = kzalloc(sizeof(*mhi_dev), GFP_KERNEL); in mhi_ep_alloc_device()
1193 if (!mhi_dev) in mhi_ep_alloc_device()
1196 dev = &mhi_dev->dev; in mhi_ep_alloc_device()
1207 dev->parent = &mhi_cntrl->mhi_dev->dev; in mhi_ep_alloc_device()
1209 mhi_dev->mhi_cntrl = mhi_cntrl; in mhi_ep_alloc_device()
1210 mhi_dev->dev_type = dev_type; in mhi_ep_alloc_device()
1212 return mhi_dev; in mhi_ep_alloc_device()
1225 struct mhi_ep_device *mhi_dev; in mhi_ep_create_device() local
1235 mhi_dev = mhi_ep_alloc_device(mhi_cntrl, MHI_DEVICE_XFER); in mhi_ep_create_device()
1236 if (IS_ERR(mhi_dev)) in mhi_ep_create_device()
1237 return PTR_ERR(mhi_dev); in mhi_ep_create_device()
1240 mhi_dev->ul_chan = mhi_chan; in mhi_ep_create_device()
1241 get_device(&mhi_dev->dev); in mhi_ep_create_device()
1242 mhi_chan->mhi_dev = mhi_dev; in mhi_ep_create_device()
1246 mhi_dev->dl_chan = mhi_chan; in mhi_ep_create_device()
1247 get_device(&mhi_dev->dev); in mhi_ep_create_device()
1248 mhi_chan->mhi_dev = mhi_dev; in mhi_ep_create_device()
1251 mhi_dev->name = mhi_chan->name; in mhi_ep_create_device()
1252 ret = dev_set_name(&mhi_dev->dev, "%s_%s", in mhi_ep_create_device()
1253 dev_name(&mhi_cntrl->mhi_dev->dev), in mhi_ep_create_device()
1254 mhi_dev->name); in mhi_ep_create_device()
1256 put_device(&mhi_dev->dev); in mhi_ep_create_device()
1260 ret = device_add(&mhi_dev->dev); in mhi_ep_create_device()
1262 put_device(&mhi_dev->dev); in mhi_ep_create_device()
1269 struct mhi_ep_device *mhi_dev; in mhi_ep_destroy_device() local
1276 mhi_dev = to_mhi_ep_device(dev); in mhi_ep_destroy_device()
1277 mhi_cntrl = mhi_dev->mhi_cntrl; in mhi_ep_destroy_device()
1280 if (mhi_dev->dev_type == MHI_DEVICE_CONTROLLER) in mhi_ep_destroy_device()
1283 ul_chan = mhi_dev->ul_chan; in mhi_ep_destroy_device()
1284 dl_chan = mhi_dev->dl_chan; in mhi_ep_destroy_device()
1287 put_device(&ul_chan->mhi_dev->dev); in mhi_ep_destroy_device()
1290 put_device(&dl_chan->mhi_dev->dev); in mhi_ep_destroy_device()
1292 dev_dbg(&mhi_cntrl->mhi_dev->dev, "Destroying device for chan:%s\n", in mhi_ep_destroy_device()
1293 mhi_dev->name); in mhi_ep_destroy_device()
1362 struct mhi_ep_device *mhi_dev; in mhi_ep_register_controller() local
1415 mhi_dev = mhi_ep_alloc_device(mhi_cntrl, MHI_DEVICE_CONTROLLER); in mhi_ep_register_controller()
1416 if (IS_ERR(mhi_dev)) { in mhi_ep_register_controller()
1418 ret = PTR_ERR(mhi_dev); in mhi_ep_register_controller()
1422 ret = dev_set_name(&mhi_dev->dev, "mhi_ep%u", mhi_cntrl->index); in mhi_ep_register_controller()
1426 mhi_dev->name = dev_name(&mhi_dev->dev); in mhi_ep_register_controller()
1427 mhi_cntrl->mhi_dev = mhi_dev; in mhi_ep_register_controller()
1429 ret = device_add(&mhi_dev->dev); in mhi_ep_register_controller()
1433 dev_dbg(&mhi_dev->dev, "MHI EP Controller registered\n"); in mhi_ep_register_controller()
1438 put_device(&mhi_dev->dev); in mhi_ep_register_controller()
1460 struct mhi_ep_device *mhi_dev = mhi_cntrl->mhi_dev; in mhi_ep_unregister_controller() local
1469 device_del(&mhi_dev->dev); in mhi_ep_unregister_controller()
1470 put_device(&mhi_dev->dev); in mhi_ep_unregister_controller()
1478 struct mhi_ep_device *mhi_dev = to_mhi_ep_device(dev); in mhi_ep_driver_probe() local
1480 struct mhi_ep_chan *ul_chan = mhi_dev->ul_chan; in mhi_ep_driver_probe()
1481 struct mhi_ep_chan *dl_chan = mhi_dev->dl_chan; in mhi_ep_driver_probe()
1486 return mhi_drv->probe(mhi_dev, mhi_dev->id); in mhi_ep_driver_probe()
1491 struct mhi_ep_device *mhi_dev = to_mhi_ep_device(dev); in mhi_ep_driver_remove() local
1498 if (mhi_dev->dev_type == MHI_DEVICE_CONTROLLER) in mhi_ep_driver_remove()
1503 mhi_chan = dir ? mhi_dev->ul_chan : mhi_dev->dl_chan; in mhi_ep_driver_remove()
1513 mhi_chan->xfer_cb(mhi_chan->mhi_dev, &result); in mhi_ep_driver_remove()
1522 mhi_drv->remove(mhi_dev); in mhi_ep_driver_remove()
1555 const struct mhi_ep_device *mhi_dev = to_mhi_ep_device(dev); in mhi_ep_uevent() local
1558 mhi_dev->name); in mhi_ep_uevent()
1563 struct mhi_ep_device *mhi_dev = to_mhi_ep_device(dev); in mhi_ep_match() local
1571 if (mhi_dev->dev_type == MHI_DEVICE_CONTROLLER) in mhi_ep_match()
1575 if (!strcmp(mhi_dev->name, id->chan)) { in mhi_ep_match()
1576 mhi_dev->id = id; in mhi_ep_match()