- 05 Jul, 2021 1 commit
-
-
Alexander Larkin authored
Even though we validate user-provided inputs we then traverse past validated data when applying the new map. The issue was originally discovered by Murray McAllister with this simple POC (if the following is executed by an unprivileged user it will instantly panic the system): int main(void) { int fd, ret; unsigned int buffer[10000]; fd = open("/dev/input/js0", O_RDONLY); if (fd == -1) printf("Error opening file\n"); ret = ioctl(fd, JSIOCSBTNMAP & ~IOCSIZE_MASK, &buffer); printf("%d\n", ret); } The solution is to traverse internal buffer which is guaranteed to only contain valid date when constructing the map. Fixes: 182d679b ("Input: joydev - prevent potential read overflow in ioctl") Fixes: 999b874f ("Input: joydev - validate axis/button maps before clobbering current ones") Reported-by: Murray McAllister <murray.mcallister@gmail.com> Suggested-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Alexander Larkin <avlarkin82@gmail.com> Link: https://lore.kernel.org/r/20210620120030.1513655-1-avlarkin82@gmail.com Cc: stable@vger.kernel.org Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
-
- 20 Jun, 2021 6 commits
-
-
Yizhuo Zhai authored
Inside function hideep_nvm_unlock(), variable "unmask_code" could be uninitialized if hideep_pgm_r_reg() returns error, however, it is used in the later if statement after an "and" operation, which is potentially unsafe. Signed-off-by: Yizhuo <yzhai003@ucr.edu> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
-
YueHaibing authored
Use kobj_to_dev() instead of container_of() Generated by: scripts/coccinelle/api/kobj_to_dev.cocci Signed-off-by: YueHaibing <yuehaibing@huawei.com> Link: https://lore.kernel.org/r/20210607122722.36736-1-yuehaibing@huawei.comSigned-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
-
YueHaibing authored
Use kobj_to_dev() instead of container_of() Generated by: scripts/coccinelle/api/kobj_to_dev.cocci Signed-off-by: YueHaibing <yuehaibing@huawei.com> Link: https://lore.kernel.org/r/20210607122653.33784-1-yuehaibing@huawei.comSigned-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
-
YueHaibing authored
Use kobj_to_dev() instead of container_of() Generated by: scripts/coccinelle/api/kobj_to_dev.cocci Signed-off-by: YueHaibing <yuehaibing@huawei.com> Link: https://lore.kernel.org/r/20210607122451.36708-1-yuehaibing@huawei.comSigned-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
-
YueHaibing authored
Use kobj_to_dev() instead of container_of() Generated by: scripts/coccinelle/api/kobj_to_dev.cocci Signed-off-by: YueHaibing <yuehaibing@huawei.com> Link: https://lore.kernel.org/r/20210607122533.10608-1-yuehaibing@huawei.comSigned-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
-
zhouchuangao authored
Use kobj_to_dev() API instead of container_of(). Signed-off-by: zhouchuangao <zhouchuangao@vivo.com> Reviewed-by: Stephen Boyd <swboyd@chromium.org> Link: https://lore.kernel.org/r/1624025283-56360-1-git-send-email-zhouchuangao@vivo.comSigned-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
-
- 19 Jun, 2021 4 commits
-
-
Geert Uytterhoeven authored
Convert the Sitronix st1232/st1633 touchscreen controller Device Tree binding documentation to json-schema. Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> Reviewed-by: Rob Herring <robh@kernel.org> Acked-by: Martin Kepplinger <martink@posteo.de> Link: https://lore.kernel.org/r/fbba650cff07780c28ad6dd8dbef5cc1451b7762.1623418065.git.geert+renesas@glider.beSigned-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
-
Tyson Moore authored
This trivial patch fixes two spelling typos in i8042.c: - 'i8042_unlock_ship()' to 'i8042_unlock_chip()' - 'i8042_controller init' to 'i8042_controller_init' Signed-off-by: Tyson Moore <tyson@tyson.me> Link: https://lore.kernel.org/r/20210612060753.28968-1-tyson@tyson.meSigned-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
-
Oleh Kravchenko authored
A simple analog joystick built on Low Power ATtiny85 Microcontroller. Directional movements are measured with two 10 kΩ potentiometers connected with a gimbal mechanism that separates the horizontal and vertical movements. This joystick also has a select button that is actuated when the joystick is pressed down. Input events polled over the I2C bus. Product page: https://www.sparkfun.com/products/15168 Firmware and hardware sources: https://github.com/sparkfun/Qwiic_Joystick Tested on RPi4B and O4-iMX-NANO boards. Signed-off-by: Oleh Kravchenko <oleg@kaa.org.ua> Reviewed-by: Jeff LaBundy <jeff@labundy.com> Link: https://lore.kernel.org/r/20210608223130.16830-2-oleg@kaa.org.uaSigned-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
-
Oleh Kravchenko authored
Add vendor prefix for SparkFun Electronics. Update trivial-devices.yaml with SparkFun Qwiic Joystick description. Signed-off-by: Oleh Kravchenko <oleg@kaa.org.ua> Acked-by: Rob Herring <robh@kernel.org> Link: https://lore.kernel.org/r/20210608223130.16830-1-oleg@kaa.org.uaSigned-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
-
- 06 Jun, 2021 7 commits
-
-
Dmitry Torokhov authored
Instead of legacy gpio API let's use newer gpiod API. This also allows us to get rid of platform data. Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Link: https://lore.kernel.org/r/20210603043726.3793876-7-dmitry.torokhov@gmail.comSigned-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
-
Dmitry Torokhov authored
This simplifies error handling paths and allows to get rid of cy8ctmg110_remove() method. Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Link: https://lore.kernel.org/r/20210603043726.3793876-6-dmitry.torokhov@gmail.comSigned-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
-
Dmitry Torokhov authored
Switch to using be16_to_cpup() instead of shifting and combining data by hand. Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Link: https://lore.kernel.org/r/20210603043726.3793876-5-dmitry.torokhov@gmail.comSigned-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
-
Dmitry Torokhov authored
I2C core already configures interrupt as wakeup source when device is registered using I2C_CLIENT_WAKE flag, so let's rely on it instead of configuring it ourselves. Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Link: https://lore.kernel.org/r/20210603043726.3793876-4-dmitry.torokhov@gmail.comSigned-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
-
Dmitry Torokhov authored
Let platform specify whether the controller should be a wakeup source by registering as I2C_CLIENT_WAKE. Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Link: https://lore.kernel.org/r/20210603043726.3793876-3-dmitry.torokhov@gmail.comSigned-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
-
Dmitry Torokhov authored
Rely on the platform to set up interrupt polarity/type properly instead of hard-coding falling edge. Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Link: https://lore.kernel.org/r/20210603043726.3793876-2-dmitry.torokhov@gmail.comSigned-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
-
Dmitry Torokhov authored
Instead of using platform data to specify GPIO that is used as interrupt source, rely on the platform and I2C core to set it up properly. Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Link: https://lore.kernel.org/r/20210603043726.3793876-1-dmitry.torokhov@gmail.comSigned-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
-
- 05 Jun, 2021 1 commit
-
-
Colin Ian King authored
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: 60b7db91 ("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.comSigned-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
-
- 02 Jun, 2021 6 commits
-
-
David Collins authored
On Qualcomm Technologies, Inc. PMIC PMK8350, the PON peripheral is split into two peripherals: PON_HLOS and PON_PBS. The application processor only has write access to PON_HLOS which limits it to only receiving PON interrupts. Add support for the PMK8350 PON_HLOS peripheral so that its KPDPWR_N and RESIN_N interrupts can be used to detect key presses. Signed-off-by: David Collins <collinsd@codeaurora.org> Signed-off-by: satya priya <skakit@codeaurora.org> Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org> Link: https://lore.kernel.org/r/1620630064-16354-2-git-send-email-skakit@codeaurora.orgSigned-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
-
David Collins authored
Add power key and resin compatible strings for the PMK8350 PMIC. These are needed to distinguish key PON_HLOS register differences between PMK8350 and previous PMIC PON modules. Signed-off-by: David Collins <collinsd@codeaurora.org> Signed-off-by: satya priya <skakit@codeaurora.org> Acked-by: Rob Herring <robh@kernel.org> Link: https://lore.kernel.org/r/1620630064-16354-3-git-send-email-skakit@codeaurora.orgSigned-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
-
Stephan Gerhold authored
At the moment, the edt-ft5x06 driver can control a single regulator ("vcc"). However, some FocalTech touch controllers have an additional IOVCC pin that should be supplied with the digital I/O voltage. The I/O voltage might be provided by another regulator that should also be kept on. Otherwise, the touchscreen can randomly stop functioning if the regulator is turned off because no other components still require it. Implement (optional) support for also enabling an "iovcc-supply". The datasheet specifies a delay of ~ 10us before enabling VDD/VCC after IOVCC is enabled, so make sure to enable IOVCC first. Signed-off-by: Stephan Gerhold <stephan@gerhold.net> Link: https://lore.kernel.org/r/20210510193108.50178-2-stephan@gerhold.netSigned-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
-
Stephan Gerhold authored
At the moment, the edt-ft5x06 driver can control a single regulator ("vcc"). However, some FocalTech touch controllers have an additional IOVCC pin that should be supplied with the digital I/O voltage. The I/O voltage might be provided by another regulator that should also be kept on. Otherwise, the touchscreen can randomly stop functioning if the regulator is turned off because no other components still require it. Document (optional) support for controlling the regulator for IOVCC using "iovcc-supply". Acked-by: Rob Herring <robh@kernel.org> Signed-off-by: Stephan Gerhold <stephan@gerhold.net> Link: https://lore.kernel.org/r/20210510193108.50178-1-stephan@gerhold.netSigned-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
-
Dmitry Torokhov authored
There is nothing in include/linux/input/cyttsp.h that might be of interes to the kernel at large, so let's move this information into the driver code and remove the header. Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Link: https://lore.kernel.org/r/20210531052307.1433979-2-dmitry.torokhov@gmail.comSigned-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
-
Dmitry Torokhov authored
Ferruh's email has been bouncing for quite some time ans Linus has agreed to look over the driver. Acked-by: Linus Walleij <linus.walleij@linaro.org> Link: https://lore.kernel.org/r/20210531052307.1433979-1-dmitry.torokhov@gmail.comSigned-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
-
- 01 Jun, 2021 3 commits
-
-
Dmitry Torokhov authored
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.comSigned-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
-
Andy Shevchenko authored
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.comSigned-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
-
Andy Shevchenko authored
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: fb082cd5 ("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.comSigned-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
-
- 31 May, 2021 1 commit
-
-
Dmitry Torokhov authored
Instead of forcing interrupt trigger to be "falling edge" let's rely on the platform to set it up according to how it is set up on a given board based on data in device tree or ACPI tables. Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Link: https://lore.kernel.org/r/YK7iO96g+7yIC0l1@google.comSigned-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
-
- 26 May, 2021 3 commits
-
-
Linus Walleij authored
The CYTTSP TMA340 chips have two supplies: VCPIN and VDD for analog and digital voltage respectively. Add some minimal code to obtain and enable these regulators if need be. Reviewed-by: Javier Martinez Canillas <javier@dowhile0.org> Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Link: https://lore.kernel.org/r/20210526230352.1433537-3-linus.walleij@linaro.orgSigned-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
-
Linus Walleij authored
The driver (both SPI and I2C interface) should probe from the compatible strings, cypress,cy8ctma340 etc when using device tree, not as now, where it is probing implicitly from the I2C/SPI node name "cypress,cyttsp-i2c" etc. Reviewed-by: Javier Martinez Canillas <javier@dowhile0.org> Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Link: https://lore.kernel.org/r/20210526230352.1433537-2-linus.walleij@linaro.orgSigned-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
-
Linus Walleij authored
This converts the CYTTSP "Cypress TrueTouch Standard Product" to YAML bindings and fixes and adds some things in the process: - Rename the bindings file to cypress,cy8ctma340 after the main product in the series. - Add proper compatibles for the two known products: CY8CTMA340 and CY8CTST341. - Deprecate "cypress,cyttsp-spi" and "cypress,cyttsp-i2c" because device compatibles should be named after the hardware and not after which bus they are connected to. The topology implicitly tells us which bus it is and what interface to used. - Add VCPIN and VDD supplies, these are present just like on the CY8CTMA140. Reviewed-by: Rob Herring <robh@kernel.org> Reviewed-by: Javier Martinez Canillas <javier@dowhile0.org> Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Link: https://lore.kernel.org/r/20210526230352.1433537-1-linus.walleij@linaro.orgSigned-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
-
- 25 May, 2021 8 commits
-
-
Oleksij Rempel authored
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.deSigned-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
-
Oleksij Rempel authored
For pressure calculation based on plates resistance we need some additional properties: - z1 and z2 channels with additional measurements between plates - actual resistance of the touchscreen. Currently we use only X-resistance. Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de> Reviewed-by: Rob Herring <robh@kernel.org> Link: https://lore.kernel.org/r/20210525054634.9134-4-o.rempel@pengutronix.deSigned-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
-
Oleksij Rempel authored
To calculate the pressure on a restrictive touchscreen we need to know resistance at least of X plate. Some calculations need to use both X and Y values. So let's add generic properties which can be used by all drivers. Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de> Reviewed-by: Rob Herring <robh@kernel.org> Link: https://lore.kernel.org/r/20210525054634.9134-3-o.rempel@pengutronix.deSigned-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
-
Oleksij Rempel authored
Convert the resistive-adc-touch binding to DT schema format using json-schema. Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de> Reviewed-by: Rob Herring <robh@kernel.org> Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Link: https://lore.kernel.org/r/20210525054634.9134-2-o.rempel@pengutronix.deSigned-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
-
Dmitry Torokhov authored
Sync up with mainline to get the latest device tree bindings and kernel APIs.
-
Shubhankar Kuranagatti authored
Unnecessary spaces have been replaced with tab space. This is done to maintain code uniformity. Signed-off-by: Shubhankar Kuranagatti <shubhankarvk@gmail.com> Link: https://lore.kernel.org/r/20210428091050.ryr7kxlxre7uhye4@kewl-virtual-machineSigned-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
-
Christophe JAILLET authored
This is a left-over from commit 1a59d1b8 ("treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 156") Axe an empty and useless comment block. Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Link: https://lore.kernel.org/r/fda981546203427a0ac86ef47f231239ad18ecfe.1618520227.git.christophe.jaillet@wanadoo.frSigned-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
-
Corentin Labbe authored
trivial-devices.yaml already provide bindings for fsl-mma8450. Since input/fsl-mma8450.txt provides no extra value, lets remove it. Signed-off-by: Corentin Labbe <clabbe@baylibre.com> Reviewed-by: Fabio Estevam <festevam@gmail.com> Link: https://lore.kernel.org/r/20210521192210.12839-1-clabbe@baylibre.comSigned-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
-