// SPDX-License-Identifier: GPL-2.0-only /* * Driver for simulating a mouse on GPIO lines. * * Copyright (C) 2007 Atmel Corporation * Copyright (C) 2017 Linus Walleij <[email protected]> */ #include <linux/module.h> #include <linux/platform_device.h> #include <linux/input.h> #include <linux/gpio/consumer.h> #include <linux/property.h> #include <linux/of.h> /** * struct gpio_mouse * @scan_ms: the scan interval in milliseconds. * @up: GPIO line for up value. * @down: GPIO line for down value. * @left: GPIO line for left value. * @right: GPIO line for right value. * @bleft: GPIO line for left button. * @bmiddle: GPIO line for middle button. * @bright: GPIO line for right button. * * This struct must be added to the platform_device in the board code. * It is used by the gpio_mouse driver to setup GPIO lines and to * calculate mouse movement. */ struct gpio_mouse { … }; /* * Timer function which is run every scan_ms ms when the device is opened. * The dev input variable is set to the input_dev pointer. */ static void gpio_mouse_scan(struct input_dev *input) { … } static int gpio_mouse_probe(struct platform_device *pdev) { … } static const struct of_device_id gpio_mouse_of_match[] = …; MODULE_DEVICE_TABLE(of, gpio_mouse_of_match); static struct platform_driver gpio_mouse_device_driver = …; module_platform_driver(…) …; MODULE_AUTHOR(…) …; MODULE_DESCRIPTION(…) …; MODULE_LICENSE(…) …; MODULE_ALIAS(…) …; /* work with hotplug and coldplug */