aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input/touchscreen/ads7846.c (follow)
AgeCommit message (Collapse)AuthorFilesLines
2019-08-09Input: ads7846 - add support for general touchscreen bindingsMarco Felsch1-8/+30
A few vendor specific bindings are now covered by common bindings. Let the driver parse the common bindings to make use of common inverting and swapping mechnism. Aslo make use of touchscreen_report_pos() to ensure the correct inverting-swapping order. The vendor specific properties are used as default (backward compatibility) and gets overwritten by common bindings. Signed-off-by: Marco Felsch <m.felsch@pengutronix.de> Reviewed-by: Rob Herring <robh@kernel.org> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2019-06-19treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500Thomas Gleixner1-4/+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>
2017-07-12Input: ads7846 - constify attribute_group structuresArvind Yadav1-2/+2
attribute_groups are not supposed to change at runtime. All functions working with attribute_groups provided by <linux/sysfs.h> work with const attribute_group. So mark the non-const structs as const. File size before: text data bss dec hex filename 9086 624 0 9710 25ee drivers/input/touchscreen/ads7846.o File size After adding 'const': text data bss dec hex filename 9198 496 0 9694 25de drivers/input/touchscreen/ads7846.o Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2017-03-25Input: ads7846 - avoid pen up/down when reading hwmonDavid Jander1-1/+1
Each time the HWMON devices are read (e.g. battery voltage) while the touchscreen is held pressed, extra pen-up and pen-down events are generated. This is fixed by avoiding the UP event when the touchscreen is stopped. Signed-off-by: David Jander <david@protonic.nl> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2017-01-21Input: touchscreen - drop unnecessary calls to device_init_wakeupGuenter Roeck1-2/+0
Calling device_init_wakeup in the remove function is unnecessary since the device is going away, and thus won't be able to cause any wakeups under any circumstances. Besides, the driver cleanup code already handles the necessary cleanup. Similarly, disabling wakeup in the probe error path is unnecessary, as is disabling wakeup in the probe function in the first place. Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2016-08-22Input: ads7846 - remove redundant regulator_disable callPetr Cvek1-1/+0
ADS7846 regulator is disabled twice in a row in ads7846_remove(). Valid one is in ads7846_disable(). Removing the ads7846 module causes warning about unbalanced disables. ... WARNING: CPU: 0 PID: 29269 at drivers/regulator/core.c:2251 _regulator_disable+0xf8/0x130 unbalanced disables for vads7846 CPU: 0 PID: 29269 Comm: rmmod Tainted: G D W 4.7.0+ #3 Hardware name: HTC Magician ... show_stack+0x10/0x14 __warn+0xd8/0x100 warn_slowpath_fmt+0x38/0x48 _regulator_disable+0xf8/0x130 regulator_disable+0x34/0x60 ads7846_remove+0x58/0xd4 [ads7846] spi_drv_remove+0x1c/0x34 __device_release_driver+0x84/0x114 driver_detach+0x8c/0x90 bus_remove_driver+0x5c/0xc8 SyS_delete_module+0x1a0/0x238 ret_fast_syscall+0x0/0x38 Signed-off-by: Petr Cvek <petr.cvek@tul.cz> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2015-11-06Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/inputLinus Torvalds1-3/+1
Pull input updates from Dmitry Torokhov: "Items of note: - evdev users can now limit or mask the kind of events they will receive. This will allow applications such as power manager or network manager to only be woken when user presses special keys such as KEY_POWER or KEY_WIFI and not be bothered with ordinary key presses coming from keyboard - support for FocalTech FT6236 touchscreen controller - support for ROHM BU21023/24 touchscreen controller - edt-ft5x06 touchscreen driver got a face lift and can now be used with FT5506 - support for Google Fiber TV Box remote controls - improvements in xpad driver (with more to come) - several parport-based drivers have been switched to the new device model - other miscellaneous driver improvements" * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input: (70 commits) HID: hid-gfrm: avoid warning for input_configured API change HID: hid-input: allow input_configured callback return errors Input: evdev - fix bug in checking duplicate clock change request Input: add userio module Input: evdev - add event-mask API Input: snvs_pwrkey - remove duplicated semicolon HID: hid-gfrm: Google Fiber TV Box remote controls Input: e3x0-button - update Kconfig description Input: tegra-kbc - drop use of IRQF_NO_SUSPEND flag Input: tegra-kbc - enable support for the standard "wakeup-source" property Input: xen - check return value of xenbus_printf Input: hp_sdc_rtc - fix y2038 problem in proc_show Input: nomadik-ske-keypad - fix a trivial typo Input: xpad - fix clash of presence handling with LED setting Input: edt-ft5x06 - work around FT5506 firmware bug Input: edt-ft5x06 - add support for FT5506 Input: edt-ft5x06 - add support for different max support points Input: edt-ft5x06 - use max support points to determine how much to read Input: rotary-encoder - add support for quarter-period mode Input: rotary-encoder - use of_property_read_bool ...
2015-11-04Merge remote-tracking branches 'spi/topic/omap-100k', 'spi/topic/omap-uwire', 'spi/topic/owner', 'spi/topic/pxa' and 'spi/topic/pxa2xx' into spi-nextMark Brown1-1/+0
2015-11-03Merge branch 'next' into for-linusDmitry Torokhov1-3/+1
Prepare first round of input updates for 4.3 merge window.
2015-10-28spi: Drop owner assignment from spi_driversAndrew F. Davis1-1/+0
An spi_driver does not need to set an owner, it will be populated by the driver core. Signed-off-by: Andrew F. Davis <afd@ti.com> Acked-by: Jonathan Cameron <jic23@kernel.org> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-10-06Input: ads7846 - correct the value got from SPIAndrey Gelman1-2/+6
According to the touch controller spec, SPI return a 16 bit value, only 12 bits are valid, they are bit[14-3]. The value of MISO and MOSI can be configured when SPI is in idle mode. Currently this touch driver assumes the SPI bus sets the MOSI and MISO in low level when SPI bus is in idle mode. So the bit[15] of the value got from SPI bus is always 0. But when SPI bus congfigures the MOSI and MISO in high level during the SPI idle mode, the bit[15] of the value get from SPI is always 1. If bit[15] is not masked, we may get the wrong value. Mask the invalid bit to make sure the correct value gets returned. Regardless of the SPI bus idle configuration. Signed-off-by: Andrey Gelman <andrey.gelman@compulab.co.il> Signed-off-by: Haibo Chen <haibo.chen@freescale.com> Signed-off-by: Igor Grinberg <grinberg@compulab.co.il> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2015-10-02Input: ads7846 - use PTR_ERR_OR_ZERO()Javier Martinez Canillas1-3/+1
The PTR_ERR_OR_ZERO() helper function checks if a pointer contains an errno code and returns it or return 0 if that's not the case. Use the helper instead of open coding the same logic in the driver. This was found with make coccicheck that complains with the following warning: drivers/input/touchscreen/ads7846.c:532:1-3: WARNING: PTR_ERR_OR_ZERO can be used Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2015-07-23Input: ads7846 - change name of wakeup property to "wakeup-source"Dmitry Torokhov1-1/+2
Wakeup property of device is not Linux-specific, it describes intended system behavior regardless of the OS being used. Therefore let's drop "linux," prefix, and, while at it, use the same name as I2C bus does: "wakeup-source". We keep parsing old name to keep compatibility with old DTSes. Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2014-11-02Input: touchscreen - use __maybe_unused instead of ifdef around suspend/resumeJingoo Han1-4/+2
Use __maybe_unused instead of ifdef guards around suspend/resume functions, in order to increase build coverage and fix build warnings. Signed-off-by: Jingoo Han <jg1.han@samsung.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2014-07-30Input: ads7846 - release resources on failure for clean exitPramod Gurav1-2/+4
Input device must be released(input_free_device) when ads7846_probe_dt fails. This fixes the same by releasing resources on failure. Signed-off-by: Pramod Gurav <pramod.gurav@smartplayin.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2014-05-14Merge tag 'v3.15-rc5' into nextDmitry Torokhov1-1/+1
Merge with Linux 3.15-rc5 to sync up Wacom and other changes.
2014-05-14Input: ads7846 - correct log message for spi_sync() errorsMark Brown1-1/+1
While searching for users of spi_async() I got a false positive in the ads7846 driver, fix that. Signed-off-by: Mark Brown <broonie@linaro.org> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2014-04-19Input: ads7846 - fix device usage within attribute showAlexander Stein1-1/+1
With commit e585c40ba (Input: ads7846 - convert to hwmon_device_register_with_groups()) the device passed to the attribute's show function isn't the spi device as before. So fixup the passed device to ads7846_read12_ser. Signed-off-by: Alexander Stein <alexanders83@web.de> Acked-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2014-01-06Input: delete non-required instances of include <linux/init.h>Paul Gortmaker1-1/+0
None of these files are actually using any __init type directives and hence don't need to include <linux/init.h>. Most are just a left over from __devinit and __cpuinit removal, or simply due to code getting copied from one driver to the next. Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2013-12-16Input: ads7846 - convert to hwmon_device_register_with_groups()Guenter Roeck1-56/+25
Simplify the code and create mandatory 'name' attribute by using new hwmon API. Also use is_visible to determine visible attributes instead of creating several different attribute groups. Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2013-12-01Input: ads7846 - use IS_ENABLED() macroFabio Estevam1-2/+2
Using the IS_ENABLED() macro can make the code shorter and simpler Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2013-07-02Input: ads7846 - add device tree bindingsDaniel Mack1-11/+104
Signed-off-by: Daniel Mack <zonque@gmail.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2013-07-02Input: ads7846 - make sure we do not change platform dataDmitry Torokhov1-5/+5
Let's declare platform data a const pointer so that we don't accitentally change it. Also fetch it with dev_get_platdata(). Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2013-04-07Input: ads7846 - use spi_get_drvdata() and spi_set_drvdata()Jingoo Han1-2/+2
Use the wrapper functions for getting and setting the driver data using spi_device instead of using dev_{get|set}_drvdata with &spi->dev, so we can directly pass a struct spi_device. Signed-off-by: Jingoo Han <jg1.han@samsung.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2013-03-10Input: ads7864 - check return value of regulator enableMark Brown1-1/+6
At least print a warning if we can't power the device up. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2012-11-24Input: remove use of __devexitBill Pemberton1-1/+1
CONFIG_HOTPLUG is going away as an option so __devexit is no longer needed. Signed-off-by: Bill Pemberton <wfp5p@virginia.edu> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2012-11-24Input: remove use of __devinitBill Pemberton1-3/+3
CONFIG_HOTPLUG is going away as an option so __devinit is no longer needed. Signed-off-by: Bill Pemberton <wfp5p@virginia.edu> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Javier Martinez Canillas <javier@dowhile0.org> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2012-11-24Input: remove use of __devexit_pBill Pemberton1-1/+1
CONFIG_HOTPLUG is going away as an option so __devexit_p is no longer needed. Signed-off-by: Bill Pemberton <wfp5p@virginia.edu> Acked-by: Russell King <rmk+kernel@arm.linux.org.uk> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2012-11-21Input: ads7846 - enable pendown GPIO debounce time settingIgor Grinberg1-1/+5
Some platforms need the pendown GPIO debounce time setting programmed. Since the pendown GPIO is handled by the driver, the debounce time should also be handled along with the pendown GPIO request. Signed-off-by: Igor Grinberg <grinberg@compulab.co.il> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2012-03-16Input: convert SPI drivers to use module_spi_driver()Axel Lin1-11/+1
This patch converts the drivers in drivers/input/* to use the module_spi_driver() macro which makes the code smaller and a bit simpler. Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2011-11-29Input: remove redundant spi driver bus initializationLars-Peter Clausen1-1/+0
In ancient times it was necessary to manually initialize the bus field of an spi_driver to spi_bus_type. These days this is done in spi_driver_register(), so we can drop the manual assignment. The patch was generated using the following coccinelle semantic patch: // <smpl> @@ identifier _driver; @@ struct spi_driver _driver = { .driver = { - .bus = &spi_bus_type, }, }; // </smpl> Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2011-11-29Merge commit 'v3.2-rc3' into nextDmitry Torokhov1-0/+1
2011-11-09Input: convert obsolete strict_strtox to kstrtoxJJ Ding1-3/+5
With commit 67d0a0754455f89ef3946946159d8ec9e45ce33a we mark strict_strtox as obsolete. Convert all remaining such uses in drivers/input/. Also change long to appropriate types, and return error conditions from kstrtox separately, as Dmitry sugguests. Signed-off-by: JJ Ding <dgdunix@gmail.com> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2011-10-31drivers/input: Add module.h to modular drivers implicitly using itPaul Gortmaker1-0/+1
A pending cleanup will mean that module.h won't be implicitly everywhere anymore. Make sure the modular drivers in input dir are actually calling out for <module.h> explicitly in advance. Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
2011-06-27Input: ads7846 - cleanup GPIO initializationIgor Grinberg1-10/+5
Use gpio_request_one() instead of multiple gpiolib calls. This also simplifies error handling a bit. Signed-off-by: Igor Grinberg <grinberg@compulab.co.il> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2011-05-24Merge branch 'next' into for-linusDmitry Torokhov1-8/+18
2011-05-12Input: ads7846 - fix gpio_pendown configurationIgor Grinberg1-0/+7
The pendown gpio was requested but not configured for input. Configure it for input. Signed-off-by: Igor Grinberg <grinberg@compulab.co.il> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2011-05-12Input: ads7846 - add possibility to use external vref on ads7846Alexander Stein1-8/+11
Just set vref_mv in your platform config to use external vref. Otherwise the internal one is used. Signed-off-by: Alexander Stein <alexander.stein@systec-electronic.com> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2011-05-05Input: ads7846 - remove unused variable from struct ads7845_ser_reqAlexander Stein1-1/+0
Signed-off-by: Alexander Stein <alexander.stein@systec-electronic.com> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2011-05-05Input: ads7846 - make transfer buffers DMA safeAlexander Stein1-2/+10
req.sample needs its own cacheline otherwise accessing req.msg fetches it in again. Note: This effect doesn't occur if the underlying SPI driver doesn't use DMA at all. Signed-off-by: Alexander Stein <alexander.stein@systec-electronic.com> Acked-by: Jonathan Cameron <jic23@cam.ac.uk> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2011-03-18Merge branch 'next' into for-linusDmitry Torokhov1-6/+10
2011-02-11Input: ads7846 - check proper condition when freeing gpioDmitry Torokhov1-16/+22
When driver uses custom pendown detection method gpio_pendown is not set up and so we should not try to free it, otherwise we are presented with: ------------[ cut here ]------------ WARNING: at drivers/gpio/gpiolib.c:1258 gpio_free+0x100/0x12c() Modules linked in: [<c0061208>] (unwind_backtrace+0x0/0xe4) from [<c0091f58>](warn_slowpath_common+0x4c/0x64) [<c0091f58>] (warn_slowpath_common+0x4c/0x64) from [<c0091f88>](warn_slowpath_null+0x18/0x1c) [<c0091f88>] (warn_slowpath_null+0x18/0x1c) from [<c024e610>](gpio_free+0x100/0x12c) [<c024e610>] (gpio_free+0x100/0x12c) from [<c03e9fbc>](ads7846_probe+0xa38/0xc5c) [<c03e9fbc>] (ads7846_probe+0xa38/0xc5c) from [<c02cff14>](spi_drv_probe+0x18/0x1c) [<c02cff14>] (spi_drv_probe+0x18/0x1c) from [<c028bca4>](driver_probe_device+0xc8/0x184) [<c028bca4>] (driver_probe_device+0xc8/0x184) from [<c028bdc8>](__driver_attach+0x68/0x8c) [<c028bdc8>] (__driver_attach+0x68/0x8c) from [<c028b4c8>](bus_for_each_dev+0x48/0x74) [<c028b4c8>] (bus_for_each_dev+0x48/0x74) from [<c028ae08>](bus_add_driver+0xa0/0x220) [<c028ae08>] (bus_add_driver+0xa0/0x220) from [<c028c0c0>](driver_register+0xa8/0x134) [<c028c0c0>] (driver_register+0xa8/0x134) from [<c0050550>](do_one_initcall+0xcc/0x1a4) [<c0050550>] (do_one_initcall+0xcc/0x1a4) from [<c00084e4>](kernel_init+0x14c/0x214) [<c00084e4>] (kernel_init+0x14c/0x214) from [<c005b494>](kernel_thread_exit+0x0/0x8) ---[ end trace 4053287f8a5ec18f ]--- Also rearrange ads7846_setup_pendown() to have only one exit point returning success. Reported-by: Sourav Poddar <sourav.poddar@ti.com> Acked-by: Wolfram Sang <w.sang@pengutronix.de> Reviewed-by: Charulatha V <charu@ti.com> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2011-01-20Input: ads7846 - convert to dev_pm_opsMark Brown1-6/+10
There is a move to deprecate bus-specific PM operations and move to using dev_pm_ops instead in order to reduce the amount of boilerplate code in buses and facilitate updates to the PM core. Do this move for the ads7846 driver. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Michael Hennerich <Michael.Hennerich@analog.com> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2010-10-17Input: ads7846 - switch to using threaded IRQJason Wang1-430/+456
Commit 9114337 introduces regulator operations in ads7846 touchscreen driver. Among these operations, some are called while holding a spinlock. On many platforms regulators reside on slow buses, such as I2C/SPI and require sleep while accessing them. The touchscreen itself is also a SPI device and currently relies on asynchronous SPI access to avoid sleeping in interrupt context. Let's switch to using threaded IRQ to be able to access SPI bus synchronously (which simplifies driver a bit); it also allows safe access to the regulators as well. This has been tested on the ti_omap3530evm board: 1) using ts_lib after normal boot 2) using ts_lib after "#echo 1/0 > /sys/bus/spi/devices/spi0.1/disable" 3) using ts_lib after "#echo mem > /sys/power/state" and "wake up" Also tested on pandora. Based on original patch by Dmitry Torokhov. Tested-by: Grazvydas Ignotas <notasas@gmail.com> Signed-off-by: Jason Wang <jason77.wang@gmail.com> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2010-07-03Input: ads7846 - extend the driver for ads7845 controller supportAnatolij Gustschin1-37/+135
ADS7845 is a controller for 5-wire touch screens and somewhat different from 7846. It requires three serial communications to accomplish one complete conversion. Unlike 7846 it doesn't allow Z1-/Z2- position measurement. The patch extends the ads7846 driver to also support ads7845. The packet struct is extended to contain needed command and conversion buffers. ads7846_rx() and ads7846_rx_val() now differentiate between 7845 and 7846 case. ads7846_probe() is modified to setup ads7845 specific command and conversion messages and to switch ads7845 into power-down mode, since this is needed to be prepared to respond to pendown interrupts. Signed-off-by: Anatolij Gustschin <agust@denx.de> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2010-07-03Input: ads7846 - do not allow altering platform dataDmitry Torokhov1-16/+19
Tested-by: Anatolij Gustschin <agust@denx.de> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2010-06-28Input: ads7846 - allow specifying irq trigger type in platform dataAnatolij Gustschin1-1/+4
On some platforms, for example with GPIO interrupts on mpc5121, it is not possible to configure falling edge interrupts. Specifying irq trigger type in platform data structure allows using ads7846 driver on such platforms. Signed-off-by: Anatolij Gustschin <agust@denx.de> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2010-06-02Input: ads7846 - fix compiler warning in ads7846_probe()Dmitry Torokhov1-1/+1
This patch fixes the follwing warning introduced by commit 067fb2f648543894ce775082c5636f4c32b99e4f ("Input: ads7846 - return error on regulator_get() failure"): drivers/input/touchscreen/ads7846.c: In function 'ads7846_probe': drivers/input/touchscreen/ads7846.c:1167: warning: format '%ld' expects type 'long int', but argument 4 has type 'int' Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2010-05-26Input: ads7846 - return error on regulator_get() failureKevin Hilman1-2/+2
In probe(), if regulator_get() failed, an error code was not being returned causing the driver to be successfully bound, even though probe failed. This in turn caused the suspend, resume and remove methods to be registered and accessed via the SPI core. Since these functions all access private driver data using pointers that had been freed during the failed probe, this would lead to unpredictable behavior. This patch ensures that probe() returns an error code in this failure case so the driver is not bound. Found using lockdep and noticing the lock used in the suspend/resum path pointed to a bogus lock due to the freed memory. Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com> Acked-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2010-03-11Input: ads7846 - add wakeup supportRanjith Lohithakshan1-0/+10
Add wakeup support to the ads7846 driver. Platforms can enable wakeup capability by setting the wakeup flag in ads7846_platform_data. With this patch the ads7846 driver can be used to wake the system from suspend. Signed-off-by: Ranjith Lohithakshan <ranjithl@ti.com> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>