Merge tag 'v4.2-rc3' into next
authorDmitry Torokhov <dmitry.torokhov@gmail.com>
Mon, 20 Jul 2015 17:08:17 +0000 (10:08 -0700)
committerDmitry Torokhov <dmitry.torokhov@gmail.com>
Mon, 20 Jul 2015 17:08:17 +0000 (10:08 -0700)
Sync up with Linux 4.2-rc3 to bring in infrastructure (OF) pieces.

1  2 
Documentation/kernel-parameters.txt
drivers/hid/hid-core.c
drivers/input/joydev.c
drivers/input/mouse/elan_i2c_core.c
drivers/input/touchscreen/Kconfig
drivers/input/touchscreen/pixcir_i2c_ts.c

@@@ -165,7 -165,7 +165,7 @@@ multipliers 'Kilo', 'Mega', and 'Giga'
  bytes respectively. Such letter suffixes can also be entirely omitted.
  
  
-       acpi=           [HW,ACPI,X86]
+       acpi=           [HW,ACPI,X86,ARM64]
                        Advanced Configuration and Power Interface
                        Format: { force | off | strict | noirq | rsdt }
                        force -- enable ACPI if default was off
                                strictly ACPI specification compliant.
                        rsdt -- prefer RSDT over (default) XSDT
                        copy_dsdt -- copy DSDT to memory
+                       For ARM64, ONLY "acpi=off" or "acpi=force" are available
  
                        See also Documentation/power/runtime_pm.txt, pci=noacpi
  
-       acpi_rsdp=      [ACPI,EFI,KEXEC]
-                       Pass the RSDP address to the kernel, mostly used
-                       on machines running EFI runtime service to boot the
-                       second kernel for kdump.
        acpi_apic_instance=     [ACPI, IOAPIC]
                        Format: <int>
                        2: use 2nd APIC table, if available
                        (e.g. thinkpad_acpi, sony_acpi, etc.) instead
                        of the ACPI video.ko driver.
  
+       acpica_no_return_repair [HW, ACPI]
+                       Disable AML predefined validation mechanism
+                       This mechanism can repair the evaluation result to make
+                       the return objects more ACPI specification compliant.
+                       This option is useful for developers to identify the
+                       root cause of an AML interpreter issue when the issue
+                       has something to do with the repair mechanism.
        acpi.debug_layer=       [HW,ACPI,ACPI_DEBUG]
        acpi.debug_level=       [HW,ACPI,ACPI_DEBUG]
                        Format: <int>
                        unusable.  The "log_buf_len" parameter may be useful
                        if you need to capture more output.
  
+       acpi_enforce_resources= [ACPI]
+                       { strict | lax | no }
+                       Check for resource conflicts between native drivers
+                       and ACPI OperationRegions (SystemIO and SystemMemory
+                       only). IO ports and memory declared in ACPI might be
+                       used by the ACPI subsystem in arbitrary AML code and
+                       can interfere with legacy drivers.
+                       strict (default): access to resources claimed by ACPI
+                       is denied; legacy drivers trying to access reserved
+                       resources will fail to bind to device using them.
+                       lax: access to resources claimed by ACPI is allowed;
+                       legacy drivers trying to access reserved resources
+                       will bind successfully but a warning message is logged.
+                       no: ACPI OperationRegions are not marked as reserved,
+                       no further checks are performed.
        acpi_force_table_verification   [HW,ACPI]
                        Enable table checksum verification during early stage.
                        By default, this is disabled due to x86 early mapping
                        This feature is enabled by default.
                        This option allows to turn off the feature.
  
+       acpi_no_memhotplug [ACPI] Disable memory hotplug.  Useful for kdump
+                          kernels.
        acpi_no_static_ssdt     [HW,ACPI]
                        Disable installation of static SSDTs at early boot time
                        By default, SSDTs contained in the RSDT/XSDT will be
                        dynamic table installation which will install SSDT
                        tables to /sys/firmware/acpi/tables/dynamic.
  
-       acpica_no_return_repair [HW, ACPI]
-                       Disable AML predefined validation mechanism
-                       This mechanism can repair the evaluation result to make
-                       the return objects more ACPI specification compliant.
-                       This option is useful for developers to identify the
-                       root cause of an AML interpreter issue when the issue
-                       has something to do with the repair mechanism.
+       acpi_rsdp=      [ACPI,EFI,KEXEC]
+                       Pass the RSDP address to the kernel, mostly used
+                       on machines running EFI runtime service to boot the
+                       second kernel for kdump.
  
        acpi_os_name=   [HW,ACPI] Tell ACPI BIOS the name of the OS
                        Format: To spoof as Windows 98: ="Microsoft Windows"
  
+       acpi_rev_override [ACPI] Override the _REV object to return 5 (instead
+                       of 2 which is mandated by ACPI 6) as the supported ACPI
+                       specification revision (when using this switch, it may
+                       be necessary to carry out a cold reboot _twice_ in a
+                       row to make it take effect on the platform firmware).
        acpi_osi=       [HW,ACPI] Modify list of supported OS interface strings
                        acpi_osi="string1"      # add string1
                        acpi_osi="!string2"     # remove string2
                        Use timer override. For some broken Nvidia NF5 boards
                        that require a timer override, but don't have HPET
  
-       acpi_enforce_resources= [ACPI]
-                       { strict | lax | no }
-                       Check for resource conflicts between native drivers
-                       and ACPI OperationRegions (SystemIO and SystemMemory
-                       only). IO ports and memory declared in ACPI might be
-                       used by the ACPI subsystem in arbitrary AML code and
-                       can interfere with legacy drivers.
-                       strict (default): access to resources claimed by ACPI
-                       is denied; legacy drivers trying to access reserved
-                       resources will fail to bind to device using them.
-                       lax: access to resources claimed by ACPI is allowed;
-                       legacy drivers trying to access reserved resources
-                       will bind successfully but a warning message is logged.
-                       no: ACPI OperationRegions are not marked as reserved,
-                       no further checks are performed.
-       acpi_no_memhotplug [ACPI] Disable memory hotplug.  Useful for kdump
-                          kernels.
        add_efi_memmap  [EFI; X86] Include EFI memory map in
                        kernel's map of available physical RAM.
  
  
                uart[8250],io,<addr>[,options]
                uart[8250],mmio,<addr>[,options]
+               uart[8250],mmio32,<addr>[,options]
+               uart[8250],0x<addr>[,options]
                        Start an early, polled-mode console on the 8250/16550
                        UART at the specified I/O port or MMIO address,
-                       switching to the matching ttyS device later.  The
-                       options are the same as for ttyS, above.
+                       switching to the matching ttyS device later.
+                       MMIO inter-register address stride is either 8-bit
+                       (mmio) or 32-bit (mmio32).
+                       If none of [io|mmio|mmio32], <addr> is assumed to be
+                       equivalent to 'mmio'. 'options' are specified in the
+                       same format described for ttyS above; if unspecified,
+                       the h/w is not re-initialized.
                hvc<n>  Use the hypervisor console device <n>. This is for
                        both Xen and PowerPC hypervisors.
  
        cpuidle.off=1   [CPU_IDLE]
                        disable the cpuidle sub-system
  
+       cpu_init_udelay=N
+                       [X86] Delay for N microsec between assert and de-assert
+                       of APIC INIT to start processors.  This delay occurs
+                       on every CPU online, such as boot, and resume from suspend.
+                       Default: 10000
        cpcihp_generic= [HW,PCI] Generic port I/O CompactPCI driver
                        Format:
                        <first_slot>,<last_slot>,<port>,<enum_bit>[,<debug>]
                        Enable debug messages at boot time.  See
                        Documentation/dynamic-debug-howto.txt for details.
  
+       nompx           [X86] Disables Intel Memory Protection Extensions.
+                       See Documentation/x86/intel_mpx.txt for more
+                       information about the feature.
+       eagerfpu=       [X86]
+                       on      enable eager fpu restore
+                       off     disable eager fpu restore
+                       auto    selects the default scheme, which automatically
+                               enables eagerfpu restore for xsaveopt.
+       module.async_probe [KNL]
+                       Enable asynchronous probe on this module.
        early_ioremap_debug [KNL]
                        Enable debug messages in early_ioremap support. This
                        is useful for tracking down temporary early mappings
                uart[8250],io,<addr>[,options]
                uart[8250],mmio,<addr>[,options]
                uart[8250],mmio32,<addr>[,options]
+               uart[8250],mmio32be,<addr>[,options]
+               uart[8250],0x<addr>[,options]
                        Start an early, polled-mode console on the 8250/16550
                        UART at the specified I/O port or MMIO address.
                        MMIO inter-register address stride is either 8-bit
-                       (mmio) or 32-bit (mmio32).
-                       The options are the same as for ttyS, above.
+                       (mmio) or 32-bit (mmio32 or mmio32be).
+                       If none of [io|mmio|mmio32|mmio32be], <addr> is assumed
+                       to be equivalent to 'mmio'. 'options' are specified
+                       in the same format described for "console=ttyS<n>"; if
+                       unspecified, the h/w is not initialized.
  
                pl011,<addr>
                        Start an early, polled-mode console on a pl011 serial
                        earlyprintk=serial[,0x...[,baudrate]]
                        earlyprintk=ttySn[,baudrate]
                        earlyprintk=dbgp[debugController#]
+                       earlyprintk=pciserial,bus:device.function[,baudrate]
  
                        earlyprintk is useful when the kernel crashes before
                        the normal console is initialized. It is not enabled by
                        Format: {"off" | "on" | "skip[mbr]"}
  
        efi=            [EFI]
-                       Format: { "old_map", "nochunk", "noruntime" }
+                       Format: { "old_map", "nochunk", "noruntime", "debug" }
                        old_map [X86-64]: switch to the old ioremap-based EFI
                        runtime services mapping. 32-bit still uses this one by
                        default.
                        boot stub, as chunking can cause problems with some
                        firmware implementations.
                        noruntime : disable EFI runtime services support
+                       debug: enable misc debug output
  
        efi_no_storage_paranoia [EFI; X86]
                        Using this parameter you can use more than 50% of
                             <bus_id>,<clkrate>
  
        i8042.debug     [HW] Toggle i8042 debug mode
 +      i8042.unmask_kbd_data
 +                      [HW] Enable printing of interrupt data from the KBD port
 +                           (disabled by default, and as a pre-condition
 +                           requires that i8042.debug=1 be enabled)
        i8042.direct    [HW] Put keyboard port into non-translated mode
        i8042.dumbkbd   [HW] Pretend that controller can only read data from
                             keyboard and cannot control its state
                        The list of supported hash algorithms is defined
                        in crypto/hash_info.h.
  
-       ima_tcb         [IMA]
+       ima_policy=     [IMA]
+                       The builtin measurement policy to load during IMA
+                       setup.  Specyfing "tcb" as the value, measures all
+                       programs exec'd, files mmap'd for exec, and all files
+                       opened with the read mode bit set by either the
+                       effective uid (euid=0) or uid=0.
+                       Format: "tcb"
+       ima_tcb         [IMA] Deprecated.  Use ima_policy= instead.
                        Load a policy which meets the needs of the Trusted
                        Computing Base.  This means IMA will measure all
                        programs exec'd, files mmap'd for exec, and all files
  
        ima_template=   [IMA]
                        Select one of defined IMA measurements template formats.
-                       Formats: { "ima" | "ima-ng" }
+                       Formats: { "ima" | "ima-ng" | "ima-sig" }
                        Default: "ima-ng"
  
        ima_template_fmt=
                        By default, super page will be supported if Intel IOMMU
                        has the capability. With this option, super page will
                        not be supported.
+               ecs_off [Default Off]
+                       By default, extended context tables will be supported if
+                       the hardware advertises that it has support both for the
+                       extended tables themselves, and also PASID support. With
+                       this option set, extended tables will not be used even
+                       on hardware which claims to support them.
  
        intel_idle.max_cstate=  [KNL,HW,ACPI,X86]
                        0       disables intel_idle and fall back on acpi_idle.
  
                        * [no]ncq: Turn on or off NCQ.
  
+                       * [no]ncqtrim: Turn off queued DSM TRIM.
                        * nohrst, nosrst, norst: suppress hard, soft
                            and both resets.
  
                                 or
                                 memmap=0x10000$0x18690000
  
+       memmap=nn[KMG]!ss[KMG]
+                       [KNL,X86] Mark specific memory as protected.
+                       Region of memory to be used, from ss to ss+nn.
+                       The memory region may be marked as e820 type 12 (0xc)
+                       and is NVDIMM or ADR memory.
        memory_corruption_check=0/1 [X86]
                        Some BIOSes seem to corrupt the first 64k of
                        memory when doing things like suspend/resume.
                        seconds.  Use this parameter to check at some
                        other rate.  0 disables periodic checking.
  
-       memtest=        [KNL,X86] Enable memtest
+       memtest=        [KNL,X86,ARM] Enable memtest
                        Format: <integer>
                        default : 0 <disable>
                        Specifies the number of memtest passes to be
  
        nmi_watchdog=   [KNL,BUGS=X86] Debugging features for SMP kernels
                        Format: [panic,][nopanic,][num]
-                       Valid num: 0
+                       Valid num: 0 or 1
                        0 - turn nmi_watchdog off
+                       1 - turn nmi_watchdog on
                        When panic is specified, panic when an NMI watchdog
                        timeout occurs (or 'nopanic' to override the opposite
                        default).
                        noexec32=off: disable non-executable mappings
                                read implies executable mappings
  
-       nofpu           [SH] Disable hardware FPU at boot time.
+       nofpu           [MIPS,SH] Disable hardware FPU at boot time.
  
        nofxsr          [BUGS=X86-32] Disables x86 floating point extended
                        register save and restore. The kernel will only save
                        legacy floating-point registers on task switch.
  
+       nohugeiomap     [KNL,x86] Disable kernel huge I/O mappings.
        noxsave         [BUGS=X86] Disables x86 extended register state save
                        and restore using xsave. The kernel will fallback to
                        enabling legacy floating-point and sse state.
                        parameter, xsave area per process might occupy more
                        memory on xsaves enabled systems.
  
-       eagerfpu=       [X86]
-                       on      enable eager fpu restore
-                       off     disable eager fpu restore
-                       auto    selects the default scheme, which automatically
-                               enables eagerfpu restore for xsaveopt.
        nohlt           [BUGS=ARM,SH] Tells the kernel that the sleep(SH) or
                        wfi(ARM) instruction doesn't work correctly and not to
                        use it. This is also useful when using JTAG debugger.
  
        nomca           [IA-64] Disable machine check abort handling
  
-       nomce           [X86-32] Machine Check Exception
+       nomce           [X86-32] Disable Machine Check Exception
  
        nomfgpt         [X86-32] Disable Multi-Function General Purpose
                        Timer usage (for AMD Geode machines).
  
        nousb           [USB] Disable the USB subsystem
  
-       nowatchdog      [KNL] Disable the lockup detector (NMI watchdog).
+       nowatchdog      [KNL] Disable both lockup detectors, i.e.
+                         soft-lockup and NMI watchdog (hard-lockup).
  
        nowb            [ARM]
  
                        Set maximum number of finished RCU callbacks to
                        process in one batch.
  
+       rcutree.dump_tree=      [KNL]
+                       Dump the structure of the rcu_node combining tree
+                       out at early boot.  This is used for diagnostic
+                       purposes, to verify correct tree setup.
+       rcutree.gp_cleanup_delay=       [KNL]
+                       Set the number of jiffies to delay each step of
+                       RCU grace-period cleanup.  This only has effect
+                       when CONFIG_RCU_TORTURE_TEST_SLOW_CLEANUP is set.
+       rcutree.gp_init_delay=  [KNL]
+                       Set the number of jiffies to delay each step of
+                       RCU grace-period initialization.  This only has
+                       effect when CONFIG_RCU_TORTURE_TEST_SLOW_INIT
+                       is set.
+       rcutree.gp_preinit_delay=       [KNL]
+                       Set the number of jiffies to delay each step of
+                       RCU grace-period pre-initialization, that is,
+                       the propagation of recent CPU-hotplug changes up
+                       the rcu_node combining tree.  This only has effect
+                       when CONFIG_RCU_TORTURE_TEST_SLOW_PREINIT is set.
+       rcutree.rcu_fanout_exact= [KNL]
+                       Disable autobalancing of the rcu_node combining
+                       tree.  This is used by rcutorture, and might
+                       possibly be useful for architectures having high
+                       cache-to-cache transfer latencies.
        rcutree.rcu_fanout_leaf= [KNL]
                        Increase the number of CPUs assigned to each
                        leaf rcu_node structure.  Useful for very large
                        value is one, and maximum value is HZ.
  
        rcutree.kthread_prio=    [KNL,BOOT]
-                       Set the SCHED_FIFO priority of the RCU
-                       per-CPU kthreads (rcuc/N). This value is also
-                       used for the priority of the RCU boost threads
-                       (rcub/N). Valid values are 1-99 and the default
-                       is 1 (the least-favored priority).
+                       Set the SCHED_FIFO priority of the RCU per-CPU
+                       kthreads (rcuc/N). This value is also used for
+                       the priority of the RCU boost threads (rcub/N)
+                       and for the RCU grace-period kthreads (rcu_bh,
+                       rcu_preempt, and rcu_sched). If RCU_BOOST is
+                       set, valid values are 1-99 and the default is 1
+                       (the least-favored priority).  Otherwise, when
+                       RCU_BOOST is not set, valid values are 0-99 and
+                       the default is zero (non-realtime operation).
  
        rcutree.rcu_nocb_leader_stride= [KNL]
                        Set the number of NOCB kthread groups, which
                        test, hence the "fake".
  
        rcutorture.nreaders= [KNL]
-                       Set number of RCU readers.
+                       Set number of RCU readers.  The value -1 selects
+                       N-1, where N is the number of CPUs.  A value
+                       "n" less than -1 selects N-n-2, where N is again
+                       the number of CPUs.  For example, -2 selects N
+                       (the number of CPUs), -3 selects N+1, and so on.
  
        rcutorture.object_debug= [KNL]
                        Enable debug-object double-call_rcu() testing.
                        improve throughput, but will also increase the
                        amount of memory reserved for use by the client.
  
+       suspend.pm_test_delay=
+                       [SUSPEND]
+                       Sets the number of seconds to remain in a suspend test
+                       mode before resuming the system (see
+                       /sys/power/pm_test). Only available when CONFIG_PM_DEBUG
+                       is set. Default value is 5.
        swapaccount=[0|1]
                        [KNL] Enable accounting of swap in memory resource
                        controller if no parameter or 1 is given or disable
                                        READ_CAPACITY_16 command);
                                f = NO_REPORT_OPCODES (don't use report opcodes
                                        command, uas only);
+                               g = MAX_SECTORS_240 (don't transfer more than
+                                       240 sectors at a time, uas only);
                                h = CAPACITY_HEURISTICS (decrease the
                                        reported device capacity by one
                                        sector if the number is odd);
diff --combined drivers/hid/hid-core.c
@@@ -706,7 -706,8 +706,8 @@@ static void hid_scan_collection(struct 
  
        if (hid->vendor == USB_VENDOR_ID_MICROSOFT &&
            (hid->product == USB_DEVICE_ID_MS_TYPE_COVER_3 ||
-            hid->product == USB_DEVICE_ID_MS_TYPE_COVER_3_JP) &&
+            hid->product == USB_DEVICE_ID_MS_TYPE_COVER_3_JP ||
+            hid->product == USB_DEVICE_ID_MS_POWER_COVER) &&
            hid->group == HID_GROUP_MULTITOUCH)
                hid->group = HID_GROUP_GENERIC;
  
@@@ -1061,13 -1062,13 +1062,13 @@@ static u32 s32ton(__s32 value, unsigne
   * Search linux-kernel and linux-usb-devel archives for "hid-core extract".
   */
  
static __u32 extract(const struct hid_device *hid, __u8 *report,
__u32 hid_field_extract(const struct hid_device *hid, __u8 *report,
                     unsigned offset, unsigned n)
  {
        u64 x;
  
        if (n > 32)
-               hid_warn(hid, "extract() called with n (%d) > 32! (%s)\n",
+               hid_warn(hid, "hid_field_extract() called with n (%d) > 32! (%s)\n",
                         n, current->comm);
  
        report += offset >> 3;  /* adjust byte index */
        x = (x >> offset) & ((1ULL << n) - 1);  /* extract bit field */
        return (u32) x;
  }
+ EXPORT_SYMBOL_GPL(hid_field_extract);
  
  /*
   * "implement" : set bits in a little endian bit stream.
@@@ -1221,9 -1223,9 +1223,9 @@@ static void hid_input_field(struct hid_
        for (n = 0; n < count; n++) {
  
                value[n] = min < 0 ?
-                       snto32(extract(hid, data, offset + n * size, size),
-                              size) :
-                       extract(hid, data, offset + n * size, size);
+                       snto32(hid_field_extract(hid, data, offset + n * size,
+                              size), size) :
+                       hid_field_extract(hid, data, offset + n * size, size);
  
                /* Ignore report if ErrorRollOver */
                if (!(field->flags & HID_MAIN_ITEM_VARIABLE) &&
@@@ -1562,12 -1564,26 +1564,26 @@@ read_report_descriptor(struct file *fil
        return count;
  }
  
+ static ssize_t
+ show_country(struct device *dev, struct device_attribute *attr,
+               char *buf)
+ {
+       struct hid_device *hdev = container_of(dev, struct hid_device, dev);
+       return sprintf(buf, "%02x\n", hdev->country & 0xff);
+ }
  static struct bin_attribute dev_bin_attr_report_desc = {
        .attr = { .name = "report_descriptor", .mode = 0444 },
        .read = read_report_descriptor,
        .size = HID_MAX_DESCRIPTOR_SIZE,
  };
  
+ static struct device_attribute dev_attr_country = {
+       .attr = { .name = "country", .mode = 0444 },
+       .show = show_country,
+ };
  int hid_connect(struct hid_device *hdev, unsigned int connect_mask)
  {
        static const char *types[] = { "Device", "Pointer", "Mouse", "Device",
                bus = "<UNKNOWN>";
        }
  
+       ret = device_create_file(&hdev->dev, &dev_attr_country);
+       if (ret)
+               hid_warn(hdev,
+                        "can't create sysfs country code attribute err: %d\n", ret);
        ret = device_create_bin_file(&hdev->dev, &dev_bin_attr_report_desc);
        if (ret)
                hid_warn(hdev,
@@@ -1661,6 -1682,7 +1682,7 @@@ EXPORT_SYMBOL_GPL(hid_connect)
  
  void hid_disconnect(struct hid_device *hdev)
  {
+       device_remove_file(&hdev->dev, &dev_attr_country);
        device_remove_bin_file(&hdev->dev, &dev_bin_attr_report_desc);
        if (hdev->claimed & HID_CLAIMED_INPUT)
                hidinput_disconnect(hdev);
@@@ -1824,12 -1846,14 +1846,14 @@@ static const struct hid_device_id hid_h
        { HID_USB_DEVICE(USB_VENDOR_ID_KYE, USB_DEVICE_ID_KYE_MOUSEPEN_I608X) },
        { HID_USB_DEVICE(USB_VENDOR_ID_KYE, USB_DEVICE_ID_KYE_MOUSEPEN_I608X_2) },
        { HID_USB_DEVICE(USB_VENDOR_ID_KYE, USB_DEVICE_ID_KYE_EASYPEN_M610X) },
+       { HID_USB_DEVICE(USB_VENDOR_ID_KYE, USB_DEVICE_ID_KYE_PENSKETCH_M912) },
        { HID_USB_DEVICE(USB_VENDOR_ID_LABTEC, USB_DEVICE_ID_LABTEC_WIRELESS_KEYBOARD) },
        { HID_USB_DEVICE(USB_VENDOR_ID_LCPOWER, USB_DEVICE_ID_LCPOWER_LC1000 ) },
  #if IS_ENABLED(CONFIG_HID_LENOVO)
        { HID_USB_DEVICE(USB_VENDOR_ID_LENOVO, USB_DEVICE_ID_LENOVO_TPKBD) },
        { HID_USB_DEVICE(USB_VENDOR_ID_LENOVO, USB_DEVICE_ID_LENOVO_CUSBKBD) },
        { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_LENOVO, USB_DEVICE_ID_LENOVO_CBTKBD) },
+       { HID_USB_DEVICE(USB_VENDOR_ID_LENOVO, USB_DEVICE_ID_LENOVO_TPPRODOCK) },
  #endif
        { HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_MX3000_RECEIVER) },
        { HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_S510_RECEIVER) },
        { HID_USB_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_OFFICE_KB) },
        { HID_USB_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_TYPE_COVER_3) },
        { HID_USB_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_TYPE_COVER_3_JP) },
+       { HID_USB_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_POWER_COVER) },
        { HID_USB_DEVICE(USB_VENDOR_ID_MONTEREY, USB_DEVICE_ID_GENIUS_KB29E) },
        { HID_USB_DEVICE(USB_VENDOR_ID_MSI, USB_DEVICE_ID_MSI_GT683R_LED_PANEL) },
        { HID_USB_DEVICE(USB_VENDOR_ID_NTRIG, USB_DEVICE_ID_NTRIG_TOUCH_SCREEN) },
        { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_SMK, USB_DEVICE_ID_SMK_PS3_BDREMOTE) },
        { HID_USB_DEVICE(USB_VENDOR_ID_SONY, USB_DEVICE_ID_SONY_BUZZ_CONTROLLER) },
        { HID_USB_DEVICE(USB_VENDOR_ID_SONY, USB_DEVICE_ID_SONY_WIRELESS_BUZZ_CONTROLLER) },
+       { HID_USB_DEVICE(USB_VENDOR_ID_SONY, USB_DEVICE_ID_SONY_MOTION_CONTROLLER) },
+       { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_SONY, USB_DEVICE_ID_SONY_MOTION_CONTROLLER) },
+       { HID_USB_DEVICE(USB_VENDOR_ID_SONY, USB_DEVICE_ID_SONY_NAVIGATION_CONTROLLER) },
+       { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_SONY, USB_DEVICE_ID_SONY_NAVIGATION_CONTROLLER) },
        { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_SONY, USB_DEVICE_ID_SONY_PS3_BDREMOTE) },
        { HID_USB_DEVICE(USB_VENDOR_ID_SONY, USB_DEVICE_ID_SONY_PS3_CONTROLLER) },
-       { HID_USB_DEVICE(USB_VENDOR_ID_SONY, USB_DEVICE_ID_SONY_NAVIGATION_CONTROLLER) },
        { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_SONY, USB_DEVICE_ID_SONY_PS3_CONTROLLER) },
        { HID_USB_DEVICE(USB_VENDOR_ID_SONY, USB_DEVICE_ID_SONY_PS4_CONTROLLER) },
        { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_SONY, USB_DEVICE_ID_SONY_PS4_CONTROLLER) },
        { HID_USB_DEVICE(USB_VENDOR_ID_WISEGROUP_LTD, USB_DEVICE_ID_SUPER_JOY_BOX_3_PRO) },
        { HID_USB_DEVICE(USB_VENDOR_ID_WISEGROUP_LTD, USB_DEVICE_ID_SUPER_DUAL_BOX_PRO) },
        { HID_USB_DEVICE(USB_VENDOR_ID_WISEGROUP_LTD, USB_DEVICE_ID_SUPER_JOY_BOX_5_PRO) },
+       { HID_USB_DEVICE(USB_VENDOR_ID_PLAYDOTCOM, USB_DEVICE_ID_PLAYDOTCOM_EMS_USBII) },
        { HID_USB_DEVICE(USB_VENDOR_ID_WALTOP, USB_DEVICE_ID_WALTOP_SLIM_TABLET_5_8_INCH) },
        { HID_USB_DEVICE(USB_VENDOR_ID_WALTOP, USB_DEVICE_ID_WALTOP_SLIM_TABLET_12_1_INCH) },
        { HID_USB_DEVICE(USB_VENDOR_ID_WALTOP, USB_DEVICE_ID_WALTOP_Q_PAD) },
@@@ -2238,21 -2267,12 +2267,13 @@@ static const struct hid_device_id hid_i
        { HID_USB_DEVICE(USB_VENDOR_ID_DELORME, USB_DEVICE_ID_DELORME_EM_LT20) },
        { HID_USB_DEVICE(USB_VENDOR_ID_DREAM_CHEEKY, 0x0004) },
        { HID_USB_DEVICE(USB_VENDOR_ID_DREAM_CHEEKY, 0x000a) },
 +      { HID_I2C_DEVICE(USB_VENDOR_ID_ELAN, 0x0400) },
        { HID_USB_DEVICE(USB_VENDOR_ID_ESSENTIAL_REALITY, USB_DEVICE_ID_ESSENTIAL_REALITY_P5) },
        { HID_USB_DEVICE(USB_VENDOR_ID_ETT, USB_DEVICE_ID_TC5UH) },
        { HID_USB_DEVICE(USB_VENDOR_ID_ETT, USB_DEVICE_ID_TC4UM) },
        { HID_USB_DEVICE(USB_VENDOR_ID_GENERAL_TOUCH, 0x0001) },
        { HID_USB_DEVICE(USB_VENDOR_ID_GENERAL_TOUCH, 0x0002) },
        { HID_USB_DEVICE(USB_VENDOR_ID_GENERAL_TOUCH, 0x0004) },
-       { HID_USB_DEVICE(USB_VENDOR_ID_GLAB, USB_DEVICE_ID_4_PHIDGETSERVO_30) },
-       { HID_USB_DEVICE(USB_VENDOR_ID_GLAB, USB_DEVICE_ID_1_PHIDGETSERVO_30) },
-       { HID_USB_DEVICE(USB_VENDOR_ID_GLAB, USB_DEVICE_ID_0_0_4_IF_KIT) },
-       { HID_USB_DEVICE(USB_VENDOR_ID_GLAB, USB_DEVICE_ID_0_16_16_IF_KIT) },
-       { HID_USB_DEVICE(USB_VENDOR_ID_GLAB, USB_DEVICE_ID_8_8_8_IF_KIT) },
-       { HID_USB_DEVICE(USB_VENDOR_ID_GLAB, USB_DEVICE_ID_0_8_7_IF_KIT) },
-       { HID_USB_DEVICE(USB_VENDOR_ID_GLAB, USB_DEVICE_ID_0_8_8_IF_KIT) },
-       { HID_USB_DEVICE(USB_VENDOR_ID_GLAB, USB_DEVICE_ID_PHIDGET_MOTORCONTROL) },
        { HID_USB_DEVICE(USB_VENDOR_ID_GOTOP, USB_DEVICE_ID_SUPER_Q2) },
        { HID_USB_DEVICE(USB_VENDOR_ID_GOTOP, USB_DEVICE_ID_GOGOPEN) },
        { HID_USB_DEVICE(USB_VENDOR_ID_GOTOP, USB_DEVICE_ID_PENPOWER) },
        { HID_USB_DEVICE(USB_VENDOR_ID_SYNAPTICS, USB_DEVICE_ID_SYNAPTICS_WTP) },
        { HID_USB_DEVICE(USB_VENDOR_ID_SYNAPTICS, USB_DEVICE_ID_SYNAPTICS_DPAD) },
  #endif
-       { HID_USB_DEVICE(USB_VENDOR_ID_VERNIER, USB_DEVICE_ID_VERNIER_LABPRO) },
-       { HID_USB_DEVICE(USB_VENDOR_ID_VERNIER, USB_DEVICE_ID_VERNIER_GOTEMP) },
-       { HID_USB_DEVICE(USB_VENDOR_ID_VERNIER, USB_DEVICE_ID_VERNIER_SKIP) },
-       { HID_USB_DEVICE(USB_VENDOR_ID_VERNIER, USB_DEVICE_ID_VERNIER_CYCLOPS) },
-       { HID_USB_DEVICE(USB_VENDOR_ID_VERNIER, USB_DEVICE_ID_VERNIER_LCSPEC) },
-       { HID_USB_DEVICE(USB_VENDOR_ID_WISEGROUP, USB_DEVICE_ID_4_PHIDGETSERVO_20) },
-       { HID_USB_DEVICE(USB_VENDOR_ID_WISEGROUP, USB_DEVICE_ID_1_PHIDGETSERVO_20) },
-       { HID_USB_DEVICE(USB_VENDOR_ID_WISEGROUP, USB_DEVICE_ID_8_8_4_IF_KIT) },
        { HID_USB_DEVICE(USB_VENDOR_ID_YEALINK, USB_DEVICE_ID_YEALINK_P1K_P4K_B2K) },
        { HID_USB_DEVICE(USB_VENDOR_ID_RISO_KAGAKU, USB_DEVICE_ID_RI_KA_WEBMAIL) },
        { }
diff --combined drivers/input/joydev.c
@@@ -747,6 -747,63 +747,63 @@@ static void joydev_cleanup(struct joyde
                input_close_device(handle);
  }
  
+ static bool joydev_dev_is_absolute_mouse(struct input_dev *dev)
+ {
+       DECLARE_BITMAP(jd_scratch, KEY_CNT);
+       BUILD_BUG_ON(ABS_CNT > KEY_CNT || EV_CNT > KEY_CNT);
+       /*
+        * Virtualization (VMware, etc) and remote management (HP
+        * ILO2) solutions use absolute coordinates for their virtual
+        * pointing devices so that there is one-to-one relationship
+        * between pointer position on the host screen and virtual
+        * guest screen, and so their mice use ABS_X, ABS_Y and 3
+        * primary button events. This clashes with what joydev
+        * considers to be joysticks (a device with at minimum ABS_X
+        * axis).
+        *
+        * Here we are trying to separate absolute mice from
+        * joysticks. A device is, for joystick detection purposes,
+        * considered to be an absolute mouse if the following is
+        * true:
+        *
+        * 1) Event types are exactly EV_ABS, EV_KEY and EV_SYN.
+        * 2) Absolute events are exactly ABS_X and ABS_Y.
+        * 3) Keys are exactly BTN_LEFT, BTN_RIGHT and BTN_MIDDLE.
+        * 4) Device is not on "Amiga" bus.
+        */
+       bitmap_zero(jd_scratch, EV_CNT);
+       __set_bit(EV_ABS, jd_scratch);
+       __set_bit(EV_KEY, jd_scratch);
+       __set_bit(EV_SYN, jd_scratch);
+       if (!bitmap_equal(jd_scratch, dev->evbit, EV_CNT))
+               return false;
+       bitmap_zero(jd_scratch, ABS_CNT);
+       __set_bit(ABS_X, jd_scratch);
+       __set_bit(ABS_Y, jd_scratch);
+       if (!bitmap_equal(dev->absbit, jd_scratch, ABS_CNT))
+               return false;
+       bitmap_zero(jd_scratch, KEY_CNT);
+       __set_bit(BTN_LEFT, jd_scratch);
+       __set_bit(BTN_RIGHT, jd_scratch);
+       __set_bit(BTN_MIDDLE, jd_scratch);
+       if (!bitmap_equal(dev->keybit, jd_scratch, KEY_CNT))
+               return false;
+       /*
+        * Amiga joystick (amijoy) historically uses left/middle/right
+        * button events.
+        */
+       if (dev->id.bustype == BUS_AMIGA)
+               return false;
+       return true;
+ }
  
  static bool joydev_match(struct input_handler *handler, struct input_dev *dev)
  {
        if (test_bit(EV_KEY, dev->evbit) && test_bit(BTN_DIGI, dev->keybit))
                return false;
  
+       /* Avoid absolute mice */
+       if (joydev_dev_is_absolute_mouse(dev))
+               return false;
        return true;
  }
  
@@@ -798,11 -859,12 +859,11 @@@ static int joydev_connect(struct input_
        joydev->handle.handler = handler;
        joydev->handle.private = joydev;
  
 -      for (i = 0; i < ABS_CNT; i++)
 -              if (test_bit(i, dev->absbit)) {
 -                      joydev->absmap[i] = joydev->nabs;
 -                      joydev->abspam[joydev->nabs] = i;
 -                      joydev->nabs++;
 -              }
 +      for_each_set_bit(i, dev->absbit, ABS_CNT) {
 +              joydev->absmap[i] = joydev->nabs;
 +              joydev->abspam[joydev->nabs] = i;
 +              joydev->nabs++;
 +      }
  
        for (i = BTN_JOYSTICK - BTN_MISC; i < KEY_MAX - BTN_MISC + 1; i++)
                if (test_bit(i + BTN_MISC, dev->keybit)) {
@@@ -771,7 -771,7 +771,7 @@@ static const struct attribute_group *el
   */
  static void elan_report_contact(struct elan_tp_data *data,
                                int contact_num, bool contact_valid,
-                               bool hover_event, u8 *finger_data)
+                               u8 *finger_data)
  {
        struct input_dev *input = data->input;
        unsigned int pos_x, pos_y;
                input_mt_report_slot_state(input, MT_TOOL_FINGER, true);
                input_report_abs(input, ABS_MT_POSITION_X, pos_x);
                input_report_abs(input, ABS_MT_POSITION_Y, data->max_y - pos_y);
-               input_report_abs(input, ABS_MT_DISTANCE, hover_event);
-               input_report_abs(input, ABS_MT_PRESSURE,
-                                hover_event ? 0 : scaled_pressure);
+               input_report_abs(input, ABS_MT_PRESSURE, scaled_pressure);
                input_report_abs(input, ABS_TOOL_WIDTH, mk_x);
                input_report_abs(input, ABS_MT_TOUCH_MAJOR, major);
                input_report_abs(input, ABS_MT_TOUCH_MINOR, minor);
@@@ -839,14 -837,14 +837,14 @@@ static void elan_report_absolute(struc
        hover_event = hover_info & 0x40;
        for (i = 0; i < ETP_MAX_FINGERS; i++) {
                contact_valid = tp_info & (1U << (3 + i));
-               elan_report_contact(data, i, contact_valid, hover_event,
-                                   finger_data);
+               elan_report_contact(data, i, contact_valid, finger_data);
  
                if (contact_valid)
                        finger_data += ETP_FINGER_DATA_LEN;
        }
  
        input_report_key(input, BTN_LEFT, tp_info & 0x01);
+       input_report_abs(input, ABS_DISTANCE, hover_event != 0);
        input_mt_report_pointer_emulation(input, true);
        input_sync(input);
  }
@@@ -922,6 -920,7 +920,7 @@@ static int elan_setup_input_device(stru
        input_abs_set_res(input, ABS_Y, data->y_res);
        input_set_abs_params(input, ABS_PRESSURE, 0, ETP_MAX_PRESSURE, 0, 0);
        input_set_abs_params(input, ABS_TOOL_WIDTH, 0, ETP_FINGER_WIDTH, 0, 0);
+       input_set_abs_params(input, ABS_DISTANCE, 0, 1, 0, 0);
  
        /* And MT parameters */
        input_set_abs_params(input, ABS_MT_POSITION_X, 0, data->max_x, 0, 0);
                             ETP_FINGER_WIDTH * max_width, 0, 0);
        input_set_abs_params(input, ABS_MT_TOUCH_MINOR, 0,
                             ETP_FINGER_WIDTH * min_width, 0, 0);
-       input_set_abs_params(input, ABS_MT_DISTANCE, 0, 1, 0, 0);
  
        data->input = input;
  
@@@ -1167,7 -1165,6 +1165,7 @@@ MODULE_DEVICE_TABLE(i2c, elan_id)
  #ifdef CONFIG_ACPI
  static const struct acpi_device_id elan_acpi_id[] = {
        { "ELAN0000", 0 },
 +      { "ELAN0600", 0 },
        { }
  };
  MODULE_DEVICE_TABLE(acpi, elan_acpi_id);
@@@ -1184,6 -1181,7 +1182,6 @@@ MODULE_DEVICE_TABLE(of, elan_of_match)
  static struct i2c_driver elan_driver = {
        .driver = {
                .name   = DRIVER_NAME,
 -              .owner  = THIS_MODULE,
                .pm     = &elan_pm_ops,
                .acpi_match_table = ACPI_PTR(elan_acpi_id),
                .of_match_table = of_match_ptr(elan_of_match),
@@@ -11,9 -11,9 +11,9 @@@ menuconfig INPUT_TOUCHSCREE
  
  if INPUT_TOUCHSCREEN
  
 -config OF_TOUCHSCREEN
 +config TOUCHSCREEN_PROPERTIES
        def_tristate INPUT
 -      depends on INPUT && OF
 +      depends on INPUT
  
  config TOUCHSCREEN_88PM860X
        tristate "Marvell 88PM860x touchscreen"
@@@ -992,8 -992,9 +992,9 @@@ config TOUCHSCREEN_SUN4
  
  config TOUCHSCREEN_SUR40
        tristate "Samsung SUR40 (Surface 2.0/PixelSense) touchscreen"
-       depends on USB
+       depends on USB && MEDIA_USB_SUPPORT && HAS_DMA
        select INPUT_POLLDEV
+       select VIDEOBUF2_DMA_SG
        help
          Say Y here if you want support for the Samsung SUR40 touchscreen
          (also known as Microsoft Surface 2.0 or Microsoft PixelSense).
  #include <linux/i2c.h>
  #include <linux/input.h>
  #include <linux/input/mt.h>
 -#include <linux/input/pixcir_ts.h>
 +#include <linux/input/touchscreen.h>
  #include <linux/gpio.h>
 -#include <linux/of.h>
 -#include <linux/of_gpio.h>
 +#include <linux/gpio/consumer.h>
 +/*#include <linux/of.h>*/
  #include <linux/of_device.h>
 +#include <linux/platform_data/pixcir_i2c_ts.h>
  
  #define PIXCIR_MAX_SLOTS       5 /* Max fingers supported by driver */
  
  struct pixcir_i2c_ts_data {
        struct i2c_client *client;
        struct input_dev *input;
 -      const struct pixcir_ts_platform_data *pdata;
 -      bool running;
 +      struct gpio_desc *gpio_attb;
 +      struct gpio_desc *gpio_reset;
 +      const struct pixcir_i2c_chip_data *chip;
        int max_fingers;        /* Max fingers supported in this instance */
 +      bool running;
  };
  
  struct pixcir_touch {
@@@ -63,7 -60,7 +63,7 @@@ static void pixcir_ts_parse(struct pixc
        u8 touch;
        int ret, i;
        int readsize;
 -      const struct pixcir_i2c_chip_data *chip = &tsdata->pdata->chip;
 +      const struct pixcir_i2c_chip_data *chip = tsdata->chip;
  
        memset(report, 0, sizeof(struct pixcir_report_data));
  
@@@ -81,7 -78,7 +81,7 @@@
        }
  
        ret = i2c_master_recv(tsdata->client, rdbuf, readsize);
-       if (ret != sizeof(rdbuf)) {
+       if (ret != readsize) {
                dev_err(&tsdata->client->dev,
                        "%s: i2c_master_recv failed(), ret=%d\n",
                        __func__, ret);
@@@ -116,13 -113,13 +116,13 @@@ static void pixcir_ts_report(struct pix
        struct pixcir_touch *touch;
        int n, i, slot;
        struct device *dev = &ts->client->dev;
 -      const struct pixcir_i2c_chip_data *chip = &ts->pdata->chip;
 +      const struct pixcir_i2c_chip_data *chip = ts->chip;
  
        n = report->num_touches;
        if (n > PIXCIR_MAX_SLOTS)
                n = PIXCIR_MAX_SLOTS;
  
 -      if (!chip->has_hw_ids) {
 +      if (!ts->chip->has_hw_ids) {
                for (i = 0; i < n; i++) {
                        touch = &report->touches[i];
                        pos[i].x = touch->x;
  static irqreturn_t pixcir_ts_isr(int irq, void *dev_id)
  {
        struct pixcir_i2c_ts_data *tsdata = dev_id;
 -      const struct pixcir_ts_platform_data *pdata = tsdata->pdata;
        struct pixcir_report_data report;
  
        while (tsdata->running) {
                /* report it */
                pixcir_ts_report(tsdata, &report);
  
 -              if (gpio_get_value(pdata->gpio_attb)) {
 +              if (gpiod_get_value_cansleep(tsdata->gpio_attb)) {
                        if (report.num_touches) {
                                /*
                                 * Last report with no finger up?
        return IRQ_HANDLED;
  }
  
 +static void pixcir_reset(struct pixcir_i2c_ts_data *tsdata)
 +{
 +      if (!IS_ERR_OR_NULL(tsdata->gpio_reset)) {
 +              gpiod_set_value_cansleep(tsdata->gpio_reset, 1);
 +              ndelay(100);    /* datasheet section 1.2.3 says 80ns min. */
 +              gpiod_set_value_cansleep(tsdata->gpio_reset, 0);
 +              /* wait for controller ready. 100ms guess. */
 +              msleep(100);
 +      }
 +}
 +
  static int pixcir_set_power_mode(struct pixcir_i2c_ts_data *ts,
                                 enum pixcir_power_mode mode)
  {
@@@ -424,59 -411,85 +424,59 @@@ static SIMPLE_DEV_PM_OPS(pixcir_dev_pm_
  #ifdef CONFIG_OF
  static const struct of_device_id pixcir_of_match[];
  
 -static struct pixcir_ts_platform_data *pixcir_parse_dt(struct device *dev)
 +static int pixcir_parse_dt(struct device *dev,
 +                         struct pixcir_i2c_ts_data *tsdata)
  {
 -      struct pixcir_ts_platform_data *pdata;
 -      struct device_node *np = dev->of_node;
        const struct of_device_id *match;
  
        match = of_match_device(of_match_ptr(pixcir_of_match), dev);
        if (!match)
 -              return ERR_PTR(-EINVAL);
 -
 -      pdata = devm_kzalloc(dev, sizeof(*pdata), GFP_KERNEL);
 -      if (!pdata)
 -              return ERR_PTR(-ENOMEM);
 -
 -      pdata->chip = *(const struct pixcir_i2c_chip_data *)match->data;
 -
 -      pdata->gpio_attb = of_get_named_gpio(np, "attb-gpio", 0);
 -      /* gpio_attb validity is checked in probe */
 -
 -      if (of_property_read_u32(np, "touchscreen-size-x", &pdata->x_max)) {
 -              dev_err(dev, "Failed to get touchscreen-size-x property\n");
 -              return ERR_PTR(-EINVAL);
 -      }
 -      pdata->x_max -= 1;
 -
 -      if (of_property_read_u32(np, "touchscreen-size-y", &pdata->y_max)) {
 -              dev_err(dev, "Failed to get touchscreen-size-y property\n");
 -              return ERR_PTR(-EINVAL);
 -      }
 -      pdata->y_max -= 1;
 +              return -EINVAL;
  
 -      dev_dbg(dev, "%s: x %d, y %d, gpio %d\n", __func__,
 -              pdata->x_max + 1, pdata->y_max + 1, pdata->gpio_attb);
 +      tsdata->chip = (const struct pixcir_i2c_chip_data *)match->data;
 +      if (!tsdata->chip)
 +              return -EINVAL;
  
 -      return pdata;
 +      return 0;
  }
  #else
 -static struct pixcir_ts_platform_data *pixcir_parse_dt(struct device *dev)
 +static int pixcir_parse_dt(struct device *dev,
 +                         struct pixcir_i2c_ts_data *tsdata)
  {
 -      return ERR_PTR(-EINVAL);
 +      return -EINVAL;
  }
  #endif
  
  static int pixcir_i2c_ts_probe(struct i2c_client *client,
 -                                       const struct i2c_device_id *id)
 +                             const struct i2c_device_id *id)
  {
        const struct pixcir_ts_platform_data *pdata =
                        dev_get_platdata(&client->dev);
        struct device *dev = &client->dev;
 -      struct device_node *np = dev->of_node;
        struct pixcir_i2c_ts_data *tsdata;
        struct input_dev *input;
        int error;
  
 -      if (np && !pdata) {
 -              pdata = pixcir_parse_dt(dev);
 -              if (IS_ERR(pdata))
 -                      return PTR_ERR(pdata);
 -      }
 +      tsdata = devm_kzalloc(dev, sizeof(*tsdata), GFP_KERNEL);
 +      if (!tsdata)
 +              return -ENOMEM;
  
 -      if (!pdata) {
 +      if (pdata) {
 +              tsdata->chip = &pdata->chip;
 +      } else if (dev->of_node) {
 +              error = pixcir_parse_dt(dev, tsdata);
 +              if (error)
 +                      return error;
 +      } else {
                dev_err(&client->dev, "platform data not defined\n");
                return -EINVAL;
        }
  
 -      if (!gpio_is_valid(pdata->gpio_attb)) {
 -              dev_err(dev, "Invalid gpio_attb in pdata\n");
 +      if (!tsdata->chip->max_fingers) {
 +              dev_err(dev, "Invalid max_fingers in chip data\n");
                return -EINVAL;
        }
  
 -      if (!pdata->chip.max_fingers) {
 -              dev_err(dev, "Invalid max_fingers in pdata\n");
 -              return -EINVAL;
 -      }
 -
 -      tsdata = devm_kzalloc(dev, sizeof(*tsdata), GFP_KERNEL);
 -      if (!tsdata)
 -              return -ENOMEM;
 -
        input = devm_input_allocate_device(dev);
        if (!input) {
                dev_err(dev, "Failed to allocate input device\n");
  
        tsdata->client = client;
        tsdata->input = input;
 -      tsdata->pdata = pdata;
  
        input->name = client->name;
        input->id.bustype = BUS_I2C;
        input->close = pixcir_input_close;
        input->dev.parent = &client->dev;
  
 -      __set_bit(EV_KEY, input->evbit);
 -      __set_bit(EV_ABS, input->evbit);
 -      __set_bit(BTN_TOUCH, input->keybit);
 -      input_set_abs_params(input, ABS_X, 0, pdata->x_max, 0, 0);
 -      input_set_abs_params(input, ABS_Y, 0, pdata->y_max, 0, 0);
 -      input_set_abs_params(input, ABS_MT_POSITION_X, 0, pdata->x_max, 0, 0);
 -      input_set_abs_params(input, ABS_MT_POSITION_Y, 0, pdata->y_max, 0, 0);
 +      if (pdata) {
 +              input_set_abs_params(input, ABS_MT_POSITION_X, 0, pdata->x_max, 0, 0);
 +              input_set_abs_params(input, ABS_MT_POSITION_Y, 0, pdata->y_max, 0, 0);
 +      } else {
 +              input_set_capability(input, EV_ABS, ABS_MT_POSITION_X);
 +              input_set_capability(input, EV_ABS, ABS_MT_POSITION_Y);
 +              touchscreen_parse_properties(input, true);
 +              if (!input_abs_get_max(input, ABS_MT_POSITION_X) ||
 +                  !input_abs_get_max(input, ABS_MT_POSITION_Y)) {
 +                      dev_err(dev, "Touchscreen size is not specified\n");
 +                      return -EINVAL;
 +              }
 +      }
  
 -      tsdata->max_fingers = tsdata->pdata->chip.max_fingers;
 +      tsdata->max_fingers = tsdata->chip->max_fingers;
        if (tsdata->max_fingers > PIXCIR_MAX_SLOTS) {
                tsdata->max_fingers = PIXCIR_MAX_SLOTS;
                dev_info(dev, "Limiting maximum fingers to %d\n",
  
        input_set_drvdata(input, tsdata);
  
 -      error = devm_gpio_request_one(dev, pdata->gpio_attb,
 -                                    GPIOF_DIR_IN, "pixcir_i2c_attb");
 -      if (error) {
 -              dev_err(dev, "Failed to request ATTB gpio\n");
 +      tsdata->gpio_attb = devm_gpiod_get(dev, "attb", GPIOD_IN);
 +      if (IS_ERR(tsdata->gpio_attb)) {
 +              error = PTR_ERR(tsdata->gpio_attb);
 +              dev_err(dev, "Failed to request ATTB gpio: %d\n", error);
 +              return error;
 +      }
 +
 +      tsdata->gpio_reset = devm_gpiod_get_optional(dev, "reset",
 +                                                   GPIOD_OUT_LOW);
 +      if (IS_ERR(tsdata->gpio_reset)) {
 +              error = PTR_ERR(tsdata->gpio_reset);
 +              dev_err(dev, "Failed to request RESET gpio: %d\n", error);
                return error;
        }
  
                return error;
        }
  
 +      pixcir_reset(tsdata);
 +
        /* Always be in IDLE mode to save power, device supports auto wake */
        error = pixcir_set_power_mode(tsdata, PIXCIR_POWER_IDLE);
        if (error) {
@@@ -604,6 -602,7 +604,6 @@@ MODULE_DEVICE_TABLE(of, pixcir_of_match
  
  static struct i2c_driver pixcir_i2c_ts_driver = {
        .driver = {
 -              .owner  = THIS_MODULE,
                .name   = "pixcir_ts",
                .pm     = &pixcir_dev_pm_ops,
                .of_match_table = of_match_ptr(pixcir_of_match),