This is the first step to also support the touch interface of the mc13892
pmic chip.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Abort driver initialization if X plate resistance was not specified in
platform data as it will cause pressure to be always calculated as 0,
and making userspace ignore touch coordinates.
Signed-off-by: Philip Rakity <prakity@marvell.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
CONFIG_PM is defined when CONFIG_PM_SLEEP or CONFIG_PM_RUNTIME is defined,
however suspend and resume methods are only valid in the context of
CONFIG_PM_SLEEP. If only CONFIG_PM_RUNTIME is defined we get the following
warning (courtesy of Geerts randconfig builds):
ad7879-i2c.c: warning: 'ad7879_i2c_resume' defined but not used
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Sysfs attribute show methods are always passed a buffer of length
PAGE_SIZE. To keep from overwriting this buffer and causing havoc, use
snprintf() to guarantee we never write more than the buffer can hold.
In addition, at least for my touchscreen, the number and size of objects
was far too big to fit in a single 4K page. Therefore, this patch also
trims some redundant framing text to leave more room for actual data.
Signed-off-by: Daniel Kurtz <djkurtz@chromium.org>
Acked-by: Nick Dyer <nick.dyer@itdev.co.uk>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
This patch adds the TSC-40 serial touchscreen driver and should be
compatible with TSC-10 and TSC-25.
The driver was written by Linutronix on behalf of Bachmann electronic GmbH.
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Since touchscreen driver does not handle any events to be sent to the
device we can close serio port first and then unregister the input device.
Tested-by: John Sung <penmount.touch@gmail.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Instead of having one large switch based on product ID use pointer to
function actually doing protocol decoding.
Tested-by: John Sung <penmount.touch@gmail.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Add multi touch support for PenMount 6250 touch controller.
Signed-off-by: John Sung <penmount.touch@gmail.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
The MSB and LSB of the XY axis value are switched according to the PenMount 9000 protocol. The driver name is also changed from penmountlpc, since it is not for LPC interface at all.
Signed-off-by: John Sung <penmount.touch@gmail.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Adds INPUT_PROP_POINTER or INPUT_PROP_DIRECT as necessary to the
hardware supported by the Wacom driver. The DIRECT property is
assigned to devices with an embedded screen (i.e. touchscreens
and display tablets). The POINTER property is assigned to those
without embedded screens.
Signed-off-by: Jason Gerecke <killertofu@gmail.com>
Reviewed-by: Ping Cheng <pingc@wacom.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
This will ensure that the device delivers input events only when there
are users.
Tested-by: Thierry Reding <thierry.reding@avionic-design.de>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Instead of using hard IRQ and workqueue solution switch to using threaded
interrupt handler to simplify the code and locking rules.
Tested-by: Thierry Reding <thierry.reding@avionic-design.de>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Since touchscreen driver does not handle any events to be sent to the
device we can close serio port first and then unregister the input device.
Tested-by: Ping Cheng <pingc@wacom.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Implement open() and close() methods for the input device so that we
do not start the device unless there are users listening to the events.
Acked-by: Chris Bagwell <chris@cnpbagwell.com>
Tested-by: Ping Cheng <pingc@wacom.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
tnetv107x-ts.c uses interfaces from linux/module.h,
so it should include that file. This patch fixes build errors.
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
The original license statement was confusing since it was unclear if
the license was pure GPLv2 or GPLv2+ and did not match the license
of the driver max11801_ts was derived from. The license is GPLv2+.
Signed-off-by: Jiejing Zhang <jiejing.zhang@freescale.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Atmel mxt1386 touch controller has the touch pressure information so
let's report it to the user space.
[dtor@mail.ru: added ABS_RESSURE reporting for ST emulation.]
Signed-off-by: Yufeng Shen <miletus@chromium.org>
Acked-by: Wanlong Gao <gaowanlong@cn.fujitsu.com>
Acked-by: Henrik Rydberg <rydberg@euromail.se>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Input close or device disable should not interact with the exported
gpiolib functionality. However that's the case. __ad7879_disable()
clears the entire AD7879_REG_CTRL2, while it should just power down
the ADC and its reference.
Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
The implementation does break from the for loop after we assign 'i' to
variable 'found'.
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
The implementation in cy8ctmg110_probe() does not properly set reset_pin
and irq_pin from platform data. Let's fix it.
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
i2c_master_send returns negative errno, or else the number of bytes written.
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Currently, battery drivers also use poll_sample() provided by the
wm97xx-core but this code always checks if the pen is down. Mark the
channels which really need this (i.e. for the touchscreen) with the
PEN_DOWN bit, and skip the checks otherwise. Now, the battery channels
can always be read.
Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
The current implementation of poll_sample() has the problem that one of
its arguments, the channel to be selected, differs from wm9713 to other
variants. This parameter gets passed to the (currently unused)
mach-specific functions pre_sample() and post_sample() which thus have
to deal with codec-specific differences. Refactor the routine so that
the argument to poll_sample() is generic for all codecs and do necessary
conversions only in the codec-specific driver. The outcome even uses
less code and removes the non-standard use of the PEN_DOWN bit to mark
the AUX-channels.
Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Handle the objects with multiple instances correctly when the configuration
data is loaded.
Signed-off-by: Iiro Valkonen <iiro.valkonen@atmel.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Update the object list to include new objects, and add unique identifiers
so we can distinguish between old & new generation of the same object.
Signed-off-by: Iiro Valkonen <iiro.valkonen@atmel.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
This patch updates the email address of the gpio_mouse, at32psif, and
atmel-wm97xx drivers supported by me to an email account I will use on a more
regular basis in the future.
Signed-off-by: Hans-Christian Egtvedt <hans-christian.egtvedt@atmel.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
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>
Remove the space between "platform:" prefix and the driver name.
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
These new platform-specific values can be used to set the fuzz parameter
passed to the input_set_abs_params() function for the ABS_X, ABS_Y and
ABS_PRESSURE axes.
Signed-off-by: Thierry Reding <thierry.reding@avionic-design.de>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
This new parameter allows the polling frequency to be configured while
keeping the default of once every millisecond.
Signed-off-by: Thierry Reding <thierry.reding@avionic-design.de>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Depending on the quality of the touch panel, the time for the X-, X+, Y-
and Y+ inputs to settle may vary. The poll_delay parameter can be used
to override the default of 1 millisecond.
Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: Kwangwoo Lee <kwangwoo.lee@gmail.com>
Signed-off-by: Thierry Reding <thierry.reding@avionic-design.de>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Finger touch events or very quick stylus events on low-quality panels
can cause the tsc2007 to read bogus values. Looking at oscilloscope
snapshots, this seems to be caused by the touch event disappearing
during the measurements. These bogus values result in misclicks, where
the X and Y values deviate from the real position.
Most of these misclicks can be filtered out by setting a low enough
threshold for the maximum resistance (which is loosely the inverse of
the pressure) allowed to consider a set of values valid. Since this
behaviour is largely dependent on the type and quality of the panel,
this commit introduces the max_rt parameter. The default value is kept
at MAX_12BIT.
Signed-off-by: Thierry Reding <thierry.reding@avionic-design.de>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
When the controller signals a pen-down event via the platform-specific
GPIO, while the sample values indicate an invalid measurement, the
measurement needs to be repeated.
Signed-off-by: Thierry Reding <thierry.reding@avionic-design.de>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
This error handling code can be reached before ts_dev->input is
initialized, so it is safer to always use the original name,
input_dev.
Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
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>
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>
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>
Make sure we are passing the same cookie in all calls to request_irq() and
free_irq().
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Don't report BTN_TOUCH until we've got data as some less robust applications
can be confused by getting a touch event by itself and it doesn't seem
unreasonable for them to expect coordinates along with a touch.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
This allows maximum flexibility for configuring the direct GPIO based
interrupts.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
If the WM831x pen down and data IRQs run in parallel it is possible for the
data and pen down IRQs to deadlock themselves as one is part way through
disabling its operation while the other is part way through enabling. Fix
this by always disabling the pen down interrupt while data is active and
vice versa. When a changeover is required we disable the IRQ that is to
be stopped then schedule work that will enable the new IRQ.
We need to handle the data flow in the data IRQ as the readback from the
device needs to be ordered correctly with the IRQ for robust operation.
This also fixes an issue when using the built in IRQs due to enable_irq()
not being valid from interrupt context on an interrupt controller with bus
operations like the built in IRQ controller - this issue may also have
affected other interrupt controllers. We can't rely on having the data
and pen down IRQs available via GPIOs on the CPU on every system.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input:
Input: xen-kbdfront - fix mouse getting stuck after save/restore
Input: estimate number of events per packet
Input: evdev - indicate buffer overrun with SYN_DROPPED
Input: document event types and codes and their intended use
Input: add KEY_IMAGES specifically for AL Image Browser
Input: twl4030_keypad - fix potential NULL dereference in twl4030_kp_probe()
Input: h3600_ts - fix error handling at connect
Input: twl4030_keypad - avoid potential NULL-pointer dereference
Atmel touchscreen chips can use MT protocol B because they can assign
unique id to ABS_MT_TRACKING_ID from finger id provided by hardware.
Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
Reviewed-by: Henrik Rydberg <rydberg@euromail.se>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Make the CHG line (interrupt line) go high after the interrupts have been
enabled to make sure we don't miss the falling edge.
Signed-off-by: Iiro Valkonen <iiro.valkonen@atmel.com>
Acked-by: Joonyoung Shim <jy0922.shim@samsung.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Atmel touchscreen chip can support 12bit resolution and this patch
modifies to get maximum x and y size from platform data.
Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
Acked-by: Iiro Valkonen <iiro.valkonen@atmel.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Add MAXI max11801 resistive touchscreen controller driver. This driver
uses Auto Mode and Aperture Mode.
Support for other max1180x devices can be added to this driver as well,
as they use almost the same register addresses and codes.
You can find data sheet here:
http://www.maxim-ic.com/datasheet/index.mvp/id/5943
Signed-off-by: Zhang Jiejing <jiejing.zhang@freescale.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
In case of an error in h3600ts_connect(), deconstruct in correct order
and with the right calls.
Signed-off-by: Christoph Fritz <chf.fritz@googlemail.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input:
Input: tsc2005 - fix locking issue
Input: tsc2005 - use relative jiffies to schedule the watchdog
Input: tsc2005 - driver should depend on GENERIC_HARDIRQS
Commit 0b950d3 (Input: tsc2005 - add open/close) introduced a
locking issue with the ESD watchdog: __tsc2005_disable() is calling
cancel_delayed_work_sync() with mutex held, and the work also needs the
same mutex.
Fix the problem by using mutex_trylock() in tsc2005_esd_work(). If the
mutex is taken, we know we are in the middle of disable or enable and
the watchdog check can be skipped.
Signed-off-by: Aaro Koskinen <aaro.koskinen@nokia.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Use relative jiffies to schedule the watchdog. Otherwise it will run
like a mad one.
Signed-off-by: Aaro Koskinen <aaro.koskinen@nokia.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
drivers/input/touchscreen/tsc2005.c: In function ‘tsc2005_probe’:
drivers/input/touchscreen/tsc2005.c:666: error: implicit declaration of function ‘set_irq_wake’
In addition, migrate from set_irq_wake() (marked "do not use" as of commit
a0cd9ca2b9 ("genirq: Namespace cleanup")) to
irq_set_irq_wake().
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input: (64 commits)
Input: tsc2005 - remove 'disable' sysfs attribute
Input: tsc2005 - add open/close
Input: tsc2005 - handle read errors from SPI layer
Input: tsc2005 - do not rearm timer in hardirq handler
Input: tsc2005 - don't use work for 'pen up' handling
Input: tsc2005 - do not use 0 in place of NULL
Input: tsc2005 - use true/false for boolean variables
Input: tsc2005 - hide selftest attribute if we can't reset
Input: tsc2005 - rework driver initialization code
Input: tsc2005 - set up bus type in input device
Input: tsc2005 - set up parent device
Input: tsc2005 - clear driver data after unbinding
Input: tsc2005 - add module description
Input: tsc2005 - remove driver banner message
Input: tsc2005 - remove incorrect module alias
Input: tsc2005 - convert to using dev_pm_ops
Input: tsc2005 - use spi_get/set_drvdata()
Input: introduce tsc2005 driver
Input: xen-kbdfront - move to drivers/input/misc
Input: xen-kbdfront - add grant reference for shared page
...
I believe that enable/disable functionality should not be implemented on
the individual driver level but rather in device core, potentially
reusing parts of PM framework. Therefore the driver-specific "disable"
attribute is removed from the mainline driver.
Tested-by: Aaro Koskinen <aaro.koskinen@nokia.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Introduce open and close methods for the input device to keep the device
powered down when it is not in use. Also rework interaction between
interrupt thread and starting/shutting off/resetting the device: instead
of taking a mutex in the intterrupt thread and elsewhere disable interrupts
before transitioning the device in a new state.
The ESD handling is also separated from the IRQ thread; we poll regularly
at a given interval and simply skip reads if we see that valid interrupt
happened not so long ago. This allows us not cancel and reschedule ESD
work from interrupt context all the time.
Tested-by: Aaro Koskinen <aaro.koskinen@nokia.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
We will most likely rearm it yet again the IRQ thread so doing it here
is pointless.
Tested-by: Aaro Koskinen <aaro.koskinen@nokia.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
We do not need process context to send input events so let's switch to
a regular timer. I am going to get rid of taking ts->mutex in
tsc2005_irq_thread() later.
Tested-by: Aaro Koskinen <aaro.koskinen@nokia.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Sparse in unhappy when people use 0 instead of NULL for pointers so
let's rework the way we initialize spi_transfer structure in
tsc2005_cmd() and tsc2005_write().
Tested-by: Aaro Koskinen <aaro.koskinen@nokia.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
If implementation to perform self-test/reset has not been provided by the
platform code hide 'selftest' sysfs attribute instead of returning error
when someone tries to use it.
Tested-by: Aaro Koskinen <aaro.koskinen@nokia.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
We need to make sure we have time/work initialized before requesting and
enabling interrupts, otherwise we might start using them way too early.
Tested-by: Aaro Koskinen <aaro.koskinen@nokia.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
We know what bus we are residing on (SPI) so let's make this data
available to the users.
Tested-by: Aaro Koskinen <aaro.koskinen@nokia.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Set up SPI device as parent of the input device so it gets placed into
proper place in sysfs tree.
Tested-by: Aaro Koskinen <aaro.koskinen@nokia.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
We should not leave garbage pointers in driver structure after we unbind
it from the device or if bind fails.
Tested-by: Aaro Koskinen <aaro.koskinen@nokia.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Add proper module description so that it would show in 'modinfo'
output.
Tested-by: Aaro Koskinen <aaro.koskinen@nokia.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
The boot process is noisy as it is and input core already announces
all new device so let's get rid of the banner message in the driver.
Tested-by: Aaro Koskinen <aaro.koskinen@nokia.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
TSC2005 is not a platform driver so it should not define "platform:tsc2005"
module alias.
Tested-by: Aaro Koskinen <aaro.koskinen@nokia.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Newer code should not be using legacy suspend/resume methods but
rather supply dev_pm_ops structure as it allows better control
over power management.
Tested-by: Aaro Koskinen <aaro.koskinen@nokia.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Instead of peeking into underlying device and using dev_get/set_drvdata(),
let's use SPI layer's implementation to access driver-private data
(which may be different from driver-core private data).
Tested-by: Aaro Koskinen <aaro.koskinen@nokia.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Discussions:
http://www.mail-archive.com/linux-omap@vger.kernel.org/msg26748.html
Introduce a driver for the Texas Instruments TSC2005 touchscreen
controller (http://focus.ti.com/docs/prod/folders/print/tsc2005.html).
The patch is based on a driver by Lauri Leukkunen, with modifications
by David Brownell, Phil Carmody, Imre Deak, Hiroshi DOYU, Ari Kauppi,
Tony Lindgren, Jarkko Nikula, Eero Nurkkala and Roman Tereshonkov.
Signed-off-by: Lauri Leukkunen <lauri.leukkunen@nokia.com>
[aaro.koskinen@nokia.com: patch description, rebasing & cleanup]
Signed-off-by: Aaro Koskinen <aaro.koskinen@nokia.com>
[ext-srikar.1.bhavanarayana@nokia.com: various fixes]
Signed-off-by: Srikar <ext-srikar.1.bhavanarayana@nokia.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Atmel mXT1386 chip is operated by atmel_mxt_ts driver and it has some
different objects.
Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Atmel touchscreen chips have different firmware version with each chip,
so we cannot distinguish attribute of chip by firmware version.
Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Explicitly set all the enable bits when opening the device just in case
something left the device in an unexpected state.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
tslib expects pressure measurements so enable them by default for better
compatibility.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
The mxt_check_matrix_size() is currently setting the CTE mode to match
xline/yline information that is in the platform data, but it does not
take into account for example the fact that we could have a key array
in use too (key array would use some x/y lines as well).
It would be better to simply rely on the configuration data, and make
sure that the CTE mode set in there matches the touch object (touchscreen,
key array, proximity) configuration (which are set in the config data too).
Signed-off-by: Iiro Valkonen <iiro.valkonen@atmel.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Different board have different requirements/setups so let's be more
flexible.
Signed-off-by: Iiro Valkonen <iiro.valkonen@atmel.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
As there is no common configuration settings that would work in every
situation, remove the fixed config data from driver code and add
config data to platform data.
Signed-off-by: Iiro Valkonen <iiro.valkonen@atmel.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
"mXT224" is used in the Intel mid firmware in SFI tables to identify the
presence of this I2C device.
Signed-off-by: Chris Leech <christopher.leech@linux.intel.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Read the whole message, as reading just the first byte isn't always
guaranteed to clear the message.
Signed-off-by: Iiro Valkonen <iiro.valkonen@atmel.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Change prefixes from qt602240 to mxt to reflect that the driver supports
whole line of mXT touchscreens.
Signed-off-by: Iiro Valkonen <iiro.valkonen@atmel.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Since the driver will be supporting whole range of Atmels mXT touchscreen
controllers we better rename it to atmel_mxt_ts.
Acked-by: Iiro Valkonen <iiro.valkonen@atmel.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
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>