aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2016-12-29Input: synaptics-rmi4 - remove redundant null check on rmi_devColin Ian King1-3/+0
rmi_dev is currently being dereferenced before it null checked, however, after deeper inspecting, rmi_dev can never be null, so just remove this redundant check. Fixes CoverityScan CID 1391218 ("Dereference before null check") Signed-off-by: Colin Ian King <[email protected]> Signed-off-by: Dmitry Torokhov <[email protected]>
2016-12-29Input: synaptics-rmi4 - check for non zero version logically dead codeColin Ian King1-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 <[email protected]> Signed-off-by: Dmitry Torokhov <[email protected]>
2016-12-29Input: synaptics-rmi4 - use Kconfig "if" to express dependencyDmitry Torokhov1-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 <[email protected]> Signed-off-by: Dmitry Torokhov <[email protected]>
2016-12-27Input: synaptics-rmi4 - fix F03 build error when serio is moduleDmitry Torokhov1-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 <[email protected]> Reviewed-by: Guenter Roeck <[email protected]> Signed-off-by: Dmitry Torokhov <[email protected]>
2016-12-12Input: synaptics-rmi4 - add support for F34 V7 bootloaderNick Dyer6-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 <[email protected]> Tested-by: Chris Healy <[email protected]> Signed-off-by: Dmitry Torokhov <[email protected]>
2016-12-07Input: synaptics-rmi4 - fix debug for sensor clipNick Dyer1-5/+3
The debug would only ever output zero for the clip information. Signed-off-by: Nick Dyer <[email protected]> Reviewed-by: Andrew Duggan <[email protected]> Tested-by: Chris Healy <[email protected]> Signed-off-by: Dmitry Torokhov <[email protected]>
2016-12-02Input: synaptics-rmi4 - store the attn data in the driverBenjamin Tissoires6-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 <[email protected]> Reviewed-by: Andrew Duggan <[email protected]> Signed-off-by: Dmitry Torokhov <[email protected]>
2016-12-02Input: synaptics-rmi4 - allow to add attention dataBenjamin Tissoires2-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 <[email protected]> Reviewed-by: Andrew Duggan <[email protected]> Signed-off-by: Dmitry Torokhov <[email protected]>
2016-12-02Input: synaptics-rmi4 - f03 - grab data passed by transport deviceDennis Wassenberg1-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 <[email protected]> Signed-off-by: Dennis Wassenberg <[email protected]> Signed-off-by: Benjamin Tissoires <[email protected]> Signed-off-by: Dmitry Torokhov <[email protected]>
2016-12-02Input: synaptics-rmi4 - add support for F03Lyude Paul5-0/+246
This adds basic functionality for PS/2 passthrough on Synaptics Touchpads using RMI4 through smbus. Reviewed-by: Andrew Duggan <[email protected]> Signed-off-by: Lyude Paul <[email protected]> Signed-off-by: Benjamin Tissoires <[email protected]> Signed-off-by: Dmitry Torokhov <[email protected]>
2016-11-30Input: synaptics-rmi4 - have only one struct platform dataBenjamin Tissoires4-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 <[email protected]> Signed-off-by: Benjamin Tissoires <[email protected]> Signed-off-by: Dmitry Torokhov <[email protected]>
2016-11-30Input: synaptics-rmi4 - remove EXPORT_SYMBOL_GPL for internal functionsBenjamin Tissoires2-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 <[email protected]> Signed-off-by: Dmitry Torokhov <[email protected]>
2016-11-30Input: synaptics-rmi4 - remove mutex calls while updating the firmwareBenjamin Tissoires2-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 <[email protected]> Signed-off-by: Nick Dyer <[email protected]> Signed-off-by: Dmitry Torokhov <[email protected]>
2016-11-30Input: synaptics-rmi4 - add rmi_enable/disable_irqBenjamin Tissoires3-19/+67
Set the .enabled boolean and trigger an event processing when enabling for edge-triggered systems. Signed-off-by: Benjamin Tissoires <[email protected]> Signed-off-by: Dmitry Torokhov <[email protected]>
2016-11-30Input: synaptics-rmi4 - remove unused fields in struct rmi_driver_dataBenjamin Tissoires1-4/+0
These fields are not used anywhere, there is no point in carrying them. Signed-off-by: Benjamin Tissoires <[email protected]> Signed-off-by: Dmitry Torokhov <[email protected]>
2016-11-30Input: synaptics-rmi4 - fix documentation of rmi_2d_sensor_platform_dataBenjamin Tissoires1-1/+1
Typos... Signed-off-by: Benjamin Tissoires <[email protected]> Signed-off-by: Dmitry Torokhov <[email protected]>
2016-11-22Input: synaptics-rmi4 - propagate correct number of rx and tx electrodes to F54Guenter Roeck4-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 <[email protected]> Tested-by: Nick Dyer <[email protected]> Signed-off-by: Dmitry Torokhov <[email protected]>
2016-11-22Input: synaptics-rmi4 - add support for F55 sensor tuningGuenter Roeck5-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 <[email protected]> Tested-by: Nick Dyer <[email protected]> Signed-off-by: Dmitry Torokhov <[email protected]>
2016-11-22Input: synaptics-rmi4 - add support for F34 device reflashNick Dyer9-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 <[email protected]> Tested-by: Chris Healy <[email protected]> Signed-off-by: Dmitry Torokhov <[email protected]>
2016-11-16Input: synaptics-rmi4 - unlock on errorDan Carpenter1-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 <[email protected]> Signed-off-by: Dmitry Torokhov <[email protected]>
2016-11-08Input: synaptics-rmi4 - add SMBus supportBenjamin Tissoires4-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 <[email protected]> Signed-off-by: Andrew Duggan <[email protected]> Signed-off-by: Dmitry Torokhov <[email protected]>
2016-11-08Input: synaptics-rmi4 - set the ABS_MT_TOOL_TYPE bit to report tool typeAndrew Duggan1-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 <[email protected]> Signed-off-by: Benjamin Tissoires <[email protected]> Signed-off-by: Dmitry Torokhov <[email protected]>
2016-11-08Input: synaptics-rmi4 - add support for controlling dribble packets in F12Andrew Duggan1-1/+69
Implements reading and setting the dribble bit in F12's control registers. Signed-off-by: Andrew Duggan <[email protected]> Acked-by: Benjamin Tissoires <[email protected]> Signed-off-by: Benjamin Tissoires <[email protected]> Signed-off-by: Dmitry Torokhov <[email protected]>
2016-11-08Input: synaptics-rmi4 - add parameters for dribble packets and palm detect ↵Andrew Duggan4-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 <[email protected]> Reviewed-by: Benjamin Tissoires <[email protected]> Signed-off-by: Benjamin Tissoires <[email protected]> Signed-off-by: Dmitry Torokhov <[email protected]>
2016-11-08Input: synaptics-rmi4 - handle incomplete input dataAndrew Duggan3-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 <[email protected]> Signed-off-by: Benjamin Tissoires <[email protected]> Signed-off-by: Dmitry Torokhov <[email protected]>
2016-11-08Input: synaptics-rmi4 - move IRQ handling to rmi_driverBjorn Andersson4-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 <[email protected]> Signed-off-by: Benjamin Tissoires <[email protected]> Signed-off-by: Dmitry Torokhov <[email protected]>
2016-11-08Input: synaptics-rmi4 - add a couple of debug linesNick Dyer2-0/+4
Signed-off-by: Nick Dyer <[email protected]> Tested-by: Chris Healy <[email protected]> Signed-off-by: Dmitry Torokhov <[email protected]>
2016-11-08Input: synaptics-rmi4 - factor out functions from probeNick Dyer1-53/+86
Signed-off-by: Nick Dyer <[email protected]> Signed-off-by: Benjamin Tissoires <[email protected]> Tested-by: Chris Healy <[email protected]> Signed-off-by: Dmitry Torokhov <[email protected]>
2016-11-08Input: synaptics-rmi4 - stop scanning PDT after two empty pagesNick Dyer1-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 <[email protected]> [Tested successfully on S7817 and S7300 Synaptics touch controllers] Tested-by: Chris Healy <[email protected]> Reviewed-by: Andrew Duggan <[email protected]> Signed-off-by: Dmitry Torokhov <[email protected]>
2016-11-07Merge tag 'media/v4.9-3' of ↵Dmitry Torokhov851-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.
2016-10-17[media] radio-bcm2048: don't ignore errorsMauro Carvalho Chehab1-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 <[email protected]>
2016-10-14[media] pctv452e: fix semicolon.cocci warningskbuild test robot1-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 <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2016-10-14[media] flexcop-usb: don't use stack for DMAMauro Carvalho Chehab2-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 <[email protected]>
2016-10-14[media] stk-webcam: don't use stack for DMAMauro Carvalho Chehab1-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 <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2016-10-14[media] s2255drv: don't use stack for DMAMauro Carvalho Chehab1-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 <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2016-10-14[media] cpia2_usb: don't use stack for DMAMauro Carvalho Chehab1-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 <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2016-10-14[media] digitv: handle error code on RC queryMauro Carvalho Chehab1-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 <[email protected]>
2016-10-14[media] dw2102: return error if su3000_power_ctrl() failsMauro Carvalho Chehab1-1/+1
Instead of silently ignoring the error, return it. Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2016-10-14[media] nova-t-usb2: handle error code on RC queryMauro Carvalho Chehab1-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 <[email protected]>
2016-10-14[media] technisat-usb2: use DMA buffers for I2C transfersMauro Carvalho Chehab1-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 <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2016-10-14[media] pctv452e: don't call BUG_ON() on non-fatal errorMauro Carvalho Chehab1-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 <[email protected]>
2016-10-14[media] pctv452e: don't do DMA on stackMauro Carvalho Chehab1-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 <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2016-10-14[media] nova-t-usb2: don't do DMA on stackMauro Carvalho Chehab1-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 <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2016-10-14[media] gp8psk: don't go past the buffer sizeMauro Carvalho Chehab1-0/+11
Add checks to avoid going out of the buffer. Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2016-10-14[media] gp8psk: don't do DMA on stackMauro Carvalho Chehab1-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 <[email protected]>
2016-10-14[media] dtv5100: don't do DMA on stackMauro Carvalho Chehab1-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 <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2016-10-14[media] dtt200u: handle USB control message errorsMauro Carvalho Chehab1-8/+18
If something bad happens while an USB control message is transfered, return an error code. Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2016-10-14[media] dtt200u: don't do DMA on stackMauro Carvalho Chehab1-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 <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2016-10-14[media] dtt200u-fe: handle errors on USB control messagesMauro Carvalho Chehab1-9/+31
If something goes wrong, return an error code, instead of assuming that everything went fine. Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2016-10-14[media] dtt200u-fe: don't do DMA on stackMauro Carvalho Chehab1-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 <[email protected]>