Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input

Pull input fixes from Dmitry Torokhov:
"Just a few driver fixes here"

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input:
Input: elants_i2c - drop zero-checking of ABS_MT_TOUCH_MAJOR resolution
Input: elants_i2c - fix division by zero if firmware reports zero phys size
Input: nspire-keypad - enable interrupts only when opened
Input: i8042 - fix Pegatron C15B ID entry
Input: n64joy - fix return value check in n64joy_probe()
Input: s6sy761 - fix coordinate read bit shift

+38 -32
+2 -2
drivers/input/joystick/n64joy.c
··· 252 252 mutex_init(&priv->n64joy_mutex); 253 253 254 254 priv->reg_base = devm_platform_ioremap_resource(pdev, 0); 255 - if (!priv->reg_base) { 256 - err = -EINVAL; 255 + if (IS_ERR(priv->reg_base)) { 256 + err = PTR_ERR(priv->reg_base); 257 257 goto fail; 258 258 } 259 259
+31 -25
drivers/input/keyboard/nspire-keypad.c
··· 93 93 return IRQ_HANDLED; 94 94 } 95 95 96 - static int nspire_keypad_chip_init(struct nspire_keypad *keypad) 96 + static int nspire_keypad_open(struct input_dev *input) 97 97 { 98 + struct nspire_keypad *keypad = input_get_drvdata(input); 98 99 unsigned long val = 0, cycles_per_us, delay_cycles, row_delay_cycles; 100 + int error; 101 + 102 + error = clk_prepare_enable(keypad->clk); 103 + if (error) 104 + return error; 99 105 100 106 cycles_per_us = (clk_get_rate(keypad->clk) / 1000000); 101 107 if (cycles_per_us == 0) ··· 127 121 keypad->int_mask = 1 << 1; 128 122 writel(keypad->int_mask, keypad->reg_base + KEYPAD_INTMSK); 129 123 130 - /* Disable GPIO interrupts to prevent hanging on touchpad */ 131 - /* Possibly used to detect touchpad events */ 132 - writel(0, keypad->reg_base + KEYPAD_UNKNOWN_INT); 133 - /* Acknowledge existing interrupts */ 134 - writel(~0, keypad->reg_base + KEYPAD_UNKNOWN_INT_STS); 135 - 136 - return 0; 137 - } 138 - 139 - static int nspire_keypad_open(struct input_dev *input) 140 - { 141 - struct nspire_keypad *keypad = input_get_drvdata(input); 142 - int error; 143 - 144 - error = clk_prepare_enable(keypad->clk); 145 - if (error) 146 - return error; 147 - 148 - error = nspire_keypad_chip_init(keypad); 149 - if (error) { 150 - clk_disable_unprepare(keypad->clk); 151 - return error; 152 - } 153 - 154 124 return 0; 155 125 } 156 126 157 127 static void nspire_keypad_close(struct input_dev *input) 158 128 { 159 129 struct nspire_keypad *keypad = input_get_drvdata(input); 130 + 131 + /* Disable interrupts */ 132 + writel(0, keypad->reg_base + KEYPAD_INTMSK); 133 + /* Acknowledge existing interrupts */ 134 + writel(~0, keypad->reg_base + KEYPAD_INT); 160 135 161 136 clk_disable_unprepare(keypad->clk); 162 137 } ··· 196 209 dev_err(&pdev->dev, "failed to allocate input device\n"); 197 210 return -ENOMEM; 198 211 } 212 + 213 + error = clk_prepare_enable(keypad->clk); 214 + if (error) { 215 + dev_err(&pdev->dev, "failed to enable clock\n"); 216 + return error; 217 + } 218 + 219 + /* Disable interrupts */ 220 + writel(0, keypad->reg_base + KEYPAD_INTMSK); 221 + /* Acknowledge existing interrupts */ 222 + writel(~0, keypad->reg_base + KEYPAD_INT); 223 + 224 + /* Disable GPIO interrupts to prevent hanging on touchpad */ 225 + /* Possibly used to detect touchpad events */ 226 + writel(0, keypad->reg_base + KEYPAD_UNKNOWN_INT); 227 + /* Acknowledge existing GPIO interrupts */ 228 + writel(~0, keypad->reg_base + KEYPAD_UNKNOWN_INT_STS); 229 + 230 + clk_disable_unprepare(keypad->clk); 199 231 200 232 input_set_drvdata(input, keypad); 201 233
+1
drivers/input/serio/i8042-x86ia64io.h
··· 588 588 DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."), 589 589 DMI_MATCH(DMI_CHASSIS_TYPE, "10"), /* Notebook */ 590 590 }, 591 + }, { 591 592 .matches = { 592 593 DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."), 593 594 DMI_MATCH(DMI_CHASSIS_TYPE, "31"), /* Convertible Notebook */
+2 -3
drivers/input/touchscreen/elants_i2c.c
··· 1441 1441 1442 1442 touchscreen_parse_properties(ts->input, true, &ts->prop); 1443 1443 1444 - if (ts->chip_id == EKTF3624) { 1444 + if (ts->chip_id == EKTF3624 && ts->phy_x && ts->phy_y) { 1445 1445 /* calculate resolution from size */ 1446 1446 ts->x_res = DIV_ROUND_CLOSEST(ts->prop.max_x, ts->phy_x); 1447 1447 ts->y_res = DIV_ROUND_CLOSEST(ts->prop.max_y, ts->phy_y); ··· 1449 1449 1450 1450 input_abs_set_res(ts->input, ABS_MT_POSITION_X, ts->x_res); 1451 1451 input_abs_set_res(ts->input, ABS_MT_POSITION_Y, ts->y_res); 1452 - if (ts->major_res > 0) 1453 - input_abs_set_res(ts->input, ABS_MT_TOUCH_MAJOR, ts->major_res); 1452 + input_abs_set_res(ts->input, ABS_MT_TOUCH_MAJOR, ts->major_res); 1454 1453 1455 1454 error = input_mt_init_slots(ts->input, MAX_CONTACT_NUM, 1456 1455 INPUT_MT_DIRECT | INPUT_MT_DROP_UNUSED);
+2 -2
drivers/input/touchscreen/s6sy761.c
··· 145 145 u8 major = event[4]; 146 146 u8 minor = event[5]; 147 147 u8 z = event[6] & S6SY761_MASK_Z; 148 - u16 x = (event[1] << 3) | ((event[3] & S6SY761_MASK_X) >> 4); 149 - u16 y = (event[2] << 3) | (event[3] & S6SY761_MASK_Y); 148 + u16 x = (event[1] << 4) | ((event[3] & S6SY761_MASK_X) >> 4); 149 + u16 y = (event[2] << 4) | (event[3] & S6SY761_MASK_Y); 150 150 151 151 input_mt_slot(sdata->input, tid); 152 152