- Oct 16, 2021
-
-
Nathan Chancellor authored
A new warning in clang points out a few places in this driver where a bitwise OR is being used with boolean types: drivers/input/touchscreen.c:81:17: warning: use of bitwise '|' with boolean operands [-Wbitwise-instead-of-logical] data_present = touchscreen_get_prop_u32(dev, "touchscreen-min-x", ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ This use of a bitwise OR is intentional, as bitwise operations do not short circuit, which allows all the calls to touchscreen_get_prop_u32() to happen so that the last parameter is initialized while coalescing the results of the calls to make a decision after they are all evaluated. To make this clearer to the compiler, use the '|=' operator to assign the result of each touchscreen_get_prop_u32() call to data_present, which keeps the meaning of the code the same but makes it obvious that every one of these calls is expected to happen. Signed-off-by:
Nathan Chancellor <nathan@kernel.org> Reported-by:
Nick Desaulniers <ndesaulniers@google.com> Reviewed-by:
Nick Desaulniers <ndesaulniers@google.com> Link: https://lore.kernel.org/r/20211014205757.3474635-1-nathan@kernel.org Signed-off-by:
Dmitry Torokhov <dmitry.torokhov@gmail.com>
-
- Mar 25, 2021
-
-
Jeff LaBundy authored
Now that the helper functions have been moved to drivers/input/ so that all input devices may use them, the introductory comments can be updated to remove any implication that the helper functions are solely limited to touchscreens. This patch also scrubs any remaining use of 'DT' since there isn't any actual dependency on OF. A minor spelling error is resolved as well ('setups' -> 'sets up'). Signed-off-by:
Jeff LaBundy <jeff@labundy.com> Link: https://lore.kernel.org/r/20210301234928.4298-3-jeff@labundy.com Signed-off-by:
Dmitry Torokhov <dmitry.torokhov@gmail.com>
-
Jeff LaBundy authored
Some devices outside of drivers/input/touchscreen/ can still make use of the touchscreen helper functions. Therefore, it was agreed in [1] to move them outside of drivers/input/touchscreen/ so that other devices can call them without INPUT_TOUCHSCREEN being set. As part of this change, 'of' is dropped from the filename because the helpers no longer actually use OF. No changes are made to the file contents whatsoever. Based on the feedback in [2], the corresponding binding documents (touchscreen.yaml and touchscreen.txt) are left in their original locations. [1] https://patchwork.kernel.org/patch/11924029/ [2] https://patchwork.kernel.org/patch/12042037/ Signed-off-by:
Jeff LaBundy <jeff@labundy.com> Link: https://lore.kernel.org/r/20210301234928.4298-2-jeff@labundy.com Signed-off-by:
Dmitry Torokhov <dmitry.torokhov@gmail.com>
-
- Mar 24, 2020
-
-
Andy Shevchenko authored
The 'axis + 1' calculation is implicit and potentially error prone. Moreover, few lines before the axis is set explicitly for both X and Y. Do the same when retrieving different properties for X and Y. Signed-off-by:
Andy Shevchenko <andriy.shevchenko@linux.intel.com> Link: https://lore.kernel.org/r/20200303180917.12563-1-andriy.shevchenko@linux.intel.com Signed-off-by:
Dmitry Torokhov <dmitry.torokhov@gmail.com>
-
- Jun 19, 2019
-
-
Thomas Gleixner authored
Based on 2 normalized pattern(s): this program is free software you can redistribute it and or modify it under the terms of the gnu general public license version 2 as published by the free software foundation this program is free software you can redistribute it and or modify it under the terms of the gnu general public license version 2 as published by the free software foundation # extracted by the scancode license scanner the SPDX license identifier GPL-2.0-only has been chosen to replace the boilerplate/reference in 4122 file(s). Signed-off-by:
Thomas Gleixner <tglx@linutronix.de> Reviewed-by:
Enrico Weigelt <info@metux.net> Reviewed-by:
Kate Stewart <kstewart@linuxfoundation.org> Reviewed-by:
Allison Randal <allison@lohutok.net> Cc: linux-spdx@vger.kernel.org Link: https://lkml.kernel.org/r/20190604081206.933168790@linutronix.de Signed-off-by:
Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
- Oct 12, 2018
-
-
Hans de Goede authored
Some touchscreens, depending on the firmware and/or the digitizer, report coordinates which never reach 0 along one or both of their axis. This has been seen for example on the Silead touchscreens on a Onda V891w and a Point of View mobii TAB-P800w(v2.0). This commit adds support for touchscreen-min-x and touchscreen-min-y device-properties which can be set to communicate the actual start coordinates (rather then 0,0) to userspace. This commit also drop the "(in pixels)" comment from the documentation of the touchscreen-size-x and touchscreen-size-y properties. The comment suggested that there is a relation between the range of reported coordinates and the display resolution, which is only true for some devices. The "(in pixels)" comment is replaced with "(maximum x coordinate reported + 1)" to mirror the language describing the new touchscreen-min-x and -min-y properties. When set this fixes e.g. not being able to click things in the GNOME3 top-bar on the 2 example tablets. Signed-off-by:
Hans de Goede <hdegoede@redhat.com> Reviewed-by:
Rob Herring <robh@kernel.org> Signed-off-by:
Dmitry Torokhov <dmitry.torokhov@gmail.com>
-
- Jan 11, 2018
-
-
Arnd Bergmann authored
The lack of the MODULE_LICENSE tag can lead to a warning here: WARNING: modpost: missing MODULE_LICENSE() in drivers/input/touchscreen/of_touchscreen.o I'm adding a license and description tag, but no MODULE_AUTHOR() as this file is a collection of standalone helper functions that were all added by different developers. Signed-off-by:
Arnd Bergmann <arnd@arndb.de> Signed-off-by:
Dmitry Torokhov <dmitry.torokhov@gmail.com>
-
- Jul 15, 2016
-
-
Hans de Goede authored
Extend touchscreen_parse_properties() with support for the touchscreen-inverted-x/y and touchscreen-swapped-x-y properties and add touchscreen_set_mt_pos() and touchscreen_report_pos() helper functions for storing coordinates into a input_mt_pos struct, or directly reporting them, taking these properties into account. This commit also modifies the existing callers of touchscreen_parse_properties() to pass in NULL for the new third argument, keeping the existing behavior. Signed-off-by:
Hans de Goede <hdegoede@redhat.com> Signed-off-by:
Dmitry Torokhov <dmitry.torokhov@gmail.com>
-
- Jul 12, 2015
-
-
Dmitry Torokhov authored
Let's switch form OF to device properties so that common parsing code could work not only on device tree but also on ACPI-based platforms. Reviewed-by:
Roger Quadros <rogerq@ti.com> Signed-off-by:
Dmitry Torokhov <dmitry.torokhov@gmail.com>
-
Dmitry Torokhov authored
The binding specification says that "touchscreen-size-x" and "-y" specify horizontal and vertical resolution of the touchscreen and therefore maximum absolute coordinates should be reduced by 1 since we are starting with 0. Reviewed-by:
Roger Quadros <rogerq@ti.com> Signed-off-by:
Dmitry Torokhov <dmitry.torokhov@gmail.com>
-
Dmitry Torokhov authored
Do issue warning about axis that is present in device tree but not specified by the driver even in case of multi-touch axis as callers now tell us if they expect multi-touch data or not. Reviewed-by:
Roger Quadros <rogerq@ti.com> Signed-off-by:
Dmitry Torokhov <dmitry.torokhov@gmail.com>
-
- Jun 25, 2015
-
-
Dmitry Torokhov authored
When applying touchscreen parameters specified in device tree let's make sure we keep whatever setup was done by the driver and not reset the missing values to zero. Reported-by:
Pavel Machek <pavel@ucw.cz> Tested-by:
Pavel Machek <pavel@ucw.cz> Signed-off-by:
Dmitry Torokhov <dmitry.torokhov@gmail.com>
-
- Mar 24, 2015
-
-
Maxime Ripard authored
So far, the DT parsing code was only setting up the regular input axes, completely ignoring their multitouch counter parts. Fill them with the same parameters than the regular axes. Signed-off-by:
Maxime Ripard <maxime.ripard@free-electrons.com> Signed-off-by:
Dmitry Torokhov <dmitry.torokhov@gmail.com>
-
Maxime Ripard authored
The DT parsing function currently duplicates a lot of the code to parse the touchscreen DT properties. In order to ease further additions to this parsing routine, rework it slightly to create new helper functions. Signed-off-by:
Maxime Ripard <maxime.ripard@free-electrons.com> Signed-off-by:
Dmitry Torokhov <dmitry.torokhov@gmail.com>
-
- May 29, 2014
-
-
Sebastian Reichel authored
Add common DT binding documentation for touchscreen devices and implement input_parse_touchscreen_of_params, which parses the common properties and configures the input device accordingly. The method currently does not interpret the axis inversion properties, since there is no matching flag in the generic linux input device. Reviewed-by:
Pavel Machek <pavel@ucw.cz> Acked-by:
Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by:
Sebastian Reichel <sre@kernel.org> Signed-off-by:
Dmitry Torokhov <dmitry.torokhov@gmail.com>
-