Adopted use of dev_get_drvdata within suspend and resume callbacks
for both timed output and LED trigger flavors.
Change-Id: I3e18a50b85d2cd8972b1c4abdb1f521f112fa661
Signed-off-by: Jeff LaBundy <jeff.labundy@cirrus.com>
Signed-off-by: Ravi Vembu <raviv@motorola.com>
Mot-CRs-Fixed: (CR)
Reviewed-on: https://gerrit.mot.com/1202249
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Submit-Approved: Jira Key
Added a safety check to retry writes to ENDPLAYBACK in the
event of an I/O error, parking the device in a reset state
following multiple failed attempts.
Change-Id: I4847f81ee7809b5a0bd0f86f65c631f8dc7d65ec
Signed-off-by: Jeff LaBundy <jeff.labundy@cirrus.com>
Signed-off-by: Ravi Vembu <raviv@motorola.com>
Mot-CRs-Fixed: (CR)
Reviewed-on: https://gerrit.mot.com/1202248
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Submit-Approved: Jira Key
Added a safety check such that all non-zero values written to the
comp_enable control are translated to '1' when passed to the DSP.
Change-Id: I359def9737eeb8e1f77abdd76ce8d7a3ef069ee5
Signed-off-by: Jeff LaBundy <jeff.labundy@cirrus.com>
Signed-off-by: Ravi Vembu <raviv@motorola.com>
Mot-CRs-Fixed: (CR)
Reviewed-on: https://gerrit.mot.com/1202247
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Submit-Approved: Jira Key
* Added a sysfs control for enabling and disabling GPIO1.
* Added a means to disable GPIO1 by default based on a device tree
entry.
* Added a means to automatically control GPIO1 as a function of the
host's power state based on a device tree entry.
* Updated the minimum supported firmware revision to 4.2.0.
Change-Id: I654da852bc9982cbc6628666b82141363651ea72
Signed-off-by: Jeff LaBundy <jeff.labundy@cirrus.com>
Signed-off-by: Ravi Vembu <raviv@motorola.com>
Mot-CRs-Fixed: (CR)
Reviewed-on: https://gerrit.mot.com/1202246
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Submit-Approved: Jira Key
Added errata support for updated IMON temperature coefficient trim
values and TEMPMON gain/offset trim values (revisions B0/B1 only).
Change-Id: I830f177d5462bb8c3764c6b63f4f2e91bf67e754
Signed-off-by: Jeff LaBundy <jeff.labundy@cirrus.com>
Signed-off-by: Ravi Vembu <raviv@motorola.com>
Mot-CRs-Fixed: (CR)
Reviewed-on: https://gerrit.mot.com/1202244
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Submit-Approved: Jira Key
Add focaltech driver into dlkm.
- The dependency on CONFIG_TOUCHSCREEN_FOCALTECH*
are removed in the driver
- Add focaltech,fw-update-mmi in dts for moto firmware update
process
- Changes related to resource release to prevent kernel panic
Change-Id: Ib38c51969e58f827e2996de1a0550bade39036e7
Signed-off-by: wengjun1 <wengjun1@motorola.com>
Reviewed-on: https://gerrit.mot.com/1200328
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Hujun Liao <liaohj@motorola.com>
Submit-Approved: Jira Key
Add the dlkm for mmi control over the qcom smb charger.
This initial drop only gives access to the factory
interfaces but over time will be granted more control
over total system charging.
Change-Id: I408a4e36dab976697d1f98499bf33b6378deaf96
Signed-off-by: Kenny Kessler <kenny.kessler@motorola.com>
Reviewed-on: https://gerrit.mot.com/1200750
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Kenneth Kessler <kennykessler@motorola.com>
Submit-Approved: Jira Key
Add the driver to talk to the muc via uart.
Change-Id: I4f2b0b1a99d6834b668a15c594ccd4f0188a8eaa
signed-off-by: Ryan Lattrel <ryanl@motorola.com>
Reviewed-on: https://gerrit.mot.com/1174586
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Kenneth Kessler <kennykessler@motorola.com>
Submit-Approved: Jira Key
Enable the ref clk when the codec is not in reset.
Mot-CRs-Fixed: (CR)
Change-Id: Ic6d0d3f869621b193747f7ba309c2fb18b6a2573
Signed-off-by: Ravi Vembu <raviv@motorola.com>
Reviewed-on: https://gerrit.mot.com/1197391
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Submit-Approved: Jira Key
Create initial drop for MAX170XX which is based on
based on teh max17042 driver.
Change-Id: Ide3cd2e8fd0dc5585c0c10665873b66845b2c45e
Signed-off-by: Kenny Kessler <kenny.kessler@motorola.com>
Reviewed-on: https://gerrit.mot.com/1197354
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Ryan Lattrel <ryanl@motorola.com>
Reviewed-by: Kenneth Kessler <kennykessler@motorola.com>
Submit-Approved: Jira Key
Some targets may not use CS35L41 AMP. Do not default to the
SPI codec as it may break the build.
Change-Id: Ie5e0da0e9a7318a99480f97df73620ea51e11d28
Signed-off-by: Ravi Vembu <raviv@motorola.com>
Mot-CRs-Fixed: (CR)
Reviewed-on: https://gerrit.mot.com/1196742
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Submit-Approved: Jira Key
DSP preload function adds "(NULL)" string to the control
name if a dsp suffix is not set. As result the control
could not be find. Zero lenght string will fix that issue.
Mot-CRs-fixed: (CR)
Change-Id: I9e8f88fb2ac10d7143b0434926dc9b589138c298
Signed-off-by: Vlad Karpovich <Vlad.Karpovich@cirrus.com>
Reviewed-on: https://gerrit.mot.com/1193402
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Guobin Zhang <zhanggb@motorola.com>
Submit-Approved: Jira Key
Function kernel_read prototype is different in kernel 4.9 and 4.14.
Adding conversion function based on LINUX_VERSION_CODE
Change-Id: Ic993ae91ddbc4db4608822009954208923abe205
Signed-off-by: Konstantin Makariev <hcv867@motorola.com>
Reviewed-on: https://gerrit.mot.com/1194418
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Konstantin Makariev <kmakariev@motorola.com>
Submit-Approved: Jira Key
Set suffix to an empty string if it is NULL to avoid
adding (NULL) to the conroll name.
Change-Id: I61e2b93cbda10b6ba5300b652b6fb0f6c49057bf
Signed-off-by: vkarp <vkarp@motorola.com>
Signed-off-by: Ravi Vembu <raviv@motorola.com>
Mot-CRs-fixed: (CR)
Reviewed-on: https://gerrit.mot.com/1193034
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Submit-Approved: Jira Key
Create tps61280 directory and move tps61280.c into it.
When put this file in root of misc folder, system will compile
cs40l2x together, build motorola_kernel_modules_drivers_misc,
this is not we want, we need build
motorola_kernel_modules_drivers_misc_tps61280.
Change-Id: Ie89182423172be16f85e8cfa01cb1a8c9360f689
Signed-off-by: zhouwl <zhouwl@lenovo.com>
Reviewed-on: https://gerrit.mot.com/1191062
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Jialei Hao <haojl2@motorola.com>
Reviewed-by: Jianqi Yang <yangj@motorola.com>
Submit-Approved: Jira Key
Reboot callback might be called multiple times causing a soft lock.
This change clears flags and invalidates pointers to avoid repeated
function call.
Change-Id: I73010f64960f238faacd2fac2f2a831e36b63d71
Signed-off-by: Konstantin Makariev <hcv867@motorola.com>
Reviewed-on: https://gerrit.mot.com/1190524
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Konstantin Makariev <kmakariev@motorola.com>
Submit-Approved: Jira Key
This feature is not used in moto projects.
Change-Id: I21b4ab7f33e448e4ce7bfaa4992ed26900b64b90
Signed-off-by: haojl2 <haojl2@motorola.com>
Reviewed-on: https://gerrit.mot.com/1189236
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Jianqi Yang <yangj@motorola.com>
Submit-Approved: Jira Key
Added device tree entries for default GPIO1 rising-edge index,
falling-edge index, and falling-edge timeout to be written to
the corresponding DSP firmware controls during initialization.
Change-Id: Ib8f0b662fdf8367e31608cdc121fdcade0fdd1be
Signed-off-by: Jeff LaBundy <jeff.labundy@cirrus.com>
Signed-off-by: Ravi Vembu <raviv@motorola.com>
Added device tree binding documentation for GPIO1 rising-edge
wavetable index, falling-edge wavetable index and falling-edge
timeout device tree entries.
Change-Id: I0b527eda2969428aadc0a8bd11131f46387cc3d6
Signed-off-by: Jeff LaBundy <jeff.labundy@cirrus.com>
Signed-off-by: Ravi Vembu <raviv@motorola.com>
Added a safety check to ensure that the values written to the
gpio1_fall_timeout and standby_timeout controls do not exceed the
maximum value supported by the DSP.
Change-Id: I8b5dca1f5013acb2d06688af577d0214ce956559
Signed-off-by: Jeff LaBundy <jeff.labundy@cirrus.com>
Signed-off-by: Ravi Vembu <raviv@motorola.com>
SoC bus controller driver may choose to use DMA for the underling data
transfer. This patch removes the usage of stack for DMA buffer.
Bug: 79998874
Test: manual haptics test
Change-Id: I5729ecc9751eb1af768261b66c499ccb9957cb69
Signed-off-by: David Lin <dtwlin@google.com>
Signed-off-by: Ravi Vembu <raviv@motorola.com>
Added GPIO configuration and amplifier digital volume to the list of
registers restored to their respective default values following the
shutdown of ROM mode, but the initialization of RAM mode (B1 only).
Change-Id: If317a0b7145718d45cea3249037a503d60c32d37
Signed-off-by: Jeff LaBundy <jeff.labundy@cirrus.com>
Signed-off-by: Ravi Vembu <raviv@motorola.com>
* Removed the ability to force the PLL active (aoh_auto_enable = 0)
as it is forbidden to do so with firmware revision 4.1.0 and above.
* Fixed playback queue polling interval to 5 ms.
Change-Id: I2e79a0becbdd2f7d4e10d15af0f675f945f0ab9f
Signed-off-by: Jeff LaBundy <jeff.labundy@cirrus.com>
Signed-off-by: Ravi Vembu <raviv@motorola.com>
Added wakeup calls in order to prevent the system from suspending
while continuous vibration is in progress.
Change-Id: I295fbe3098ebda4710bcd90653609c284d8c69a3
Signed-off-by: Jeff LaBundy <jeff.labundy@cirrus.com>
Signed-off-by: Ravi Vembu <raviv@motorola.com>
Replaced references to a local copy of digital volume (mapped to the
dig_scale sysfs control) with an actual query of the device.
Change-Id: If5c1a3d65a4466299f198f751f6364e979243fd1
Signed-off-by: Jeff LaBundy <jeff.labundy@cirrus.com>
Signed-off-by: Ravi Vembu <raviv@motorola.com>
Replaced changes to the chip-level digital volume control (dig_scale)
during execution of the playback queue with changes to the firmware's
control-port-triggered amplitude control (cp_dig_scale) to prevent
changes to the amplitude of GPIO-triggered playback during execution
of the playback queue.
Change-Id: Ice5b7a36978a73f2c2408f2f1ead8dbb48dbe8f9
Signed-off-by: Jeff LaBundy <jeff.labundy@cirrus.com>
Signed-off-by: Ravi Vembu <raviv@motorola.com>
* Added sysfs controls for the firmware's separate GPIO-triggered
playback and control-port-triggered playback amplitude controls.
* Increased the minimum supported firmware revision to 4.1.0.
Change-Id: Idae3fa1a839871cfa2760f14fc3b6ecf707fbd93
Signed-off-by: Jeff LaBundy <jeff.labundy@cirrus.com>
Signed-off-by: Ravi Vembu <raviv@motorola.com>
* Added device tree entries for default f0/ReDC values to be written
to the corresponding DSP firmware controls during initialization.
* Added device tree entries for minimum and maximum values that may
be written to the f0_stored and redc_stored sysfs controls.
Change-Id: I5b681efc38e466d1545496f327da66f189c8fc89
Signed-off-by: Jeff LaBundy <jeff.labundy@cirrus.com>
Signed-off-by: Ravi Vembu <raviv@motorola.com>
Added device tree binding documentation for default, minimum and
maximum f0 and ReDC device tree entries.
Change-Id: I7f3d7170e51e81bf4900c4065500a78fbae55878
Signed-off-by: Jeff LaBundy <jeff.labundy@cirrus.com>
Signed-off-by: Ravi Vembu <raviv@motorola.com>
Added the ability to group multiple segments together and repeat them
multiple times within the queue.
Change-Id: I0eb3a4931092961e8ac332ee5f4d5507a0128c20
Signed-off-by: Jeff LaBundy <jeff.labundy@cirrus.com>
Signed-off-by: Ravi Vembu <raviv@motorola.com>
* Replaced instances of strcpy and strchr with strlcpy and strnchr,
respectively.
* Eliminated use of strlen.
Change-Id: I44e0a47329a2d2d3bc440aee3a0f0bce5f4a0971
Signed-off-by: Jeff LaBundy <jeff.labundy@cirrus.com>
Signed-off-by: Ravi Vembu <raviv@motorola.com>
Updated PLL loop parameters as per new errata issued for the device.
Change-Id: I772b4b93b91eec6ee1ed90461e3df57ceb0562a9
Signed-off-by: Jeff LaBundy <jeff.labundy@cirrus.com>
Signed-off-by: Ravi Vembu <raviv@motorola.com>