diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2018-04-05 16:21:57 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2018-04-05 16:21:57 -0400 |
commit | 5414ab31b1e8dec34800201cb5211abf3436129e (patch) | |
tree | 1abb330d904362742b1eb88e62b1e95e60a83f71 /drivers/input/misc | |
parent | 672a9c106966f8d418478830975288b8096bb058 (diff) | |
parent | 664b0bae0b87f69bc9deb098f5e0158b9cf18e04 (diff) |
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input
Pull input updates from Dmitry Torokhov:
- new driver for PhoenixRC Flight Controller Adapter
- new driver for RAVE SP Power button
- fixes for autosuspend-related deadlocks in a few unput USB dirvers
- support for 2nd wheel in ATech PS/2 mouse
- fix for ALPS trackpoint detection on Thinkpad L570 and Latitude 7370
- bunch of cleanups in various in PS/2 protocols
- other assorted changes and fixes
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input: (35 commits)
Input: i8042 - enable MUX on Sony VAIO VGN-CS series to fix touchpad
Input: stmfts, s6sy761 - update my e-mail
Input: stmfts - use async probe & suspend/resume to avoid 2s delay
Input: ALPS - fix TrackStick detection on Thinkpad L570 and Latitude 7370
Input: xpad - add PDP device id 0x02a4
Input: alps - report pressure of v3 and v7 trackstick
Input: pxrc - new driver for PhoenixRC Flight Controller Adapter
Input: usbtouchscreen - do not rely on input_dev->users
Input: usbtouchscreen - fix deadlock in autosuspend
Input: pegasus_notetaker - do not rely on input_dev->users
Input: pagasus_notetaker - fix deadlock in autosuspend
Input: synaptics_usb - do not rely on input_dev->users
Input: synaptics_usb - fix deadlock in autosuspend
Input: gpio-keys - add support for wakeup event action
Input: appletouch - use true and false for boolean values
Input: silead - add Chuwi Hi8 support
Input: analog - use get_cycles() on PPC
Input: stmpe-keypad - remove VLA usage
Input: i8042 - add Lenovo ThinkPad L460 to i8042 reset list
Input: add RAVE SP Powerbutton driver
...
Diffstat (limited to 'drivers/input/misc')
-rw-r--r-- | drivers/input/misc/Kconfig | 9 | ||||
-rw-r--r-- | drivers/input/misc/Makefile | 1 | ||||
-rw-r--r-- | drivers/input/misc/rave-sp-pwrbutton.c | 94 |
3 files changed, 104 insertions, 0 deletions
diff --git a/drivers/input/misc/Kconfig b/drivers/input/misc/Kconfig index e9770f5e3f77..572b15fa18c2 100644 --- a/drivers/input/misc/Kconfig +++ b/drivers/input/misc/Kconfig | |||
@@ -832,4 +832,13 @@ config INPUT_HISI_POWERKEY | |||
832 | To compile this driver as a module, choose M here: the | 832 | To compile this driver as a module, choose M here: the |
833 | module will be called hisi_powerkey. | 833 | module will be called hisi_powerkey. |
834 | 834 | ||
835 | config INPUT_RAVE_SP_PWRBUTTON | ||
836 | tristate "RAVE SP Power button Driver" | ||
837 | depends on RAVE_SP_CORE | ||
838 | help | ||
839 | Say Y here if you want to enable power key reporting from RAVE SP | ||
840 | |||
841 | To compile this driver as a module, choose M here: the | ||
842 | module will be called rave-sp-pwrbutton. | ||
843 | |||
835 | endif | 844 | endif |
diff --git a/drivers/input/misc/Makefile b/drivers/input/misc/Makefile index eb9c6c3ec530..72cde28649e2 100644 --- a/drivers/input/misc/Makefile +++ b/drivers/input/misc/Makefile | |||
@@ -59,6 +59,7 @@ obj-$(CONFIG_INPUT_PMIC8XXX_PWRKEY) += pmic8xxx-pwrkey.o | |||
59 | obj-$(CONFIG_INPUT_POWERMATE) += powermate.o | 59 | obj-$(CONFIG_INPUT_POWERMATE) += powermate.o |
60 | obj-$(CONFIG_INPUT_PWM_BEEPER) += pwm-beeper.o | 60 | obj-$(CONFIG_INPUT_PWM_BEEPER) += pwm-beeper.o |
61 | obj-$(CONFIG_INPUT_PWM_VIBRA) += pwm-vibra.o | 61 | obj-$(CONFIG_INPUT_PWM_VIBRA) += pwm-vibra.o |
62 | obj-$(CONFIG_INPUT_RAVE_SP_PWRBUTTON) += rave-sp-pwrbutton.o | ||
62 | obj-$(CONFIG_INPUT_RB532_BUTTON) += rb532_button.o | 63 | obj-$(CONFIG_INPUT_RB532_BUTTON) += rb532_button.o |
63 | obj-$(CONFIG_INPUT_REGULATOR_HAPTIC) += regulator-haptic.o | 64 | obj-$(CONFIG_INPUT_REGULATOR_HAPTIC) += regulator-haptic.o |
64 | obj-$(CONFIG_INPUT_RETU_PWRBUTTON) += retu-pwrbutton.o | 65 | obj-$(CONFIG_INPUT_RETU_PWRBUTTON) += retu-pwrbutton.o |
diff --git a/drivers/input/misc/rave-sp-pwrbutton.c b/drivers/input/misc/rave-sp-pwrbutton.c new file mode 100644 index 000000000000..bcab3cdb7ebd --- /dev/null +++ b/drivers/input/misc/rave-sp-pwrbutton.c | |||
@@ -0,0 +1,94 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0+ | ||
2 | // | ||
3 | // Power Button driver for RAVE SP | ||
4 | // | ||
5 | // Copyright (C) 2017 Zodiac Inflight Innovations | ||
6 | // | ||
7 | // | ||
8 | |||
9 | #include <linux/input.h> | ||
10 | #include <linux/kernel.h> | ||
11 | #include <linux/module.h> | ||
12 | #include <linux/mfd/rave-sp.h> | ||
13 | #include <linux/platform_device.h> | ||
14 | |||
15 | #define RAVE_SP_EVNT_BUTTON_PRESS (RAVE_SP_EVNT_BASE + 0x00) | ||
16 | |||
17 | struct rave_sp_power_button { | ||
18 | struct input_dev *idev; | ||
19 | struct notifier_block nb; | ||
20 | }; | ||
21 | |||
22 | static int rave_sp_power_button_event(struct notifier_block *nb, | ||
23 | unsigned long action, void *data) | ||
24 | { | ||
25 | struct rave_sp_power_button *pb = | ||
26 | container_of(nb, struct rave_sp_power_button, nb); | ||
27 | const u8 event = rave_sp_action_unpack_event(action); | ||
28 | const u8 value = rave_sp_action_unpack_value(action); | ||
29 | struct input_dev *idev = pb->idev; | ||
30 | |||
31 | if (event == RAVE_SP_EVNT_BUTTON_PRESS) { | ||
32 | input_report_key(idev, KEY_POWER, value); | ||
33 | input_sync(idev); | ||
34 | |||
35 | return NOTIFY_STOP; | ||
36 | } | ||
37 | |||
38 | return NOTIFY_DONE; | ||
39 | } | ||
40 | |||
41 | static int rave_sp_pwrbutton_probe(struct platform_device *pdev) | ||
42 | { | ||
43 | struct device *dev = &pdev->dev; | ||
44 | struct rave_sp_power_button *pb; | ||
45 | struct input_dev *idev; | ||
46 | int error; | ||
47 | |||
48 | pb = devm_kzalloc(dev, sizeof(*pb), GFP_KERNEL); | ||
49 | if (!pb) | ||
50 | return -ENOMEM; | ||
51 | |||
52 | idev = devm_input_allocate_device(dev); | ||
53 | if (!idev) | ||
54 | return -ENOMEM; | ||
55 | |||
56 | idev->name = pdev->name; | ||
57 | |||
58 | input_set_capability(idev, EV_KEY, KEY_POWER); | ||
59 | |||
60 | error = input_register_device(idev); | ||
61 | if (error) | ||
62 | return error; | ||
63 | |||
64 | pb->idev = idev; | ||
65 | pb->nb.notifier_call = rave_sp_power_button_event; | ||
66 | pb->nb.priority = 128; | ||
67 | |||
68 | error = devm_rave_sp_register_event_notifier(dev, &pb->nb); | ||
69 | if (error) | ||
70 | return error; | ||
71 | |||
72 | return 0; | ||
73 | } | ||
74 | |||
75 | static const struct of_device_id rave_sp_pwrbutton_of_match[] = { | ||
76 | { .compatible = "zii,rave-sp-pwrbutton" }, | ||
77 | {} | ||
78 | }; | ||
79 | |||
80 | static struct platform_driver rave_sp_pwrbutton_driver = { | ||
81 | .probe = rave_sp_pwrbutton_probe, | ||
82 | .driver = { | ||
83 | .name = KBUILD_MODNAME, | ||
84 | .of_match_table = rave_sp_pwrbutton_of_match, | ||
85 | }, | ||
86 | }; | ||
87 | module_platform_driver(rave_sp_pwrbutton_driver); | ||
88 | |||
89 | MODULE_DEVICE_TABLE(of, rave_sp_pwrbutton_of_match); | ||
90 | MODULE_LICENSE("GPL"); | ||
91 | MODULE_AUTHOR("Andrey Vostrikov <andrey.vostrikov@cogentembedded.com>"); | ||
92 | MODULE_AUTHOR("Nikita Yushchenko <nikita.yoush@cogentembedded.com>"); | ||
93 | MODULE_AUTHOR("Andrey Smirnov <andrew.smirnov@gmail.com>"); | ||
94 | MODULE_DESCRIPTION("RAVE SP Power Button driver"); | ||