summaryrefslogtreecommitdiff
path: root/drivers/input/keyboard/cap11xx.c
AgeCommit message (Collapse)Author
2023-12-12Input: cap11xx - convert to use maple tree register cacheMark Brown
The maple tree register cache is based on a much more modern data structure than the rbtree cache and makes optimisation choices which are probably more appropriate for modern systems than those made by the rbtree cache. Signed-off-by: Mark Brown <broonie@kernel.org> Link: https://lore.kernel.org/r/20231001-input-maple-v1-2-ed3716051431@kernel.org Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2023-12-12Input: cap11xx - cache hardware ID registersMark Brown
The cap11xx devices have three hardware identification registers which are currently marked as volatile, preventing caching of those registers. This is not ideal since the registers should never change at runtime, we should be able to cache the value after the first read. Stop marking the registers as volatile, we don't have register defaults specified in the driver so this will result in reading from the hardware on first use. Signed-off-by: Mark Brown <broonie@kernel.org> Link: https://lore.kernel.org/r/20231001-input-maple-v1-1-ed3716051431@kernel.org Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2023-12-12Input: cap11xx - add advanced sensitivity settingsJiri Valek - 2N
Add support for advanced sensitivity settings that allows more precise tunig of touch buttons. Input-treshold allows to set the sensitivity for each channel separately. Also add signal guard feature for CAP129x chips. Signed-off-by: Jiri Valek - 2N <jiriv@axis.com> Link: https://lore.kernel.org/r/20231121155250.613242-3-jiriv@axis.com Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2023-11-17Input: cap11xx - remove unnecessary IRQ parsingJiri Valek - 2N
Separate IRQ parsing is not necessary, I2C core do the job. Signed-off-by: Jiri Valek - 2N <jiriv@axis.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2023-05-17Input: Switch i2c drivers back to use .probe()Uwe Kleine-König
After commit b8a1a4cd5a98 ("i2c: Provide a temporary .probe_new() call-back type"), all drivers being converted to .probe_new() and then 03c835f498b5 ("i2c: Switch .probe() to not take an id parameter") convert back to (the new) .probe() to be able to eventually drop .probe_new() from struct i2c_driver. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Link: https://lore.kernel.org/r/20230517164645.162294-1-u.kleine-koenig@pengutronix.de Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2023-02-03Input: cap11xx - add support for cap1203, cap1293 and cap1298Jiri Valek - 2N
Add basic support for more CAP1xxx sensors. All models from CAP1xxx family are register-compatible. Some advanced features are not used and disabled by default. Reported-by: kernel test robot <lkp@xxxxxxxxx> Signed-off-by: Jiri Valek - 2N <jiriv@axis.com> Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com> Link: https://lore.kernel.org/r/20230111131111.475270-3-jiriv@axis.com Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2022-12-02Input: cap11xx - Convert to i2c's .probe_new()Uwe Kleine-König
.probe_new() doesn't get the i2c_device_id * parameter, so determine that explicitly in the probe function. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Link: https://lore.kernel.org/r/20221118224540.619276-195-uwe@kleine-koenig.org Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2021-11-02Input: cap11xx - add support for cap1206Jesse Taube
According to the datasheet "The CAP1206 is pin- and register-compatible with the CAP1106, with the exception of the GAIN[1:0] bits and ALT_POL bit"(57). So, this patch aims to disable them as they are no longer used. Signed-off-by: Jesse Taube <mr.bossman075@gmail.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2019-06-19treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500Thomas Gleixner
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>
2019-02-09Input: cap11xx - switch to using set_brightness_blocking()Dmitry Torokhov
Updating LED state requires access to regmap and therefore we may sleep, so we could not do that directly form set_brightness() method. Historically we used private work to adjust the brightness, but with the introduction of set_brightness_blocking() we no longer need it. As a bonus, not having our own work item means we do not have use-after-free issue as we neglected to cancel outstanding work on driver unbind. Reported-by: Sven Van Asbroeck <thesven73@gmail.com> Reviewed-by: Sven Van Asbroeck <TheSven73@googlemail.com> Acked-by: Jacek Anaszewski <jacek.anaszewski@gmail.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2018-06-06treewide: Use struct_size() for devm_kmalloc() and friendsKees Cook
Replaces open-coded struct size calculations with struct_size() for devm_*, f2fs_*, and sock_* allocations. Automatically generated (and manually adjusted) from the following Coccinelle script: // Direct reference to struct field. @@ identifier alloc =~ "devm_kmalloc|devm_kzalloc|sock_kmalloc|f2fs_kmalloc|f2fs_kzalloc"; expression HANDLE; expression GFP; identifier VAR, ELEMENT; expression COUNT; @@ - alloc(HANDLE, sizeof(*VAR) + COUNT * sizeof(*VAR->ELEMENT), GFP) + alloc(HANDLE, struct_size(VAR, ELEMENT, COUNT), GFP) // mr = kzalloc(sizeof(*mr) + m * sizeof(mr->map[0]), GFP_KERNEL); @@ identifier alloc =~ "devm_kmalloc|devm_kzalloc|sock_kmalloc|f2fs_kmalloc|f2fs_kzalloc"; expression HANDLE; expression GFP; identifier VAR, ELEMENT; expression COUNT; @@ - alloc(HANDLE, sizeof(*VAR) + COUNT * sizeof(VAR->ELEMENT[0]), GFP) + alloc(HANDLE, struct_size(VAR, ELEMENT, COUNT), GFP) // Same pattern, but can't trivially locate the trailing element name, // or variable name. @@ identifier alloc =~ "devm_kmalloc|devm_kzalloc|sock_kmalloc|f2fs_kmalloc|f2fs_kzalloc"; expression HANDLE; expression GFP; expression SOMETHING, COUNT, ELEMENT; @@ - alloc(HANDLE, sizeof(SOMETHING) + COUNT * sizeof(ELEMENT), GFP) + alloc(HANDLE, CHECKME_struct_size(&SOMETHING, ELEMENT, COUNT), GFP) Signed-off-by: Kees Cook <keescook@chromium.org>
2017-01-21Input: keyboard - drop calls to platform_set_drvdata and i2c_set_clientdataGuenter Roeck
There is no call to i2c_get_clientdata(), platform_get_drvdata(), or dev_get_drvdata() in any of the drivers in this patch. Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2016-01-27Input: cap11xx - add missing of_node_putAmitoj Kaur Chawla
for_each_child_of_node performs an of_node_get on each iteration, so to break out of the loop an of_node_put is required. Found using Coccinelle. Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2015-08-16Input: cap11xx - add LED supportMatt Ranostay
Several cap11xx variants have LEDs that be can be controlled; let's plug the driver into the LED subsystem. Signed-off-by: Matt Ranostay <mranostay@gmail.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2015-07-17Input: drop owner assignment from i2c_driverKrzysztof Kozlowski
i2c_driver does not need to set an owner because i2c_register_driver() will set it. Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2015-02-01Input: cap11xx - remove wrong and unneeded cap11xx modaliasAxel Lin
This is a I2C driver, so it's wrong to use platform prefix for the modalias. We have all needed i2c aliases coming form MODULE_DEVICE_TABLE, so let's remove the wrong and unneeded cap11xx modalias. Signed-off-by: Axel Lin <axel.lin@ingics.com> Acked-by: Daniel Mack <linux@zonque.org> Reviewed-by: Matt Ranostay <mranostay@gmail.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2014-11-02Input: cap11xx - support for irq-active-high optionMatt Ranostay
Some applications need to use the irq-active-high push-pull option. This allows it be enabled in the device tree child node. Signed-off-by: Matt Ranostay <mranostay@gmail.com> Reviewed-by: Daniel Mack <daniel@zonque.org> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2014-11-02Input: cap11xx - add support for various cap11xx devicesMatt Ranostay
There are variants of the cap11xx device with a varying number of capacitance detection channels. Signed-off-by: Matt Ranostay <mranostay@gmail.com> Reviewed-by: Daniel Mack <daniel@zonque.org> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2014-11-02Input: rename cap1106 driver to cap11xxMatt Ranostay
There are several devices in cap11xx family besides cap1106. The driver can be made to support all of them, so let's give it more generic name. Signed-off-by: Matt Ranostay <mranostay@gmail.com> Reviewed-by: Daniel Mack <daniel@zonque.org> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>