Merge branch 'next' into for-linus
authorDmitry Torokhov <dmitry.torokhov@gmail.com>
Sat, 15 Jan 2022 20:09:44 +0000 (12:09 -0800)
committerDmitry Torokhov <dmitry.torokhov@gmail.com>
Sat, 15 Jan 2022 20:09:44 +0000 (12:09 -0800)
Prepare input updates for 5.17 merge window.

1  2 
Documentation/admin-guide/kernel-parameters.txt
drivers/input/touchscreen/goodix.c
drivers/input/touchscreen/goodix.h
drivers/input/touchscreen/zinitix.c

index ddfa50578a3e16c72e07979a0bf05c9c0591b876,43dc35fe5bc038ee93bd32f0c7fe641038427bd1..0c4361b4f8444a4d779cbbc9ef62549c0c084919
                        the GPE dispatcher.
                        This facility can be used to prevent such uncontrolled
                        GPE floodings.
-                       Format: <byte>
+                       Format: <byte> or <bitmap-list>
  
        acpi_no_auto_serialize  [HW,ACPI]
                        Disable auto-serialization of AML methods
                        do not want to use tracing_snapshot_alloc() as it needs
                        to be done where GFP_KERNEL allocations are allowed.
  
+       allow_mismatched_32bit_el0 [ARM64]
+                       Allow execve() of 32-bit applications and setting of the
+                       PER_LINUX32 personality on systems where only a strict
+                       subset of the CPUs support 32-bit EL0. When this
+                       parameter is present, the set of CPUs supporting 32-bit
+                       EL0 is indicated by /sys/devices/system/cpu/aarch32_el0
+                       and hot-unplug operations may be restricted.
+                       See Documentation/arm64/asymmetric-32bit.rst for more
+                       information.
        amd_iommu=      [HW,X86-64]
                        Pass parameters to the AMD IOMMU driver in the system.
                        Possible values are:
-                       fullflush - enable flushing of IO/TLB entries when
-                                   they are unmapped. Otherwise they are
-                                   flushed before they will be reused, which
-                                   is a lot of faster
+                       fullflush - Deprecated, equivalent to iommu.strict=1
                        off       - do not initialize any AMD IOMMU found in
                                    the system
                        force_isolation - Force device isolation for all
                                          allowed anymore to lift isolation
                                          requirements as needed. This option
                                          does not override iommu=pt
+                       force_enable - Force enable the IOMMU on platforms known
+                                      to be buggy with IOMMU enabled. Use this
+                                      option with care.
  
        amd_iommu_dump= [HW,X86-64]
                        Enable AMD IOMMU driver option to dump the ACPI table
        arm64.nopauth   [ARM64] Unconditionally disable Pointer Authentication
                        support
  
+       arm64.nomte     [ARM64] Unconditionally disable Memory Tagging Extension
+                       support
        ataflop=        [HW,M68k]
  
        atarimouse=     [HW,MOUSE] Atari Mouse
        ccw_timeout_log [S390]
                        See Documentation/s390/common_io.rst for details.
  
-       cgroup_disable= [KNL] Disable a particular controller
-                       Format: {name of the controller(s) to disable}
+       cgroup_disable= [KNL] Disable a particular controller or optional feature
+                       Format: {name of the controller(s) or feature(s) to disable}
                        The effects of cgroup_disable=foo are:
                        - foo isn't auto-mounted if you mount all cgroups in
                          a single hierarchy
                        - foo isn't visible as an individually mountable
                          subsystem
+                       - if foo is an optional feature then the feature is
+                         disabled and corresponding cgroup files are not
+                         created
                        {Currently only "memory" controller deal with this and
                        cut the overhead, others just disable the usage. So
                        only cgroup_disable=memory is actually worthy}
+                       Specifying "pressure" disables per-cgroup pressure
+                       stall information accounting feature
  
        cgroup_no_v1=   [KNL] Disable cgroup controllers and named hierarchies in v1
                        Format: { { controller | "all" | "named" }
                        loops can be debugged more effectively on production
                        systems.
  
+       clocksource.max_cswd_read_retries= [KNL]
+                       Number of clocksource_watchdog() retries due to
+                       external delays before the clock will be marked
+                       unstable.  Defaults to three retries, that is,
+                       four attempts to read the clock under test.
+       clocksource.verify_n_cpus= [KNL]
+                       Limit the number of CPUs checked for clocksources
+                       marked with CLOCK_SOURCE_VERIFY_PERCPU that
+                       are marked unstable due to excessive skew.
+                       A negative value says to check all CPUs, while
+                       zero says not to check any.  Values larger than
+                       nr_cpu_ids are silently truncated to nr_cpu_ids.
+                       The actual CPUs are chosen randomly, with
+                       no replacement if the same CPU is chosen twice.
+       clocksource-wdtest.holdoff= [KNL]
+                       Set the time in seconds that the clocksource
+                       watchdog test waits before commencing its tests.
+                       Defaults to zero when built as a module and to
+                       10 seconds when built into the kernel.
        clearcpuid=BITNUM[,BITNUM...] [X86]
                        Disable CPUID feature X for the kernel. See
                        arch/x86/include/asm/cpufeatures.h for the valid bit
                        the driver will use only 32-bit accessors to read/write
                        the device registers.
  
+               liteuart,<addr>
+                       Start an early console on a litex serial port at the
+                       specified address. The serial port must already be
+                       setup and configured. Options are not yet supported.
                meson,<addr>
                        Start an early, polled-mode console on a meson serial
                        port at the specified address. The serial port must
                        The VGA and EFI output is eventually overwritten by
                        the real console.
  
-                       The xen output can only be used by Xen PV guests.
+                       The xen option can only be used in Xen domains.
  
                        The sclp output can only be used on s390.
  
                        Documentation/admin-guide/mm/hugetlbpage.rst.
                        Format: size[KMG]
  
+       hugetlb_free_vmemmap=
+                       [KNL] Reguires CONFIG_HUGETLB_PAGE_FREE_VMEMMAP
+                       enabled.
+                       Allows heavy hugetlb users to free up some more
+                       memory (6 * PAGE_SIZE for each 2MB hugetlb page).
+                       Format: { on | off (default) }
+                       on:  enable the feature
+                       off: disable the feature
+                       Built with CONFIG_HUGETLB_PAGE_FREE_VMEMMAP_DEFAULT_ON=y,
+                       the default is on.
+                       This is not compatible with memory_hotplug.memmap_on_memory.
+                       If both parameters are enabled, hugetlb_free_vmemmap takes
+                       precedence over memory_hotplug.memmap_on_memory.
        hung_task_panic=
                        [KNL] Should the hung task detector generate panics.
                        Format: 0 | 1
                        architectures force reset to be always executed
        i8042.unlock    [HW] Unlock (ignore) the keylock
        i8042.kbdreset  [HW] Reset device connected to KBD port
 +      i8042.probe_defer
 +                      [HW] Allow deferred probing upon i8042 probe errors
  
        i810=           [HW,DRM]
  
                        support for the idxd driver. By default it is set to
                        true (1).
  
+       idxd.tc_override= [HW]
+                       Format: <bool>
+                       Allow override of default traffic class configuration
+                       for the device. By default it is set to false (0).
        ieee754=        [MIPS] Select IEEE Std 754 conformance mode
                        Format: { strict | legacy | 2008 | relaxed }
                        Default: strict
                        this case, gfx device will use physical address for
                        DMA.
                strict [Default Off]
-                       With this option on every unmap_single operation will
-                       result in a hardware IOTLB flush operation as opposed
-                       to batching them for performance.
+                       Deprecated, equivalent to iommu.strict=1.
                sp_off [Default Off]
                        By default, super page will be supported if Intel IOMMU
                        has the capability. With this option, super page will
                        not be supported.
-               sm_on [Default Off]
-                       By default, scalable mode will be disabled even if the
-                       hardware advertises that it has support for the scalable
-                       mode translation. With this option set, scalable mode
-                       will be used on hardware which claims to support it.
+               sm_on
+                       Enable the Intel IOMMU scalable mode if the hardware
+                       advertises that it has support for the scalable mode
+                       translation.
+               sm_off
+                       Disallow use of the Intel IOMMU scalable mode.
                tboot_noforce [Default Off]
                        Do not force the Intel IOMMU enabled under tboot.
                        By default, tboot will force Intel IOMMU on, which
                          forcing Dual Address Cycle for PCI cards supporting
                          greater than 32-bit addressing.
  
-       iommu.strict=   [ARM64] Configure TLB invalidation behaviour
+       iommu.strict=   [ARM64, X86] Configure TLB invalidation behaviour
                        Format: { "0" | "1" }
                        0 - Lazy mode.
                          Request that DMA unmap operations use deferred
                          throughput at the cost of reduced device isolation.
                          Will fall back to strict mode if not supported by
                          the relevant IOMMU driver.
-                       1 - Strict mode (default).
+                       1 - Strict mode.
                          DMA unmap operations invalidate IOMMU hardware TLBs
                          synchronously.
+                       unset - Use value of CONFIG_IOMMU_DEFAULT_DMA_{LAZY,STRICT}.
+                       Note: on x86, strict mode specified via one of the
+                       legacy driver-specific options takes precedence.
  
        iommu.passthrough=
                        [ARM64, X86] Configure DMA to bypass the IOMMU by default.
                        feature (tagged TLBs) on capable Intel chips.
                        Default is 1 (enabled)
  
+       l1d_flush=      [X86,INTEL]
+                       Control mitigation for L1D based snooping vulnerability.
+                       Certain CPUs are vulnerable to an exploit against CPU
+                       internal buffers which can forward information to a
+                       disclosure gadget under certain conditions.
+                       In vulnerable processors, the speculatively
+                       forwarded data can be used in a cache side channel
+                       attack, to access data to which the attacker does
+                       not have direct access.
+                       This parameter controls the mitigation. The
+                       options are:
+                       on         - enable the interface for the mitigation
        l1tf=           [X86] Control mitigation of the L1TF vulnerability on
                              affected CPUs
  
                        Note that even when enabled, there are a few cases where
                        the feature is not effective.
  
+                       This is not compatible with hugetlb_free_vmemmap. If
+                       both parameters are enabled, hugetlb_free_vmemmap takes
+                       precedence over memory_hotplug.memmap_on_memory.
        memtest=        [KNL,X86,ARM,PPC,RISCV] Enable memtest
                        Format: <integer>
                        default : 0 <disable>
  
        noclflush       [BUGS=X86] Don't use the CLFLUSH instruction
  
-       nodelayacct     [KNL] Disable per-task delay accounting
+       delayacct       [KNL] Enable per-task delay accounting
  
        nodsp           [SH] Disable hardware DSP at boot time.
  
  
        nr_uarts=       [SERIAL] maximum number of UARTs to be registered.
  
+       numa=off        [KNL, ARM64, PPC, RISCV, SPARC, X86] Disable NUMA, Only
+                       set up a single NUMA node spanning all memory.
        numa_balancing= [KNL,ARM64,PPC,RISCV,S390,X86] Enable or disable automatic
                        NUMA balancing.
                        Allowed values are enable and disable
                        off: turn off poisoning (default)
                        on: turn on poisoning
  
+       page_reporting.page_reporting_order=
+                       [KNL] Minimal page reporting order
+                       Format: <integer>
+                       Adjust the minimal page reporting order. The page
+                       reporting is disabled when it exceeds (MAX_ORDER-1).
        panic=          [KNL] Kernel behaviour on panic: delay <timeout>
                        timeout > 0: seconds before rebooting
                        timeout = 0: wait forever
                        Format: <bool>  (1/Y/y=enable, 0/N/n=disable)
                        default: disabled
  
+       printk.console_no_auto_verbose=
+                       Disable console loglevel raise on oops, panic
+                       or lockdep-detected issues (only if lock debug is on).
+                       With an exception to setups with low baudrate on
+                       serial console, keeping this 0 is a good choice
+                       in order to provide more debug information.
+                       Format: <bool>
+                       default: 0 (auto_verbose is enabled)
        printk.devkmsg={on,off,ratelimit}
                        Control writing to /dev/kmsg.
                        on - unlimited logging to /dev/kmsg from userspace
                        whole algorithm to behave better in low memory
                        condition.
  
+       rcutree.rcu_delay_page_cache_fill_msec= [KNL]
+                       Set the page-cache refill delay (in milliseconds)
+                       in response to low-memory conditions.  The range
+                       of permitted values is in the range 0:100000.
        rcutree.jiffies_till_first_fqs= [KNL]
                        Set delay from grace-period initialization to
                        first attempt to force quiescent states.
  
        reboot=         [KNL]
                        Format (x86 or x86_64):
-                               [w[arm] | c[old] | h[ard] | s[oft] | g[pio]] \
+                               [w[arm] | c[old] | h[ard] | s[oft] | g[pio]] | d[efault] \
                                [[,]s[mp]#### \
                                [[,]b[ios] | a[cpi] | k[bd] | t[riple] | e[fi] | p[ci]] \
                                [[,]f[orce]
                        Reserves a hole at the top of the kernel virtual
                        address space.
  
-       reservelow=     [X86]
-                       Format: nn[K]
-                       Set the amount of memory to reserve for BIOS at
-                       the bottom of the address space.
        reset_devices   [KNL] Force drivers to reset the underlying device
                        during initialization.
  
        sa1100ir        [NET]
                        See drivers/net/irda/sa1100_ir.c.
  
-       sbni=           [NET] Granch SBNI12 leased line adapter
        sched_verbose   [KNL] Enables verbose scheduler debug messages.
  
        schedstats=     [KNL,X86] Enable or disable scheduled statistics.
                                  exception. Default behavior is by #AC if
                                  both features are enabled in hardware.
  
+                       ratelimit:N -
+                                 Set system wide rate limit to N bus locks
+                                 per second for bus lock detection.
+                                 0 < N <= 1000.
+                                 N/A for split lock detection.
                        If an #AC exception is hit in the kernel or in
                        firmware (i.e. not while executing in user mode)
                        the kernel will oops in either "warn" or "fatal"
                        Note, echoing 1 into this file without the
                        tracepoint_printk kernel cmdline option has no effect.
  
+                       The tp_printk_stop_on_boot (see below) can also be used
+                       to stop the printing of events to console at
+                       late_initcall_sync.
                        ** CAUTION **
  
                        Having tracepoints sent to printk() and activating high
                        frequency tracepoints such as irq or sched, can cause
                        the system to live lock.
  
+       tp_printk_stop_on_boot[FTRACE]
+                       When tp_printk (above) is set, it can cause a lot of noise
+                       on the console. It may be useful to only include the
+                       printing of events during boot up, as user space may
+                       make the system inoperable.
+                       This command line option will stop the printing of events
+                       to console at the late_initcall_sync() time frame.
        traceoff_on_warning
                        [FTRACE] enable this option to disable tracing when a
                        warning is hit. This turns off "tracing_on". Tracing can
index 87263eb9e5a4340c55d5aed120d3c9c6509375ff,ba84985b41c29210e54868c0e4507f9fff93a885..a3bfc7a4167974a5290da864abdff811a4f71ca1
@@@ -102,7 -102,6 +102,7 @@@ static const struct goodix_chip_id good
        { .id = "911", .data = &gt911_chip_data },
        { .id = "9271", .data = &gt911_chip_data },
        { .id = "9110", .data = &gt911_chip_data },
 +      { .id = "9111", .data = &gt911_chip_data },
        { .id = "927", .data = &gt911_chip_data },
        { .id = "928", .data = &gt911_chip_data },
  
@@@ -119,51 -118,6 +119,6 @@@ static const unsigned long goodix_irq_f
        IRQ_TYPE_LEVEL_HIGH,
  };
  
- /*
-  * Those tablets have their coordinates origin at the bottom right
-  * of the tablet, as if rotated 180 degrees
-  */
- static const struct dmi_system_id rotated_screen[] = {
- #if defined(CONFIG_DMI) && defined(CONFIG_X86)
-       {
-               .ident = "Teclast X89",
-               .matches = {
-                       /* tPAD is too generic, also match on bios date */
-                       DMI_MATCH(DMI_BOARD_VENDOR, "TECLAST"),
-                       DMI_MATCH(DMI_BOARD_NAME, "tPAD"),
-                       DMI_MATCH(DMI_BIOS_DATE, "12/19/2014"),
-               },
-       },
-       {
-               .ident = "Teclast X98 Pro",
-               .matches = {
-                       /*
-                        * Only match BIOS date, because the manufacturers
-                        * BIOS does not report the board name at all
-                        * (sometimes)...
-                        */
-                       DMI_MATCH(DMI_BOARD_VENDOR, "TECLAST"),
-                       DMI_MATCH(DMI_BIOS_DATE, "10/28/2015"),
-               },
-       },
-       {
-               .ident = "WinBook TW100",
-               .matches = {
-                       DMI_MATCH(DMI_SYS_VENDOR, "WinBook"),
-                       DMI_MATCH(DMI_PRODUCT_NAME, "TW100")
-               }
-       },
-       {
-               .ident = "WinBook TW700",
-               .matches = {
-                       DMI_MATCH(DMI_SYS_VENDOR, "WinBook"),
-                       DMI_MATCH(DMI_PRODUCT_NAME, "TW700")
-               },
-       },
- #endif
-       {}
- };
  static const struct dmi_system_id nine_bytes_report[] = {
  #if defined(CONFIG_DMI) && defined(CONFIG_X86)
        {
@@@ -342,6 -296,108 +297,108 @@@ static int goodix_ts_read_input_report(
        return -ENOMSG;
  }
  
+ static struct input_dev *goodix_create_pen_input(struct goodix_ts_data *ts)
+ {
+       struct device *dev = &ts->client->dev;
+       struct input_dev *input;
+       input = devm_input_allocate_device(dev);
+       if (!input)
+               return NULL;
+       input_alloc_absinfo(input);
+       if (!input->absinfo) {
+               input_free_device(input);
+               return NULL;
+       }
+       input->absinfo[ABS_X] = ts->input_dev->absinfo[ABS_MT_POSITION_X];
+       input->absinfo[ABS_Y] = ts->input_dev->absinfo[ABS_MT_POSITION_Y];
+       __set_bit(ABS_X, input->absbit);
+       __set_bit(ABS_Y, input->absbit);
+       input_set_abs_params(input, ABS_PRESSURE, 0, 255, 0, 0);
+       input_set_capability(input, EV_KEY, BTN_TOUCH);
+       input_set_capability(input, EV_KEY, BTN_TOOL_PEN);
+       input_set_capability(input, EV_KEY, BTN_STYLUS);
+       input_set_capability(input, EV_KEY, BTN_STYLUS2);
+       __set_bit(INPUT_PROP_DIRECT, input->propbit);
+       /*
+        * The resolution of these touchscreens is about 10 units/mm, the actual
+        * resolution does not matter much since we set INPUT_PROP_DIRECT.
+        * Userspace wants something here though, so just set it to 10 units/mm.
+        */
+       input_abs_set_res(input, ABS_X, 10);
+       input_abs_set_res(input, ABS_Y, 10);
+       input->name = "Goodix Active Pen";
+       input->phys = "input/pen";
+       input->id.bustype = BUS_I2C;
+       input->id.vendor = 0x0416;
+       if (kstrtou16(ts->id, 10, &input->id.product))
+               input->id.product = 0x1001;
+       input->id.version = ts->version;
+       if (input_register_device(input) != 0) {
+               input_free_device(input);
+               return NULL;
+       }
+       return input;
+ }
+ static void goodix_ts_report_pen_down(struct goodix_ts_data *ts, u8 *data)
+ {
+       int input_x, input_y, input_w;
+       u8 key_value;
+       if (!ts->input_pen) {
+               ts->input_pen = goodix_create_pen_input(ts);
+               if (!ts->input_pen)
+                       return;
+       }
+       if (ts->contact_size == 9) {
+               input_x = get_unaligned_le16(&data[4]);
+               input_y = get_unaligned_le16(&data[6]);
+               input_w = get_unaligned_le16(&data[8]);
+       } else {
+               input_x = get_unaligned_le16(&data[2]);
+               input_y = get_unaligned_le16(&data[4]);
+               input_w = get_unaligned_le16(&data[6]);
+       }
+       touchscreen_report_pos(ts->input_pen, &ts->prop, input_x, input_y, false);
+       input_report_abs(ts->input_pen, ABS_PRESSURE, input_w);
+       input_report_key(ts->input_pen, BTN_TOUCH, 1);
+       input_report_key(ts->input_pen, BTN_TOOL_PEN, 1);
+       if (data[0] & GOODIX_HAVE_KEY) {
+               key_value = data[1 + ts->contact_size];
+               input_report_key(ts->input_pen, BTN_STYLUS, key_value & 0x10);
+               input_report_key(ts->input_pen, BTN_STYLUS2, key_value & 0x20);
+       } else {
+               input_report_key(ts->input_pen, BTN_STYLUS, 0);
+               input_report_key(ts->input_pen, BTN_STYLUS2, 0);
+       }
+       input_sync(ts->input_pen);
+ }
+ static void goodix_ts_report_pen_up(struct goodix_ts_data *ts)
+ {
+       if (!ts->input_pen)
+               return;
+       input_report_key(ts->input_pen, BTN_TOUCH, 0);
+       input_report_key(ts->input_pen, BTN_TOOL_PEN, 0);
+       input_report_key(ts->input_pen, BTN_STYLUS, 0);
+       input_report_key(ts->input_pen, BTN_STYLUS2, 0);
+       input_sync(ts->input_pen);
+ }
  static void goodix_ts_report_touch_8b(struct goodix_ts_data *ts, u8 *coor_data)
  {
        int id = coor_data[0] & 0x0F;
@@@ -372,6 -428,14 +429,14 @@@ static void goodix_ts_report_touch_9b(s
        input_report_abs(ts->input_dev, ABS_MT_WIDTH_MAJOR, input_w);
  }
  
+ static void goodix_ts_release_keys(struct goodix_ts_data *ts)
+ {
+       int i;
+       for (i = 0; i < GOODIX_MAX_KEYS; i++)
+               input_report_key(ts->input_dev, ts->keymap[i], 0);
+ }
  static void goodix_ts_report_key(struct goodix_ts_data *ts, u8 *data)
  {
        int touch_num;
                                input_report_key(ts->input_dev,
                                                 ts->keymap[i], 1);
        } else {
-               for (i = 0; i < GOODIX_MAX_KEYS; i++)
-                       input_report_key(ts->input_dev, ts->keymap[i], 0);
+               goodix_ts_release_keys(ts);
        }
  }
  
@@@ -409,6 -472,15 +473,15 @@@ static void goodix_process_events(struc
        if (touch_num < 0)
                return;
  
+       /* The pen being down is always reported as a single touch */
+       if (touch_num == 1 && (point_data[1] & 0x80)) {
+               goodix_ts_report_pen_down(ts, point_data);
+               goodix_ts_release_keys(ts);
+               goto sync; /* Release any previously registered touches */
+       } else {
+               goodix_ts_report_pen_up(ts);
+       }
        goodix_ts_report_key(ts, point_data);
  
        for (i = 0; i < touch_num; i++)
                        goodix_ts_report_touch_8b(ts,
                                &point_data[1 + ts->contact_size * i]);
  
+ sync:
        input_mt_sync_frame(ts->input_dev);
        input_sync(ts->input_dev);
  }
@@@ -696,16 -769,10 +770,16 @@@ int goodix_reset_no_int_sync(struct goo
  
        usleep_range(6000, 10000);              /* T4: > 5ms */
  
 -      /* end select I2C slave addr */
 -      error = gpiod_direction_input(ts->gpiod_rst);
 -      if (error)
 -              goto error;
 +      /*
 +       * Put the reset pin back in to input / high-impedance mode to save
 +       * power. Only do this in the non ACPI case since some ACPI boards
 +       * don't have a pull-up, so there the reset pin must stay active-high.
 +       */
 +      if (ts->irq_pin_access_method == IRQ_PIN_ACCESS_GPIO) {
 +              error = gpiod_direction_input(ts->gpiod_rst);
 +              if (error)
 +                      goto error;
 +      }
  
        return 0;
  
@@@ -839,14 -906,6 +913,14 @@@ static int goodix_add_acpi_gpio_mapping
                return -EINVAL;
        }
  
 +      /*
 +       * Normally we put the reset pin in input / high-impedance mode to save
 +       * power. But some x86/ACPI boards don't have a pull-up, so for the ACPI
 +       * case, leave the pin as is. This results in the pin not being touched
 +       * at all on x86/ACPI boards, except when needed for error-recover.
 +       */
 +      ts->gpiod_rst_flags = GPIOD_ASIS;
 +
        return devm_acpi_dev_add_driver_gpios(dev, gpio_mapping);
  }
  #else
@@@ -872,12 -931,6 +946,12 @@@ static int goodix_get_gpio_config(struc
                return -EINVAL;
        dev = &ts->client->dev;
  
 +      /*
 +       * By default we request the reset pin as input, leaving it in
 +       * high-impedance when not resetting the controller to save power.
 +       */
 +      ts->gpiod_rst_flags = GPIOD_IN;
 +
        ts->avdd28 = devm_regulator_get(dev, "AVDD28");
        if (IS_ERR(ts->avdd28)) {
                error = PTR_ERR(ts->avdd28);
@@@ -902,7 -955,7 +976,7 @@@ retry_get_irq_gpio
        if (IS_ERR(gpiod)) {
                error = PTR_ERR(gpiod);
                if (error != -EPROBE_DEFER)
-                       dev_dbg(dev, "Failed to get %s GPIO: %d\n",
+                       dev_err(dev, "Failed to get %s GPIO: %d\n",
                                GOODIX_GPIO_INT_NAME, error);
                return error;
        }
        ts->gpiod_int = gpiod;
  
        /* Get the reset line GPIO pin number */
 -      gpiod = devm_gpiod_get_optional(dev, GOODIX_GPIO_RST_NAME, GPIOD_IN);
 +      gpiod = devm_gpiod_get_optional(dev, GOODIX_GPIO_RST_NAME, ts->gpiod_rst_flags);
        if (IS_ERR(gpiod)) {
                error = PTR_ERR(gpiod);
                if (error != -EPROBE_DEFER)
-                       dev_dbg(dev, "Failed to get %s GPIO: %d\n",
+                       dev_err(dev, "Failed to get %s GPIO: %d\n",
                                GOODIX_GPIO_RST_NAME, error);
                return error;
        }
@@@ -1113,13 -1166,6 +1187,6 @@@ static int goodix_configure_dev(struct 
                                  ABS_MT_POSITION_Y, ts->prop.max_y);
        }
  
-       if (dmi_check_system(rotated_screen)) {
-               ts->prop.invert_x = true;
-               ts->prop.invert_y = true;
-               dev_dbg(&ts->client->dev,
-                       "Applying '180 degrees rotated screen' quirk\n");
-       }
        if (dmi_check_system(nine_bytes_report)) {
                ts->contact_size = 9;
  
index 02065d1c326354a87aa3f1270c7435115d621223,f79eaeaceedbf27b05916a18e8c69750af110971..fa8602e78a6480c066103214cb06e475b36de6eb
@@@ -76,6 -76,7 +76,7 @@@ struct goodix_chip_data 
  struct goodix_ts_data {
        struct i2c_client *client;
        struct input_dev *input_dev;
+       struct input_dev *input_pen;
        const struct goodix_chip_data *chip;
        const char *firmware_name;
        struct touchscreen_properties prop;
@@@ -87,7 -88,6 +88,7 @@@
        struct gpio_desc *gpiod_rst;
        int gpio_count;
        int gpio_int_idx;
 +      enum gpiod_flags gpiod_rst_flags;
        char id[GOODIX_ID_MAX_LEN + 1];
        char cfg_name[64];
        u16 version;
index 1e70b8d2a8d79869c94200511c4b5e0c9fecd298,cf7ee4c765a76c755c65a7c15f5fb1ab4060008a..7c82c4f5fa6b331f2bf532c63c19a860ac13616e
@@@ -252,16 -252,27 +252,27 @@@ static int zinitix_init_touch(struct bt
  
  static int zinitix_init_regulators(struct bt541_ts_data *bt541)
  {
-       struct i2c_client *client = bt541->client;
+       struct device *dev = &bt541->client->dev;
        int error;
  
-       bt541->supplies[0].supply = "vdd";
-       bt541->supplies[1].supply = "vddo";
-       error = devm_regulator_bulk_get(&client->dev,
+       /*
+        * Some older device trees have erroneous names for the regulators,
+        * so check if "vddo" is present and in that case use these names.
+        * Else use the proper supply names on the component.
+        */
+       if (of_find_property(dev->of_node, "vddo-supply", NULL)) {
+               bt541->supplies[0].supply = "vdd";
+               bt541->supplies[1].supply = "vddo";
+       } else {
+               /* Else use the proper supply names */
+               bt541->supplies[0].supply = "vcca";
+               bt541->supplies[1].supply = "vdd";
+       }
+       error = devm_regulator_bulk_get(dev,
                                        ARRAY_SIZE(bt541->supplies),
                                        bt541->supplies);
        if (error < 0) {
-               dev_err(&client->dev, "Failed to get regulators: %d\n", error);
+               dev_err(dev, "Failed to get regulators: %d\n", error);
                return error;
        }
  
@@@ -488,15 -499,6 +499,15 @@@ static int zinitix_ts_probe(struct i2c_
                return error;
        }
  
 +      error = devm_request_threaded_irq(&client->dev, client->irq,
 +                                        NULL, zinitix_ts_irq_handler,
 +                                        IRQF_ONESHOT | IRQF_NO_AUTOEN,
 +                                        client->name, bt541);
 +      if (error) {
 +              dev_err(&client->dev, "Failed to request IRQ: %d\n", error);
 +              return error;
 +      }
 +
        error = zinitix_init_input_dev(bt541);
        if (error) {
                dev_err(&client->dev,
                return -EINVAL;
        }
  
 -      error = devm_request_threaded_irq(&client->dev, client->irq,
 -                                        NULL, zinitix_ts_irq_handler,
 -                                        IRQF_ONESHOT | IRQF_NO_AUTOEN,
 -                                        client->name, bt541);
 -      if (error) {
 -              dev_err(&client->dev, "Failed to request IRQ: %d\n", error);
 -              return error;
 -      }
 -
        return 0;
  }
  
@@@ -560,6 -571,7 +571,7 @@@ static SIMPLE_DEV_PM_OPS(zinitix_pm_ops
  
  #ifdef CONFIG_OF
  static const struct of_device_id zinitix_of_match[] = {
+       { .compatible = "zinitix,bt532" },
        { .compatible = "zinitix,bt541" },
        { }
  };