aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input/touchscreen/zforce_ts.c (follow)
AgeCommit message (Collapse)AuthorFilesLines
2016-04-25Input: zforce_ts - fix dual touch recognitionKnut Wohlrab1-2/+2
A wrong decoding of the touch coordinate message causes a wrong touch ID. Touch ID for dual touch must be 0 or 1. According to the actual Neonode nine byte touch coordinate coding, the state is transported in the lower nibble and the touch ID in the higher nibble of payload byte five. Signed-off-by: Knut Wohlrab <Knut.Wohlrab@de.bosch.com> Signed-off-by: Oleksij Rempel <linux@rempel-privat.de> Signed-off-by: Dirk Behme <dirk.behme@de.bosch.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2015-10-02Input: zforce - simplify function return logicJavier Martinez Canillas1-6/+1
The invoked function already returns zero on success or a negative errno code so there is no need to open code the logic in the caller. This also fixes the following make coccicheck warning: end returns can be simplified and declaration on line 602 can be dropped Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com> Reviewed-by: Heiko Stuebner <heiko.stuebner@bq.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2015-08-03Input: zforce - make the interrupt GPIO optionalDirk Behme1-14/+49
Add support for hardware which uses an I2C Serializer / Deserializer (SerDes) to communicate with the zFroce touch driver. In this case the SerDes will be configured as an interrupt controller and the zForce driver will have no access to poll the GPIO line. To support this, we add two dedicated new GPIOs in the device tree: reset-gpios and irq-gpios, with the irq-gpios being optional. To not break the existing device trees, the index based 'gpios' entries are still supported, but marked as deprecated. With this, if the interrupt GPIO is available, either via the old or new device tree style, the while loop will read and handle the packets as long as the GPIO indicates that the interrupt is asserted (existing, unchanged driver behavior). If the interrupt GPIO isn't available, i.e. not configured via the new device tree style, we are falling back to one read per ISR invocation (new behavior to support the SerDes). Note that the gpiod functions help to handle the optional GPIO: devm_gpiod_get_index_optional() will return NULL in case the interrupt GPIO isn't available. And gpiod_get_value_cansleep() does cover this, too, by returning 0 in this case. Signed-off-by: Dirk Behme <dirk.behme@de.bosch.com> Reviewed-by: Heiko Stuebner <heiko.stuebner@bq.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2015-07-20Input: zforce - don't invert the interrupt GPIODirk Behme1-1/+1
Commit 2d53809594af ("Input: zforce_ts - convert to use the gpiod interface") converted this driver to use the gpiod functions. These functions take the active low property into account, so we don't have to invert the result of gpiod_get_value_cansleep(). This has been missed in that commit. Fix it. Signed-off-by: Dirk Behme <dirk.behme@de.bosch.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2015-07-17Input: drop owner assignment from i2c_driverKrzysztof Kozlowski1-1/+0
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-07-08Input: zforce_ts - convert to use the gpiod interfaceDirk Behme1-28/+30
Use the new GPIO descriptor interface to handle the zForce GPIOs. This simplifies the code and allows transparently handle GPIO polarity, as specified in device tree data. Also switch to using gpio_{set|get}_value_cansleep() since none of the callers is in atomic context and cansleep variant allows more GPIO controllers to be used with the touchscreen. Signed-off-by: Dirk Behme <dirk.behme@de.bosch.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2015-05-13Input: zforce - remove duplicated includeWei Yongjun1-1/+0
Remove duplicated include for delay.h. Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn> Reviewed-by: Heiko Stuebner <heiko.stuebner@bq.com> 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-21Input: zforce - add regulator handlingHeiko Stuebner1-0/+31
It's possible that the controller has an individually switchable power supply. Therefore add support to control a supplying regulator. As this is not always the case, the regulator is requested as optional. Signed-off-by: Heiko Stuebner <heiko.stuebner@bq.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2014-05-14Input: zforce - make of_device_id array constJingoo Han1-1/+1
Make of_device_id array const, because all OF functions handle it as const. Signed-off-by: Jingoo Han <jg1.han@samsung.com> Acked-by: Heiko Stuebner <heiko@sntech.de> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2014-03-01Merge tag 'v3.14-rc4' into nextDmitry Torokhov1-6/+15
Merge with Linux 3.14-rc4 to bring devm_request_any_context_irq().
2014-01-27Input: zforce - add devicetree supportHeiko Stübner1-2/+55
This makes the zforce driver usable on devicetree-based platforms too. Signed-off-by: Heiko Stuebner <heiko.stuebner@bqreaders.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2014-01-27Input: zforce - use internal pdata pointer instead of dev_get_platdataHeiko Stübner1-3/+3
Devicetree support will be creating its own platfprm data structure that is not attached to the device. Let's use the internal pointer to the pdata instead of re-fetching it with dev_get_platdata(). Signed-off-by: Heiko Stuebner <heiko.stuebner@bqreaders.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2014-01-27Input: zforce - reduce stack memory allocated to framesLuis Ortega1-1/+2
A frame is a u8 array with the following structure: [PAYLOAD_HEADER, PAYLOAD_LENGTH, ...PAYLOAD_BODY...] PAYLOAD_BODY can be at most 255 bytes long, as it's size is represented by PAYLOAD_LENGTH. Therefore we can reduce the stack memory allocated to payload_buffer[] roughly by half, from 512 to 257 bytes. Signed-off-by: Luis Ortega <luiorpe1@upv.es> Acked-by: Heiko Stuebner <heiko@sntech.de> Tested-by: Heiko Stuebner <heiko@sntech.de> - bq Cervantes (imx6sl) Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2014-01-27Input: zforce - remove unnecessary payload data checksLuis Ortega1-1/+1
The function zforce_read_packet() reads 2 values (bytes) of payload header, validates them and then proceeds to read the payload body. The function stores all these in a u8 buffer. The PAYLOAD_LENGTH check seems to be trying to detect an overflow error. However, since we are just reading a u8 value from the buffer, these checks are unnecessary and we should simply compare against zero. Signed-off-by: Luis Ortega <luiorpe1@upv.es> Acked-by: Heiko Stuebner <heiko@sntech.de> Tested-by: Heiko Stuebner <heiko@sntech.de> - bq Cervantes (imx6sl) Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2014-01-27Input: zforce - fix lines exceeding 80 columnsLuis Ortega1-7/+12
Fixed lines exceeding 80 characters long wherever possible, as per the coding style. Signed-off-by: Luis Ortega <luiorpe1@upv.es> Acked-by: Heiko Stuebner <heiko@sntech.de> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2014-01-27Input: zforce - fix spelling errorsLuis Ortega1-5/+5
Fixed a few spelling errors. Signed-off-by: Luis Ortega <luiorpe1@upv.es> Acked-by: Heiko Stuebner <heiko@sntech.de> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2014-01-23Merge branch 'next' into for-linusDmitry Torokhov1-1/+2
First round of input updates for 3.14.
2013-12-18Input: zforce - fix error return code in zforce_start()Wei Yongjun1-1/+2
The error code was not set if unable to set config, so the error condition wasn't reflected in the return value. Fix to return a negative error code from the error handling case instead of 0. Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn> Acked-by: Heiko Stuebner <heiko@sntech.de> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2013-12-15Input: zforce - fix possible driver hang during suspendHeiko Stübner1-6/+15
handle_level_irq masks the interrupt before handling it, and only unmasks it after the handler is finished. So when a touch event happens after threads are suspended, but before the system is fully asleep the irq handler tries to wakeup the thread which will only happen on the next resume, resulting in the wakeup event never being sent and the driver not being able to wake the system from sleep due to the masked irq. Therefore move the wakeup_event to a small non-threaded handler. Signed-off-by: Heiko Stuebner <heiko@sntech.de> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2013-10-31Input: add driver for Neonode zForce based touchscreensHeiko Stübner1-0/+836
This adds a driver for touchscreens using the zforce infrared technology from Neonode connected via i2c to the host system. It supports multitouch with up to two fingers and tracking of the contacts in hardware. Signed-off-by: Heiko Stuebner <heiko@sntech.de> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>