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 <[email protected]>
We leak "cd" if the cd->xfer_buf allocation fails. It was weird to
"goto error_gpio_irq" so I changed the label name. (Label names should
reflect the label location not the goto location otherwise you get an
"all roads lead to Rome problem").
Signed-off-by: Dan Carpenter <[email protected]>
Signed-off-by: Dmitry Torokhov <[email protected]>
If "cd" were NULL then we would dereference it when we print the error
message. Fortunately enough, it can't ever be NULL so we can remove
those lines.
Signed-off-by: Dan Carpenter <[email protected]>
Signed-off-by: Dmitry Torokhov <[email protected]>
"*max" is a size_t (long) type but "1" is an int so static checkers
complain that the shift could wrap.
Signed-off-by: Dan Carpenter <[email protected]>
Signed-off-by: Dmitry Torokhov <[email protected]>
There is no need to roll our own polling scheme when we already have
one implemented by the core.
Tested-by: Manish Badarkhe <[email protected]>
Signed-off-by: Dmitry Torokhov <[email protected]>
Cypress TrueTouch(tm) Standard Product controllers,
Generetion4 devices, Core driver.
Core driver is interface between host and TTSP controller and processes
data sent by controller.
Responsibilities of module are IRQ handling, reading system information
registers and sending multi-touch protocol type B events.
Signed-off-by: Ferruh Yigit <[email protected]>
Acked-by: Greg Kroah-Hartman <[email protected]>
Acked-by: Javier Martinez Canillas <[email protected]>
Signed-off-by: Dmitry Torokhov <[email protected]>
Existing I2C code is for TrueTouch Gen3 devices
TrueTouch Gen4 device is using same protocol, will split driver into
two pieces to use common code with both drivers.
Read/Write functions parameter list modified, since shared code will
be used by two separate drivers and these drivers are not sharing same
structs, parameters updated to use common structures.
Signed-off-by: Ferruh Yigit <[email protected]>
Acked-by: Greg Kroah-Hartman <[email protected]>
Acked-by: Javier Martinez Canillas <[email protected]>
Signed-off-by: Dmitry Torokhov <[email protected]>
Although defined in platform data, vref is not used anywhere.
Also remove model, irq, and clear_penirq as they are not used either.
Signed-off-by: Dmitry Torokhov <[email protected]>
tsc->polling is write only and the poll local is meaningless
Signed-off-by: Alan Cox <[email protected]>
Signed-off-by: Dmitry Torokhov <[email protected]>
Although BTN_TOOL_PEN and BTN_TOOL_RUBBER functioned properly, the driver
didn't have hover functionality, so it's been added.
Also, "WACOM_RETRY_CNT" was not used, so it was removed.
Signed-off-by: Tatsunosuke Tobita <[email protected]>
Signed-off-by: Dmitry Torokhov <[email protected]>
The previous patch ("input/ti_am335x_tsc: ACK the HW_PEN irq in ISR")
acked the interrupt so we don't freeze if we don't handle an enabled
interrupt source. The interrupt core has a mechanism for this and to get
it work one should only say that it handled an interrupt if it is
actually the case.
Signed-off-by: Sebastian Andrzej Siewior <[email protected]>
The interrupt source IRQENB_HW_PEN is enabled in suspend and suposed to
be used as a wake up source. Once this interrupt source is unmaksed, the
devices ends up in ISR and never continues.
This change ACKs the interrupt and disables it so the system does not
freeze.
Signed-off-by: Sebastian Andrzej Siewior <[email protected]>
The driver programs a threshold of "coordinate_readouts" say 5. The
REG_FIFO0THR registers says it should it be programmed to "threshold
minus one". The driver does not expect just 5 coordinates but 5 * 2 + 2.
Multiplied by two because 5 for X and 5 for Y and plus 2 because we have
two Z.
The whole thing kind of works because It reads the 5 coordinates for X
and Y from FIFO0 and FIFO1 and the last element in each FIFO is ignored
within the loop and read later.
Nothing guaranties that FIFO1 is ready by the time it is read. In fact I
could see that that FIFO1 reaturns for Y channels 8,9, 10, 12, 6 and for
Y channel 7 for Z. The problem is that channel 7 and channel 12 got
somehow mixed up.
The other Problem is that FIFO1 is also used by the IIO part leading to
wrong results if both (tsc & adc) are used.
The patch tries to clean up the whole thing a little:
- Remove the +1 and -1 in REG_STEPCONFIG, REG_STEPDELAY and its counter
part in the for loop. This is just confusing.
- Use only FIFO0 in TSC. The fifo has space for 64 entries so should be
fine.
- Read the whole FIFO in one function and check the channel.
- in case we dawdle around, make sure we only read a multiple of our
coordinate set. On the second interrupt we will cleanup the remaining
enties.
Acked-by: Dmitry Torokhov <[email protected]>
Signed-off-by: Sebastian Andrzej Siewior <[email protected]>
This patch removes access to platform data mfd_tscadc_board because the
platform is DT only.
Acked-by: Dmitry Torokhov <[email protected]>
Signed-off-by: Sebastian Andrzej Siewior <[email protected]>
This patch adds DT support to touch driver. It also provides a binding
document which is used by the MFD and IIO part of the device.
This patch also renames steps_to_configure to coordinate_readouts
because the original name misleads the purpose of the variable.
Signed-off-by: Pantelis Antoniou <[email protected]>
Signed-off-by: Patil, Rachna <[email protected]>
Signed-off-by: Felipe Balbi <[email protected]>
Signed-off-by: Sebastian Andrzej Siewior <[email protected]>
When touchscreen and ADC are used together, this
unwanted fifo flush leads to loss of ADC data.
Signed-off-by: Patil, Rachna <[email protected]>
Signed-off-by: Felipe Balbi <[email protected]>
Signed-off-by: Sebastian Andrzej Siewior <[email protected]>
The current driver expected touchscreen input
wires(XP,XN,YP,YN) to be connected in a particular order.
Making changes to accept this as platform data.
Sebastian reworked the original patch and removed a lot of the not
required pieces.
Signed-off-by: Patil, Rachna <[email protected]>
Signed-off-by: Felipe Balbi <[email protected]>
Signed-off-by: Sebastian Andrzej Siewior <[email protected]>
Current code has hard coded value written to
step enable bits. Now the bits are updated based
on how many steps are needed to be configured got
from platform data.
The user needs to take care not to exceed
the count more than 16. While using ADC and TSC
one should take care to set this parameter correctly.
Sebastian added the common lock and moved the code, that manipulates the
steps, from into the mfd module.
Signed-off-by: Patil, Rachna <[email protected]>
Signed-off-by: Felipe Balbi <[email protected]>
Signed-off-by: Sebastian Andrzej Siewior <[email protected]>
The mfd driver creates platform data for the child devices and it is the
ti_tscadc_dev struct. This struct is copied for the two devices.
The copy of the structure makes a common lock in this structure a little
less usefull. Therefore the platform data is not a pointer to the
structure and the same structure is used.
While doing the change I noticed that the suspend/resume code assumes
the wrong pointer for ti_tscadc_dev and this has been fixed as well.
Signed-off-by: Sebastian Andrzej Siewior <[email protected]>
If pdata is NULL, atmel_tsadcc_probe() will release all the resources
and return 0, but we need a error code is returned in this case.
Fix to return -EINVAL and move the check for pdata to the begin
of this function.
Signed-off-by: Wei Yongjun <[email protected]>
Signed-off-by: Dmitry Torokhov <[email protected]>
The command and status register in the driver were swapped with
respect to the order specified in the datasheet (CY8CTMA140).
Confirmed with Cypress that the order in the datasheet is correct.
Signed-off-by: Matthias Kaehlcke <[email protected]>
Acked-by: Javier Martinez Canillas <[email protected]>
Signed-off-by: Dmitry Torokhov <[email protected]>
For the devices that has blocking with timeout communication, these
extra handshakes will prevent one timeout delay in startup sequence
Tested-by: Ferruh Yigit <[email protected]> on TMA300-DVK
Signed-off-by: Ferruh Yigit <[email protected]>
Acked-by: Javier Martinez Canillas <[email protected]>
Signed-off-by: Dmitry Torokhov <[email protected]>
Use the wrapper functions for getting and setting the driver data using
platform_device instead of using dev_{get,set}_drvdata() with &pdev->dev,
so we can directly pass a struct platform_device.
Signed-off-by: Jingoo Han <[email protected]>
Signed-off-by: Dmitry Torokhov <[email protected]>
Commit 0998d06310 (device-core: Ensure drvdata = NULL when no
driver is bound) removes the need to set driver data field to
NULL.
Signed-off-by: Sachin Kamat <[email protected]>
Signed-off-by: Dmitry Torokhov <[email protected]>
Commit 0998d06310 (device-core: Ensure drvdata = NULL when no
driver is bound) removes the need to set driver data field to
NULL.
Signed-off-by: Sachin Kamat <[email protected]>
Signed-off-by: Dmitry Torokhov <[email protected]>
Commit 0998d06310 (device-core: Ensure drvdata = NULL when no
driver is bound) removes the need to set driver data field to
NULL.
Signed-off-by: Sachin Kamat <[email protected]>
Signed-off-by: Dmitry Torokhov <[email protected]>
Commit 0998d06310 (device-core: Ensure drvdata = NULL when no
driver is bound) removes the need to set driver data field to
NULL.
Signed-off-by: Sachin Kamat <[email protected]>
Signed-off-by: Dmitry Torokhov <[email protected]>
Commit 0998d06310 (device-core: Ensure drvdata = NULL when no
driver is bound) removes the need to set driver data field to
NULL.
Signed-off-by: Sachin Kamat <[email protected]>
Signed-off-by: Dmitry Torokhov <[email protected]>
Commit 0998d06310 (device-core: Ensure drvdata = NULL when no
driver is bound) removes the need to set driver data field to
NULL.
Signed-off-by: Sachin Kamat <[email protected]>
Signed-off-by: Dmitry Torokhov <[email protected]>
Commit 0998d06310 (device-core: Ensure drvdata = NULL when no
driver is bound) removes the need to set driver data field to
NULL.
Signed-off-by: Sachin Kamat <[email protected]>
Signed-off-by: Dmitry Torokhov <[email protected]>
Commit 0998d06310 (device-core: Ensure drvdata = NULL when no
driver is bound) removes the need to set driver data field to
NULL.
Signed-off-by: Sachin Kamat <[email protected]>
Acked-by: Hans-Christian Egtvedt <[email protected]>
Signed-off-by: Dmitry Torokhov <[email protected]>
Commit 0998d06310 (device-core: Ensure drvdata = NULL when no
driver is bound) removes the need to set driver data field to
NULL.
Signed-off-by: Sachin Kamat <[email protected]>
Signed-off-by: Dmitry Torokhov <[email protected]>
The usage of devm_* functions makes code cleaner and tidier.
Signed-off-by: Andy Shevchenko <[email protected]>
Signed-off-by: Dmitry Torokhov <[email protected]>
The egalax_ts touchscreen modul not report ABS_MT_POSITION_Y proper.
As result it may be, that upper software levels only receive x coordinates well.
Signed-off-by: Heiko Abraham <[email protected]>
Cc: [email protected]
Signed-off-by: Dmitry Torokhov <[email protected]>
We add the possibility to hand over a GPIO number for the reset pin.
This way we can remove existing board code that takes care of it and
group this information properly in the platform data or in the device
tree configuration.
Signed-off-by: Bastian Hecht <[email protected]>
Acked-by: Laurent Pinchart <[email protected]>
Signed-off-by: Dmitry Torokhov <[email protected]>
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 <[email protected]>
Signed-off-by: Dmitry Torokhov <[email protected]>
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 <[email protected]>
Signed-off-by: Dmitry Torokhov <[email protected]>
kfree on a null pointer is a no-op. Hence null check is not
necessary.
Signed-off-by: Sachin Kamat <[email protected]>
Signed-off-by: Dmitry Torokhov <[email protected]>
This patch converts the drivers to use the
module_platform_driver_probe() macro which makes the code smaller and
a bit simpler.
Signed-off-by: Fabio Porcedda <[email protected]>
Signed-off-by: Dmitry Torokhov <[email protected]>