summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Input: synaptics-rmi4 - check for non zero version logically dead codeColin Ian King2016-12-291-2/+0
| | | | | | | | version is a u8, the check for version > 0 means that version can only be zero, so the subsequent check for version != 0 is never true and hence is redudant code and can be removed. Signed-off-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
* Input: synaptics-rmi4 - use Kconfig "if" to express dependencyDmitry Torokhov2016-12-291-16/+12
| | | | | | | | | There is no need to repeat "depends on RMI4_CORE" on every bit of RMI4 support, we can guard all of them at once with "if RMI4_CORE". Also use tabs for F03 indentation. Reviewed-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
* Input: synaptics-rmi4 - fix F03 build error when serio is moduleDmitry Torokhov2016-12-271-1/+2
| | | | | | | | | | | | | | | | | | Since F03 is a boolean, "depends" on symbols that can be modules do not work quite right. We can enable F03 if SERIO is built-in or if both RMI core and SERIO core are modules. If SERIO core is module, but RMI is built-in, we'll get: drivers/built-in.o: In function `rmi_f03_attention': rmi_f03.c:(.text+0xf8ef8): undefined reference to `serio_interrupt' rmi_f03.c:(.text+0xf8fbd): undefined reference to `serio_interrupt' drivers/built-in.o: In function `rmi_f03_remove': rmi_f03.c:(.text+0xf9082): undefined reference to `serio_unregister_port' drivers/built-in.o: In function `rmi_f03_probe': rmi_f03.c:(.text+0xf9260): undefined reference to `__serio_register_port' Reported-by: Randy Dunlap <rdunlap@infradead.org> Reviewed-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
* Input: synaptics-rmi4 - add support for F34 V7 bootloaderNick Dyer2016-12-126-34/+1688
| | | | | | | | | | Port firmware update code from Samsung Galaxy S7 driver into mainline framework. This patch has been tested on Synaptics S7813. Signed-off-by: Nick Dyer <nick@shmanahar.org> Tested-by: Chris Healy <cphealy@gmail.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
* Input: synaptics-rmi4 - fix debug for sensor clipNick Dyer2016-12-081-5/+3
| | | | | | | | The debug would only ever output zero for the clip information. Signed-off-by: Nick Dyer <nick@shmanahar.org> Reviewed-by: Andrew Duggan <aduggan@synaptics.com> Tested-by: Chris Healy <cphealy@gmail.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
* Input: synaptics-rmi4 - store the attn data in the driverBenjamin Tissoires2016-12-036-44/+45
| | | | | | | | Now that we have a proper API to set the attention data, there is no point in keeping it in the transport driver. Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Reviewed-by: Andrew Duggan <aduggan@synaptics.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
* Input: synaptics-rmi4 - allow to add attention dataBenjamin Tissoires2016-12-032-2/+58
| | | | | | | | | | | | The HID implementation of RMI4 provides the data during the interrupt (in the input report). We need to provide a way for this transport driver to provide the attention data while calling an IRQ. We use a fifo in rmi_core to not lose any incoming event. Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Reviewed-by: Andrew Duggan <aduggan@synaptics.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
* Input: synaptics-rmi4 - f03 - grab data passed by transport deviceDennis Wassenberg2016-12-031-9/+26
| | | | | | | | | | | | | | | | | First check if there are data available passed by the transport device. If data available use these data. If there are no data available try to read the rmi block if dsata are passed this way. This is the way the other rmi function handlers will do this. This patch is needed on HID devices because the firmware reads F03 data registers and adds them to the HID attention report. Reading those registers from the driver after the firmware read them will result in invalid data. Reviewed-by: Andrew Duggan <aduggan@synaptics.com> Signed-off-by: Dennis Wassenberg <dennis.wassenberg@secunet.com> Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
* Input: synaptics-rmi4 - add support for F03Lyude Paul2016-12-035-0/+246
| | | | | | | | | This adds basic functionality for PS/2 passthrough on Synaptics Touchpads using RMI4 through smbus. Reviewed-by: Andrew Duggan <aduggan@synaptics.com> Signed-off-by: Lyude Paul <thatslyude@gmail.com> Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
* Input: synaptics-rmi4 - have only one struct platform dataBenjamin Tissoires2016-12-014-11/+10
| | | | | | | | | | | If struct rmi_device_platform_data contains pointers to other struct, it gets difficult to allocate a fixed size struct and copy it over between drivers. Change the pointers into a struct and change the code in rmi4 accordingly. Reviewed-by: Andrew Duggan <aduggan@synaptics.com> Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
* Input: synaptics-rmi4 - remove EXPORT_SYMBOL_GPL for internal functionsBenjamin Tissoires2016-12-012-16/+2
| | | | | | | | | those functions should not be used outside of rmi_core.ko. There is no point in exporting them to the world. It looks like rmi_read_pdt_entry() should be static too. Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
* Input: synaptics-rmi4 - remove mutex calls while updating the firmwareBenjamin Tissoires2016-12-012-37/+22
| | | | | | | | | | | | | | | This partially reverts commit 29fd0ec2bdbe ("Input: synaptics-rmi4 - add support for F34 device reflash") irq_mutex should be used only to protect data->current_irq_mask, not preventing incoming input to be processed while the upgrade of the firmware is happening. We can simply disable the irqs when we don't want them to interfere with the upgrade process. Tested on S7300 and S7800 (with F34 v7 patch added) Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Signed-off-by: Nick Dyer <nick@shmanahar.org> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
* Input: synaptics-rmi4 - add rmi_enable/disable_irqBenjamin Tissoires2016-11-303-19/+67
| | | | | | | Set the .enabled boolean and trigger an event processing when enabling for edge-triggered systems. Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
* Input: synaptics-rmi4 - remove unused fields in struct rmi_driver_dataBenjamin Tissoires2016-11-301-4/+0
| | | | | | These fields are not used anywhere, there is no point in carrying them. Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
* Input: synaptics-rmi4 - fix documentation of rmi_2d_sensor_platform_dataBenjamin Tissoires2016-11-301-1/+1
| | | | | | Typos... Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
* Input: synaptics-rmi4 - propagate correct number of rx and tx electrodes to F54Guenter Roeck2016-11-234-4/+21
| | | | | | | | | | | | | | | | F54 diagnostics report functions provide data based on the number of enabled rx and tx electrodes, which is not identical to the number of electrodes reported with F54:Query0 and F54:Query1. Those values report the number of supported electrodes, not the number of enabled electrodes. The number of enabled electrodes can be determined by analyzing F55:Ctrl1 (sensor receiver assignment) and F55:Ctrl2 (sensor transmitter assignment). Propagate the number of enabled electrodes from F55 to F54 to avoid corrupted output if not all electrodes are enabled. Fixes: 3a762dbd5347 ("[media] Input: synaptics-rmi4 - add support for F54 ...") Signed-off-by: Guenter Roeck <linux@roeck-us.net> Tested-by: Nick Dyer <nick@shmanahar.org> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
* Input: synaptics-rmi4 - add support for F55 sensor tuningGuenter Roeck2016-11-235-0/+138
| | | | | | | | | | | | | | | | Sensor tuning support is needed to determine the number of enabled tx and rx electrodes for use in F54 functions. The number of enabled electrodes is not identical to the total number of electrodes as reported with F55:Query0 and F55:Query1. It has to be calculated by analyzing F55:Ctrl1 (sensor receiver assignment) and F55:Ctrl2 (sensor transmitter assignment). Support for additional sensor tuning functions may be added later. Fixes: 3a762dbd5347 ("[media] Input: synaptics-rmi4 - add support for F54 ...") Signed-off-by: Guenter Roeck <linux@roeck-us.net> Tested-by: Nick Dyer <nick@shmanahar.org> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
* Input: synaptics-rmi4 - add support for F34 device reflashNick Dyer2016-11-239-31/+670
| | | | | | | | | Add support for updating firmware, triggered by a sysfs attribute. This patch has been tested on Synaptics S7300. Signed-off-by: Nick Dyer <nick@shmanahar.org> Tested-by: Chris Healy <cphealy@gmail.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
* Input: synaptics-rmi4 - unlock on errorDan Carpenter2016-11-171-2/+3
| | | | | | | We should unlock before returning on this error path. Fixes: 3a762dbd5347 ('[media] Input: synaptics-rmi4 - add support for F54 diagnostics') Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
* Input: synaptics-rmi4 - add SMBus supportBenjamin Tissoires2016-11-094-0/+472
| | | | | | | | Code obtained from https://raw.githubusercontent.com/mightybigcar/synaptics-rmi4/jf/drivers/input/rmi4/rmi_smbus.c and updated to match upstream. And fixed to make it work. Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Signed-off-by: Andrew Duggan <aduggan@synaptics.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
* Input: synaptics-rmi4 - set the ABS_MT_TOOL_TYPE bit to report tool typeAndrew Duggan2016-11-091-4/+6
| | | | | | | | | | The rmi4 2D sensor functions report the tool type via input_mt_report_slot_state(), but the abs parameter bit has not been set so the tool type is not reported to userspace. This patch set the ABS_MT_TOOL_TYPE bit. Signed-off-by: Andrew Duggan <aduggan@synaptics.com> Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
* Input: synaptics-rmi4 - add support for controlling dribble packets in F12Andrew Duggan2016-11-091-1/+69
| | | | | | | | Implements reading and setting the dribble bit in F12's control registers. Signed-off-by: Andrew Duggan <aduggan@synaptics.com> Acked-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
* Input: synaptics-rmi4 - add parameters for dribble packets and palm detect ↵Andrew Duggan2016-11-094-15/+46
| | | | | | | | | | | | | | | | | | | gesture The rmi_f11 driver currently disables dribble packets and the palm detect gesture for all devices. This patch creates a parameter in the 2d sensor platform data for controlling this functionality on a per device basis. For more information on dribble packets: Commit 05ba999fcabb ("HID: rmi: disable dribble packets on Synaptics touchpads") For more information on the palm detect gesture: Commit f097deef59a6 ("HID: rmi: disable palm detect gesture when present") Signed-off-by: Andrew Duggan <aduggan@synaptics.com> Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
* Input: synaptics-rmi4 - handle incomplete input dataAndrew Duggan2016-11-093-20/+61
| | | | | | | | | | | Commit 5b65c2a02966 ("HID: rmi: check sanity of the incoming report") added support for handling incomplete HID reports do to the input data being corrupted in transit. This patch reimplements this functionality in the function drivers so they can handle getting less valid data then they expect. Signed-off-by: Andrew Duggan <aduggan@synaptics.com> Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
* Input: synaptics-rmi4 - move IRQ handling to rmi_driverBjorn Andersson2016-11-094-143/+83
| | | | | | | | | | The attn IRQ is related to the chip, rather than the transport, so move all handling of interrupts to the core driver. This also makes sure that there are no races between interrupts and availability of the resources used by the core driver. Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org> Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
* Input: synaptics-rmi4 - add a couple of debug linesNick Dyer2016-11-092-0/+4
| | | | | | Signed-off-by: Nick Dyer <nick@shmanahar.org> Tested-by: Chris Healy <cphealy@gmail.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
* Input: synaptics-rmi4 - factor out functions from probeNick Dyer2016-11-091-53/+86
| | | | | | Signed-off-by: Nick Dyer <nick@shmanahar.org> Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Tested-by: Chris Healy <cphealy@gmail.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
* Input: synaptics-rmi4 - stop scanning PDT after two empty pagesNick Dyer2016-11-091-2/+14
| | | | | | | | | | | | | We have encountered some RMI4 firmwares where there are blank pages in between PDT pages which contain functions. This change makes them correctly enumerate all functions on the device. Tested on S7817 (has empty page 2). Signed-off-by: Nick Dyer <nick@shmanahar.org> [Tested successfully on S7817 and S7300 Synaptics touch controllers] Tested-by: Chris Healy <cphealy@gmail.com> Reviewed-by: Andrew Duggan <aduggan@synaptics.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
* Merge tag 'media/v4.9-3' of ↵Dmitry Torokhov2016-11-08851-51601/+44227
|\ | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media into synaptics-rmi4 Sync up with media tree to bring up latest Synaptics and Atmel changes.
| * [media] radio-bcm2048: don't ignore errorsMauro Carvalho Chehab2016-10-171-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | Remove this warning: drivers/staging/media/bcm2048/radio-bcm2048.c: In function 'bcm2048_set_rds_no_lock': drivers/staging/media/bcm2048/radio-bcm2048.c:467:6: warning: variable 'err' set but not used [-Wunused-but-set-variable] int err; ^~~ By returning the error code. Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
| * [media] pctv452e: fix semicolon.cocci warningskbuild test robot2016-10-141-1/+1
| | | | | | | | | | | | | | | | | | | | | | drivers/media/usb/dvb-usb/pctv452e.c:115:2-3: Unneeded semicolon Remove unneeded semicolon. Generated by: scripts/coccinelle/misc/semicolon.cocci Signed-off-by: Fengguang Wu <fengguang.wu@intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
| * [media] flexcop-usb: don't use stack for DMAMauro Carvalho Chehab2016-10-142-37/+72
| | | | | | | | | | | | | | | | | | | | The USB control messages require DMA to work. We cannot pass a stack-allocated buffer, as it is not warranted that the stack would be into a DMA enabled area. While here, remove a dead function calling usb_control_msg(). Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
| * [media] stk-webcam: don't use stack for DMAMauro Carvalho Chehab2016-10-141-5/+11
| | | | | | | | | | | | | | | | | | The USB control messages require DMA to work. We cannot pass a stack-allocated buffer, as it is not warranted that the stack would be into a DMA enabled area. Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
| * [media] s2255drv: don't use stack for DMAMauro Carvalho Chehab2016-10-141-2/+13
| | | | | | | | | | | | | | | | | | The USB control messages require DMA to work. We cannot pass a stack-allocated buffer, as it is not warranted that the stack would be into a DMA enabled area. Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
| * [media] cpia2_usb: don't use stack for DMAMauro Carvalho Chehab2016-10-141-4/+30
| | | | | | | | | | | | | | | | | | The USB control messages require DMA to work. We cannot pass a stack-allocated buffer, as it is not warranted that the stack would be into a DMA enabled area. Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
| * [media] digitv: handle error code on RC queryMauro Carvalho Chehab2016-10-141-4/+6
| | | | | | | | | | | | | | There's no sense on decoding and generating a RC key code if there was an error on the URB control message. Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
| * [media] dw2102: return error if su3000_power_ctrl() failsMauro Carvalho Chehab2016-10-141-1/+1
| | | | | | | | | | | | Instead of silently ignoring the error, return it. Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
| * [media] nova-t-usb2: handle error code on RC queryMauro Carvalho Chehab2016-10-141-3/+6
| | | | | | | | | | | | | | There's no sense on decoding and generating a RC key code if there was an error on the URB control message. Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
| * [media] technisat-usb2: use DMA buffers for I2C transfersMauro Carvalho Chehab2016-10-141-5/+11
| | | | | | | | | | | | | | | | | | | | | | | | The USB control messages require DMA to work. We cannot pass a stack-allocated buffer, as it is not warranted that the stack would be into a DMA enabled area. On this driver, most of the transfers are OK, but the I2C one was using stack. Reviewed-by: Patrick Boettcher <patrick.boettcher@posteo.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
| * [media] pctv452e: don't call BUG_ON() on non-fatal errorMauro Carvalho Chehab2016-10-141-3/+4
| | | | | | | | | | | | | | | | | | There are some conditions on this driver that are tested with BUG_ON() with are not serious enough to hang a machine. So, just return an error if this happens. Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
| * [media] pctv452e: don't do DMA on stackMauro Carvalho Chehab2016-10-141-55/+74
| | | | | | | | | | | | | | | | | | The USB control messages require DMA to work. We cannot pass a stack-allocated buffer, as it is not warranted that the stack would be into a DMA enabled area. Reviewed-by: Patrick Boettcher <patrick.boettcher@posteo.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
| * [media] nova-t-usb2: don't do DMA on stackMauro Carvalho Chehab2016-10-141-5/+13
| | | | | | | | | | | | | | | | | | The USB control messages require DMA to work. We cannot pass a stack-allocated buffer, as it is not warranted that the stack would be into a DMA enabled area. Reviewed-by: Patrick Boettcher <patrick.boettcher@posteo.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
| * [media] gp8psk: don't go past the buffer sizeMauro Carvalho Chehab2016-10-141-0/+11
| | | | | | | | | | | | Add checks to avoid going out of the buffer. Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
| * [media] gp8psk: don't do DMA on stackMauro Carvalho Chehab2016-10-141-2/+12
| | | | | | | | | | | | | | | | The USB control messages require DMA to work. We cannot pass a stack-allocated buffer, as it is not warranted that the stack would be into a DMA enabled area. Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
| * [media] dtv5100: don't do DMA on stackMauro Carvalho Chehab2016-10-141-2/+8
| | | | | | | | | | | | | | | | | | The USB control messages require DMA to work. We cannot pass a stack-allocated buffer, as it is not warranted that the stack would be into a DMA enabled area. Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
| * [media] dtt200u: handle USB control message errorsMauro Carvalho Chehab2016-10-141-8/+18
| | | | | | | | | | | | | | If something bad happens while an USB control message is transfered, return an error code. Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
| * [media] dtt200u: don't do DMA on stackMauro Carvalho Chehab2016-10-141-29/+75
| | | | | | | | | | | | | | | | | | | | The USB control messages require DMA to work. We cannot pass a stack-allocated buffer, as it is not warranted that the stack would be into a DMA enabled area. Reviewed-by: Patrick Boettcher <patrick.boettcher@posteo.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
| * [media] dtt200u-fe: handle errors on USB control messagesMauro Carvalho Chehab2016-10-141-9/+31
| | | | | | | | | | | | | | If something goes wrong, return an error code, instead of assuming that everything went fine. Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
| * [media] dtt200u-fe: don't do DMA on stackMauro Carvalho Chehab2016-10-141-30/+65
| | | | | | | | | | | | | | | | The USB control messages require DMA to work. We cannot pass a stack-allocated buffer, as it is not warranted that the stack would be into a DMA enabled area. Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
| * [media] dtt200u-fe: don't keep waiting for lock at set_frontend()Mauro Carvalho Chehab2016-10-141-9/+0
| | | | | | | | | | | | It is up to the frontend kthread to wait for lock. Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>