mousedev           78 drivers/input/mousedev.c 	int (*open_device)(struct mousedev *mousedev);
mousedev           79 drivers/input/mousedev.c 	void (*close_device)(struct mousedev *mousedev);
mousedev           96 drivers/input/mousedev.c 	struct mousedev *mousedev;
mousedev          116 drivers/input/mousedev.c static struct mousedev *mousedev_mix;
mousedev          119 drivers/input/mousedev.c #define fx(i)  (mousedev->old_x[(mousedev->pkt_count - (i)) & 03])
mousedev          120 drivers/input/mousedev.c #define fy(i)  (mousedev->old_y[(mousedev->pkt_count - (i)) & 03])
mousedev          123 drivers/input/mousedev.c 				    struct mousedev *mousedev,
mousedev          134 drivers/input/mousedev.c 		if (mousedev->touch && mousedev->pkt_count >= 2) {
mousedev          141 drivers/input/mousedev.c 			tmp += mousedev->frac_dx;
mousedev          142 drivers/input/mousedev.c 			mousedev->packet.dx = tmp / FRACTION_DENOM;
mousedev          143 drivers/input/mousedev.c 			mousedev->frac_dx =
mousedev          144 drivers/input/mousedev.c 				tmp - mousedev->packet.dx * FRACTION_DENOM;
mousedev          150 drivers/input/mousedev.c 		if (mousedev->touch && mousedev->pkt_count >= 2) {
mousedev          158 drivers/input/mousedev.c 			tmp += mousedev->frac_dy;
mousedev          159 drivers/input/mousedev.c 			mousedev->packet.dy = tmp / FRACTION_DENOM;
mousedev          160 drivers/input/mousedev.c 			mousedev->frac_dy = tmp -
mousedev          161 drivers/input/mousedev.c 				mousedev->packet.dy * FRACTION_DENOM;
mousedev          167 drivers/input/mousedev.c static void mousedev_abs_event(struct input_dev *dev, struct mousedev *mousedev,
mousedev          184 drivers/input/mousedev.c 		mousedev->packet.x = ((value - min) * xres) / size;
mousedev          185 drivers/input/mousedev.c 		mousedev->packet.abs_event = 1;
mousedev          198 drivers/input/mousedev.c 		mousedev->packet.y = yres - ((value - min) * yres) / size;
mousedev          199 drivers/input/mousedev.c 		mousedev->packet.abs_event = 1;
mousedev          204 drivers/input/mousedev.c static void mousedev_rel_event(struct mousedev *mousedev,
mousedev          209 drivers/input/mousedev.c 		mousedev->packet.dx += value;
mousedev          213 drivers/input/mousedev.c 		mousedev->packet.dy -= value;
mousedev          217 drivers/input/mousedev.c 		mousedev->packet.dz -= value;
mousedev          222 drivers/input/mousedev.c static void mousedev_key_event(struct mousedev *mousedev,
mousedev          253 drivers/input/mousedev.c 		set_bit(index, &mousedev->packet.buttons);
mousedev          256 drivers/input/mousedev.c 		clear_bit(index, &mousedev->packet.buttons);
mousedev          261 drivers/input/mousedev.c static void mousedev_notify_readers(struct mousedev *mousedev,
mousedev          270 drivers/input/mousedev.c 	list_for_each_entry_rcu(client, &mousedev->client_list, node) {
mousedev          276 drivers/input/mousedev.c 		if (client->ready && p->buttons != mousedev->packet.buttons) {
mousedev          300 drivers/input/mousedev.c 		p->buttons = mousedev->packet.buttons;
mousedev          316 drivers/input/mousedev.c 		wake_up_interruptible(&mousedev->wait);
mousedev          319 drivers/input/mousedev.c static void mousedev_touchpad_touch(struct mousedev *mousedev, int value)
mousedev          322 drivers/input/mousedev.c 		if (mousedev->touch &&
mousedev          324 drivers/input/mousedev.c 				mousedev->touch + msecs_to_jiffies(tap_time))) {
mousedev          330 drivers/input/mousedev.c 			set_bit(0, &mousedev->packet.buttons);
mousedev          332 drivers/input/mousedev.c 			mousedev_notify_readers(mousedev, &mousedev_mix->packet);
mousedev          335 drivers/input/mousedev.c 			clear_bit(0, &mousedev->packet.buttons);
mousedev          338 drivers/input/mousedev.c 		mousedev->touch = mousedev->pkt_count = 0;
mousedev          339 drivers/input/mousedev.c 		mousedev->frac_dx = 0;
mousedev          340 drivers/input/mousedev.c 		mousedev->frac_dy = 0;
mousedev          342 drivers/input/mousedev.c 	} else if (!mousedev->touch)
mousedev          343 drivers/input/mousedev.c 		mousedev->touch = jiffies;
mousedev          349 drivers/input/mousedev.c 	struct mousedev *mousedev = handle->private;
mousedev          360 drivers/input/mousedev.c 						mousedev, code, value);
mousedev          362 drivers/input/mousedev.c 			mousedev_abs_event(handle->dev, mousedev, code, value);
mousedev          367 drivers/input/mousedev.c 		mousedev_rel_event(mousedev, code, value);
mousedev          374 drivers/input/mousedev.c 				mousedev_touchpad_touch(mousedev, value);
mousedev          376 drivers/input/mousedev.c 				mousedev_key_event(mousedev, code, value);
mousedev          382 drivers/input/mousedev.c 			if (mousedev->touch) {
mousedev          383 drivers/input/mousedev.c 				mousedev->pkt_count++;
mousedev          393 drivers/input/mousedev.c 			mousedev_notify_readers(mousedev, &mousedev->packet);
mousedev          394 drivers/input/mousedev.c 			mousedev_notify_readers(mousedev_mix, &mousedev->packet);
mousedev          396 drivers/input/mousedev.c 			mousedev->packet.dx = mousedev->packet.dy =
mousedev          397 drivers/input/mousedev.c 				mousedev->packet.dz = 0;
mousedev          398 drivers/input/mousedev.c 			mousedev->packet.abs_event = 0;
mousedev          413 drivers/input/mousedev.c 	struct mousedev *mousedev = container_of(dev, struct mousedev, dev);
mousedev          415 drivers/input/mousedev.c 	input_put_device(mousedev->handle.dev);
mousedev          416 drivers/input/mousedev.c 	kfree(mousedev);
mousedev          419 drivers/input/mousedev.c static int mousedev_open_device(struct mousedev *mousedev)
mousedev          423 drivers/input/mousedev.c 	retval = mutex_lock_interruptible(&mousedev->mutex);
mousedev          427 drivers/input/mousedev.c 	if (!mousedev->exist)
mousedev          429 drivers/input/mousedev.c 	else if (!mousedev->open++) {
mousedev          430 drivers/input/mousedev.c 		retval = input_open_device(&mousedev->handle);
mousedev          432 drivers/input/mousedev.c 			mousedev->open--;
mousedev          435 drivers/input/mousedev.c 	mutex_unlock(&mousedev->mutex);
mousedev          439 drivers/input/mousedev.c static void mousedev_close_device(struct mousedev *mousedev)
mousedev          441 drivers/input/mousedev.c 	mutex_lock(&mousedev->mutex);
mousedev          443 drivers/input/mousedev.c 	if (mousedev->exist && !--mousedev->open)
mousedev          444 drivers/input/mousedev.c 		input_close_device(&mousedev->handle);
mousedev          446 drivers/input/mousedev.c 	mutex_unlock(&mousedev->mutex);
mousedev          454 drivers/input/mousedev.c static int mixdev_open_devices(struct mousedev *mixdev)
mousedev          463 drivers/input/mousedev.c 		struct mousedev *mousedev;
mousedev          465 drivers/input/mousedev.c 		list_for_each_entry(mousedev, &mousedev_mix_list, mixdev_node) {
mousedev          466 drivers/input/mousedev.c 			if (!mousedev->opened_by_mixdev) {
mousedev          467 drivers/input/mousedev.c 				if (mousedev_open_device(mousedev))
mousedev          470 drivers/input/mousedev.c 				mousedev->opened_by_mixdev = true;
mousedev          484 drivers/input/mousedev.c static void mixdev_close_devices(struct mousedev *mixdev)
mousedev          489 drivers/input/mousedev.c 		struct mousedev *mousedev;
mousedev          491 drivers/input/mousedev.c 		list_for_each_entry(mousedev, &mousedev_mix_list, mixdev_node) {
mousedev          492 drivers/input/mousedev.c 			if (mousedev->opened_by_mixdev) {
mousedev          493 drivers/input/mousedev.c 				mousedev->opened_by_mixdev = false;
mousedev          494 drivers/input/mousedev.c 				mousedev_close_device(mousedev);
mousedev          503 drivers/input/mousedev.c static void mousedev_attach_client(struct mousedev *mousedev,
mousedev          506 drivers/input/mousedev.c 	spin_lock(&mousedev->client_lock);
mousedev          507 drivers/input/mousedev.c 	list_add_tail_rcu(&client->node, &mousedev->client_list);
mousedev          508 drivers/input/mousedev.c 	spin_unlock(&mousedev->client_lock);
mousedev          511 drivers/input/mousedev.c static void mousedev_detach_client(struct mousedev *mousedev,
mousedev          514 drivers/input/mousedev.c 	spin_lock(&mousedev->client_lock);
mousedev          516 drivers/input/mousedev.c 	spin_unlock(&mousedev->client_lock);
mousedev          523 drivers/input/mousedev.c 	struct mousedev *mousedev = client->mousedev;
mousedev          525 drivers/input/mousedev.c 	mousedev_detach_client(mousedev, client);
mousedev          528 drivers/input/mousedev.c 	mousedev->close_device(mousedev);
mousedev          536 drivers/input/mousedev.c 	struct mousedev *mousedev;
mousedev          541 drivers/input/mousedev.c 		mousedev = mousedev_mix;
mousedev          544 drivers/input/mousedev.c 		mousedev = container_of(inode->i_cdev, struct mousedev, cdev);
mousedev          553 drivers/input/mousedev.c 	client->mousedev = mousedev;
mousedev          554 drivers/input/mousedev.c 	mousedev_attach_client(mousedev, client);
mousedev          556 drivers/input/mousedev.c 	error = mousedev->open_device(mousedev);
mousedev          566 drivers/input/mousedev.c 	mousedev_detach_client(mousedev, client);
mousedev          711 drivers/input/mousedev.c 	wake_up_interruptible(&client->mousedev->wait);
mousedev          720 drivers/input/mousedev.c 	struct mousedev *mousedev = client->mousedev;
mousedev          724 drivers/input/mousedev.c 	if (!client->ready && !client->buffer && mousedev->exist &&
mousedev          728 drivers/input/mousedev.c 	retval = wait_event_interruptible(mousedev->wait,
mousedev          729 drivers/input/mousedev.c 			!mousedev->exist || client->ready || client->buffer);
mousedev          733 drivers/input/mousedev.c 	if (!mousedev->exist)
mousedev          761 drivers/input/mousedev.c 	struct mousedev *mousedev = client->mousedev;
mousedev          764 drivers/input/mousedev.c 	poll_wait(file, &mousedev->wait, wait);
mousedev          766 drivers/input/mousedev.c 	mask = mousedev->exist ? EPOLLOUT | EPOLLWRNORM : EPOLLHUP | EPOLLERR;
mousedev          789 drivers/input/mousedev.c static void mousedev_mark_dead(struct mousedev *mousedev)
mousedev          791 drivers/input/mousedev.c 	mutex_lock(&mousedev->mutex);
mousedev          792 drivers/input/mousedev.c 	mousedev->exist = false;
mousedev          793 drivers/input/mousedev.c 	mutex_unlock(&mousedev->mutex);
mousedev          800 drivers/input/mousedev.c static void mousedev_hangup(struct mousedev *mousedev)
mousedev          804 drivers/input/mousedev.c 	spin_lock(&mousedev->client_lock);
mousedev          805 drivers/input/mousedev.c 	list_for_each_entry(client, &mousedev->client_list, node)
mousedev          807 drivers/input/mousedev.c 	spin_unlock(&mousedev->client_lock);
mousedev          809 drivers/input/mousedev.c 	wake_up_interruptible(&mousedev->wait);
mousedev          812 drivers/input/mousedev.c static void mousedev_cleanup(struct mousedev *mousedev)
mousedev          814 drivers/input/mousedev.c 	struct input_handle *handle = &mousedev->handle;
mousedev          816 drivers/input/mousedev.c 	mousedev_mark_dead(mousedev);
mousedev          817 drivers/input/mousedev.c 	mousedev_hangup(mousedev);
mousedev          820 drivers/input/mousedev.c 	if (mousedev->open)
mousedev          842 drivers/input/mousedev.c static struct mousedev *mousedev_create(struct input_dev *dev,
mousedev          846 drivers/input/mousedev.c 	struct mousedev *mousedev;
mousedev          856 drivers/input/mousedev.c 	mousedev = kzalloc(sizeof(struct mousedev), GFP_KERNEL);
mousedev          857 drivers/input/mousedev.c 	if (!mousedev) {
mousedev          862 drivers/input/mousedev.c 	INIT_LIST_HEAD(&mousedev->client_list);
mousedev          863 drivers/input/mousedev.c 	INIT_LIST_HEAD(&mousedev->mixdev_node);
mousedev          864 drivers/input/mousedev.c 	spin_lock_init(&mousedev->client_lock);
mousedev          865 drivers/input/mousedev.c 	mutex_init(&mousedev->mutex);
mousedev          866 drivers/input/mousedev.c 	lockdep_set_subclass(&mousedev->mutex,
mousedev          868 drivers/input/mousedev.c 	init_waitqueue_head(&mousedev->wait);
mousedev          871 drivers/input/mousedev.c 		dev_set_name(&mousedev->dev, "mice");
mousedev          873 drivers/input/mousedev.c 		mousedev->open_device = mixdev_open_devices;
mousedev          874 drivers/input/mousedev.c 		mousedev->close_device = mixdev_close_devices;
mousedev          880 drivers/input/mousedev.c 		dev_set_name(&mousedev->dev, "mouse%d", dev_no);
mousedev          882 drivers/input/mousedev.c 		mousedev->open_device = mousedev_open_device;
mousedev          883 drivers/input/mousedev.c 		mousedev->close_device = mousedev_close_device;
mousedev          886 drivers/input/mousedev.c 	mousedev->exist = true;
mousedev          887 drivers/input/mousedev.c 	mousedev->handle.dev = input_get_device(dev);
mousedev          888 drivers/input/mousedev.c 	mousedev->handle.name = dev_name(&mousedev->dev);
mousedev          889 drivers/input/mousedev.c 	mousedev->handle.handler = handler;
mousedev          890 drivers/input/mousedev.c 	mousedev->handle.private = mousedev;
mousedev          892 drivers/input/mousedev.c 	mousedev->dev.class = &input_class;
mousedev          894 drivers/input/mousedev.c 		mousedev->dev.parent = &dev->dev;
mousedev          895 drivers/input/mousedev.c 	mousedev->dev.devt = MKDEV(INPUT_MAJOR, minor);
mousedev          896 drivers/input/mousedev.c 	mousedev->dev.release = mousedev_free;
mousedev          897 drivers/input/mousedev.c 	device_initialize(&mousedev->dev);
mousedev          900 drivers/input/mousedev.c 		error = input_register_handle(&mousedev->handle);
mousedev          905 drivers/input/mousedev.c 	cdev_init(&mousedev->cdev, &mousedev_fops);
mousedev          907 drivers/input/mousedev.c 	error = cdev_device_add(&mousedev->cdev, &mousedev->dev);
mousedev          911 drivers/input/mousedev.c 	return mousedev;
mousedev          914 drivers/input/mousedev.c 	mousedev_cleanup(mousedev);
mousedev          916 drivers/input/mousedev.c 		input_unregister_handle(&mousedev->handle);
mousedev          918 drivers/input/mousedev.c 	put_device(&mousedev->dev);
mousedev          925 drivers/input/mousedev.c static void mousedev_destroy(struct mousedev *mousedev)
mousedev          927 drivers/input/mousedev.c 	cdev_device_del(&mousedev->cdev, &mousedev->dev);
mousedev          928 drivers/input/mousedev.c 	mousedev_cleanup(mousedev);
mousedev          929 drivers/input/mousedev.c 	input_free_minor(MINOR(mousedev->dev.devt));
mousedev          930 drivers/input/mousedev.c 	if (mousedev != mousedev_mix)
mousedev          931 drivers/input/mousedev.c 		input_unregister_handle(&mousedev->handle);
mousedev          932 drivers/input/mousedev.c 	put_device(&mousedev->dev);
mousedev          935 drivers/input/mousedev.c static int mixdev_add_device(struct mousedev *mousedev)
mousedev          944 drivers/input/mousedev.c 		retval = mousedev_open_device(mousedev);
mousedev          948 drivers/input/mousedev.c 		mousedev->opened_by_mixdev = true;
mousedev          951 drivers/input/mousedev.c 	get_device(&mousedev->dev);
mousedev          952 drivers/input/mousedev.c 	list_add_tail(&mousedev->mixdev_node, &mousedev_mix_list);
mousedev          959 drivers/input/mousedev.c static void mixdev_remove_device(struct mousedev *mousedev)
mousedev          963 drivers/input/mousedev.c 	if (mousedev->opened_by_mixdev) {
mousedev          964 drivers/input/mousedev.c 		mousedev->opened_by_mixdev = false;
mousedev          965 drivers/input/mousedev.c 		mousedev_close_device(mousedev);
mousedev          968 drivers/input/mousedev.c 	list_del_init(&mousedev->mixdev_node);
mousedev          971 drivers/input/mousedev.c 	put_device(&mousedev->dev);
mousedev          978 drivers/input/mousedev.c 	struct mousedev *mousedev;
mousedev          981 drivers/input/mousedev.c 	mousedev = mousedev_create(dev, handler, false);
mousedev          982 drivers/input/mousedev.c 	if (IS_ERR(mousedev))
mousedev          983 drivers/input/mousedev.c 		return PTR_ERR(mousedev);
mousedev          985 drivers/input/mousedev.c 	error = mixdev_add_device(mousedev);
mousedev          987 drivers/input/mousedev.c 		mousedev_destroy(mousedev);
mousedev          996 drivers/input/mousedev.c 	struct mousedev *mousedev = handle->private;
mousedev          998 drivers/input/mousedev.c 	mixdev_remove_device(mousedev);
mousedev          999 drivers/input/mousedev.c 	mousedev_destroy(mousedev);