summaryrefslogtreecommitdiffstats
path: root/drivers/input/touchscreen/of_touchscreen.c
AgeCommit message (Collapse)AuthorFilesLines
2021-03-25Input: touchscreen - move helper functions to coreJeff LaBundy1-206/+0
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>
2020-03-24Input: of_touchscreen - explicitly choose axisAndy Shevchenko1-18/+17
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>
2019-06-19treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500Thomas Gleixner1-5/+1
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>
2018-10-11Input: of_touchscreen - add support for touchscreen-min-x|yHans de Goede1-8/+28
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>
2018-01-10Input: of_touchscreen - add MODULE_LICENSEArnd Bergmann1-0/+4
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>
2016-07-15Input: of_touchscreen - add support for inverted / swapped axesHans de Goede1-1/+80
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>
2015-07-11Input: of_touchscreen - switch to using device propertiesDmitry Torokhov1-26/+30
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>
2015-07-11Input: of_touchscreen - fix setting max values on X/Y axisDmitry Torokhov1-4/+6
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>
2015-07-11Input: of_touchscreen - always issue warning if axis is not set upDmitry Torokhov1-7/+3
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>
2015-06-25Input: improve parsing OF parameters for touchscreensDmitry Torokhov1-25/+44
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>
2015-03-24Input: of_touchscreen - register multitouch axesMaxime Ripard1-5/+17
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>
2015-03-24Input: of_touchscreen - rework the DT parsing functionMaxime Ripard1-10/+40
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>
2014-05-29Input: add common DT binding for touchscreensSebastian Reichel1-0/+45
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>