Age | Commit message (Collapse) | Author |
|
There is no need to tread the same register twice in a row.
Fixes: ea4348c8462a ("Input: tca8418_keypad - hide gcc-4.9 -Wmaybe-un ...")
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
|
|
Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
|
|
Using regmap this is no longer required.
Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
|
|
Up until now only platforms using legacy platform data were able to switch
AUX/VBAT/GPIO pin in GPIO mode and use it as regular GPIO line. Let's
allow platforms using generic device properties to do the same.
Reviewed-by: Michael Hennerich <michael.hennerich@analog.com>
Tested-by: Michael Hennerich <michael.hennerich@analog.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
|
|
gpiochip_add now has a managed version, and we can remove sysfs attribute
group via devm_add_action_or_reset (at least until we have devm version of
sysfs_create_group). This allows us to get rid of ad7879_remove().
Reviewed-by: Michael Hennerich <michael.hennerich@analog.com>
Tested-by: Michael Hennerich <michael.hennerich@analog.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
|
|
Instead of rolling our own infrastructure to provide uniform access to I2C
and SPI buses, let's switch to using regmap.
Reviewed-by: Michael Hennerich <michael.hennerich@analog.com>
Tested-by: Michael Hennerich <michael.hennerich@analog.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
|
|
The I2C core always reports a MODALIAS of the form i2c:<foo> even if the
device was registered via OF, this means that exporting the OF device ID
table device aliases in the module is not needed. But in order to change
how the core reports modaliases to user-space, it's better to export it.
Before this patch:
$ modinfo drivers/input/touchscreen/zet6223.ko | grep alias
alias: i2c:zet6223
After this patch:
$ modinfo drivers/input/touchscreen/zet6223.ko | grep alias
alias: of:N*T*Czeitec,zet6223C*
alias: of:N*T*Czeitec,zet6223
alias: i2c:zet6223
Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
|
|
git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd into next
Merge in cros-ec changes applied through MFD branch to resolve
conflicts.
|
|
Add switch to report tablet mode.
Signed-off-by: Gwendal Grignou <gwendal@chromium.org>
Signed-off-by: Enric Balletbo Serra <enric.balletbo@collabora.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
|
|
Instead of supporting legacy platform data (of which we have no mainline
users) and OF-based properties, let's switch to generic device properties.
This will still allow legacy boards to use the driver (by defining property
sets and attaching them to the drivers) and will simplify probe and make
driver usable on ACPI-based systems as well.
Reviewed-By: Sebastian Reichel <sre@kernel.org>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
|
|
In case of an optional regulator missing, regulator core will return
ERR_PTR(-ENOENT) and not NULL, so the check for missing regulator is
incorrect. Also, the regulator is not optional, it may simply be missing
from platform description, so let's use devm_regulator_get() and rely on
regulator core to give us dummy supply when real one is not available.
Fixes: d257f2980feb ("Input: tsc2005 - convert to gpiod")
Acked-By: Sebastian Reichel <sre@kernel.org>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
|
|
To be prepared for SPI module loading using full compatible strings from
device tree, let's add OF module device table data.
Reviewed-By: Sebastian Reichel <sre@kernel.org>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
|
|
This is a basic driver for the Zeitec ZET6223 I2C touchscreen
controllers. The driver does not support firmware loading, which is not
required for all tablets which contain this chip.
Signed-off-by: Jelle van der Waa <jelle@vdwaa.nl>
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
|
|
Postpone axis initialization to the first open instead of doing it
in joydev_connect. This is to make sure the generated startup events
are representative of the current joystick state rather than what
it was when joydev_connect() was called, potentially much earlier.
Once the first user is connected to joydev node we'll be updating
joydev->abs[] values and subsequent clients will be getting correct
initial states as well.
This solves issues with joystick driven menus that start scrolling
up each time they are started, until the user moves the joystick to
generate events. In emulator menu setups where the menu program is
restarted every time the game exits, the repeated need to move the
joystick to stop the unintended scrolling gets old rather quickly...
Signed-off-by: Raphael Assenat <raph@raphnet.net>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
|
|
On the latest series of ThinkPads, the button events for the TrackPoint
are reported through the touchpad itself as opposed to the TrackPoint
device. In order to report these buttons properly, we need to forward
them to the TrackPoint device and notify psmouse to send the button
presses/releases.
Signed-off-by: Lyude Paul <thatslyude@gmail.com>
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
|
|
This patch does several cleanup changes to F30 code
- switch to using BIT() macro
- use DIV_ROUND_UP() where appropriate
- factor out code setting up and reporting buttons
- use single loop when reporting buttons: arithmetic is cheap compared to
conditionals and associated branch misprediction.
Tested-By: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
|
|
Instead of using custom method of "passing" extended buttons from the
touchpad to trackstick, let's switch to the newly introduced SERIO_OOB_DATA
channel.
Tested-By: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
|
|
The tracksticks on the Lenovo thinkpads have their buttons connected
through the touchpad device. We already fixed that in synaptics.c, but
when we switch the device into RMI4 mode to have proper support, the
pass-through functionality can't deal with them easily.
We add a new PS/2 flag and protocol designed for psmouse. The RMI4 F03
pass-through can then emit a special set of commands to notify psmouse the
state of the buttons.
This patch implements the protocol in psmouse, while an other will
do the same for rmi4-f03.
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
|
|
On some newer boards using mkbp we're hooking up non-matrix buttons and
switches to the EC but NOT to the main application processor.
Let's add kernel support to handle this. Rather than creating a whole
new input driver, we'll continue to use cros_ec_keyb and just report the
new keys.
Signed-off-by: Douglas Anderson <dianders@chromium.org>
Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
|
|
Fix to return error code -ENOMEM from the devm_kzalloc() error handling
case instead of 0, as done elsewhere in this function.
Fixes: 6bd0dcfacf28 ("Input: synaptics-rmi4 - factor out functions
from probe")
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
|
|
Set the LED_CORE_SUSPENDRESUME flag on our LED device so the
LED state will be automatically restored by LED core on resume.
Since Xbox One pads stop flashing only when reinitialized, we'll
send them the initialization packet so they calm down too.
Signed-off-by: Cameron Gutman <aicommander@gmail.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
|
|
Bring in latest RMI4 support in preparation to the merge window.
|
|
If a function needs to communicate with an other, it's better to have
a way to retrieve this other.
Reviewed-by: Andrew Duggan <aduggan@synaptics.com>
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
|
|
The Xbox One S requires an ack to its mode button report, otherwise it
continuously retransmits the report. This makes the mode button appear to
be stuck down after it is pressed for the first time.
Signed-off-by: Cameron Gutman <aicommander@gmail.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
|
|
We have a nice macro ensuring that the value is within certain range, let's
use it instead of open-coding.
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
|
|
If device is supposed to send absolute events (i.e. EV_ABS bit is set in
dev->evbit) but dev->absinfo is not allocated, then the driver has done
something wrong, and we should not register such device. Otherwise we'll
crash later, when driver tries to send absolute event.
Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Acked-by: Jiri Kosina <jkosina@suse.cz>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
|
|
These attributes provide various bits of information which may be enumerated
under the RMI4 protocol to user space.
This may be useful for displaying the particular version which is in use, or
selecting the correct firmware to flash.
Signed-off-by: Nick Dyer <nick@shmanahar.org>
Tested-by: Chris Healy <cphealy@gmail.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
|
|
The attribute returns the percentage complete. If the firmware update fails, it
reports a negative error code.
Signed-off-by: Nick Dyer <nick@shmanahar.org>
Tested-by: Chris Healy <cphealy@gmail.com>
Acked-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
|
|
Evdev interface has been available for many years and by now everyone
is switched to using it, so let's stop offering /dev/input/mouseN
and /dev/psaux by default.
Acked-by: Jiri Kosina <jkosina@suse.cz>
Acked-by: Peter Hutterer <peter.hutterer@who-t.net>
Acked-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
|
|
Let's drop legacy platform data support (there are no users in mainline)
and switch to using generic device properties, which will make the driver
simpler (non-OF boards can use property sets to describe hardware).
Reviewed-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
|
|
Instead of being OF-specific, let's switch to using generic device
properties, which will make this code usable on ACPI, device tree and
legacy boards that use property sets.
As part of the change let's rename matrix_keypad_parse_of_params() to
matrix_keypad_parse_properties().
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
|
|
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 <linus.walleij@linaro.org>
Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
|
|
Declare device_type structures as const as they are only stored in the
type field of a device structure. This field is of type const, so add
const to declaration of device_type structures.
File size before:
text data bss dec hex filename
17184 1344 80 18608 48b0 drivers/input/input.o
File size after:
text data bss dec hex filename
17248 1280 80 18608 48b0 drivers/input/input.o
File size before:
text data bss dec hex filename
2355 384 8 2747 abb drivers/input/rmi4/rmi_bus.o
File size after:
text data bss dec hex filename
2483 264 8 2755 ac3 drivers/input/rmi4/rmi_bus.o
Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
|
|
Sync up with mainline to bring up improvements in various subsystems.
|
|
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 <linux@roeck-us.net>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
|
|
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 <linux@roeck-us.net>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
|
|
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 <linux@roeck-us.net>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
|
|
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 <linux@roeck-us.net>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
|
|
If 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 <linux@roeck-us.net>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
|
|
This can happen in cases like bug #102951[1], so add a proper debug msg
as done in wait_read. Also, change wait_read debug message to differ from
wait_write.
[1] https://bugzilla.kernel.org/show_bug.cgi?id=102951
Signed-off-by: Marcos Paulo de Souza <marcos.souza.org@gmail.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
|
|
Nobody calls input_get_drvdata() so setting it is not required.
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
|
|
The "atomic" API allows us to configure PWM period and duty cycle and
enable it in one call.
Reviewed-by: Thierry Reding <thierry.reding@gmail.com>
Tested-by: David Lechner <david@lechnology.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
|
|
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 <david@lechnology.com>
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
|
|
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 <david@lechnology.com>
Reviewed-by: Thierry Reding <thierry.reding@gmail.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
|
|
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 <thierry.reding@gmail.com>
Tested-by: David Lechner <david@lechnology.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
|
|
Instead of manipulating capability bits directly, let's use
input_set_capability() API.
Reviewed-by: Thierry Reding <thierry.reding@gmail.com>
Tested-by: David Lechner <david@lechnology.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
|
|
Use of managed resources (devm) simplifies error handling and tear down
of the driver.
Reviewed-by: Thierry Reding <thierry.reding@gmail.com>
Tested-by: David Lechner <david@lechnology.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
|
|
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 <thierry.reding@gmail.com>
Tested-by: David Lechner <david@lechnology.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
|
|
If a function declares a variable to access a structure element,
use it conssistently.
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
|
|
Empty remove functions don't serve a useful purpose and can be removed.
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
|