From c5053e695d621f8a8a3992c5e93dd3be088fa267 Mon Sep 17 00:00:00 2001 From: Linus Walleij Date: Thu, 19 Oct 2017 16:19:03 -0700 Subject: Input: gpio_mouse - kill off platform data This is not used much: git grep gpio_mouse_platform_data shows that absolutely nothing in the kernel defines this platform data. It could be argued that the driver should be deleted. But that is a bit harsh I think since it seems generally useful. So this patch starts a series which repurposes it to be used with hardware nodes from device tree or ACPI. This first patch simply localize the platform data header and allocates a dummy platform data. Yes: this patch leaves the driver in a pretty useless state, but since nothing is instantiating this driver, it doesn't make it more useless than it already is. Later patches makes use of the driver. Acked-by: Hans-Christian Noren Egtvedt Signed-off-by: Linus Walleij Signed-off-by: Dmitry Torokhov --- include/linux/gpio_mouse.h | 61 ---------------------------------------------- 1 file changed, 61 deletions(-) delete mode 100644 include/linux/gpio_mouse.h (limited to 'include') diff --git a/include/linux/gpio_mouse.h b/include/linux/gpio_mouse.h deleted file mode 100644 index 44ed7aa14d85..000000000000 --- a/include/linux/gpio_mouse.h +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Driver for simulating a mouse on GPIO lines. - * - * Copyright (C) 2007 Atmel Corporation - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - */ - -#ifndef _GPIO_MOUSE_H -#define _GPIO_MOUSE_H - -#define GPIO_MOUSE_POLARITY_ACT_HIGH 0x00 -#define GPIO_MOUSE_POLARITY_ACT_LOW 0x01 - -#define GPIO_MOUSE_PIN_UP 0 -#define GPIO_MOUSE_PIN_DOWN 1 -#define GPIO_MOUSE_PIN_LEFT 2 -#define GPIO_MOUSE_PIN_RIGHT 3 -#define GPIO_MOUSE_PIN_BLEFT 4 -#define GPIO_MOUSE_PIN_BMIDDLE 5 -#define GPIO_MOUSE_PIN_BRIGHT 6 -#define GPIO_MOUSE_PIN_MAX 7 - -/** - * struct gpio_mouse_platform_data - * @scan_ms: integer in ms specifying the scan periode. - * @polarity: Pin polarity, active high or low. - * @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_platform_data { - int scan_ms; - int polarity; - - union { - struct { - int up; - int down; - int left; - int right; - - int bleft; - int bmiddle; - int bright; - }; - int pins[GPIO_MOUSE_PIN_MAX]; - }; -}; - -#endif /* _GPIO_MOUSE_H */ -- cgit v1.2.3 From a11bc476b987925654369411dd8281a60cb5a175 Mon Sep 17 00:00:00 2001 From: Dmitry Torokhov Date: Mon, 4 Sep 2017 12:19:07 -0700 Subject: Input: uinput - fold header into the driver proper There is nothing in the uinput kernel header that is of use to anyone in the kernel besides the uinput driver itself, so let's fold it into the driver code (leaving uapi part intact). Signed-off-by: Dmitry Torokhov --- drivers/input/misc/uinput.c | 40 +++++++++++++++++++++- include/linux/uinput.h | 81 --------------------------------------------- 2 files changed, 39 insertions(+), 82 deletions(-) delete mode 100644 include/linux/uinput.h (limited to 'include') diff --git a/drivers/input/misc/uinput.c b/drivers/input/misc/uinput.c index 06f3ac67dde1..7b41aad7ec27 100644 --- a/drivers/input/misc/uinput.c +++ b/drivers/input/misc/uinput.c @@ -31,6 +31,7 @@ * 0.1 20/06/2002 * - first public version */ +#include #include #include #include @@ -38,10 +39,47 @@ #include #include #include -#include #include #include "../input-compat.h" +#define UINPUT_NAME "uinput" +#define UINPUT_BUFFER_SIZE 16 +#define UINPUT_NUM_REQUESTS 16 + +enum uinput_state { UIST_NEW_DEVICE, UIST_SETUP_COMPLETE, UIST_CREATED }; + +struct uinput_request { + unsigned int id; + unsigned int code; /* UI_FF_UPLOAD, UI_FF_ERASE */ + + int retval; + struct completion done; + + union { + unsigned int effect_id; + struct { + struct ff_effect *effect; + struct ff_effect *old; + } upload; + } u; +}; + +struct uinput_device { + struct input_dev *dev; + struct mutex mutex; + enum uinput_state state; + wait_queue_head_t waitq; + unsigned char ready; + unsigned char head; + unsigned char tail; + struct input_event buff[UINPUT_BUFFER_SIZE]; + unsigned int ff_effects_max; + + struct uinput_request *requests[UINPUT_NUM_REQUESTS]; + wait_queue_head_t requests_waitq; + spinlock_t requests_lock; +}; + static int uinput_dev_event(struct input_dev *dev, unsigned int type, unsigned int code, int value) { diff --git a/include/linux/uinput.h b/include/linux/uinput.h deleted file mode 100644 index 75de43da2301..000000000000 --- a/include/linux/uinput.h +++ /dev/null @@ -1,81 +0,0 @@ -/* - * User level driver support for input subsystem - * - * Heavily based on evdev.c by Vojtech Pavlik - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Author: Aristeu Sergio Rozanski Filho - * - * Changes/Revisions: - * 0.5 08/13/2015 (David Herrmann & - * Benjamin Tissoires ) - * - add UI_DEV_SETUP ioctl - * - add UI_ABS_SETUP ioctl - * - add UI_GET_VERSION ioctl - * 0.4 01/09/2014 (Benjamin Tissoires ) - * - add UI_GET_SYSNAME ioctl - * 0.3 24/05/2006 (Anssi Hannula ) - * - update ff support for the changes in kernel interface - * - add UINPUT_VERSION - * 0.2 16/10/2004 (Micah Dowty ) - * - added force feedback support - * - added UI_SET_PHYS - * 0.1 20/06/2002 - * - first public version - */ -#ifndef __UINPUT_H_ -#define __UINPUT_H_ - -#include - -#define UINPUT_NAME "uinput" -#define UINPUT_BUFFER_SIZE 16 -#define UINPUT_NUM_REQUESTS 16 - -enum uinput_state { UIST_NEW_DEVICE, UIST_SETUP_COMPLETE, UIST_CREATED }; - -struct uinput_request { - unsigned int id; - unsigned int code; /* UI_FF_UPLOAD, UI_FF_ERASE */ - - int retval; - struct completion done; - - union { - unsigned int effect_id; - struct { - struct ff_effect *effect; - struct ff_effect *old; - } upload; - } u; -}; - -struct uinput_device { - struct input_dev *dev; - struct mutex mutex; - enum uinput_state state; - wait_queue_head_t waitq; - unsigned char ready; - unsigned char head; - unsigned char tail; - struct input_event buff[UINPUT_BUFFER_SIZE]; - unsigned int ff_effects_max; - - struct uinput_request *requests[UINPUT_NUM_REQUESTS]; - wait_queue_head_t requests_waitq; - spinlock_t requests_lock; -}; -#endif /* __UINPUT_H_ */ -- cgit v1.2.3 From 4a1a57df97636b9323c4221cc75a35694b6d34c7 Mon Sep 17 00:00:00 2001 From: Geert Uytterhoeven Date: Tue, 31 Oct 2017 09:47:28 -0700 Subject: Input: st1232 - remove obsolete platform device support Commit 1fa59bda21c7fa36 ("ARM: shmobile: Remove legacy board code for Armadillo-800 EVA"), removed the last user of st1232_pdata and the "st1232-ts" platform device. All remaining users use DT. Signed-off-by: Geert Uytterhoeven Signed-off-by: Dmitry Torokhov --- drivers/input/touchscreen/st1232.c | 16 +++------------- include/linux/platform_data/st1232_pdata.h | 14 -------------- 2 files changed, 3 insertions(+), 27 deletions(-) delete mode 100644 include/linux/platform_data/st1232_pdata.h (limited to 'include') diff --git a/drivers/input/touchscreen/st1232.c b/drivers/input/touchscreen/st1232.c index be5615c6bf8f..d5dfa4053bbf 100644 --- a/drivers/input/touchscreen/st1232.c +++ b/drivers/input/touchscreen/st1232.c @@ -29,7 +29,6 @@ #include #include #include -#include #define ST1232_TS_NAME "st1232-ts" @@ -152,10 +151,9 @@ static void st1232_ts_power(struct st1232_ts_data *ts, bool poweron) } static int st1232_ts_probe(struct i2c_client *client, - const struct i2c_device_id *id) + const struct i2c_device_id *id) { struct st1232_ts_data *ts; - struct st1232_pdata *pdata = dev_get_platdata(&client->dev); struct input_dev *input_dev; int error; @@ -180,13 +178,7 @@ static int st1232_ts_probe(struct i2c_client *client, ts->client = client; ts->input_dev = input_dev; - if (pdata) - ts->reset_gpio = pdata->reset_gpio; - else if (client->dev.of_node) - ts->reset_gpio = of_get_gpio(client->dev.of_node, 0); - else - ts->reset_gpio = -ENODEV; - + ts->reset_gpio = of_get_gpio(client->dev.of_node, 0); if (gpio_is_valid(ts->reset_gpio)) { error = devm_gpio_request(&client->dev, ts->reset_gpio, NULL); if (error) { @@ -281,13 +273,11 @@ static const struct i2c_device_id st1232_ts_id[] = { }; MODULE_DEVICE_TABLE(i2c, st1232_ts_id); -#ifdef CONFIG_OF static const struct of_device_id st1232_ts_dt_ids[] = { { .compatible = "sitronix,st1232", }, { } }; MODULE_DEVICE_TABLE(of, st1232_ts_dt_ids); -#endif static struct i2c_driver st1232_ts_driver = { .probe = st1232_ts_probe, @@ -295,7 +285,7 @@ static struct i2c_driver st1232_ts_driver = { .id_table = st1232_ts_id, .driver = { .name = ST1232_TS_NAME, - .of_match_table = of_match_ptr(st1232_ts_dt_ids), + .of_match_table = st1232_ts_dt_ids, .pm = &st1232_ts_pm_ops, }, }; diff --git a/include/linux/platform_data/st1232_pdata.h b/include/linux/platform_data/st1232_pdata.h deleted file mode 100644 index 1dcd23bee24e..000000000000 --- a/include/linux/platform_data/st1232_pdata.h +++ /dev/null @@ -1,14 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -#ifndef _LINUX_ST1232_PDATA_H -#define _LINUX_ST1232_PDATA_H - -/* - * Optional platform data - * - * Use this if you want the driver to drive the reset pin. - */ -struct st1232_pdata { - int reset_gpio; -}; - -#endif -- cgit v1.2.3