aboutsummaryrefslogtreecommitdiff
path: root/drivers/input/misc
AgeCommit message (Collapse)AuthorFilesLines
2017-04-05Input: pm8xxx-vib - add support for pm8916's vibratorDamien Riegel2-1/+11
Add pm8xxx_regs for this PMIC and the device tree match table entry. Signed-off-by: Damien Riegel <[email protected]> Signed-off-by: Dmitry Torokhov <[email protected]>
2017-04-05Input: pm8xxx-vib - handle separate enable registerDamien Riegel1-1/+10
Some PMIC vibrator IPs use a separate enable register to turn the vibrator on and off. To detect if a vibrator uses this feature, rely on the enable_mask being non-zero. Signed-off-by: Damien Riegel <[email protected]> Signed-off-by: Dmitry Torokhov <[email protected]>
2017-04-05Input: pm8xxx-vib - parametrize the driverDamien Riegel1-16/+33
In order to prepare this driver to support other vibrators of the same kind, move some hardcoded values to a structure holding register parameters (address, mask, shit of the control register). Signed-off-by: Damien Riegel <[email protected]> Signed-off-by: Dmitry Torokhov <[email protected]>
2017-04-05Input: pm8xxx-vib - reorder header alphabeticallyDamien Riegel1-4/+4
Signed-off-by: Damien Riegel <[email protected]> Signed-off-by: Dmitry Torokhov <[email protected]>
2017-04-03Merge tag 'v4.11-rc5' into nextDmitry Torokhov3-0/+12
Sync up with mainline to bring in changes to input subsystem merged through other trees.
2017-04-01Input: bma150 - remove support for bma150H. Nikolaus Schaller1-10/+1
This essentially reverts commit baf28d91e7b1 ("Input: bma150 - avoid binding to bma180 if IIO bma180 driver present") and commit ef3714fdbc8d ("Input: bma150 - extend chip detection for bma180") Rationale: initially (2012) the GTA04 device using a bma180 chip simply referenced the bma150 platform driver in its board file [1] which happened to work in all scenarios that were tested. When conversion to DT started (2014), we needed to make the driver be still recognised. Hence we introduced the compatibility to the bma180 chip in Linux 3.15-rc5 [2] without further checks if it is really 100% compatible. This worked flawlessly for years with the GTA04 device. Recently (2016), Hans de Goede pointed out that the chips are not as similar as they appeared and the driver works with the bma180 for the GTA04 only by good luck. He proposed to remove the bma180 support completely [3], but we still did need it until we have a replacement. Thus, a conditional compile was added. We have now developed a generic iio-input-bridge which works with any 2 or 3 axis iio based accelerometer. It has been tested on GTA04 and Pyra and works as expected. Therefore we can remove the bma180 support from this driver completely. User-space API compatibility can be restored by using the iio-input-bridge. Maybe it is time to convert the bma150 driver to iio as well and retire the accelerometer input drivers completely but this is a different story and task. [1]: https://github.com/neilbrown/linux/blob/gta04/3.2.y/arch/arm/mach-omap2/board-omap3gta04.c#L976 [2]: https://patchwork.kernel.org/patch/3961171/ [3]: https://patchwork.kernel.org/patch/9325481/ Signed-off-by: H. Nikolaus Schaller <[email protected]> Reviewed-by: Hans de Goede <[email protected]> Signed-off-by: Dmitry Torokhov <[email protected]>
2017-03-17Input: convert remaining uses of pr_warning to pr_warnJoe Perches2-5/+6
To enable eventual removal of pr_warning This makes pr_warn use consistent for drivers/input Prior to this patch, there were 8 uses of pr_warning and 17 uses of pr_warn in drivers/input Signed-off-by: Joe Perches <[email protected]> Signed-off-by: Dmitry Torokhov <[email protected]>
2017-03-17Input: soc_button_array - add support for ACPI 6.0 Generic Button DeviceHans de Goede1-1/+158
Windows 10 tablets with gpio buttons will typically use the ACPI 6.0 Generic Button Device with a HID of ACPI0011 for these buttons. The ACPI description for these in the ACPI0011 devices _DSD object uses something resembling HID descriptors, except that instead of indicating a bit index into a HID input report, the index indicates the _CRS index for the GPIO. The use of 1 interrupt per button, some of which need to be wakeup sources, instead of using input reports makes it impossible to use the HID subsystem for this. This really is just another gpio-keys input device with the platform data described in ACPI, so this commit adds parsing for this new way to describe gpio-keys to the soc_button_array driver. Signed-off-by: Hans de Goede <[email protected]> Signed-off-by: Dmitry Torokhov <[email protected]>
2017-03-17Input: soc_button_array - get rid of MAX_NBUTTONSHans de Goede1-8/+11
Count how much gpio_keys we actually need, this is a preparation patch for adding support for the new Win10 / ACPI-6.0 "Generic Buttons Device" support. Signed-off-by: Hans de Goede <[email protected]> Signed-off-by: Dmitry Torokhov <[email protected]>
2017-03-16Input: yealink - validate number of endpoints before using themJohan Hovold1-0/+4
Make sure to check the number of endpoints to avoid dereferencing a NULL-pointer should a malicious device lack endpoints. Fixes: aca951a22a1d ("[PATCH] input-driver-yealink-P1K-usb-phone") Signed-off-by: Johan Hovold <[email protected]> Cc: [email protected] # 2.6.14 Signed-off-by: Dmitry Torokhov <[email protected]>
2017-03-16Input: ims-pcu - validate number of endpoints before using themJohan Hovold1-0/+4
Make sure to check the number of endpoints to avoid dereferencing a NULL-pointer should a malicious device lack control-interface endpoints. Fixes: 628329d52474 ("Input: add IMS Passenger Control Unit driver") Signed-off-by: Johan Hovold <[email protected]> Cc: [email protected] # 3.10 Signed-off-by: Dmitry Torokhov <[email protected]>
2017-03-16Input: cm109 - validate number of endpoints before using themJohan Hovold1-0/+4
Make sure to check the number of endpoints to avoid dereferencing a NULL-pointer should a malicious device lack endpoints. Fixes: c04148f915e5 ("Input: add driver for USB VoIP phones with CM109...") Signed-off-by: Johan Hovold <[email protected]> Cc: [email protected] # 2.6.28 Signed-off-by: Dmitry Torokhov <[email protected]>
2017-03-16Input: soc_button_array - Propagate error from gpiod_count()Andy Shevchenko1-2/+3
Since gpiod_count() does not return 0 anymore, we don't need to shadow its error code and would safely propagate to the user. While here, replace second parameter by NULL in order to prevent side effects on _DSD enabled firmware. Cc: Benjamin Tissoires <[email protected]> Signed-off-by: Andy Shevchenko <[email protected]> Acked-by: Dmitry Torokhov <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2017-03-09Input: dm355evm_keys - switch to using managed resourcesDmitry Torokhov1-50/+26
Using devm_* APIs simpifies error handling and device teardown. Signed-off-by: Dmitry Torokhov <[email protected]>
2017-03-09Input: wistron_btns - remove use of sparse_keymap_freeDmitry Torokhov1-4/+1
Now that sparse keymap uses managed memory, we no longer need to clean it up manually. Signed-off-by: Dmitry Torokhov <[email protected]>
2017-03-09Input: dm355evm_keys - remove use of sparse_keymap_freeDmitry Torokhov1-6/+3
Now that sparse keymap uses managed memory, we no longer need to clean it up manually. Signed-off-by: Dmitry Torokhov <[email protected]>
2017-03-09Merge branch 'ib/4.10-sparse-keymap-managed' into nextDmitry Torokhov1-6/+14
This brings in version of sparse keymap code that uses managed memory.
2017-03-09Input: soc_button_array - use NULL for GPIO connection IDHans de Goede1-2/+2
The gpiolib-acpi code is becoming more strict and connection-IDs may only be used with devices which have a _DSD with matching IDs in there. Since the soc_button_array ACPI binding is pure index based pass in NULL as connection-ID to avoid the more strict cheks resulting in gpiod_count and gpiod_get_index not returning any gpios. Signed-off-by: Hans de Goede <[email protected]> Reviewed-by: Andy Shevchenko <[email protected]> Signed-off-by: Dmitry Torokhov <[email protected]>
2017-03-09Input: axp20x-pek - do not register input device on some systemsHans de Goede1-3/+12
On some systems (Intel tablets with axp288 pmic) the powerbutton is also connected to a gpio pin of the SoC, advertised through the "INTCFD9" / "PNP0C40" acpi device. This leads to double reporting of powerbutton events, which is undesirable, so one driver needs to not report input events in this case. Since the soc_button_array driver for the "PNP0C40" acpi device also handles wake from suspend on these tablets and since the axp20x-pel driver requires relative expensive i2c accrsses, it is best for the axp20x-pek driver to not register an input device in this case. Note that this commit leaves the axp20x-driver bound to the device, rather then returning -ENODEV, this is done so that the sysfs attributes it offers are kept around. Signed-off-by: Hans de Goede <[email protected]> Signed-off-by: Dmitry Torokhov <[email protected]>
2017-03-09Input: axp20x_pek - add axp20x_pek_probe_input_device helperHans de Goede1-18/+29
Move all input device related initialization into a new axp20x_pek_probe_input_device helper function. This introduces one functional change, the input device is now registered before the sysfs attr get registered. This is not a problem as the sysfs attr are to configure some long press settings (forced poweroff) in the hardware and do not interact with the input_device. This is a preparation patch for not always registering the input dev. Signed-off-by: Hans de Goede <[email protected]> Signed-off-by: Dmitry Torokhov <[email protected]>
2017-03-09Input: axp20x-pek - use our own device for errorsHans de Goede1-4/+4
Before this commit axp20x-pek was mixing 2 style error reporting calls: dev_err(&pdev->dev, ...); dev_err(axp20x->dev, ...); But the second is our parent device, not our own device, so switch to using &pdev->dev everywhere. Signed-off-by: Hans de Goede <[email protected]> Signed-off-by: Dmitry Torokhov <[email protected]>
2017-03-09Input: drv260x - remove OF dependencyJingkui Wang1-3/+1
As the driver is using generic device properties, it should work properly when CONFIG_OF is turned off. This patch removes the ifdef CONFIGOF and make sure the driver always have of_match_table. Signed-off-by: Jingkui Wang <[email protected]> Signed-off-by: Dmitry Torokhov <[email protected]>
2017-03-07Input: pwm-beeper - support customized freq for SND_BELLGuan Ben1-1/+14
Extend the pwm-beeper driver to support customized frequency for SND_BELL from device properties. Signed-off-by: Guan Ben <[email protected]> Signed-off-by: Mark Jonas <[email protected]> Signed-off-by: Heiko Schocher <[email protected]> Acked-by: Rob Herring <[email protected]> Signed-off-by: Dmitry Torokhov <[email protected]>
2017-02-20Merge branch 'next' into for-linusDmitry Torokhov26-630/+115
Prepare input updates for 4.11 merge window.
2017-02-01Input: uinput - fix crash when mixing old and new init styleDmitry Torokhov1-6/+14
If user tries to initialize uinput device mixing old and new style initialization (i.e. using old UI_SET_ABSBIT instead of UI_ABS_SETUP, we forget to allocate input->absinfo and will crash when trying to send absolute events: ioctl(ui, UI_DEV_SETUP, &us); ioctl(ui, UI_SET_PHYS, "Test"); ioctl(ui, UI_SET_EVBIT, EV_ABS); ioctl(ui, UI_SET_ABSBIT, ABS_X); ioctl(ui, UI_SET_ABSBIT, ABS_Y); ioctl(ui, UI_DEV_CREATE, 0); Reported-by: Rodrigo Rivas Costa <[email protected]> Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=191811 Fixes: fbae10db0940 ("Input: uinput - rework ABS validation") Reviewed-by: Benjamin Tissoires <[email protected]> Cc: [email protected] Signed-off-by: Dmitry Torokhov <[email protected]>
2017-01-31Input: delete MPU3050 driverLinus Walleij3-492/+0
The MPU3050 driver in the input subsystem has been superseded by a proper IIO driver found in drivers/iio/gyro/mpu3050*. Patches have been submitted to remove all defconfig and related references to the old driver and replace this input driver with the IIO driver. So delete the input driver. Input was never a good fit for sensors anyway. Signed-off-by: Linus Walleij <[email protected]> Reviewed-by: Heikki Krogerus <[email protected]> Signed-off-by: Dmitry Torokhov <[email protected]>
2017-01-24Merge tag 'v4.10-rc5' into nextDmitry Torokhov6-29/+26
Sync up with mainline to bring up improvements in various subsystems.
2017-01-22Input: dm355evm_keys - drop unnecessary call to input_set_drvdataGuenter Roeck1-2/+0
Since there is no call to dev_get_drvdata() or input_get_drvdata(), the call to input_set_drvdata() is unnecessary and can be dropped. Signed-off-by: Guenter Roeck <[email protected]> Signed-off-by: Dmitry Torokhov <[email protected]>
2017-01-22Input: pwm-beeper - switch to using "atomic" PWM APIDmitry Torokhov1-9/+17
The "atomic" API allows us to configure PWM period and duty cycle and enable it in one call. Reviewed-by: Thierry Reding <[email protected]> Tested-by: David Lechner <[email protected]> Signed-off-by: Dmitry Torokhov <[email protected]>
2017-01-22Input: pwm-beeper - add optional amplifier regulatorDavid Lechner1-13/+50
This adds an optional regulator to the pwm-beeper device. This regulator acts as an amplifier. The amplifier is only enabled while beeping in order to reduce power consumption. Tested on LEGO MINDSTORMS EV3, which has a speaker connected to PWM through an amplifier. Signed-off-by: David Lechner <[email protected]> Acked-by: Rob Herring <[email protected]> Signed-off-by: Dmitry Torokhov <[email protected]>
2017-01-22Input: pwm-beeper - suppress error message on probe deferDavid Lechner1-1/+3
This suppress printing an error message when pwm_get returns -EPROBE_DEFER. Otherwise you get a bunch of noise in the kernel log. Signed-off-by: David Lechner <[email protected]> Reviewed-by: Thierry Reding <[email protected]> Signed-off-by: Dmitry Torokhov <[email protected]>
2017-01-22Input: pwm-beeper - fix race when suspendingDmitry Torokhov1-3/+18
Usually userspace sends SND_BELL and SND_TONE events, and by the time pwm_beeper_suspend() runs userpsace is already frozen, but theoretically in-kernel users may send these events too, and that may cause pwm_beeper_event() scheduling another work after we canceled it. Let's introduce a "suspended" flag and check it in pwm_beeper_event() to avoid this race. Reviewed-by: Thierry Reding <[email protected]> Tested-by: David Lechner <[email protected]> Signed-off-by: Dmitry Torokhov <[email protected]>
2017-01-22Input: pwm-beeper - use input_set_capability()Dmitry Torokhov1-2/+2
Instead of manipulating capability bits directly, let's use input_set_capability() API. Reviewed-by: Thierry Reding <[email protected]> Tested-by: David Lechner <[email protected]> Signed-off-by: Dmitry Torokhov <[email protected]>
2017-01-22Input: pwm-beeper - switch to using managed resourcesDmitry Torokhov1-34/+10
Use of managed resources (devm) simplifies error handling and tear down of the driver. Reviewed-by: Thierry Reding <[email protected]> Tested-by: David Lechner <[email protected]> Signed-off-by: Dmitry Torokhov <[email protected]>
2017-01-22Input: pwm-beeper - remove calls to legacy pwm_request APIDmitry Torokhov1-6/+0
There are no more users of pwm-beeper driver in mainline relying on this legacy API, so let's remove it and simplify the driver code. Acked-by: Thierry Reding <[email protected]> Tested-by: David Lechner <[email protected]> Signed-off-by: Dmitry Torokhov <[email protected]>
2017-01-21Input: misc - drop empty remove functionsGuenter Roeck5-30/+0
Empty remove functions don't serve a useful purpose and can be removed. Signed-off-by: Guenter Roeck <[email protected]> Signed-off-by: Dmitry Torokhov <[email protected]>
2017-01-21Input: misc - drop unnecessary calls to device_init_wakeupGuenter Roeck7-11/+0
Calling device_init_wakeup in the remove function is unnecessary since the device is going away, and thus won't be able to cause any wakeups under any circumstances. Besides, the driver cleanup code already handles the necessary cleanup. Similarly, disabling wakeup in the probe error path is unnecessary, as is disabling wakeup in the probe function in the first place. Signed-off-by: Guenter Roeck <[email protected]> Signed-off-by: Dmitry Torokhov <[email protected]>
2017-01-21Input: misc - use local variables consistentlyGuenter Roeck3-7/+6
If a function declares a variable to access a structure element, use it consistently. Signed-off-by: Guenter Roeck <[email protected]> Signed-off-by: Dmitry Torokhov <[email protected]>
2017-01-21Input: misc - drop calls to platform_set_drvdata and i2c_set_clientdataGuenter Roeck5-6/+0
There is no call to i2c_get_clientdata(), platform_get_drvdata(), or dev_get_drvdata() in any of the drivers in this patch. Signed-off-by: Guenter Roeck <[email protected]> Signed-off-by: Dmitry Torokhov <[email protected]>
2017-01-21Input: soc_button_array - debounce the buttonsHans de Goede1-0/+2
The soc_button_array driver was initializing (kzalloc) the debounce_interval value to 0, leading to no debouncing at all, while the buttons are simple mechanical switches. This commit sets debounce_interval to 50ms to avoid spurious button press reports both on press and release of the button. Note 50ms may seem like a lot but soc_button_array is typically used with cheap tablets, with not so great buttons. I tried 10ms on my tablet and it is not enough, where as 50ms works well. Signed-off-by: Hans de Goede <[email protected]> Signed-off-by: Dmitry Torokhov <[email protected]>
2017-01-18Input: ab8500-ponkey - drop unnecessary call to platform_set_drvdataGuenter Roeck1-1/+0
There is no call to platform_get_drvdata() or dev_get_drvdata(). Drop the unnecessary call to platform_set_drvdata(). Signed-off-by: Guenter Roeck <[email protected]> Signed-off-by: Dmitry Torokhov <[email protected]>
2017-01-18Input: tps65218-pwrbutton - drop unnecessary call to platform_set_drvdataGuenter Roeck1-5/+3
There is no call to platform_get_drvdata() or dev_get_drvdata(). Drop the unnecessary call to platform_set_drvdata(). Also use existing variable 'dev' instead of dereferencing it several times. Signed-off-by: Guenter Roeck <[email protected]> Signed-off-by: Dmitry Torokhov <[email protected]>
2017-01-18Input: soc_button_array - use 'dev' instead of dereferencing itGuenter Roeck1-3/+3
Use local variable 'dev' instead of dereferencing it several times. Signed-off-by: Guenter Roeck <[email protected]> Signed-off-by: Dmitry Torokhov <[email protected]>
2017-01-18Input: mma8450 - drop unnecessary call to i2c_set_clientdataGuenter Roeck1-2/+0
There is no call to i2c_get_clientdata() or dev_get_drvdata(). Drop the unnecessary call to i2c_set_clientdata(). Signed-off-by: Guenter Roeck <[email protected]> Signed-off-by: Dmitry Torokhov <[email protected]>
2017-01-18Input: gpio_decoder - drop unnecessary call to platform_set_drvdataGuenter Roeck1-1/+0
There is no call to platform_get_drvdata() or dev_get_drvdata(). Drop the unnecessary call to platform_set_drvdata(). Signed-off-by: Guenter Roeck <[email protected]> Signed-off-by: Dmitry Torokhov <[email protected]>
2017-01-18Input: bfin_rotary - switch to using devm_add_action_or_reset()Guenter Roeck1-6/+5
Use local variable 'dev' instead of dereferencing it several times and replace devm_add_action() and manual error handling with devm_add_action_or_reset(). Signed-off-by: Guenter Roeck <[email protected]> Signed-off-by: Dmitry Torokhov <[email protected]>
2017-01-13Merge branch 'for-linus' of ↵Linus Torvalds1-3/+1
git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input Pull input updates from Dmitry Torokhov: "Small driver fixups" * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input: Input: elants_i2c - avoid divide by 0 errors on bad touchscreen data Input: adxl34x - make it enumerable in ACPI environment Input: ALPS - fix TrackStick Y axis handling for SS5 hardware Input: synaptics-rmi4 - fix F03 build error when serio is module Input: xpad - use correct product id for x360w controllers Input: synaptics_i2c - change msleep to usleep_range for small msecs Input: i8042 - add Pegatron touchpad to noloop table Input: joydev - remove unused linux/miscdevice.h include
2017-01-03Input: adxl34x - make it enumerable in ACPI environmentAndy Shevchenko1-3/+1
The ACPI-enabled platform may contain _DSD method to enable this driver using compatible string. Remove OF specifics to re-use existing code on ACPI-enabled platforms. Suggested-by: Mika Westerberg <[email protected]> Signed-off-by: Andy Shevchenko <[email protected]> Signed-off-by: Dmitry Torokhov <[email protected]>
2016-12-27Input: bma150 - switch to using usleep_range instead of msleepAniroop Mathur1-2/+2
msleep (1~20) may not do what the caller intends, and will often sleep longer. (~20 ms actual sleep for any value given in the 1~20ms range) This is not the desired behaviour for many cases like device resume time, device suspend time, device enable time, etc. Thus, change msleep to usleep_range for precise wakeups. Signed-off-by: Aniroop Mathur <[email protected]> Acked by: Albert Zhang <[email protected]> Signed-off-by: Dmitry Torokhov <[email protected]>
2016-12-24Replace <asm/uaccess.h> with <linux/uaccess.h> globallyLinus Torvalds1-1/+1
This was entirely automated, using the script by Al: PATT='^[[:blank:]]*#[[:blank:]]*include[[:blank:]]*<asm/uaccess.h>' sed -i -e "s!$PATT!#include <linux/uaccess.h>!" \ $(git grep -l "$PATT"|grep -v ^include/linux/uaccess.h) to do the replacement at the end of the merge window. Requested-by: Al Viro <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>