]> Git Repo - linux.git/commitdiff
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input
authorLinus Torvalds <[email protected]>
Tue, 4 Dec 2018 16:47:04 +0000 (08:47 -0800)
committerLinus Torvalds <[email protected]>
Tue, 4 Dec 2018 16:47:04 +0000 (08:47 -0800)
Pull input updates from Dmitry Torokhov:
 "Mostly new IDs for Elan/Synaptics touchpads, plus a few small fixups"

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input:
  Input: omap-keypad - fix keyboard debounce configuration
  Input: xpad - quirk all PDP Xbox One gamepads
  Input: synaptics - enable SMBus for HP 15-ay000
  Input: synaptics - add PNP ID for ThinkPad P50 to SMBus
  Input: elan_i2c - add ACPI ID for Lenovo IdeaPad 330-15ARR
  Input: elan_i2c - add support for ELAN0621 touchpad
  Input: hyper-v - fix wakeup from suspend-to-idle
  Input: atkbd - clean up indentation issue
  Input: st1232 - convert to SPDX identifiers
  Input: migor_ts - convert to SPDX identifiers
  Input: dt-bindings - fix a typo in file input-reset.txt
  Input: cros_ec_keyb - fix button/switch capability reports
  Input: elan_i2c - add ELAN0620 to the ACPI table
  Input: matrix_keypad - check for errors from of_get_named_gpio()

1  2 
drivers/hid/hid-hyperv.c
drivers/input/keyboard/matrix_keypad.c
drivers/input/keyboard/omap4-keypad.c
drivers/input/serio/hyperv-keyboard.c

diff --combined drivers/hid/hid-hyperv.c
index b372854cf38d3221d8598affb395845fb42ce930,fc1db8c4ff0f9b7666699bc12c02da1ced527c6a..704049e62d58ac9a9cd1e7c8bb4a3e1c222eb42d
@@@ -309,7 -309,7 +309,7 @@@ static void mousevsc_on_receive(struct 
                hid_input_report(input_dev->hid_device, HID_INPUT_REPORT,
                                 input_dev->input_buf, len, 1);
  
-               pm_wakeup_event(&input_dev->device->device, 0);
+               pm_wakeup_hard_event(&input_dev->device->device);
  
                break;
        default:
@@@ -598,9 -598,6 +598,9 @@@ static struct  hv_driver mousevsc_drv 
        .id_table = id_table,
        .probe = mousevsc_probe,
        .remove = mousevsc_remove,
 +      .driver = {
 +              .probe_type = PROBE_PREFER_ASYNCHRONOUS,
 +      },
  };
  
  static int __init mousevsc_init(void)
index f51ae09596ef25942ff6bab030be9697c3a0eca7,782dda68d93ae7d327bc8cf20ee013afdacf032b..403452ef00e6f257d67ca44bdf5626b0e5cc53a4
@@@ -407,7 -407,7 +407,7 @@@ matrix_keypad_parse_dt(struct device *d
        struct matrix_keypad_platform_data *pdata;
        struct device_node *np = dev->of_node;
        unsigned int *gpios;
-       int i, nrow, ncol;
+       int ret, i, nrow, ncol;
  
        if (!np) {
                dev_err(dev, "device lacks DT data\n");
        of_property_read_u32(np, "col-scan-delay-us",
                                                &pdata->col_scan_delay_us);
  
 -      gpios = devm_kzalloc(dev,
 -                           sizeof(unsigned int) *
 -                              (pdata->num_row_gpios + pdata->num_col_gpios),
 +      gpios = devm_kcalloc(dev,
 +                           pdata->num_row_gpios + pdata->num_col_gpios,
 +                           sizeof(unsigned int),
                             GFP_KERNEL);
        if (!gpios) {
                dev_err(dev, "could not allocate memory for gpios\n");
                return ERR_PTR(-ENOMEM);
        }
  
-       for (i = 0; i < pdata->num_row_gpios; i++)
-               gpios[i] = of_get_named_gpio(np, "row-gpios", i);
+       for (i = 0; i < nrow; i++) {
+               ret = of_get_named_gpio(np, "row-gpios", i);
+               if (ret < 0)
+                       return ERR_PTR(ret);
+               gpios[i] = ret;
+       }
  
-       for (i = 0; i < pdata->num_col_gpios; i++)
-               gpios[pdata->num_row_gpios + i] =
-                       of_get_named_gpio(np, "col-gpios", i);
+       for (i = 0; i < ncol; i++) {
+               ret = of_get_named_gpio(np, "col-gpios", i);
+               if (ret < 0)
+                       return ERR_PTR(ret);
+               gpios[nrow + i] = ret;
+       }
  
        pdata->row_gpios = gpios;
        pdata->col_gpios = &gpios[pdata->num_row_gpios];
@@@ -484,10 -491,8 +491,8 @@@ static int matrix_keypad_probe(struct p
        pdata = dev_get_platdata(&pdev->dev);
        if (!pdata) {
                pdata = matrix_keypad_parse_dt(&pdev->dev);
-               if (IS_ERR(pdata)) {
-                       dev_err(&pdev->dev, "no platform data defined\n");
+               if (IS_ERR(pdata))
                        return PTR_ERR(pdata);
-               }
        } else if (!pdata->keymap_data) {
                dev_err(&pdev->dev, "no keymap data defined\n");
                return -EINVAL;
index 46406345742b97c06595ab7e3b785ee2a6daca1b,ce8e2baf31bbb17da4db8430d3d001fec875f450..a7dc286f406c992ebd55d764808691101dfff690
  
  /* OMAP4 values */
  #define OMAP4_VAL_IRQDISABLE          0x0
- #define OMAP4_VAL_DEBOUNCINGTIME      0x7
- #define OMAP4_VAL_PVT                 0x7
+ /*
+  * Errata i689: If a key is released for a time shorter than debounce time,
+  * the keyboard will idle and never detect the key release. The workaround
+  * is to use at least a 12ms debounce time. See omap5432 TRM chapter
+  * "26.4.6.2 Keyboard Controller Timer" for more information.
+  */
+ #define OMAP4_KEYPAD_PTV_DIV_128        0x6
+ #define OMAP4_KEYPAD_DEBOUNCINGTIME_MS(dbms, ptv)     \
+       ((((dbms) * 1000) / ((1 << ((ptv) + 1)) * (1000000 / 32768))) - 1)
+ #define OMAP4_VAL_DEBOUNCINGTIME_16MS                                 \
+       OMAP4_KEYPAD_DEBOUNCINGTIME_MS(16, OMAP4_KEYPAD_PTV_DIV_128)
  
  enum {
        KBD_REVISION_OMAP4 = 0,
@@@ -181,9 -191,9 +191,9 @@@ static int omap4_keypad_open(struct inp
  
        kbd_writel(keypad_data, OMAP4_KBD_CTRL,
                        OMAP4_DEF_CTRL_NOSOFTMODE |
-                       (OMAP4_VAL_PVT << OMAP4_DEF_CTRL_PTV_SHIFT));
+                       (OMAP4_KEYPAD_PTV_DIV_128 << OMAP4_DEF_CTRL_PTV_SHIFT));
        kbd_writel(keypad_data, OMAP4_KBD_DEBOUNCINGTIME,
-                       OMAP4_VAL_DEBOUNCINGTIME);
+                       OMAP4_VAL_DEBOUNCINGTIME_16MS);
        /* clear pending interrupts */
        kbd_write_irqreg(keypad_data, OMAP4_KBD_IRQSTATUS,
                         kbd_read_irqreg(keypad_data, OMAP4_KBD_IRQSTATUS));
@@@ -337,8 -347,7 +347,8 @@@ static int omap4_keypad_probe(struct pl
  
        keypad_data->row_shift = get_count_order(keypad_data->cols);
        max_keys = keypad_data->rows << keypad_data->row_shift;
 -      keypad_data->keymap = kzalloc(max_keys * sizeof(keypad_data->keymap[0]),
 +      keypad_data->keymap = kcalloc(max_keys,
 +                                    sizeof(keypad_data->keymap[0]),
                                      GFP_KERNEL);
        if (!keypad_data->keymap) {
                dev_err(&pdev->dev, "Not enough memory for keymap\n");
index 47a0e81a2989c93389e2affd20414d17057cde79,55288a026e4e2919ab06a18b18b810b5d628dd59..a8b9be3e28db709ef8769e29da2684c3d1e3bcf9
@@@ -177,7 -177,7 +177,7 @@@ static void hv_kbd_on_receive(struct hv
                 * state because the Enter-UP can trigger a wakeup at once.
                 */
                if (!(info & IS_BREAK))
-                       pm_wakeup_event(&hv_dev->device, 0);
+                       pm_wakeup_hard_event(&hv_dev->device);
  
                break;
  
@@@ -424,9 -424,6 +424,9 @@@ static struct  hv_driver hv_kbd_drv = 
        .id_table = id_table,
        .probe = hv_kbd_probe,
        .remove = hv_kbd_remove,
 +      .driver = {
 +              .probe_type = PROBE_PREFER_ASYNCHRONOUS,
 +      },
  };
  
  static int __init hv_kbd_init(void)
This page took 0.088265 seconds and 4 git commands to generate.