Commit 4b6920ba authored by Linus Torvalds's avatar Linus Torvalds

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

Pull input updates from Dmitry Torokhov:
 "Just a few small fixups and switching a couple of Thinkpads to SMBus
  for touchpads as PS/2 emulation is not working well"

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input:
  Input: synaptics - enable SMBus on ThinkPad E480 and E580
  Input: imx_keypad - make sure keyboard can always wake up system
  Input: iqs5xx - get axis info before calling input_mt_init_slots()
  Input: uinput - add compat ioctl number translation for UI_*_FF_UPLOAD
  Input: silead - add MSSL0017 to acpi_device_id
  Input: elantech - enable middle button support on 2 ThinkPads
  Input: elan_i2c - increment wakeup count if wake source
parents bed3c0d8 9843f3e0
......@@ -526,11 +526,12 @@ static int imx_keypad_probe(struct platform_device *pdev)
return 0;
}
static int __maybe_unused imx_kbd_suspend(struct device *dev)
static int __maybe_unused imx_kbd_noirq_suspend(struct device *dev)
{
struct platform_device *pdev = to_platform_device(dev);
struct imx_keypad *kbd = platform_get_drvdata(pdev);
struct input_dev *input_dev = kbd->input_dev;
unsigned short reg_val = readw(kbd->mmio_base + KPSR);
/* imx kbd can wake up system even clock is disabled */
mutex_lock(&input_dev->mutex);
......@@ -540,13 +541,20 @@ static int __maybe_unused imx_kbd_suspend(struct device *dev)
mutex_unlock(&input_dev->mutex);
if (device_may_wakeup(&pdev->dev))
if (device_may_wakeup(&pdev->dev)) {
if (reg_val & KBD_STAT_KPKD)
reg_val |= KBD_STAT_KRIE;
if (reg_val & KBD_STAT_KPKR)
reg_val |= KBD_STAT_KDIE;
writew(reg_val, kbd->mmio_base + KPSR);
enable_irq_wake(kbd->irq);
}
return 0;
}
static int __maybe_unused imx_kbd_resume(struct device *dev)
static int __maybe_unused imx_kbd_noirq_resume(struct device *dev)
{
struct platform_device *pdev = to_platform_device(dev);
struct imx_keypad *kbd = platform_get_drvdata(pdev);
......@@ -570,7 +578,9 @@ static int __maybe_unused imx_kbd_resume(struct device *dev)
return ret;
}
static SIMPLE_DEV_PM_OPS(imx_kbd_pm_ops, imx_kbd_suspend, imx_kbd_resume);
static const struct dev_pm_ops imx_kbd_pm_ops = {
SET_NOIRQ_SYSTEM_SLEEP_PM_OPS(imx_kbd_noirq_suspend, imx_kbd_noirq_resume)
};
static struct platform_driver imx_keypad_driver = {
.driver = {
......
......@@ -1038,13 +1038,31 @@ static long uinput_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
#ifdef CONFIG_COMPAT
#define UI_SET_PHYS_COMPAT _IOW(UINPUT_IOCTL_BASE, 108, compat_uptr_t)
/*
* These IOCTLs change their size and thus their numbers between
* 32 and 64 bits.
*/
#define UI_SET_PHYS_COMPAT \
_IOW(UINPUT_IOCTL_BASE, 108, compat_uptr_t)
#define UI_BEGIN_FF_UPLOAD_COMPAT \
_IOWR(UINPUT_IOCTL_BASE, 200, struct uinput_ff_upload_compat)
#define UI_END_FF_UPLOAD_COMPAT \
_IOW(UINPUT_IOCTL_BASE, 201, struct uinput_ff_upload_compat)
static long uinput_compat_ioctl(struct file *file,
unsigned int cmd, unsigned long arg)
{
if (cmd == UI_SET_PHYS_COMPAT)
switch (cmd) {
case UI_SET_PHYS_COMPAT:
cmd = UI_SET_PHYS;
break;
case UI_BEGIN_FF_UPLOAD_COMPAT:
cmd = UI_BEGIN_FF_UPLOAD;
break;
case UI_END_FF_UPLOAD_COMPAT:
cmd = UI_END_FF_UPLOAD;
break;
}
return uinput_ioctl_handler(file, cmd, arg, compat_ptr(arg));
}
......
......@@ -981,6 +981,8 @@ static irqreturn_t elan_isr(int irq, void *dev_id)
if (error)
goto out;
pm_wakeup_event(dev, 0);
switch (report[ETP_REPORT_ID_OFFSET]) {
case ETP_REPORT_ID:
elan_report_absolute(data, report);
......
......@@ -1189,6 +1189,8 @@ static const char * const middle_button_pnp_ids[] = {
"LEN2132", /* ThinkPad P52 */
"LEN2133", /* ThinkPad P72 w/ NFC */
"LEN2134", /* ThinkPad P72 */
"LEN0407",
"LEN0408",
NULL
};
......
......@@ -179,6 +179,8 @@ static const char * const smbus_pnp_ids[] = {
"LEN0096", /* X280 */
"LEN0097", /* X280 -> ALPS trackpoint */
"LEN200f", /* T450s */
"LEN2054", /* E480 */
"LEN2055", /* E580 */
"SYN3052", /* HP EliteBook 840 G4 */
"SYN3221", /* HP 15-ay000 */
NULL
......
......@@ -502,14 +502,6 @@ static int iqs5xx_axis_init(struct i2c_client *client)
input_set_capability(input, EV_ABS, ABS_MT_POSITION_Y);
input_set_capability(input, EV_ABS, ABS_MT_PRESSURE);
error = input_mt_init_slots(input,
IQS5XX_NUM_CONTACTS, INPUT_MT_DIRECT);
if (error) {
dev_err(&client->dev,
"Failed to initialize slots: %d\n", error);
return error;
}
input_set_drvdata(input, iqs5xx);
iqs5xx->input = input;
}
......@@ -591,9 +583,19 @@ static int iqs5xx_axis_init(struct i2c_client *client)
if (error)
return error;
return iqs5xx_write_word(client,
prop.swap_x_y ? IQS5XX_X_RES : IQS5XX_Y_RES,
max_y);
error = iqs5xx_write_word(client,
prop.swap_x_y ? IQS5XX_X_RES : IQS5XX_Y_RES,
max_y);
if (error)
return error;
error = input_mt_init_slots(iqs5xx->input, IQS5XX_NUM_CONTACTS,
INPUT_MT_DIRECT);
if (error)
dev_err(&client->dev, "Failed to initialize slots: %d\n",
error);
return error;
}
static int iqs5xx_dev_init(struct i2c_client *client)
......
......@@ -609,6 +609,7 @@ static const struct acpi_device_id silead_ts_acpi_match[] = {
{ "MSSL1680", 0 },
{ "MSSL0001", 0 },
{ "MSSL0002", 0 },
{ "MSSL0017", 0 },
{ }
};
MODULE_DEVICE_TABLE(acpi, silead_ts_acpi_match);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment