Lines Matching refs:gdev
34 struct vbg_dev *gdev; in vbg_misc_device_open() local
37 gdev = container_of(filp->private_data, struct vbg_dev, misc_device); in vbg_misc_device_open()
39 session = vbg_core_open_session(gdev, false); in vbg_misc_device_open()
50 struct vbg_dev *gdev; in vbg_misc_device_user_open() local
53 gdev = container_of(filp->private_data, struct vbg_dev, in vbg_misc_device_user_open()
56 session = vbg_core_open_session(gdev, false); in vbg_misc_device_user_open()
183 struct vbg_dev *gdev = input_get_drvdata(input); in vbg_input_open() local
187 ret = vbg_core_set_mouse_status(gdev, feat); in vbg_input_open()
201 struct vbg_dev *gdev = input_get_drvdata(input); in vbg_input_close() local
203 vbg_core_set_mouse_status(gdev, 0); in vbg_input_close()
211 static int vbg_create_input_device(struct vbg_dev *gdev) in vbg_create_input_device() argument
215 input = devm_input_allocate_device(gdev->dev); in vbg_create_input_device()
224 input->dev.parent = gdev->dev; in vbg_create_input_device()
232 input_set_drvdata(input, gdev); in vbg_create_input_device()
234 gdev->input = input; in vbg_create_input_device()
236 return input_register_device(gdev->input); in vbg_create_input_device()
242 struct vbg_dev *gdev = dev_get_drvdata(dev); in host_version_show() local
244 return sprintf(buf, "%s\n", gdev->host_version); in host_version_show()
250 struct vbg_dev *gdev = dev_get_drvdata(dev); in host_features_show() local
252 return sprintf(buf, "%#x\n", gdev->host_features); in host_features_show()
268 struct vbg_dev *gdev; in vbg_pci_probe() local
271 gdev = devm_kzalloc(dev, sizeof(*gdev), GFP_KERNEL); in vbg_pci_probe()
272 if (!gdev) in vbg_pci_probe()
324 gdev->io_port = io; in vbg_pci_probe()
325 gdev->mmio = vmmdev; in vbg_pci_probe()
326 gdev->dev = dev; in vbg_pci_probe()
327 gdev->misc_device.minor = MISC_DYNAMIC_MINOR; in vbg_pci_probe()
328 gdev->misc_device.name = DEVICE_NAME; in vbg_pci_probe()
329 gdev->misc_device.fops = &vbg_misc_device_fops; in vbg_pci_probe()
330 gdev->misc_device_user.minor = MISC_DYNAMIC_MINOR; in vbg_pci_probe()
331 gdev->misc_device_user.name = DEVICE_NAME_USER; in vbg_pci_probe()
332 gdev->misc_device_user.fops = &vbg_misc_device_user_fops; in vbg_pci_probe()
334 ret = vbg_core_init(gdev, VMMDEV_EVENT_MOUSE_POSITION_CHANGED); in vbg_pci_probe()
338 ret = vbg_create_input_device(gdev); in vbg_pci_probe()
345 gdev); in vbg_pci_probe()
351 ret = misc_register(&gdev->misc_device); in vbg_pci_probe()
358 ret = misc_register(&gdev->misc_device_user); in vbg_pci_probe()
367 vbg_gdev = gdev; in vbg_pci_probe()
377 pci_set_drvdata(pci, gdev); in vbg_pci_probe()
382 gdev->misc_device.minor, pci->irq, gdev->io_port, in vbg_pci_probe()
388 misc_deregister(&gdev->misc_device_user); in vbg_pci_probe()
390 misc_deregister(&gdev->misc_device); in vbg_pci_probe()
392 free_irq(pci->irq, gdev); in vbg_pci_probe()
394 vbg_core_exit(gdev); in vbg_pci_probe()
403 struct vbg_dev *gdev = pci_get_drvdata(pci); in vbg_pci_remove() local
409 free_irq(pci->irq, gdev); in vbg_pci_remove()
410 device_remove_file(gdev->dev, &dev_attr_host_features); in vbg_pci_remove()
411 device_remove_file(gdev->dev, &dev_attr_host_version); in vbg_pci_remove()
412 misc_deregister(&gdev->misc_device_user); in vbg_pci_remove()
413 misc_deregister(&gdev->misc_device); in vbg_pci_remove()
414 vbg_core_exit(gdev); in vbg_pci_remove()
435 void vbg_put_gdev(struct vbg_dev *gdev) in vbg_put_gdev() argument
437 WARN_ON(gdev != vbg_gdev); in vbg_put_gdev()
450 void vbg_linux_mouse_event(struct vbg_dev *gdev) in vbg_linux_mouse_event() argument
455 gdev->mouse_status_req->mouse_features = 0; in vbg_linux_mouse_event()
456 gdev->mouse_status_req->pointer_pos_x = 0; in vbg_linux_mouse_event()
457 gdev->mouse_status_req->pointer_pos_y = 0; in vbg_linux_mouse_event()
458 rc = vbg_req_perform(gdev, gdev->mouse_status_req); in vbg_linux_mouse_event()
460 input_report_abs(gdev->input, ABS_X, in vbg_linux_mouse_event()
461 gdev->mouse_status_req->pointer_pos_x); in vbg_linux_mouse_event()
462 input_report_abs(gdev->input, ABS_Y, in vbg_linux_mouse_event()
463 gdev->mouse_status_req->pointer_pos_y); in vbg_linux_mouse_event()
464 input_sync(gdev->input); in vbg_linux_mouse_event()