History log of /linux-master/drivers/input/touchscreen/resistive-adc-touch.c
Revision Date Author Comments
# 17d981fa 25-Jun-2023 Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>

Input: resistive-adc-touch - simplify with dev_err_probe()

Common pattern of handling deferred probe can be simplified with
dev_err_probe(). Less code and also it prints the error value.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Link: https://lore.kernel.org/r/20230625162817.100397-18-krzysztof.kozlowski@linaro.org
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>


# fe0a7e3d 15-Oct-2021 Oleksij Rempel <linux@rempel-privat.de>

Input: resistive-adc-touch - fix division by zero error on z1 == 0

For proper pressure calculation we need at least x and z1 to be non
zero. Even worse, in case z1 we may run in to division by zero
error.

Fixes: 60b7db914ddd ("Input: resistive-adc-touch - rework mapping of channels")
Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
Link: https://lore.kernel.org/r/20211007095727.29579-1-o.rempel@pengutronix.de
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>


# 6cdc1ef8 05-Jun-2021 Colin Ian King <colin.king@canonical.com>

Input: resistive-adc-touch - fix uninitialized variable 'press'

In the case where st->ch_map[GRTS_CH_PRESSURE] < GRTS_MAX_CHANNELS is false
and also st->ch_map[GRTS_CH_Z1] < GRTS_MAX_CHANNELS is false the variable
press is not initialized and contains garbage. In this situation
st->pressure is also false, so we do not actually use press value, but
it is impossible for the compiler to realize this, and it emits
"uninitialized variable" warning. Fix this by initializing press
to 0 and allows us to also remove an else clause that sets press to 0.

Addresses-Coverity: ("Uninitialized scalar variable")
Fixes: 60b7db914ddd ("Input: resistive-adc-touch - rework mapping of channels")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Link: https://lore.kernel.org/r/20210603220809.155118-1-colin.king@canonical.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>


# 60b7db91 01-Jun-2021 Dmitry Torokhov <dmitry.torokhov@gmail.com>

Input: resistive-adc-touch - rework mapping of channels

Instead of iterating over channels establish and use channel map to
retrieve data. As a side effect this will silence "uninitialized variable"
warnings.

Tested-by: Oleksij Rempel <o.rempel@pengutronix.de>
Link: https://lore.kernel.org/r/YLXR2brkc4H54xtK@google.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>


# 08729298 30-May-2021 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

Input: resistive-adc-touch - replace OF headers with proper ones

The driver is actually OF independent and doesn't need anything from OF (*).
Replace OF headers with mod_devicetable.h and property.h.

*) use of of_match_ptr() is actually wrong here, since it may provoke
a compiler to warn about unused variable.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20210528151113.85943-2-andriy.shevchenko@linux.intel.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>


# 02e28cf7 30-May-2021 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

Input: resistive-adc-touch - describe parameters in kernel doc

Validation script is not happy:

resistive-adc-touch.c:53: warning: Function parameter or member 'x_plate_ohms' not described in 'grts_state'
resistive-adc-touch.c:53: warning: Function parameter or member 'ch' not described in 'grts_state'

Describe parameters in kernel doc to make it happy.

Fixes: fb082cd59afa ("Input: resistive-adc-touch - add support for z1 and z2 channels")
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20210528151113.85943-1-andriy.shevchenko@linux.intel.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>


# fb082cd5 25-May-2021 Oleksij Rempel <linux@rempel-privat.de>

Input: resistive-adc-touch - add support for z1 and z2 channels

This patch adds support for the z1 and z2 channels. These are used to
calculate the applied pressure. As there is no common order of the
individual channels of a resistive touch ADC, support for
io-channel-names is added (although the DT bindings stated the driver
already supports these).

Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Link: https://lore.kernel.org/r/20210525054634.9134-5-o.rempel@pengutronix.de
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>


# 136feb4c 08-Nov-2020 Lee Jones <lee.jones@linaro.org>

Input: resistive-adc-touch - struct headers should start with 'struct <name>'

Fixes the following W=1 kernel build warning(s):

drivers/input/touchscreen/resistive-adc-touch.c:34: warning: cannot understand function prototype: 'struct grts_state '

Signed-off-by: Lee Jones <lee.jones@linaro.org>
Link: https://lore.kernel.org/r/20201104162427.2984742-10-lee.jones@linaro.org
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>


# aa132ffb 22-May-2018 Eugen Hristev <eugen.hristev@microchip.com>

input: touchscreen: resistive-adc-touch: add generic resistive ADC touchscreen

This adds a generic resistive touchscreen (GRTS) driver, which is based
on an IIO device (an ADC). It must be connected to the channels of an ADC
to receive touch data. Then it will feed the data into the input subsystem
where it registers an input device.
It uses an IIO callback buffer to register to the IIO device

Some parts of this patch are based on initial original work by
Mohamed Jamsheeth Hajanajubudeen and Bandaru Venkateswara Swamy

Signed-off-by: Eugen Hristev <eugen.hristev@microchip.com>
Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>