Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input
authorLinus Torvalds <torvalds@linux-foundation.org>
Thu, 1 Feb 2018 18:49:58 +0000 (10:49 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Thu, 1 Feb 2018 18:49:58 +0000 (10:49 -0800)
Pull input layer updates from Dmitry Torokhov:

 - evdev interface has been adjusted to extend the life of timestamps on
   32 bit systems to the year of 2108

 - Synaptics RMI4 driver's PS/2 guest handling ha beed updated to
   improve chances of detecting trackpoints on the pass-through port

 - mms114 touchcsreen controller driver has been updated to support
   generic device properties and work with mms152 cntrollers

 - Goodix driver now supports generic touchscreen properties

 - couple of drivers for AVR32 architecture are gone as the architecture
   support has been removed from the kernel

 - gpio-tilt driver has been removed as there are no mainline users and
   the driver itself is using legacy APIs and relies on platform data

 - MODULE_LINECSE/MODULE_VERSION cleanups

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input: (45 commits)
  Input: goodix - use generic touchscreen_properties
  Input: mms114 - fix typo in definition
  Input: mms114 - use BIT() macro instead of explicit shifting
  Input: mms114 - replace mdelay with msleep
  Input: mms114 - add support for mms152
  Input: mms114 - drop platform data and use generic APIs
  Input: mms114 - mark as direct input device
  Input: mms114 - do not clobber interrupt trigger
  Input: edt-ft5x06 - fix error handling for factory mode on non-M06
  Input: stmfts - set IRQ_NOAUTOEN to the irq flag
  Input: auo-pixcir-ts - delete an unnecessary return statement
  Input: auo-pixcir-ts - remove custom log for a failed memory allocation
  Input: da9052_tsi - remove unused mutex
  Input: docs - use PROPERTY_ENTRY_U32() directly
  Input: synaptics-rmi4 - log when we create a guest serio port
  Input: synaptics-rmi4 - unmask F03 interrupts when port is opened
  Input: synaptics-rmi4 - do not delete interrupt memory too early
  Input: ad7877 - use managed resource allocations
  Input: stmfts,s6sy671 - add SPDX identifier
  Input: remove atmel-wm97xx touchscreen driver
  ...

1  2 
drivers/input/evdev.c
drivers/input/misc/uinput.c
drivers/input/touchscreen/Kconfig
drivers/input/touchscreen/elants_i2c.c

diff --combined drivers/input/evdev.c
index 0193dd4f045277a6eadee57f07bd3be2f205dbe7,116088fc3621c4fc5b37fc4b7ce8c3f3f7d09537..94049fdc583cce8900bdaab9f69ac7f20ff7dd0e
@@@ -135,10 -135,7 +135,7 @@@ static void __evdev_flush_queue(struct 
                        continue;
                } else if (head != i) {
                        /* move entry to fill the gap */
-                       client->buffer[head].time = ev->time;
-                       client->buffer[head].type = ev->type;
-                       client->buffer[head].code = ev->code;
-                       client->buffer[head].value = ev->value;
+                       client->buffer[head] = *ev;
                }
  
                num++;
@@@ -157,6 -154,7 +154,7 @@@ static void __evdev_queue_syn_dropped(s
  {
        struct input_event ev;
        ktime_t time;
+       struct timespec64 ts;
  
        time = client->clk_type == EV_CLK_REAL ?
                        ktime_get_real() :
                                ktime_get() :
                                ktime_get_boottime();
  
-       ev.time = ktime_to_timeval(time);
+       ts = ktime_to_timespec64(time);
+       ev.input_event_sec = ts.tv_sec;
+       ev.input_event_usec = ts.tv_nsec / NSEC_PER_USEC;
        ev.type = EV_SYN;
        ev.code = SYN_DROPPED;
        ev.value = 0;
@@@ -241,7 -241,10 +241,10 @@@ static void __pass_event(struct evdev_c
                 */
                client->tail = (client->head - 2) & (client->bufsize - 1);
  
-               client->buffer[client->tail].time = event->time;
+               client->buffer[client->tail].input_event_sec =
+                                               event->input_event_sec;
+               client->buffer[client->tail].input_event_usec =
+                                               event->input_event_usec;
                client->buffer[client->tail].type = EV_SYN;
                client->buffer[client->tail].code = SYN_DROPPED;
                client->buffer[client->tail].value = 0;
@@@ -262,12 -265,15 +265,15 @@@ static void evdev_pass_values(struct ev
        struct evdev *evdev = client->evdev;
        const struct input_value *v;
        struct input_event event;
+       struct timespec64 ts;
        bool wakeup = false;
  
        if (client->revoked)
                return;
  
-       event.time = ktime_to_timeval(ev_time[client->clk_type]);
+       ts = ktime_to_timespec64(ev_time[client->clk_type]);
+       event.input_event_sec = ts.tv_sec;
+       event.input_event_usec = ts.tv_nsec / NSEC_PER_USEC;
  
        /* Interrupts are disabled, just acquire the lock. */
        spin_lock(&client->buffer_lock);
@@@ -635,11 -641,11 +641,11 @@@ static ssize_t evdev_read(struct file *
  }
  
  /* No kernel lock - fine */
 -static unsigned int evdev_poll(struct file *file, poll_table *wait)
 +static __poll_t evdev_poll(struct file *file, poll_table *wait)
  {
        struct evdev_client *client = file->private_data;
        struct evdev *evdev = client->evdev;
 -      unsigned int mask;
 +      __poll_t mask;
  
        poll_wait(file, &evdev->wait, wait);
  
index 91df0df15e685f813db27d822b50bc2a43ca1f4d,a94c5e05006b082f49376c1e42bffabae6dda5a0..f640c591ef23fde4a6b753976917983e5f057e75
@@@ -84,11 -84,14 +84,14 @@@ static int uinput_dev_event(struct inpu
                            unsigned int type, unsigned int code, int value)
  {
        struct uinput_device    *udev = input_get_drvdata(dev);
+       struct timespec64       ts;
  
        udev->buff[udev->head].type = type;
        udev->buff[udev->head].code = code;
        udev->buff[udev->head].value = value;
-       do_gettimeofday(&udev->buff[udev->head].time);
+       ktime_get_ts64(&ts);
+       udev->buff[udev->head].input_event_sec = ts.tv_sec;
+       udev->buff[udev->head].input_event_usec = ts.tv_nsec / NSEC_PER_USEC;
        udev->head = (udev->head + 1) % UINPUT_BUFFER_SIZE;
  
        wake_up_interruptible(&udev->waitq);
@@@ -694,7 -697,7 +697,7 @@@ static ssize_t uinput_read(struct file 
        return retval;
  }
  
 -static unsigned int uinput_poll(struct file *file, poll_table *wait)
 +static __poll_t uinput_poll(struct file *file, poll_table *wait)
  {
        struct uinput_device *udev = file->private_data;
  
@@@ -1085,4 -1088,3 +1088,3 @@@ MODULE_ALIAS("devname:" UINPUT_NAME)
  MODULE_AUTHOR("Aristeu Sergio Rozanski Filho");
  MODULE_DESCRIPTION("User level driver support for input subsystem");
  MODULE_LICENSE("GPL");
- MODULE_VERSION("0.3");
index 38a226f9fcbd42b874a2d1e9d37dc28fae4b0192,5fac4ef3ae7b78f0f89720c73b7a9c967533d8e1..4f15496fec8b56ebaa75dd22051b0ce63d9a6827
@@@ -759,7 -759,7 +759,7 @@@ config TOUCHSCREEN_WM831
  
  config TOUCHSCREEN_WM97XX
        tristate "Support for WM97xx AC97 touchscreen controllers"
 -      depends on AC97_BUS
 +      depends on AC97_BUS || AC97_BUS_NEW
        help
          Say Y here if you have a Wolfson Microelectronics WM97xx
          touchscreen connected to your system. Note that this option
@@@ -795,21 -795,6 +795,6 @@@ config TOUCHSCREEN_WM971
          Say Y here to enable support for the Wolfson Microelectronics
          WM9713 touchscreen controller.
  
- config TOUCHSCREEN_WM97XX_ATMEL
-       tristate "WM97xx Atmel accelerated touch"
-       depends on TOUCHSCREEN_WM97XX && AVR32
-       help
-         Say Y here for support for streaming mode with WM97xx touchscreens
-         on Atmel AT91 or AVR32 systems with an AC97C module.
-         Be aware that this will use channel B in the controller for
-         streaming data, this must not conflict with other AC97C drivers.
-         If unsure, say N.
-         To compile this driver as a module, choose M here: the module will
-         be called atmel-wm97xx.
  config TOUCHSCREEN_WM97XX_MAINSTONE
        tristate "WM97xx Mainstone/Palm accelerated touch"
        depends on TOUCHSCREEN_WM97XX && ARCH_PXA
index 819213e88f321311ec4de87b931d429592272e92,bb8aac23e464af8ff8fdeaef64eb666c22bbc8da..d21ca39b0fdb0832f850173c2fa6e7d0cbde74da
@@@ -45,7 -45,6 +45,6 @@@
  
  /* Device, Driver information */
  #define DEVICE_NAME   "elants_i2c"
- #define DRV_VERSION   "1.0.9"
  
  /* Convert from rows or columns into resolution */
  #define ELAN_TS_RESOLUTION(n, m)   (((n) - 1) * (m))
@@@ -1000,7 -999,7 +999,7 @@@ static ssize_t show_iap_mode(struct dev
                                "Normal" : "Recovery");
  }
  
 -static DEVICE_ATTR(calibrate, S_IWUSR, NULL, calibrate_store);
 +static DEVICE_ATTR_WO(calibrate);
  static DEVICE_ATTR(iap_mode, S_IRUGO, show_iap_mode, NULL);
  static DEVICE_ATTR(update_fw, S_IWUSR, NULL, write_update_fw);
  
@@@ -1406,5 -1405,4 +1405,4 @@@ module_i2c_driver(elants_i2c_driver)
  
  MODULE_AUTHOR("Scott Liu <scott.liu@emc.com.tw>");
  MODULE_DESCRIPTION("Elan I2c Touchscreen driver");
- MODULE_VERSION(DRV_VERSION);
  MODULE_LICENSE("GPL");