sec_ts driver used a mutex to serialize access to a flag indicating whether any
command is currently running. But some code path reading the status of
the flag were not protected which could potentially result in race. In
any case a mutex for a flag seem an over-kill. This CL got rid of this
mutex by converting the flag to an atomic variable.
Bug: 123027495
Change-Id: I4537241d5d10dc97dd764fe8324afb35c414668c
Signed-off-by: Biswajit Dash <bisdash@google.com>
Match video device name with input device name.
There isn't an explicit API in v4l2 to get the video device name. The
closest API to this is struct v4l2_capability.card that is obtained via
VIDIOC_QUERYCAP ioctl.
Currently, the "card" field is set to the touch driver name, which may
(and usually does) not correspond to the input device name. To fix this,
add an optional reference to the parent input device.
The decision was made here to just provide an input device reference
instead of just copying the string name into the v4l2 struct. The
rationale is that the logic is simpler, the nullness check can be more
meaningful (if not specified, can default to driver name), and it is
more efficient to just keep a pointer around instead of worrying about
copying strings, allocating the proper amount of space, etc.
Test: tested with C1. With additional (unreleased) code to match the
input device with a video device in inputflinger, able to correctly
receive the video frames and pass that on to higher layers of the stack.
Bug: 111480215
Signed-Off-By: Siarhei Vishniakou <svv@google.com>
Change-Id: I2b84a6d5d06a0cb88ab0ae03ec1fa32c1a1e7405
The access (r/w) to the list of heatmap buffers was protected by the
heatmap lock. However, the actual usage of the buffers was not.
Therefore, once a buffer is dequeued from the list, it was being
modified without the lock protection. This lead to the following
problem: during teardown, if a touch interrupt comes in, the buffers can
be torn down but still be accessed from the heatmap read. This caused
kernel panic (leading to ramdump).
To reproduce the bug, write a program that accesses the heatmap video
device, and then crashes (happened during HAL development). Next,
continuosly touch the screen (to keep generating interrupts), and launch
the HAL process. The phone will enter ramdump after HAL crashes.
To fix this, move the bus read into a separate step in the interrupt
routine. Now there's a private temporary buffer on the stack that the
bus read is pulling data into. Once the bus read is finished, the data
from the temporary buffer gets copied into the actual (user-readable)
heatmap frame in a single locking operation.
This change means that we no longer (*) check if there are available
buffers before we begin the bus read. This could lead to inefficiency,
since at the end of the bus read, we may find out that there aren't any
free buffers, so we will drop the frame. That would mean that the bus
read was wasteful. In real life testing, however, such a situation was
not observed.
* we do actually check
Still, to account for this possibility, we add an optimization. If we
see that this situation happens at least 3 times in a row, we will start
checking for the availability of free buffers before doing the bus read.
This would also help prevent logspam, which currently happens in a
situation where the user process decided to stop reading buffers, but
did not stop streaming.
We don't want to unconditionally check for availability of free buffers
before the bus read, because it is possible that a buffer may become
available during the read itself. The read can take several
milliseconds, so this could give the user space additional time to
process the existing data and return a buffer.
To check for whether the streaming is currently on, use official api
"vb2_is_streaming", instead of using hidden api "streaming".
Small additional fixes:
- Ensure consistent use of strength_t
- Add a doc for heatmap_read
Bug: 117469302
Test: crashes no longer observed using the steps described above
Change-Id: I2b77a79469e22ce4ee39827a951a2ace58db8972
Signed-Off-By: Siarhei Vishniakou <svv@google.com>
Register v4l2 device to report heatmap data. Use MSC_TIMESTAMP events
to synchronize the video frames with the input events.
Now includes:
- Support for B1 and C1
- registering of the v4l-touch device in the touch driver
- data properly written to video frame
- timestamps are populated
- report msc_timestamp before sync, but read_heatmap after:
this informs user space that input event occurred, and allows the
i2c read to happen in parallel. Then, user space can wait on the frame
to become available.
Bug: 62940136
Test: used the HeatMapDemo app to visually confirm the output
Signed-off-by: Siarhei Vishniakou <svv@google.com>
Change-Id: Ib282a0c59849a07cac542c1cdc6ed2b3d035a6af
Switch i2c master to SSC during suspend and switch back to AP during
resume.
Bug: 113627738
Test: function works
Change-Id: Iaad8c8e46854746317af2e5533b0a9bca4aec5f9
Signed-off-by: Bob Chang <bobpcchang@google.com>
Update different firmware image based on different panel id.
Bug: 112520426
Test: build full image to verify.
Change-Id: I90bc3701d453c70f39e32d67d7648fa5298b7a52
Signed-off-by: davidycchen <davidycchen@google.com>
Add "packout" reboot reason to signal to the bootloader we
want it to go into its in-boxing mode.
Bug: 112744852
Change-Id: Id575bd67994ee13024c96d70428ba31ea844f5c3
Signed-off-by: Chris Fries <cfries@google.com>
Add touch point location log, and set default to off.
Turn on the log by /sys/android_touch/debug_level.
Change-Id: I9517491f813cc44031a250cd313b78cdbf7fe437
Signed-off-by: davidycchen <davidycchen@google.com>
While holding power key to trigger reset, the bootreason is
reboot_longkey and also stored in RAMDUMP_MSG.txt.
Bug: 79553608
Bug: 110231796
Change-Id: I17ec89337d754e83d7dd218430af1f92f72173cb
Signed-off-by: Chungjui Fan <chungjuifan@google.com>
Signed-off-by: Chris Fries <cfries@google.com>
bootreason would be brought to kernel cmdline for debugging usage
bootreason is set to 'WDT' by bootloader by default
bootreason is set to 'PANIC' or 0 when KP or reboot is triggered
Bug: 80553005
Change-Id: I58c40cee99f3eee615fcef9e514cb4fc0d3a9b4b
Signed-off-by: jonechou <jonechou@google.com>
This commit is a squash of all the below commits from the
branch msm-3.18 with updated license and checkpatch errors fixed
25bdea0 input: synaptics_2.6: add pin control func for TMO project
f24e4ec synaptics_dsx_2.6: not reinit when spontaneous reset is detected
1b62edb input: synaptics_dsx_2.6: correct secure_touch_init function
109cf15 input: synaptics_dsx_2.6: correct sysfs permissions
a7ade8b5 input: synaptics_dsx_2.6: fix issues raised by static analyzer
5c47ba4 input: synaptics_dsx_2.6: fix CTP power issue for QRD8953
9832a75 input: synaptics: defer touch resume to workqueue for v2.6 driver
4059151 input: synaptics_dsx_2.6: Add support for clocks for secure touch
422e578 input: synaptics_dsx_2.6: remove fake touch points
a75bcbc input: synaptics_dsx_2.6: creation of secure touch sysfs ifiles
4a580c2 synaptics_dsx_2.6: add secure touch support for Synaptics V2.6
Change-Id: Ice4e04189a6280d94ab09a426860975a65724635
Signed-off-by: Venkata Prahlad Valluru <vvalluru@codeaurora.org>
Signed-off-by: Shantanu Jain <shjain@codeaurora.org>
Conflicts:
Makefile
drivers/media/platform/msm/camera/cam_lrme/lrme_hw_mgr/cam_lrme_hw_mgr.c
drivers/power/supply/qcom/qpnp-smb2.c
fs/crypto/crypto.c
fs/crypto/policy.c
Changed arch/arm64/boot/dts/google/sdm845-b1c1-memory.dtsi to accomodate
for new memory layout in arch/arm64/boot/dts/qcom/sdm845.dtsi
Change-Id: Ibb6fbf95bd1f8fba142e77807cce42cde5f793a2
This is the reference driver source code for synaptics touch driver,
the version is 2.6.
All the new files are copied from the git commit:
7b6b9d126aca1f371e8abf3ae56d7a5a4e538f13
drivers/input/touchscreen/synaptics_dsx_2.6/synaptics_dsx_active_pen.c
is copied from
kernel/drivers/input/touchscreen/synaptics_dsx/synaptics_dsx_active_pen.c;
drivers/input/touchscreen/synaptics_dsx_2.6/synaptics_dsx_core.c
is copied from
kernel/drivers/input/touchscreen/synaptics_dsx/synaptics_dsx_core.c;
drivers/input/touchscreen/synaptics_dsx_2.6/synaptics_dsx_core.h
is copied from
kernel/drivers/input/touchscreen/synaptics_dsx/synaptics_dsx_core.h;
drivers/input/touchscreen/synaptics_dsx_2.6/synaptics_dsx_fw_update.c
is copied from
kernel/drivers/input/touchscreen/synaptics_dsx/synaptics_dsx_fw_update.c;
drivers/input/touchscreen/synaptics_dsx_2.6/synaptics_dsx_gesture.c
is copied from
kernel/drivers/input/touchscreen/synaptics_dsx/synaptics_dsx_gesture.c;
drivers/input/touchscreen/synaptics_dsx_2.6/synaptics_dsx_i2c.c
is copied from
kernel/drivers/input/touchscreen/synaptics_dsx/synaptics_dsx_i2c.c;
drivers/input/touchscreen/synaptics_dsx_2.6/synaptics_dsx_proximity.c
is copied from
kernel/drivers/input/touchscreen/synaptics_dsx/synaptics_dsx_proximity.c;
drivers/input/touchscreen/synaptics_dsx_2.6/synaptics_dsx_rmi_dev.c
is copied from
kernel/drivers/input/touchscreen/synaptics_dsx/synaptics_dsx_rmi_dev.c;
drivers/input/touchscreen/synaptics_dsx_2.6/synaptics_dsx_rmi_hid_i2c.c
is copied from
kernel/drivers/input/touchscreen/synaptics_dsx/synaptics_dsx_rmi_hid_i2c.c;
drivers/input/touchscreen/synaptics_dsx_2.6/synaptics_dsx_spi.c
is copied from
kernel/drivers/input/touchscreen/synaptics_dsx/synaptics_dsx_spi.c;
drivers/input/touchscreen/synaptics_dsx_2.6/synaptics_dsx_test_reporting.c
is copied from
kernel/drivers/input/touchscreen/synaptics_dsx/synaptics_dsx_test_reporting.c
drivers/input/touchscreen/synaptics_dsx_2.6/synaptics_dsx_video.c
is copied from
kernel/drivers/input/touchscreen/synaptics_dsx/synaptics_dsx_video.c
include/linux/input/synaptics_dsx_v2_6.h
is copied from
kernel/include/linux/input/synaptics_dsx.h
Change-Id: Ifda2c38ca5b4a82c3363d8c59ae9da3839568e82
Signed-off-by: Mao Li <maol@codeaurora.org>
- Modified sec_ts driver and added sec_cmd
- Modified Linux header files with changes from open source kernel
Bug: 69859019
Change-Id: Ibd8b53eadb5726720505dfdd4f25e290b8de3e97
Signed-off-by: Steve Pfetsch <spfetsch@google.com>
As the IMEM approach to store reset reason is deprecated, so use
the spare register in PMIC power-on peripheral to store the oem
restart reason.
Bit-2 to bit-7 of SOFT_RB_SPARE for hard reset reason, so divide
existing range into regions, value 0 to 31 for common defined features
and 32 to 63 values are for OEMs/ODMs specific features.
Change-Id: Ib8e64d6dd5a335325d0469280e41e9d10ec9b893
Signed-off-by: Lijuan Gao <lijuang@codeaurora.org>
The qpnp-power-on driver provides support for key presses via
several key specific PMIC inputs. It also supports reading
power-on reasons and configuring the power-off type (i.e.
restart, shutdown, etc).
This snapshot is taken as of msm-4.4
commit 07f2f9952c78 ("input: move qpnp-power-on driver into
input/misc directory").
Change-Id: Idcbaefa635d49075c9b93819766d722ca0eb698f
Signed-off-by: David Collins <collinsd@codeaurora.org>
Extend touchscreen_parse_properties() with support for the
touchscreen-inverted-x/y and touchscreen-swapped-x-y properties and
add touchscreen_set_mt_pos() and touchscreen_report_pos() helper
functions for storing coordinates into a input_mt_pos struct, or
directly reporting them, taking these properties into account.
This commit also modifies the existing callers of
touchscreen_parse_properties() to pass in NULL for the new third
argument, keeping the existing behavior.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Drop support for platform data passed via a C-structure and switch to
device properties instead, which should make the driver compatible
with all platforms: OF, ACPI and static boards. Static boards should
use property sets to communicate device parameters to the driver.
Signed-off-by: Oreste Salerno <oreste.salerno@tomtom.com>
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
We do not have any users of platform data in the tree and all newer
platforms are either DT or ACPI, so let's drop handling of platform data.
Tested-by: Franklin S Cooper Jr <fcooper@ti.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
The current/old gpio framework used doesn't properly listen to
ACTIVE_LOW and ACTIVE_HIGH flags. The newer gpio framework takes into
account these flags when setting gpio values.
Since the values being output were based on voltage and not logic they
change to reflect this difference. Also use gpiod_set_value_cansleep since
wake and reset pins can be provided by bus based io expanders.
Switch from msleep(5) to udelay_range(5000,6000) to avoid check patch
warning.
Signed-off-by: Franklin S Cooper Jr <fcooper@ti.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Let's move driver's platform data definitions from include/linux/input/
into include/linux/platform_data/ so that it stays with the rest of
platform data definitions.
Acked-by: Roger Quadros <rogerq@ti.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Let's switch form OF to device properties so that common parsing code could
work not only on device tree but also on ACPI-based platforms.
Reviewed-by: Roger Quadros <rogerq@ti.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
When applying touchscreen parameters specified in device tree let's make
sure we keep whatever setup was done by the driver and not reset the
missing values to zero.
Reported-by: Pavel Machek <pavel@ucw.cz>
Tested-by: Pavel Machek <pavel@ucw.cz>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Some devices are not fast enough to differentiate between a fast-moving
contact and a new contact. This problem cannot be fully resolved because
information is truly missing, but it is possible to safe-guard against
obvious mistakes by restricting movement with a maximum displacement.
The new problem formulation for dmax > 0 cannot benefit from the speedup
for positive definite matrices, but since the convergence is faster, the
result is about the same. For a handful of contacts, the latency difference
is truly negligible.
Suggested-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Tested-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Henrik Rydberg <rydberg@bitmath.org>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Some semi-mt drivers use the slots in a manual way, but may still
want to call parts of the frame synchronization logic. This patch
makes input_mt_drop_unused callable from those drivers.
Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
Reviewed-by: Benson Leung <bleung@chromium.org>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Some variants of the Pixcir touch controller support up to 5 simultaneous
fingers and hardware tracking IDs. Prepare the driver for that.
Signed-off-by: Roger Quadros <rogerq@ti.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Add common DT binding documentation for touchscreen devices and
implement input_parse_touchscreen_of_params, which parses the common
properties and configures the input device accordingly.
The method currently does not interpret the axis inversion properties,
since there is no matching flag in the generic linux input device.
Reviewed-by: Pavel Machek <pavel@ucw.cz>
Acked-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Sebastian Reichel <sre@kernel.org>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Get rid of the attb_read_val() platform hook. Instead, read the ATTB gpio
directly from the driver.
Fail if valid ATTB gpio is not provided by patform data.
Signed-off-by: Roger Quadros <rogerq@ti.com>
Acked-by: Mugunthan V N <mugunthanvnm@ti.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Introduce helper functions to configure power and interrupt registers.
Default to IDLE mode on probe as device supports auto wakeup to ACVIE mode
on detecting finger touch.
Configure interrupt mode and polarity on start up. Power down on device
closure or module removal.
Signed-off-by: Roger Quadros <rogerq@ti.com>
Acked-by: Mugunthan V N <mugunthanvnm@ti.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
The driver is only supported on DT enabled platforms. Convert the
driver to DT so that it can probe properly.
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
The driver is only supported on DT enabled platforms. Convert the
driver to DT so that it can probe properly.
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Pull MFD update from Samuel Ortiz:
"For the 3.11 merge we only have one new MFD driver for the Kontron
PLD.
But we also have:
- Support for the TPS659038 PMIC from the palmas driver.
- Intel's Coleto Creek and Avoton SoCs support from the lpc_ich
driver.
- RTL8411B support from the rtsx driver.
- More DT support for the Arizona, max8998, twl4030-power and the
ti_am335x_tsadc drivers.
- The SSBI driver move under MFD.
- A conversion to the devm_* API for most of the MFD drivers.
- The twl4030-power got split from twl-core into its own module.
- A major ti_am335x_adc cleanup, leading to a proper DT support.
- Our regular arizona and wm* updates and cleanups from the Wolfson
folks.
- A better error handling and initialization, and a regulator
subdevice addition for the 88pm80x driver.
- A bulk platform_set_drvdata() call removal that's no longer need
since commit 0998d06310 ("device-core: Ensure drvdata = NULL when
no driver is bound")
* tag 'mfd-3.11-1' of git://git.kernel.org/pub/scm/linux/kernel/git/sameo/mfd-next: (102 commits)
mfd: sec: Provide max_register to regmap
mfd: wm8994: Remove duplicate check for active JACKDET
MAINTAINERS: Add include directory to MFD file patterns
mfd: sec: Remove fields not used since regmap conversion
watchdog: Kontron PLD watchdog timer driver
mfd: max8998: Add support for Device Tree
regulator: max8998: Use arrays for specifying voltages in platform data
mfd: max8998: Add irq domain support
regulator: palmas: Add TPS659038 support
mfd: Kontron PLD mfd driver
mfd: palmas: Add TPS659038 PMIC support
mfd: palmas: Add SMPS10_BOOST feature
mfd: palmas: Check if irq is valid
mfd: lpc_ich: iTCO_wdt patch for Intel Coleto Creek DeviceIDs
mfd: twl-core: Change TWL6025 references to TWL6032
mfd: davinci_voicecodec: Fix build breakage
mfd: vexpress: Make the driver optional for arm and arm64
mfd: htc-egpio: Use devm_ioremap_nocache() instead of ioremap_nocache()
mfd: davinci_voicecodec: Convert to use devm_* APIs
mfd: twl4030-power: Fix relocking on error
...
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 <dmitry.torokhov@gmail.com>
The two header files removed here are unused and have no users as this
platform was never used with platform devices.
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
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 <rachna@ti.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Pull MFD update from Samuel Ortiz:
"For 3.10 we have a few new MFD drivers for:
- The ChromeOS embedded controller which provides keyboard, battery
and power management services. This controller is accessible
through i2c or SPI.
- Silicon Laboratories 476x controller, providing access to their FM
chipset and their audio codec.
- Realtek's RTS5249, a memory stick, MMC and SD/SDIO PCI based
reader.
- Nokia's Tahvo power button and watchdog device. This device is
very similar to Retu and is thus supported by the same code base.
- STMicroelectronics STMPE1801, a keyboard and GPIO controller
supported by the stmpe driver.
- ST-Ericsson AB8540 and AB8505 power management and voltage
converter controllers through the existing ab8500 code.
Some other drivers got cleaned up or improved. In particular:
- The Linaro/STE guys got the ab8500 driver in sync with their
internal code through a series of optimizations, fixes and
improvements.
- The AS3711 and OMAP USB drivers now have DT support.
- The arizona clock and interrupt handling code got improved.
- The wm5102 register patch and boot mechanism also got improved."
* tag 'mfd-3.10-1' of git://git.kernel.org/pub/scm/linux/kernel/git/sameo/mfd-next: (104 commits)
mfd: si476x: Don't use 0bNNN
mfd: vexpress: Handle pending config transactions
mfd: ab8500: Export ab8500_gpadc_sw_hw_convert properly
mfd: si476x: Fix i2c warning
mfd: si476x: Add header files and Kbuild plumbing
mfd: si476x: Add chip properties handling code
mfd: si476x: Add the bulk of the core driver
mfd: si476x: Add commands abstraction layer
mfd: rtsx: Support RTS5249
mfd: retu: Add Tahvo support
mfd: ucb1400: Pass ucb1400-gpio data through ac97 bus
mfd: wm8994: Add some OF properties
mfd: wm8994: Add device ID data to WM8994 OF device IDs
input: Export matrix_keypad_parse_of_params()
mfd: tps65090: Add compatible string for charger subnode
mfd: db8500-prcmu: Support platform dependant device selection
mfd: syscon: Fix warnings when printing resource_size_t
of: Add stub of_get_parent for non-OF builds
mfd: omap-usb-tll: Convert to devm_ioremap_resource()
mfd: omap-usb-host: Convert to devm_ioremap_resource()
...