If the panel is programmed with incorrect resolution then
during the probe it gets corrected. During suspend this
might be lost because of reset. Reconfigure the resolution
parameters in such cases.
CRs-fixed: 751477
Change-Id: I7ba3acd2d0bad7e2359563cd7344a1ab95aa6319
Signed-off-by: Mohan Pallaka <mpallaka@codeaurora.org>
Optimize AP3426 power consumption by changing interrupt trigger
conditions and setting correct output data rate.
Change-Id: I21fc78423d0913667d117ec8bb7a1e23cf09bbad
Signed-off-by: Oliver Wang <mengmeng@codeaurora.org>
Update MPU6050 driver to add "set latency" and "flush"
interface, with these new interface sensor can run in
batching mode, a sensor in batching mode will buffer
sensor events into its internal FIFO and process them
in batch.
Change-Id: I71906f966e73c8134e22b425fcb613e015ee0712
Signed-off-by: Bingzhe Cai <bingzhec@codeaurora.org>
Android considers that minimum and maximum values of the
ABS_MT_POSITION_X and ABS_MT_POSITION_Y axes define the bounds
of the active area of the device in device-specific surface
units. These axes are stored inside the input_absinfo array of
the registered input devices. For touchscreen devices, these
axes are normally configured during driver's probe time.
However, some usecases would want to shrink or expand this
active area of the touch device on runtime. This patch adds
flexibility to configure these axes for touch screen's
corresponding input device.
Change-Id: I45e02bb93f02365ae44cffb04e8674244e4e372b
Signed-off-by: Shantanu Jain <shjain@codeaurora.org>
Fixed below irq flag issues of Focaltech CTP:
Focaltech CTP firmware generates edge interrupt to MSM, but the
interrupt type in DTSI is level, which will cause CTP interrupt
cannot wake up MSM when system is in deep sleep. Fix this by
setting edge irq flag in DTSI.
For GPIO irq, the irq flag should be specified in "interrupts"
node. Msm_gpio module will only use the lower 8-bit of
"interrupts" node and discards the upper bits. If we specify
0x2002 in "interrupts" node, the upper bits(0x2000) is not used
by msm_gpio, only lower bits(0x2) is used, that means only
lower bits(0x2) should be set in "interrupts" node.
"focaltech,irq-gpio" node is used to specify gpio property,
rather than irq flag. Remove the irq flag setting in this node.
In driver code, specify only "IRQF_ONESHOT". The irq trigger type
is specified by DTSI "interrupts" node. See above.
Change-Id: I4cd8596fb4538b701317f01a6cafaa771041ffdd
Signed-off-by: Mao Li <maol@codeaurora.org>
Do cleanup to fix all checkpatch errors, fix obvious problems
and add device tree documentation.
Change-Id: Ia3ef0a711b2cccc9058d5ebd307ec0ca1318fe73
Signed-off-by: Gustavo Solaira <gustavos@codeaurora.org>
MPU6880 chip is compatible with mpu6050 driver,
add the compatible string for correct matching.
Change-Id: I9fef5df6769bf426a45246a97d2ba2fedd9e5909
Signed-off-by: Gustavo Solaira <gustavos@codeaurora.org>
Focaltech's CTP FT6436 is able to behave like a proximity sensor.
Enable the driver support this new feature.
Change-Id: I7a6ec3a387536c512637b0bd8dab95e7cceca212
Signed-off-by: Mao Li <maol@codeaurora.org>
AP3426 is an ambient light and proximity sensor from dyna image.
It can measure light intensity and object distance. Add Makefile
and Kconfig to enable AP3426 driver.
Change-Id: Ia9ba2ed604de6b2768f5256e13ab84e95c915f7b
Signed-off-by: Oliver Wang <mengmeng@codeaurora.org>
commit 9d720b34c0a432639252f63012e18b0507f5b432 upstream.
On some Dell Latitude laptops ALPS device or Dell EC send one invalid byte
in 6 bytes ALPS packet. In this case psmouse driver enter out of sync
state. It looks like that all other bytes in packets are valid and also
device working properly. So there is no need to do full device reset, just
need to wait for byte which match condition for first byte (start of
packet). Because ALPS packets are bigger (6 or 8 bytes) default limit is
small.
This patch increase number of invalid bytes to size of 2 ALPS packets which
psmouse driver can drop before do full reset.
Resetting ALPS devices take some time and when doing reset on some Dell
laptops touchpad, trackstick and also keyboard do not respond. So it is
better to do it only if really necessary.
Signed-off-by: Pali Rohár <pali.rohar@gmail.com>
Tested-by: Pali Rohár <pali.rohar@gmail.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
commit 4ab8f7f320f91f279c3f06a9795cfea5c972888a upstream.
5th and 6th byte of ALPS trackstick V3 protocol match condition for first
byte of PS/2 3 bytes packet. When driver enters out of sync state and ALPS
trackstick is sending data then driver match 5th, 6th and next 1st bytes as
PS/2.
It basically means if user is using trackstick when driver is in out of
sync state driver will never resync. Processing these bytes as 3 bytes PS/2
data cause total mess (random cursor movements, random clicks) and make
trackstick unusable until psmouse driver decide to do full device reset.
Lot of users reported problems with ALPS devices on Dell Latitude E6440,
E6540 and E7440 laptops. ALPS device or Dell EC for unknown reason send
some invalid ALPS PS/2 bytes which cause driver out of sync. It looks like
that i8042 and psmouse/alps driver always receive group of 6 bytes packets
so there are no missing bytes and no bytes were inserted between valid
ones.
This patch does not fix root of problem with ALPS devices found in Dell
Latitude laptops but it does not allow to process some (invalid)
subsequence of 6 bytes ALPS packets as 3 bytes PS/2 when driver is out of
sync.
So with this patch trackstick input device does not report bogus data when
also driver is out of sync, so trackstick should be usable on those
machines.
Signed-off-by: Pali Rohár <pali.rohar@gmail.com>
Tested-by: Pali Rohár <pali.rohar@gmail.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
msm8909 SKUC uses AP3426 as ambient light and proximity sensor.
Add AP3426 sensor driver to enable it.
Change-Id: Ic18674066314d997f9d4a2cfb34e2a922dbf2849
Signed-off-by: Oliver Wang <mengmeng@codeaurora.org>
Batching should be disabled after writing 0 to max_latency sysfs
node. Fix it by correct the batching activation logic.
Change-Id: Idbdc883fcbb9d4ad4042512068becf69725f4650
Signed-off-by: Oliver Wang <mengmeng@codeaurora.org>
Add the vdd-min-uv property so the VDD voltage can
be configured through the device tree. This is
required by some parts that use 1.8V as the nominal
VDD voltage.
Change-Id: I66ef0432bfc804a0980d41892855f3e229840035
Signed-off-by: Gustavo Solaira <gustavos@codeaurora.org>
commit 993b3a3f80a7842a48cd46c2b41e1b3ef6302468 upstream.
These models need i8042.notimeout, otherwise the touchpad will not work.
BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=69731
BugLink: https://bugzilla.redhat.com/show_bug.cgi?id=1111138
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
commit 9ff84a17302aeb8913ff244ecc0d8f9d219fecb5 upstream.
Without this the aux port does not get detected, and consequently the
touchpad will not work.
https://bugzilla.redhat.com/show_bug.cgi?id=1110011
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
The touchscreen controllers are field-swappable on both customer
devices and internal reference devices. It is possible to have
multiple Atmel touch controllers where each controller would
support softkeys in a different way. While some Atmel touch
controllers support sending a series of keys (using T15 object),
some others report native X-Y touch coordinates of the touch
sensor in the soft key region. While in the earlier case, the
touch sensor directly reports the key codes and hence there is
no need for software to do any translation, In the latter case
software needs to translate these coordinates to keycodes.
The current architecture of Atmel touchscreen driver does not
have support to disambiguate between more than two Atmel touch
controllers that send coordinates in lieu of key codes. To
support this functionality in driver, a device-tree property
is defined that describes the key codes for the soft-key area.
The driver calculates the total soft key area based on the
display resolution and touch sensor dimensions. Based on the
total soft-key area and number of keys to be supported, it
calculates the area for each of the soft-keys. It exports this
information to userspace by populating a sysfs file. User-space
programs can then translate the touch coordinates received to
key codes.
Change-Id: I69c411f65f439dddf39f00b31fb409bb3e5c54bf
Signed-off-by: Himanshu Aggarwal <haggarwa@codeaurora.org>
Signed-off-by: Shantanu Jain <shjain@codeaurora.org>
Compilation for mc3xxx fails in arm64 because it does
not have mach/hardware.h header file.
Change-Id: Iedd0063a19d09f2dbbb81a9efdacf99fb04e8839
Signed-off-by: Gustavo Solaira <gustavos@codeaurora.org>
Service all types of interrupts generated by the controller
such as the spontaneous reset. Not handling these interrupts
can cause an interrupt storm as controller wouldn't deactivate
the interrupt line.
Change-Id: Ib6f3b1b8003b8b927951fa2f0cc2bf3de872e6d5
Signed-off-by: Mohan Pallaka <mpallaka@codeaurora.org>
If the firmware is not properly updated, the controller
would stuck in bootloader mode. Make sure this scenario
does not cause any crash and inform the user to do
manual firmware update.
Change-Id: I1ac96628b282afbfdbe53e1e34369b9e72c1614c
CRs-fixed: 748032
Signed-off-by: Mohan Pallaka <mpallaka@codeaurora.org>
Some devices do not have separate regulator for I2C bus pull-up,
the property "vi2c-supply" should be optional property. This change
updates MPU6050 driver to continue without this property, binding
document is also updated accordingly.
Change-Id: I77210eadb858392efdc13911ae1a0a03b346523c
Signed-off-by: Bingzhe Cai <bingzhec@codeaurora.org>
Do cleanup to fix all checkpatch errors and fix obvious problems.
Change-Id: Ib37ec7be6827142f71a41b44d2a987b7e4439cbb
Signed-off-by: Gustavo Solaira <gustavos@codeaurora.org>
Android thinks hbtp_input is an alphabetical keyboard if these
keys are configured. This brings a mismatch between physical
hardware and Android configuration, and malfunction.
Change-Id: Iedce93d6313b544c85071baa88ba2cc253932e6b
Signed-off-by: Chun Zhang <chunz@codeaurora.org>
In device open function, the client's irq is requested. In device release
function, the same irq is disabled. The calls are not balanced and cause
error when the device is re-opened. Fix it by changing disable_irq to
free_irq.
Change-Id: I9134837561e6fde369358c7b36e8b23a189ec8f2
Signed-off-by: Jing Lin <jinglin@codeaurora.org>
Querying the device is not needed in re-initialization.
The data is already saved as part of probe sequence.
Remove query operation to improve latency.
Change-Id: I416a16701765f8329b1eb735627c8fbfc6fff6e1
Signed-off-by: Mohan Pallaka <mpallaka@codeaurora.org>
A wrongly interpreted return code from pm_runtime_get_sync caused
clocks to be unprepared without being previously prepared
Also fix a merge typo for the on the suspend operation.
Change-Id: I03cd465976d8b5d7b5519c2122692d0bdba8ada8
Acked-by: Christian Bolis <cbolis@qti.qualcomm.com>
Signed-off-by: Keith Fallows <keithf@codeaurora.org>
Remove virtual key kobject in module remove only if vkeys
are supported.
CRs-fixed: 741470
Change-Id: I11460172a4c2dce99e4fd37f2aaf5b0d643f837c
Signed-off-by: Mohan Pallaka <mpallaka@codeaurora.org>
Add support for pinctrl framework for GPIO configuration so
that the Atmel touch controller driver is compatible with
targets that use and targets that don't use pinctrl framework.
Also configured the gpio and pinctrl in driver suspend/resume
method for the run time power consumption.
Change-Id: Icacc96367081953ae08f4fbee954f15c216f1d98
Signed-off-by: Sarada Prasanna Garnayak <c_sgarna@codeaurora.org>
The new Android sensor HAL requires more interfaces to communicate with
sensors driver. Change batching interface to meet the requirements. Sensor
drivers can use the interfaces to provide more features.
Change-Id: I7f3cbdcaa6f5473b038d1cdc07eb34685c1fca23
Signed-off-by: Oliver Wang <mengmeng@codeaurora.org>
Add support for pm ops only if early suspend
or fb notifications are not available.
CRs-fixed: 728814
Change-Id: If266faf9ef429b1efd368601b319624e32f1be2c
Signed-off-by: Mohan Pallaka <mpallaka@codeaurora.org>
Add sysfs interface for configuration update. As part
of configuration update resolution can be changed. So,
add interfaces to update the resolution to the display.
Refactor the code to be efficient with this usecase.
Change-Id: I529108eec21dd4505cbf3dd87e879217eb718b55
Signed-off-by: Mohan Pallaka <mpallaka@codeaurora.org>
Fix firmware and configuration update routines to follow
device specification. Parse the firmware and configuration
file names from DT and provide interfaces to read them
from user space.
Change-Id: I9fa2a13a17702cd26d36987a6584adf398e962a8
Signed-off-by: Mohan Pallaka <mpallaka@codeaurora.org>
MPU6050 hardware sample rate is fixed at 50Hz in polling mode, driver
cannot get enough number of new samples and fail on sensor frequency
check.
CRs-fixed: 736320
Change-Id: I5b2dfceda19639a97176232d0aba8f7c0c4e88e4
Signed-off-by: Bingzhe Cai <bingzhec@codeaurora.org>
Associate accurate sensor event generation time to Accel
and Gyro data samples.Algorithms using Accel and Gyro data
need very accurate event generation timestamps.
Change-Id: Ie07c66bb986ab52ed812d3b6ddc93674db1b414e
Signed-off-by: Ananda Kishore <kananda@codeaurora.org>
Add secure touch support to the new version of the Atmel MaxTouch
driver.
Change-Id: I3abb62ac27e01c0f448cab3d923d5d6dc11ff533
Signed-off-by: Keith Fallows <keithf@codeaurora.org>
Some unprogrammed touch panels from touch vendor and
wrongly programmed touch panels from factory may
return incorrect touch sensor coordinate range when
their query registers are read via I2C transaction,
but these panels work fine in the field otherwise
and their data registers give correct coordinates.
These panels give incorrect coordinates range because
either they are not programmed with a firmware file
or there was an error in programming the firmware.
In such a scenario, touch driver should not compare
the coordinate ranges retreived from touch sensor
and DT node and allow the driver operation to continue
normally.
Change-Id: Id2a5d8e7c3298adc4a583a87d577adbe951003c5
Signed-off-by: Himanshu Aggarwal <haggarwa@codeaurora.org>
When akm8963 report data is read, fix the checking of the hardware
status. Now it is just checking the hardware status is overflow or not.
Change-Id: I41f4d400379c85e21b28529fb3469a6a9a9d19e3
CRs-Fixed: 725779
Signed-off-by: Daqing Chen <chendaqing@codeaurora.org>
commit d2682118f4bb3ceb835f91c1a694407a31bb7378 upstream.
The sys_vendor / product_name are somewhat generic unfortunately, so this
may lead to some false positives. But nomux usually does no harm, where as
not having it clearly is causing problems on the Avatar AVIU-145A6.
https://bugzilla.kernel.org/show_bug.cgi?id=77391
Reported-by: Hugo P <saurosii@gmail.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
commit c01206796139e2b1feb7539bc72174fef1c6dc6e upstream.
We are getting more and more reports about LG laptops not having
functioning keyboard if we try to deactivate keyboard during probe.
Given that having keyboard deactivated is merely "nice to have"
instead of a hard requirement for probing, let's disable it on all
LG boxes instead of trying to hunt down particular models.
This change is prompted by patches trying to add "LG Electronics"/"ROCKY"
and "LG Electronics"/"LW60-F27B" to the DMI list.
https://bugzilla.kernel.org/show_bug.cgi?id=77051
Reported-by: Jaime Velasco Juan <jsagarribay@gmail.com>
Reported-by: Georgios Tsalikis <georgios@tsalikis.net>
Tested-by: Jaime Velasco Juan <jsagarribay@gmail.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
commit 5715fc764f7753d464dbe094b5ef9cffa6e479a4 upstream.
ForcePads are found on HP EliteBook 1040 laptops. They lack any kind of
physical buttons, instead they generate primary button click when user
presses somewhat hard on the surface of the touchpad. Unfortunately they
also report primary button click whenever there are 2 or more contacts
on the pad, messing up all multi-finger gestures (2-finger scrolling,
multi-finger tapping, etc). To cope with this behavior we introduce a
delay (currently 50 msecs) in reporting primary press in case more
contacts appear.
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
commit a80d8b02751060a178bb1f7a6b7a93645a7a308b upstream.
When running a 32-bit inputattach utility in a 64-bit system, there will be
error code "inputattach: can't set device type". This is caused by the
serport device driver not supporting compat_ioctl, so that SPIOCSTYPE ioctl
fails.
Signed-off-by: John Sung <penmount.touch@gmail.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Sensor class enable_wakeup interface is to provide user space
interface to configure sensor to work on wake-up mode. This change
add MPU6050 wake-up callback function and register it to sensor
class.
Change-Id: If84ec2cd008c8cd1161b94de227aa1a3b45621a6
Signed-off-by: Bingzhe Cai <bingzhec@codeaurora.org>
Remove the inclusion of the outdated (and now unused) asm/system.h.
Change-Id: Ic2081c61f4596d74560e00ffb4d486f7519ef473
Acked-by: Christian Bolis <cbolis@qti.qualcomm.com>
Signed-off-by: Keith Fallows <keithf@codeaurora.org>
MPU6050 axis standby bits are not set by default after
sensor power cycle, this results gyroscope and accelerometer
stay active and consume more power.
CRs-fixed: 731419
Change-Id: I606de419ca46695e9c1d451fa3860d10627683d0
Signed-off-by: Bingzhe Cai <bingzhec@codeaurora.org>
As the initial delay time is 10000ms, 10s is a too long time to
report the first data. Modify the initial delay_mesc form 10000ms
to 10ms. So the report data can be reported in time.
Change-Id: I82968c93cc8d5b97536e38861ccbdc5b40db67cf
CRs-Fixed: 725779
Signed-off-by: Daqing Chen <chendaqing@codeaurora.org>
Continuous mode doesn't need to send SNG_MEASUREMENT command. It
can save some cpu cycles and reach higher polling rate.
CRs-fixed: 719393
Change-Id: I5abaae4050e58dc1ddf9265adfe84a7a34aed3d9
Signed-off-by: Oliver Wang <mengmeng@codeaurora.org>
When MPU6050 is run in interrupt mode, its build in accelerometer will
stay powered on and the device is woken up when significant motion is
detected. This is part of sensor low power implementation.
Change-Id: I979d586413fd364d5fc787888fbd2369dcab83c9
Signed-off-by: Bingzhe Cai <bingzhec@codeaurora.org>
Convert accelerometer and gyroscope output according sensor full
measurement range. This allow gyroscope output to be convert
correctly and fix gyroscope output value issue.
Change-Id: I47790615c3549142878da6ee55c9d87e4b77fb1c
Signed-off-by: Bingzhe Cai <bingzhec@codeaurora.org>
Add new function to configure interrupt register that allow sensor
to work on interrupt mode. When interrupt mode is enabled, sensor
can work at background and allow AP processor to sleep, it will
issue interrupt to wakeup AP processor until any preset condition is
meet.
Change-Id: I3e535af12ca200b744c9ee7a3f90a79f23640bd1
Signed-off-by: Bingzhe Cai <bingzhec@codeaurora.org>
The bu21150 touch AFE driver does not have pinctrl and regulator to
access GPIOs and do power management. Therefore, add such change to
keep the feasibility.
Change-Id: Iab145096162e83d51aef75f61f3364a0298a3b47
Signed-off-by: Chun Zhang <chunz@codeaurora.org>
Mstar driver uses the ic-type DT property for dynamic detection
support. Driver reads a register from the controller and compares
both the values to check if connected touch controller is of
Mstar or not.
Remove all DBG messages and convert them to dev_dbg/info.
Add a debugfs entry for suspend/resume.
Remove ts_data/pdata global declaration and use dev_get_drvdata()
and input_set_drvdata()/dev_set_drvdata() instead.
Change-Id: Ia053745d48faf68b946fbb0cf16d392cbfdd2a3c
Signed-off-by: Mao Li <maol@codeaurora.org>
This driver is for Rohm's touch Analog Front End (AFE) bu21150. It
receives raw frame from touch AFE via SPI so that host processor
can process raw frame to generate touch coordinates.
Change-Id: I6548dbd064e90653c0642e1a40a8834182997c71
Signed-off-by: iuchi <shinya.iuchi.jg@j-display.com>
Git-commit: 7f0911a70b204a2ba90f66b1792b5229b23342eb
Git-repo: https://github.com/JapanDisplayInc/bu21150-driver
[jinglin@codeaurora.org: fix compilation errors on 3.10 kernel, fix bug
in array definition, add commit text]
Signed-off-by: Jing Lin <jinglin@codeaurora.org>
There's timestamp jitter between the input events and input_sync.
Add two more event code to pass the timestamp to userspace. This
is needed since some input devices such as sensors need to retrieve
the accurate timestamp of the events generated.
Change-Id: I8d83739dfa4a70ca3877363c920bd5e3301f5494
Signed-off-by: Oliver Wang <mengmeng@codeaurora.org>
The polling delay of akm09911 is not accurate since it uses the
system_wq to queue the delayed work. This may cause the work unable
to be scheduled in time. So add a dedicated workqueue and improve
the priority. Also use hrtimer to improve the timer resolution.
Change-Id: I3aacd763ab6221fd158ad02c3c99ad5ca7d3de7c
Signed-off-by: Oliver Wang <mengmeng@codeaurora.org>
The touchscreen controllers are field-swappable on both
customer devices and internal reference devices. For
Synaptics touch controller, package ID is a unique
identifier that is used to uniquely distinguish the touch
controller part. However, it is still possible to flash
these touch controllers with different firmware images. In
such a case, same touch controller's sensor will have
different dimensions depending on the firmware image
flashed in it. The patch adds the ability to identify
the correct sensor dimension for above use case. If
package ID read from device tree matches the package ID
read from touch controller, the driver also checks if
the sensor dimensions read from device tree match those
which are read from the touch controller.
Change-Id: I8423df30c61aaa7696c494aa5f105f169ad9c954
Signed-off-by: Himanshu Aggarwal <haggarwa@codeaurora.org>
Signed-off-by: Sarada Prasanna Garnayak <c_sgarna@codeaurora.org>
The sensors HAL can't distinguish accelerometer from each other by
input device name. This may cause accelerometer data not correct on
target with multiple accelerometers. So rename the accelerometer
sensor name to distinguish each other.
Change-Id: I57ed6416d04fd5bd1208ba8f9bfed039cca3b441
Signed-off-by: Oliver Wang <mengmeng@codeaurora.org>
Add pinctrl support to configure interrupt pin state, this will
set interrupt pin to correct state to receive interrupt signal.
Change-Id: Icbec746452939691d8a845f8a292f723941dd5ae
Signed-off-by: Bingzhe Cai <bingzhec@codeaurora.org>
To comply with power up sequence requirements,
take the TS out of reset after power is up.
Change-Id: I20eec823b6728430986e2cc96156d1287122dbc5
Signed-off-by: Eugene Yasman <eyasman@codeaurora.org>
devm_pinctrl_get() does not release the ownership of mux function
of pins in the associated pin-group whenever a failure occurs in
driver probe routine. i.e struct pin_desc's mux_owner field is
still marked as being in use after a failure occurs in probe.
As a result of this, if another driver tries to acquire the
ownership of same pin, it gets an error while applying that
setting. To fix this, explicitly release the mux function
ownership of the the pin, by adding a new pin-group in pinctrl
DT and a new pinctrl state in touch device's DT node. This new
pin-group does not have a function setting (qcom,pin-func property).
This new state is explicitly activated during a probe failure
and driver remove routine to release the mux function ownership.
The patch also reorganizes the pinctrl related code in driver.
Change-Id: I05f88b04ca37035028f2a383848c3e330c877780
Signed-off-by: Shantanu Jain <shjain@codeaurora.org>
This driver provides service to Host Based Touch Processing
in three aspects:
- It serves as an input device driver to send touch/key events from
user space to the kernel input core.
- It monitors LCD on/off and sends uevent accordingly.
- It performs power management for the touch AFE (Analog Front End).
Change-Id: I1308dae8e44a824d84e3b13536a1b621f9df5bca
Signed-off-by: Jing Lin <jinglin@codeaurora.org>
Add null pointer exception check for pointers which
may be NULL after memory allocation failure and may
be deferenced.
Change-Id: Ied34d548bff27f8f6da9f4c81896e4505cdce218
Signed-off-by: Sarada Prasanna Garnayak <c_sgarna@codeaurora.org>
Add null pointer exception check for pointers which
may be NULL after memory allocation failure and
may be deferenced.
Change-Id: I99a24ada5b91743bc57568b6ab7b39e655c7bb64
Signed-off-by: Sarada Prasanna Garnayak <c_sgarna@codeaurora.org>
Add sysfs entries to upgrade the firmware from userspace. Update_fw
sysfs entry upgrades the firmware inside the touch controller only
when the controller's firmware version is lesser than that in
userspace's firmware file. Force firmware upgrade sysfs entry
forcefully upgrades the firmware inside the touch controller even
when the controller's firmware version matches that of the firmware
file in userspace.
Change-Id: Ib6046de5230c395b48818d01f26eb9394046808b
Signed-off-by: Mao Li <maol@codeaurora.org>
When device switch to suspend state the gpio and pinctrl need to be
configured properly to prevent the touch controller current leakage in
device suspend state. The pinctrl must be configure first before
the gpio configuration. Select the pinctrl sleep state and after that
in gpio configuration part free both IRQ and reset gpio, and also set
direction of reset gpio to be input. If the gpio and pinctrl is not in
proper state the touch controller will not switch to the deep sleep state
and it will start consume current during the device suspend state.
To prevent this leakage current issue, pinctrl and gpio must be
configured properly.
Change-Id: I0ec72bbbf12320ad22608522d1250614c6686fe3
Signed-off-by: Sarada Prasanna Garnayak <c_sgarna@codeaurora.org>
When fingers on the panel decrease, release corresponding touches.
Change-Id: Iafc3a9dda252417fcd06e3d9d24fb73b4d6f8e58
Signed-off-by: Mao Li <maol@codeaurora.org>
Because of a change in the underlying bus driver, the secure
touch layer in the input drivers is now required to control
directly the clocks which are needed during the touch sessions.
Clocks are turned on/off when the session is started/ended.
Change-Id: Ib123ea6f9f38d990e1ab6e6bdbb776faeb591c11
Acked-by: Christian Bolis <cbolis@qti.qualcomm.com>
Signed-off-by: Keith Fallows <keithf@codeaurora.org>
MPU6050 sensor requires Vdd power on before Vio, it may enter
bad power state if this power on sequence does not satisfied.
As MPU6050 share power rails with other devices, this power on
sequence is not guaranteed.
Reset the sensor when system back form sleep and retain the sensor
power to recover the sensor from bad power state.
Change-Id: I3e39174cafe31645e92e13cb1647834ee47add3d
Signed-off-by: Bingzhe Cai <bingzhec@codeaurora.org>
When CONFIG_PM is not selected in defconfig, following warnings
are reported during driver compilation:
CC drivers/input/touchscreen/synaptics_dsx/synaptics_dsx_core.o
drivers/input/touchscreen/synaptics_dsx/synaptics_dsx_core.c:109:12:
warning: 'fb_notifier_callback' used but never defined
[enabled by default]
error, forbidden warning: synaptics_dsx_core.c:109
make[6]: *** [drivers/input/touchscreen/synaptics_dsx/synaptics_dsx_core.o]
Error 1
Since frame-buffer notifiers do not have any dependency on CONFIG_PM's
selection in defconfig, modify the driver accordingly to fix these
warnings.
Change-Id: Ie5f68a725639d40b6c3aabe965e55f64c79590ca
Signed-off-by: Himanshu Aggarwal <haggarwa@codeaurora.org>
add null pointer exception check for pointers which
may be NULL after request for memory allocation and
may be deferenced.
CRs-Fixed: 712847
Change-Id: I59ee5b00b124bc49fcc5d9d8bbfcb393fa70de05
Signed-off-by: Sarada Prasanna Garnayak <c_sgarna@codeaurora.org>
Modify an error for lis3dh sensor after judge the sensor update odr
success of not.
Change-Id: Ifd14f4866f22b37af16e42573e16f309981c10f6
Signed-off-by: Daqing Chen <chendaqing@codeaurora.org>
As part of resume sequence, interrupts are enabled first
and then the device configuration takes place. However,
in certain scenarios this would cause interrupt storm.
Reorder the resume sequence to make device configuration
before enabling the interrupts.
Change-Id: I548c5d0a91cb237c8109921ddb38d984fe439c8c
CRs-fixed: 705671
Signed-off-by: Mohan Pallaka <mpallaka@codeaurora.org>
* commit 'v3.10.49': (529 commits)
Linux 3.10.49
ACPI / battery: Retry to get battery information if failed during probing
x86, ioremap: Speed up check for RAM pages
Score: Modify the Makefile of Score, remove -mlong-calls for compiling
Score: The commit is for compiling successfully.
Score: Implement the function csum_ipv6_magic
score: normalize global variables exported by vmlinux.lds
rtmutex: Plug slow unlock race
rtmutex: Handle deadlock detection smarter
rtmutex: Detect changes in the pi lock chain
rtmutex: Fix deadlock detector for real
ring-buffer: Check if buffer exists before polling
drm/radeon: stop poisoning the GART TLB
drm/radeon: fix typo in golden register setup on evergreen
ext4: disable synchronous transaction batching if max_batch_time==0
ext4: clarify error count warning messages
ext4: fix unjournalled bg descriptor while initializing inode bitmap
dm io: fix a race condition in the wake up code for sync_io
Drivers: hv: vmbus: Fix a bug in the channel callback dispatch code
clk: spear3xx: Use proper control register offset
...
In addition to bringing in upstream commits, this merge also makes minor
changes to mainitain compatibility with upstream:
The definition of list_next_entry in qcrypto.c and ipa_dp.c has been
removed, as upstream has moved the definition to list.h. The implementation
of list_next_entry was identical between the two.
irq.c, for both arm and arm64 architecture, has had its calls to
__irq_set_affinity_locked updated to reflect changes to the API upstream.
Finally, as we have removed the sleep_length member variable of the
tick_sched struct, all changes made by upstream commit ec804bd do not
apply to our tree and have been removed from this merge. Only
kernel/time/tick-sched.c is impacted.
Change-Id: I63b7e0c1354812921c94804e1f3b33d1ad6ee3f1
Signed-off-by: Ian Maund <imaund@codeaurora.org>
Amend Synaptics touch driver to optionally take a pinctrl
handle and set the state of pins during boot. Some platforms
do not support pinctrl and making pinctrl support an optional
feature of the driver, allows this driver to be used on
those platforms as well.
Change-Id: I3c6c39c56161da9b6fa10302865d6ff8728683e9
Signed-off-by: Himanshu Aggarwal <haggarwa@codeaurora.org>
Mstar reference driver is being cleaned up to be checkpatch
compliant. Add Kconfig and Makefile changes to enable Mstar
driver's compilation. And following new features are added to
the driver:
1. Pinctrl support
2. Threaded irq support
3. Release all touches in suspend
4. Protocol B compliance
5. Explicit suspend/resume function
6. Configure gpios in suspend/resume function
7. Add device tree parser function
8. Add dtsi support for gpio, regulator, I2C address, display coords
Change-Id: Ic49a18de64ec210a0636405394ba7a8f52f336a9
Signed-off-by: Mao Li <maol@codeaurora.org>
Signed-off-by: Shantanu Jain <shjain@codeaurora.org>
This Mstar CTP reference driver code is added into a wrong place,
a follow-on patch is created to move the driver to proper path.
Change-Id: I34365ce21659348ad1d1289e3b06b81e778c2648
Signed-off-by: Mao Li <maol@codeaurora.org>
Add sensor fifo mode, then it can work in the fifo mode when the
system in deep suspend. And sensor can wake up system when the
sensor fifo is full.
Change-Id: I684a1a67b34fe00a7889af5bee7b0f733c787ddc
Signed-off-by: c_daqing <chendaqing@codeaurora.org>
Signed-off-by: Bingzhe Cai <bingzhec@codeaurora.org>
Cyclic Redundancy Check is performed on object configuration
during boot. Some of the atmel controllers store incorrect
CRC and causes the driver to fail. Add optional feature to
disable CRC in such cases.
Change-Id: I512318976462de4944184a05d9ca9745a545b270
Signed-off-by: Mohan Pallaka <mpallaka@codeaurora.org>
commit 50c5d36dab930b1f1b1e3348b8608aa8b9ee7610 upstream.
We attempt to remove noise from coordinates reported by devices in
input_handle_abs_event(), unfortunately, unless we were dropping the
event altogether, we were ignoring the adjusted value and were passing
on the original value instead.
Reviewed-by: Andrew de los Reyes <adlr@chromium.org>
Reviewed-by: Benson Leung <bleung@chromium.org>
Reviewed-by: David Herrmann <dh.herrmann@gmail.com>
Reviewed-by: Henrik Rydberg <rydberg@euromail.se>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Fix the compilation errors caused by including wrong header files and
wrong function declaration.
Change-Id: Ie57484fcacf68cac700a808b67340988230b63d6
Signed-off-by: Oliver Wang <mengmeng@codeaurora.org>
devm_pinctrl_get() does not release the ownership of mux function
of pins in the associated pin-group whenever a failure occurs in
driver probe routine. i.e struct pin_desc's mux_owner field is
still marked as being in use after a failure occurs in probe.
As a result of this, if another driver tries to acquire the
ownership of same pin, it gets an error while applying that
setting. To fix this, explicitly release the mux function
ownership of the the pin, by adding a new pin-group in pinctrl
DT and a new pinctrl state in touch device's DT node. This new
pin-group does not have a function setting (qcom,pin-func property).
This new state is explicitly activated during a probe failure
and driver remove routine to release the mux function ownership.
The patch also reorganizes the pinctrl related code in driver.
Change-Id: I16a97fefc64dd171deb800b481aa74a797c9ad55
Signed-off-by: Shantanu Jain <shjain@codeaurora.org>
devm_pinctrl_get() does not release the ownership of mux function
of pins in the associated pin-group whenever a failure occurs in
driver probe routine. i.e struct pin_desc's mux_owner field is
still marked as being in use after a failure occurs in probe.
As a result of this, if another driver tries to acquire the
ownership of same pin, it gets an error while applying that
setting. To fix this, explicitly release the mux function
ownership of the the pin, by adding a new pin-group in pinctrl
DT and a new pinctrl state in touch device's DT node. This new
pin-group does not have a function setting (qcom,pin-func property).
This new state is explicitly activated during a probe failure
and driver remove routine to release the mux function ownership.
The patch also reorganizes the pinctrl related code in driver.
Change-Id: I6726aa2fb5cca47012d72713ce0c13737e472a3e
Signed-off-by: Shantanu Jain <shjain@codeaurora.org>
Device driver does not need to request regulator each time it power
on the device, it only need to vote on/off regulators and release
regulators before exit.
Change-Id: I01c4e1a9ee48495cdab965a4fb99dae3b01b57a3
Signed-off-by: Bingzhe Cai <bingzhec@codeaurora.org>
Add lis3dh accelerometer sensor interrupt handler, so we can select
interrupt mode or polling mode.
Change-Id: I36172bb2b04e0a787a1d07c735b0783c83ebe5ca
Signed-off-by: c_daqing <chendaqing@codeaurora.org>
The mmc3416x polling thread may get the chance to run when it's
already disabled after setting polling rate.
Change-Id: If2624eac23a21e0799bc0edc3a41412e8bf4b33b
Signed-off-by: Oliver Wang <mengmeng@codeaurora.org>
commit fb4f8f568a9def02240ef9bf7aabd246dc63a081 upstream.
The touchpad on the GIGABYTE U2442 not only stops communicating when we try
to set bit 3 (enable real hardware resolution) of reg_10, but on some BIOS
versions also when we set bit 1 (enable two finger mode auto correct).
I've asked the original reporter of:
https://bugzilla.kernel.org/show_bug.cgi?id=61151
To check that not setting bit 1 does not lead to any adverse effects on his
model / BIOS revision, and it does not, so this commit fixes the touchpad
not working on these versions by simply never setting bit 1 for laptop
models with the no_hw_res quirk.
Reported-and-tested-by: James Lademann <jwlademann@gmail.com>
Tested-by: Philipp Wolfer <ph.wolfer@gmail.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
commit cd9e83e2754465856097f31c7ab933ce74c473f8 upstream.
At least the Dell Vostro 5470 elantech *clickpad* reports right button
clicks when clicked in the right bottom area:
https://bugzilla.redhat.com/show_bug.cgi?id=1103528
This is different from how (elantech) clickpads normally operate, normally
no matter where the user clicks on the pad the pad always reports a left
button event, since there is only 1 hardware button beneath the path.
It looks like Dell has put 2 buttons under the pad, one under each bottom
corner, causing this.
Since this however still clearly is a real clickpad hardware-wise, we still
want to report it as such to userspace, so that things like finger movement
in the bottom area can be properly ignored as it should be on clickpads.
So deal with this weirdness by simply mapping a right click to a left click
on elantech clickpads. As an added advantage this is something which we can
simply do on all elantech clickpads, so no need to add special quirks for
this weird model.
Reported-and-tested-by: Elder Marco <eldermarco@gmail.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
The touchscreen controllers are field-swappable on both customer
devices and internal reference devices. It is possible to have
multiple Synaptics touch controllers where each controller would
support softkey in a different way. While some touch controllers
support 2-dimensional touch sensor, some others support capacitative
button(0D) sensing. In the former case, the touch sensor reports
native X-Y touch coordinates of the touch sensor in the soft key region.
This is implemented by RMI4 function F11 or F12 and software needs to
translate these coordinates to keycodes. In the latter case, the touch
sensor directly reports the key codes and hence there is no need for
software to do any translation. This is implemented by RMI4 function
F1A or F19.
The current architecture of Synaptics touchscreen driver does not have
support to disambiguate between more than two Synaptics touch controllers
that support 2-dimensional touch sensor for soft keys. To support
this functionality in driver, a device-tree property is defined that
describes the key codes for the soft-key area. The driver calculates
the total soft key area based on the display resolution and touch sensor
dimensions. Based on the total soft-key area and number of keys to be
supported, it calculates the area for each of the soft-keys. It exports
this information to userspace by populating a sysfs file. User-space
programs can then translate the touch coordinates received to key codes.
Change-Id: I99876527660d0be7cef86e88d7583e331159e7eb
Signed-off-by: Himanshu Aggarwal <haggarwa@codeaurora.org>
Signed-off-by: Shantanu Jain <shjain@codeaurora.org>
Change the data sysfs file read-write permissions to
RW permission to user and R permission to group and
world.
Change-Id: I8f2d3da1f491d6ee63fc6ed6e33de12f1a4bc282
Signed-off-by: Shantanu Jain <shjain@codeaurora.org>
Allowing the data sysfs file is not a good idea. We don't need this
sysfs file to be world writable or group writable. By default only
root should be able to write to this file. Change the write permissions
of this file to S_IWUSR (00200).
Signed-off-by: Himanshu Aggarwal <haggarwa@codeaurora.org>
Change-Id: I1d92d0e3eb2cfdc52a3873babe94c9c562a9df85
When resume from suspend, sensor driver should resume sensor to
state before suspend, bma2x2 driver does not handle this correctly.
CRs-fixed: 685381
Change-Id: Id2ad9e6117d8d6b43aec9bbf33f7a3e3a2654fb4
Signed-off-by: Bingzhe Cai <bingzhec@codeaurora.org>
The touchscreen controllers are field-swappable on both customer
devices and internal reference devices. Current touch driver
architecture for Synaptics does not support dynamic detection
of two or more Synaptics touchscreens having same slave address. The
patch provides a solution for the scenario in which it is required
to swap two Synaptics touchscreens without changing DT. Support of
this is added in driver as follows:
1. During driver probe, touch controller is identified by reading
the Package Id from controller. Package ID in F01_RMI_Query register
comprises of a 16-bit Package ID and a 16-bit Package ID Revision
of which both are unique for a touch controller part. If Package ID
is present,then a RMI read operation in UI Mode at seventeenth
register from F01 Query base returns it. First two bytes of this
Package ID base are used to select the correct Synaptics touch
controller from device tree.
2. Add a new property synaptics,detect-device in DT files which
will allow software to enable this logic to detect correct
touchscreen slave.
3. All such devices are placed as child nodes of Synaptics
Touchpanel node. These child nodes are parsed only if the property
synaptics,detect-device is defined in DT file.
Change-Id: I2383b8bed85b130a8558db403b565cec693d17fa
Signed-off-by: Himanshu Aggarwal <haggarwa@codeaurora.org>
Signed-off-by: Shantanu Jain <shjain@codeaurora.org>
keyreset now registers a keycombo driver that acts as the old
keyreset driver acted.
Change-Id: I08f5279e3a33b267571b699697f9f54508868983
Signed-off-by: Daniel Rosenberg <drosen@google.com>
Git-commit: 06cba5a45233fae085a74a389a52036bda892b9a
Git-repo: https://android.googlesource.com/kernel/common.git
Signed-off-by: Ian Maund <imaund@codeaurora.org>
Keycombo lets you provide a key up and key down function, and an
optional time delay for key down. The driver will call the key
down function after the specified key combo has been held for the
speicified time delay. After you release the combo, if the key down
has happened, it calls key up.
Change-Id: I6a9a94e96a8f58fadd908fd1dc7944b9102a089f
Signed-off-by: Daniel Rosenberg <drosen@google.com>
Git-commit: 491e319ddc9388350826ef2333f5cbe27ace7f1c
Git-repo: https://android.googlesource.com/kernel/common.git
Signed-off-by: Ian Maund <imaund@codeaurora.org>
* commit 'v3.10.40': (203 commits)
Linux 3.10.40
ARC: !PREEMPT: Ensure Return to kernel mode is IRQ safe
drm: cirrus: add power management support
Input: synaptics - add min/max quirk for ThinkPad Edge E431
Input: synaptics - add min/max quirk for ThinkPad T431s, L440, L540, S1 Yoga and X1
lockd: ensure we tear down any live sockets when socket creation fails during lockd_up
dm thin: fix dangling bio in process_deferred_bios error path
dm transaction manager: fix corruption due to non-atomic transaction commit
Skip intel_crt_init for Dell XPS 8700
mtd: sm_ftl: heap corruption in sm_create_sysfs_attributes()
mtd: nuc900_nand: NULL dereference in nuc900_nand_enable()
mtd: atmel_nand: Disable subpage NAND write when using Atmel PMECC
tgafb: fix data copying
gpio: mxs: Allow for recursive enable_irq_wake() call
rtlwifi: rtl8188ee: initialize packet_beacon
rtlwifi: rtl8192se: Fix regression due to commit 1bf4bbb
rtlwifi: rtl8192se: Fix too long disable of IRQs
rtlwifi: rtl8192cu: Fix too long disable of IRQs
rtlwifi: rtl8188ee: Fix too long disable of IRQs
rtlwifi: rtl8723ae: Fix too long disable of IRQs
...
Change-Id: If5388cf980cb123e35e1b29275ba288c89c5aa18
Signed-off-by: Ian Maund <imaund@codeaurora.org>
For some touch controller nodes, there is no explicit device tree
property specifying the touch coordinates range. In this case,
touch coordinates range is read explicitly from the sensor.
Add support for configuring the maximum X and Y coordinates of
touch driver's input device based for such cases.
Change-Id: Ic86aa90598aa1a7935f2562753ccf863edba1c9f
Signed-off-by: Sarada Prasanna Garnayak <c_sgarna@codeaurora.org>
Set correct permissions for write-only sysfs nodes. Show method
of such attributes is set to NULL since the attributes are write-only.
Remove the sysfs entry for the suspend/resume of touch controller
because the suspend/resume user interface is already part of debugfs
entry. Add sysfs entry to read package id of the touch controller.
Change-Id: I22b3980bc415e6749689f9fc0e7345bbd87cb680
Signed-off-by: Sarada Prasanna Garnayak <c_sgarna@codeaurora.org>
Firmware update at boot blocks on waiting for user space
to supply firmware image. Instead start firmware update
from user space when it is ready.
Change-Id: I6c38c25b52942a6946458c320c2285d2fd145486
Signed-off-by: Mohan Pallaka <mpallaka@codeaurora.org>
If touch controller goes into suspend while firmware upgrade is
happening, then the upgrade process will fail. Add support to keep
the touch controller awake during firmware upgrade. Also reduce
the excessive logs coming during firmware upgrade. Now logs are
printed per block only.
Change-Id: I7f20c87b21189b1731a7941c79ba3024c61bdfb9
Signed-off-by: Sarada Prasanna Garnayak <c_sgarna@codeaurora.org>
Focaltech touch controller does not go to sleep in suspend because
the pinctrl operation inadvertently resets the touch controller.
Remove the pinctrl operation in suspend and resume callback to
prevent this spurious reset.
CRs-fixed: 677169
Change-Id: Ifa02c0287195d7ce55fb2d8ac49ec1c8ae5baec9
Signed-off-by: Mao Li <maol@codeaurora.org>
It checks the wrong register to tell if the akm09911 sensor is overflow
or not. Change it to fix potential akm09911 magnetic field overflow issue.
Change-Id: I5742b79303daf8b5fdb1a77e0ddc910012b6b445
Signed-off-by: Oliver Wang <mengmeng@codeaurora.org>
commit 6d396ede224dc596d92d7cab433713536e68916c upstream.
The T540p has a touchpad with pnp-id LEN0034, all the models with this
pnp-id have the same min/max values, except the T540p where the values are
slightly off. Fix them to be identical.
This is a preparation patch for simplifying the quirk table.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
commit 36189cc3cd57ab0f1cd75241f93fe01de928ac06 upstream.
The hw_version 3 Elantech touchpad on the Gigabyte U2442 does not accept
0x0b as initialization value for r10, this stand-alone version of the
driver: http://planet76.com/drivers/elantech/psmouse-elantech-v6.tar.bz2
Uses 0x03 which does work, so this means not setting bit 3 of r10 which
sets: "Enable Real H/W Resolution In Absolute mode"
Which will result in half the x and y resolution we get with that bit set,
so simply not setting it everywhere is not a solution. We've been unable to
find a way to identify touchpads where setting the bit will fail, so this
patch uses a dmi based blacklist for this.
https://bugzilla.kernel.org/show_bug.cgi?id=61151
Reported-by: Philipp Wolfer <ph.wolfer@gmail.com>
Tested-by: Philipp Wolfer <ph.wolfer@gmail.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
commit 3d725caa9dcc78c3dc9e7ea0c04f626468edd9c9 upstream.
After issuing ATKBD_CMD_RESET_DIS, keyboard on some LG laptops stops
working. The workaround is to stop issuing ATKBD_CMD_RESET_DIS commands.
In order to keep changes in atkbd driver to the minimum we check DMI
signature and only skip ATKBD_CMD_RESET_DIS if we are running on LG
LW25-B7HV or P1-J273B.
Signed-off-by: Sheng-Liang Song <ssl@chromium.org>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Add support for following features to touch controller driver
- xvdd regulator
- i2cmode gpio
- pin control framework
- early suspend
- frame buffer notifications
Change-Id: Ib8338351dfd4927c33bf0ed383dd0d550a3d6e46
Signed-off-by: Mohan Pallaka <mpallaka@codeaurora.org>
firmware update method compare the version id and package id
the of new firmware with the existing firmware of the touch controller.
if the version id of the new firmware is older than the existing firmware
it will skip the firmware update. sometime to measure the touch performance
difference between the new firmware and old firmware we need to update
old firmware in touch controller. So this sysfs entry bypass the firmware
header check before the firmware update and allow the driver to update
the old firmware in the touch controller.
Change-Id: Ib4f5b75940c54c4d04ac1701d387d59f50eb3a71
Signed-off-by: Sarada Prasanna Garnayak <c_sgarna@codeaurora.org>
Sensor node should not be world writable.
CRs-fixed: 667207
Change-Id: Ib89ad28e0d20866441d38620adf730a41e468e3b
Signed-off-by: Bingzhe Cai <bingzhec@codeaurora.org>
The driver doesn't vote regulators off when sensor device is
not detected.
CRs-fixed: 669309
Change-Id: Ie8a93ddc8b89b3ef9d4a3dfa6b4dae17c13ab76e
Signed-off-by: Bingzhe Cai <bingzhec@codeaurora.org>
The self calibration can be used for factory test, and the sensor
can calibrate by itself, the clibration data store in sensor eeprom.
CRs-fixed: 668548
Change-Id: If237224c75ba948a26d96746ade68c478e2ed4e0
Signed-off-by: Oliver Wang <mengmeng@codeaurora.org>
The set/reset operation takes long time to complete. This will
lead to the reported data can't streaming at high rate. Thus
change the logic to avoid freqent set/reset operation.
Change-Id: I2205eae31110348f312386214fb6e75dc4a15175
Signed-off-by: Oliver Wang <mengmeng@codeaurora.org>
Add secure touch support to the synaptics RMI4 and DSX drivers.
Expose the new interface through sysfs, to enable/disable
secure touch, and to wait for touch events.
When secure touch is active, interrupts are forwarded via sysfs
to a listening layer in userspace and processed in TrustZone.
Secure touch is aborted on power events.
Change-Id: If4c6b76d020ef061338378a8737702cec7bada33
Acked-by: Christian Bolis <cbolis@qti.qualcomm.com>
Signed-off-by: Keith Fallows <keithf@codeaurora.org>
Remove use of invalid header file to fix compile error for
64 bit target.
CRS-fixed: 646776
Change-Id: I538749544d6f1701a52ea6b704d4bb62de21feae
Signed-off-by: Bingzhe Cai <bingzhec@codeaurora.org>
Vote off regulators during suspend and set sensor gpio to sleep
state for power saving.
CRs-fixed: 669309
Change-Id: I053b20c67b1d5f07f495f800e94b12df1c669faa
Signed-off-by: Bingzhe Cai <bingzhec@codeaurora.org>
correct the pinctrl configuration for the synaptics touch
controller. Configure the pinctrl and gpio in touch controller
suspend/resume method to avoid the current leak in the device
suspend state.
Change-Id: Ib372f70189dd35c2eca9bb69a40ec1d6f3f23f5e
Signed-off-by: Sarada Prasanna Garnayak <c_sgarna@codeaurora.org>
Remove the delay time to improve system performance, so
it can save the system go to sleep/resume time.
Change-Id: I897cfc4708a1966fe1e6ee339a71c9625220103d
Signed-off-by: Oliver Wang <mengmeng@codeaurora.org>
To save more power, mpu6050 sensor needs vote regulators off after
disable and during suspend. The sensor register context needs to
be restored after it is powered up again.
CRs-fixed: 663426
Change-Id: I06e33c1e2e268c6fa957f0d26bf610ff254b3d22
Signed-off-by: Oliver Wang <mengmeng@codeaurora.org>
Signed-off-by: Bingzhe Cai <bingzhec@codeaurora.org>
The firmware image format is changed in CTP FT6436. Also vendor
id and version id are read from fw image from a different offset
as compared to previous controllers. The driver is updated to
support the new image format.
Change-Id: I465fdfa73e56e8fc4bbfdde980c558e4715d6d08
Signed-off-by: Mao Li <maol@codeaurora.org>
Add debugfs support for suspend and resume test to
Synaptics v2 driver.
Change-Id: I3d680d6bde0db4c9ab53924588579a80b25b6426
Signed-off-by: Shantanu Jain <shjain@codeaurora.org>
- Sensor class interface is required for sensor HAL to
discover the sensor. This change creates sensor class
interface for AKM8963 magnetometer sensor.
- Auto-report support added for AKM8963 driver.
CRs-fixed: 631108
Change-Id: I45dd4406a46469fe193579ee931bb266a68739e9
Signed-off-by: Prakash Gupta <guptap@codeaurora.org>
The power up/down is not handled properly. Add some power
optimization to handle the enable/disable and suspend/resume
routine.
Change-Id: I8ccf257ad19c629ea05973d29a7202002b2c7621
Signed-off-by: Oliver Wang <mengmeng@codeaurora.org>
commit 46a2986ebbe18757c2d8c352f8fb6e0f4f0754e3 upstream.
We expect that all the Haswell series will need such quirks, sigh.
The T431s seems to be T430 hardware in a T440s case, using the T440s touchpad,
with the same min/max issue.
The X1 Carbon 3rd generation name says 2nd while it is a 3rd generation.
The X1 and T431s share a PnPID with the T540p, but the reported ranges are
closer to those of the T440s.
HdG: Squashed 5 quirk patches into one. T431s + L440 + L540 are written by me,
S1 Yoga and X1 are written by Benjamin Tissoires.
Hdg: Standardized S1 Yoga and X1 values, Yoga uses the same touchpad as the
X240, X1 uses the same touchpad as the T440.
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
The power up/down is not handled properly. Add suspend/resume
functions and fix power ops functions issue which will enable
the sensor power by default in probe function.
CRs-fixed: 657320
Change-Id: I9796808a10245de2d0b563a56545ef82ca48bfe2
Signed-off-by: Oliver Wang <mengmeng@codeaurora.org>
As sensor will power down during suspend, those GPIOs used by
sensors also need pull down to minimize leakage.
CRs-fixed: 655099
Change-Id: If9463e0cc89675204b9b4bee5eca2dd5a44515a5
Signed-off-by: Bingzhe Cai <bingzhec@codeaurora.org>
Kconfig and makefile entity is required to build MEMSIC mmc3416x
3-axis magnetic sensor driver.
Change-Id: I839d1ddccf46e6aa22a981b1c6d2c0eaee3d6323
Signed-off-by: Oliver Wang <mengmeng@codeaurora.org>
Add board specific configurations to MEMSIC mmc3416x magnetic
field sensor driver to make it compatible with current kernel and
HAL architecture.
CRs-fixed: 652454
Change-Id: I390fa35f4185e94c00de497e951de6ace0034fac
Signed-off-by: Oliver Wang <mengmeng@codeaurora.org>
To save more power, sensor needs power off during suspend and
sensor GPIOs also need to be properly configured.
CRs-fixed: 655099
Change-Id: Id47160e51a4e14464d66156731d3012eedd184d9
Signed-off-by: Bingzhe Cai <bingzhec@codeaurora.org>
Change F1A registrations procedure if there are two synaptics
touch panels where only one has F1A support.
Change-Id: I8791fb0e86e0b266b813615da527735d10c66056
Signed-off-by: Shantanu Jain <shjain@codeaurora.org>
The place property is to configure the position of sensor mounting.
For different devices the relative position to first pin will be
different.
CRs-fixed: 655796
Change-Id: I39e1da93106d81679166e89534dd6cebb1a0d096
Signed-off-by: Bingzhe Cai <bingzhec@codeaurora.org>
Sensor class interface is required for sensor HAL to discover
the sensor. This change adds sensor class support for BOSCH
bma2x2 accelerometer.
CRs-fixed: 653165
Change-Id: If9dbddff3b4a58f21945a5da7dc4dbcec9c2e178
Signed-off-by: Oliver Wang <mengmeng@codeaurora.org>
Signed-off-by: Bingzhe Cai <bingzhec@codeaurora.org>
Sensor class interface is required for sensor HAL to
discover the sensor. This change creates sensor class
interface for INVENSENSE MPU6050 accelerometer +
gyroscope sensor combo.
CRs-fixed: 655796
Change-Id: Iec9e5cd7601b5a8a29ce5c1c267d63548afa2491
Signed-off-by: Bingzhe Cai <bingzhec@codeaurora.org>
Fix error exit handler for BOSCH bma2x2 accelerometer driver.
When probe does not success, driver can release resources
correctly.
CRs-fixed: 653165
Change-Id: If2add335f42bbf0c510e8f9028aa8f85caba804a
Signed-off-by: Oliver Wang <mengmeng@codeaurora.org>
Signed-off-by: Bingzhe Cai <bingzhec@codeaurora.org>
The resolution of akm09911 is 0.6uT/LSB, so fix it in order to make
it compatible with sensor HAL.
Change-Id: I182511a9700f9ea9c0fbd9549a4bfa00d92d8fc4
Signed-off-by: Oliver Wang <mengmeng@codeaurora.org>
Sensors HAL will update to support other gyroscopes,
MPU3050 driver needs update to follow the HAL change.
CRs-fixed: 653165
Change-Id: I99b30f8ad1c8504167122840925647620627d87a
Signed-off-by: Bingzhe Cai <bingzhec@codeaurora.org>
The interrupt and power enabling pin configurations are not
required properties since some design doesn't have gpio for
interrupt and power enabling.
CRs-fixed: 655796
Change-Id: If66bd0cd1a75dea3ef8c65439218cf8e096b7d5d
Signed-off-by: Bingzhe Cai <bingzhec@codeaurora.org>
Add standard features to Synaptics V2 driver. The supported
features are -
- Frame buffer(fb) blank/unblank notifications
- Pin control framework for gpios
- Sysfs interface for config id
- Dtsi interface for panel and display resolution
Change-Id: I7b057b09a2f2f1e30fe0ae5f1449282fe06551dd
Signed-off-by: Mohan Pallaka <mpallaka@codeaurora.org>
Add device tree and regulator control for BOSCH bma2x2
3-axis accelerometer.
CRs-fixed: 653165
Change-Id: I661e43b559190251dbaff4f26a1ccf004a708611
Signed-off-by: Oliver Wang <mengmeng@codeaurora.org>
Signed-off-by: Bingzhe Cai <bingzhec@codeaurora.org>
It takes about 7.2 ms for akm09911 to get valid data after single
measurement mode is set. Thus add some logic to wait until the data
is available.
CRs-fixed: 652168
Change-Id: I4f2d2117cd6f3e1dcfc2a27a692c211ac7990239
Signed-off-by: Oliver Wang <mengmeng@codeaurora.org>
Do cleanup to fix all checkpatch error and fix obvious problem.
Change-Id: Ib9da1e97a220a935f7c73798db1d9c64306c01e9
Signed-off-by: Oliver Wang <mengmeng@codeaurora.org>
Signed-off-by: Bingzhe Cai <bingzhec@codeaurora.org>
Migrate the Focaltech driver to use pinctrl framework for GPIO
configuration so that driver is compatible with targets that
use and targets that don't use pinctrl framework.
Change-Id: I84fc2a6d30f831b4b054780b107ce105614855ea
Signed-off-by: Mao Li <maol@codeaurora.org>
Add support to modify the Maximum_X_Position and
Maximum_Y_position in F11 and F12 control registers.
Re-programm the maximum coordinates of touch controller
if the firmware resolution mismatches the required
touch panel resolution.
Change-Id: I6256ff861f7830f5604f8be3552266edb5aa07ba
Signed-off-by: Shantanu Jain <shjain@codeaurora.org>
The measurement data read from akm09911 should be adjusted as the
following equation: Hadj = H * (ASA/128 + 1), where Hadj is the
output data, H is the raw data from akm09911 registers and ASA is
the sensor sensitivity adjustment data.
Change-Id: I893427da6cb31352340f94184490899f2c417912
Signed-off-by: Oliver Wang <mengmeng@codeaurora.org>
The touchscreen controllers are field-swappable on both customer
devices and internal reference devices. Current touch driver
architecture for Synaptics does not support dynamic detection
of two Synaptics touchscreens with the same slave address. The
patch provides a solution for the scenario in which it is required
to swap two Synaptics touchscreens without changing DT. Support of
this is added in driver as follows:
1. During driver probe, touch controller is identified by reading
the Package Id from controller. Package ID in F01_RMI_Query register
comprises of a 16-bit Package ID and a 16-bit Package ID Revision
of which both are unique for a touch controller part. If Package ID
is present,then a RMI read operation in UI Mode at seventeenth
register from F01 Query base returns it. First two bytes of this
Package ID base are used to select the correct Synaptics touch
controller from device tree.
2. Add a new property synaptics,detect-device in DT files which
will allow software to enable this logic to detect correct
touchscreen slave.
3. All such devices are placed as child nodes of Synaptics
Touchpanel node. These child nodes are parsed only if the property
synaptics,detect-device is defined in DT file.
Change-Id: Iac0eaef1b8cd301da763ef980a33ba27ccfb858d
Signed-off-by: Himanshu Aggarwal <haggarwa@codeaurora.org>
The sensor cm36283 sysfs ATTR ls_adc is read only ,so the permission
should be 0444 not 0664.
Change-Id: I2b9695cd8225785297778d5f9719e48983deb0a7
Signed-off-by: Jie Cheng <rockiec@codeaurora.org>