Use polling instead of interrupt for DSP mail box
acknowledgement.
With interrupt method, the amount of time for mail box
acknowledgement can vary, and sometimes long.
This is because interrupt handler reads all interrupt
status registers and masks, which can take long time,
especially on slow I2C bus.
Use polling to directly check for DSP mail box
acknowledgement reduces variability in amount of time
needed, because only 1 register is read.
Cirrus-JIRA-fixed: MMI-912
Change-Id: I21a223bbfdccb3593c61c7d04ae8355f2734c7a9
Signed-off-by: Li Xu <li-xu@outlook.com>
Signed-off-by: Yoon (Seungyoon) Lee <w22905@motorola.com>
Reviewed-on: https://gerrit.mot.com/1259695
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Seungyoon Lee <yoon@motorola.com>
Submit-Approved: Jira Key
There is a corner case in separate earpiece and speaker system, where
speaker path isn't open (so DSP isn't enabled yet) when usecase switches
but AP consumes the event and doesn't send again to DSP when DSP enabled.
Send usecase switches to DSP everytime, let it decide to switch or ignore.
Change-Id: I014d4d607f5a134970c3f8e43d41c296b62b3a46
Signed-off-by: Yoon (Seungyoon) Lee <w22905@motorola.com>
Reviewed-on: https://gerrit.mot.com/1259187
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Seungyoon Lee <yoon@motorola.com>
Submit-Approved: Jira Key
The Dual battery design could lead to a filaure where it drops
the SOC to a value of 0. This happens on error but also the
math could have been wrong. Only allow a change in SOC if it
is within +/-2% of the current reported SOC.
Also still only update if it changes and bound check 0 and 100
as min and max.
Change-Id: Ie049f9edcf62371b75f1e6def29b1742a9798a88
Signed-off-by: Kenny Kessler <kenny.kessler@motorola.com>
Reviewed-on: https://gerrit.mot.com/1258474
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Ryan Lattrel <ryanl@motorola.com>
Reviewed-by: Kenneth Kessler <kennykessler@motorola.com>
Submit-Approved: Jira Key
Add a State Machine for Charging a Dual Parallel battery
device. This State Machine requires independent battery
measurements with a singular charge controller.
Any other type of design might require a different SM.
Change-Id: Idd8fabc7b9af3ad853df8f7280d7e393787c1075
Signed-off-by: Kenny Kessler <kenny.kessler@motorola.com>
Reviewed-on: https://gerrit.mot.com/1258322
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
If CGAIN is set to Max then the Sense Resistnace should
be doubled to account for 200% gain.
This will make hte reported Current Now data to be valid.
Change-Id: Iafad42d0470dd71ebfc16fb5135ff415f9d1f2b3
Signed-off-by: Kenny Kessler <kenny.kessler@motorola.com>
Reviewed-on: https://gerrit.mot.com/1256824
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Kenneth Kessler <kennykessler@motorola.com>
Submit-Approved: Jira Key
With introduction DRM support, we need to make touch firmware
upgrade script waiting until driver becomes ready to perform
an upgrade. This change creates power on sysfs entry in the
driver's probe to indicate that firmware upgrade has to wait
until touch IC gets ready after it receives DRM framework
notification.
Change-Id: Ib5d8ed5f638890498fc4414c081dfaaa234063d7
Signed-off-by: Konstantin Makariev <hcv867@motorola.com>
Reviewed-on: https://gerrit.mot.com/1257955
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Konstantin Makariev <kmakariev@motorola.com>
Submit-Approved: Jira Key
Unmute the device after it is powered up and mute it
just before power down.
Mot-CRs-fixed: (CR)
Change-Id: I85a7e17c48181b708e1ad68025fab31c7ca16f2b
Signed-off-by: Paul Handrigan <Paul.Handrigan@cirrus.com>
Reviewed-on: https://gerrit.mot.com/1258201
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Guobin Zhang <zhanggb@motorola.com>
Submit-Approved: Jira Key
Get feature enable info "novatek,usb_charger" from dts.
Registe power supply notify to detect the usb plug/unplug event.
Set appropriate config with the power supply event
Change-Id: Ice136f21475c59be59157c9da1b074e05d2bd1ac
Reviewed-on: https://gerrit.mot.com/1253918
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Jun Weng <wengjun1@motorola.com>
Reviewed-by: Jialei Hao <haojl2@motorola.com>
Reviewed-by: Huosheng Liao <liaohs@motorola.com>
Submit-Approved: Jira Key
We have River and Olson only in DLKM kernel so far and this is good
timing to transit to use new 'cirrus' node instead of old 'wlf' node
since we don't have lots of old products dt in this kernel branch yet.
(This reverts commit 05d11bc217e6a46f67be0c8d9c635feba9a45d78.)
Mot-CR-fixed: (CR)
Change-Id: Ideed9b83314f06fb0058af7d2cb311b1347dec75
Signed-off-by: Yoon (Seungyoon) Lee <w22905@motorola.com>
Reviewed-on: https://gerrit.mot.com/1255127
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Patrick Gries <patgries@motorola.com>
Reviewed-by: Igor Kovalenko <igork@motorola.com>
Submit-Approved: Jira Key
Newly added DRM support utilizes API only available when CONFIG_DRM
declared. This change ensures driver can still be used with FB framework
and fixes some synchronisation issues found in the originl DRM support
implementation
Change-Id: Ic314c62e0f8693348b5ea631bc30905217810d77
Signed-off-by: Konstantin Makariev <hcv867@motorola.com>
Reviewed-on: https://gerrit.mot.com/1243348
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Konstantin Makariev <kmakariev@motorola.com>
Submit-Approved: Jira Key
No need to run SM in Factory mode.
Check for factory mode and skip the Charge SM if true.
Change-Id: I62a32a7dbe45cf0bdc6695e5c98e33852b97f9e8
Signed-off-by: Kenny Kessler <kenny.kessler@motorola.com>
Reviewed-on: https://gerrit.mot.com/1255777
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Kenneth Kessler <kennykessler@motorola.com>
Submit-Approved: Jira Key
Add the muc fw version to the boot mode parameters.
Version is passed in as module parameter.
Change-Id: I4c040ba22c756e67ab174a909f9b86e523d332a9
Signed-off-by: Ryan Lattrel <ryanl@motorola.com>
Reviewed-on: https://gerrit.mot.com/1254562
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Kenneth Kessler <kennykessler@motorola.com>
Submit-Approved: Jira Key
Basic Charge State Machine to handle Temperature and Step
Charging of a Single battery. Kernel DTS must be updated
for the correct profile to be loaded.
Change-Id: Ie86c01dfa97003f01504d62a85c3c5a52ff26001
Signed-off-by: Kenny Kessler <kenny.kessler@motorola.com>
Reviewed-on: https://gerrit.mot.com/1254237
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Ryan Lattrel <ryanl@motorola.com>
Reviewed-by: Kenneth Kessler <kennykessler@motorola.com>
Submit-Approved: Jira Key
-1, use circle array to record pps result for detecting some unstable
chargers.
-2, use the software algorithm to dynamic balance pps charger power.
once this charger can't balance power by itself
Change-Id: Ic30125ab6601b26d9da05617e9b0bbd81a02538f
Signed-off-by: xuwt2 <xuwt2@lenovo.com>
Reviewed-on: https://gerrit.mot.com/1254186
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Jianqi Yang <yangj@motorola.com>
Submit-Approved: Jira Key
The keys of olson are haptic, so key test need to add
some vibration sysfs nodes for test.
Change-Id: I687b0c70d465eae26161c1592c2166b909b7c9cd
Reviewed-on: https://gerrit.mot.com/1246114
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Konstantin Makariev <kmakariev@motorola.com>
Submit-Approved: Jira Key
Factory SW support to disable battery charging once the capacity larger
than 75%, and re-enable charging when the capacity lower than 60%.
the mmi_pl_chg_manager is the manager of parallel charging,
when the main charging path was disable by factory sw policy,
and the slave charging path was also to be disable.
Change-Id: If3b5b978aa47900e11a3abc15ffcfefd1a5dec20
Signed-off-by: xuwt2 <xuwt2@lenovo.com>
Reviewed-on: https://gerrit.mot.com/1254012
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Jianqi Yang <yangj@motorola.com>
Submit-Approved: Jira Key
Increase the time to wait for an ack from the muc.
Number of credits appears to remain at 100 with
timeout increase, where before it would lose a
couple on each boot.
Add IPC logging to prevent the muc_uart driver from
spamming the console. Remove timing messages, as
they are no longer useful.
Change-Id: I03b485905482bb25feddd23207db96bbea240920
Signed-off-by: Ryan Lattrel <ryanl@motorola.com>
Reviewed-on: https://gerrit.mot.com/1250793
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Kenneth Kessler <kennykessler@motorola.com>
Submit-Approved: Jira Key
something worng in sx933x_sar DLKM ko
need revert this befor fixed the error
This reverts commit fe4ce396d7c7029467e08e83c90fe58a61ff5314.
Change-Id: Iad3ff050a58ec04f7b61b2efe6e6d1851c3cda1c
Reviewed-on: https://gerrit.mot.com/1248677
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Guoyue Liu <liugy11@motorola.com>
Reviewed-by: Tao Sun <suntao2@motorola.com>
Submit-Approved: Jira Key
Program such as nanomix allows out of bound input
to mixer, which may crash kernel.
This issue is found by Google test (LENOVO-848).
Add out of bound check for mixer to prevent
kernel crash.
Mot-Crs-fixed:(CR)
Change-Id: I4c0437cfd2d2570a9c9489db500cffc513f27c43
Signed-off-by: Li Xu <li.xu@cirrus.com>
Reviewed-on: https://gerrit.mot.com/1253050
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Guobin Zhang <zhanggb@motorola.com>
Submit-Approved: Jira Key
Reviewed-on: https://gerrit.mot.com/1253083
Make OTP memory precious.
OTP memory should not be read while DSP firmware is running,
according to Design Team (XIAM-55).
By changing to precious, OTP memory can only be read by
driver, but not by debug sys file system.
Mot-Crs-fixed:(CR)
Change-Id: Ie394373cb73bc443a1f1fc97e9b626c997d8a4fa
Signed-off-by: Li Xu <li.xu@cirrus.com>
Reviewed-on: https://gerrit.mot.com/1253049
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Guobin Zhang <zhanggb@motorola.com>
Submit-Approved: Jira Key
Reviewed-on: https://gerrit.mot.com/1253079
Reviewed-by: Rav(CR) Vembu <raviv@motorola.com>
Reviewed-by: Yuesheng Huang <huangys@motorola.com>
Distortion can occur if the RX and TX paths do not use the same
frame sync signal. This forces the FS1 and FS2 signals to
use the same frame sync signal and also ensures common sample
rates between the RX and TX paths.
SQA-1135
Mot-Crs-fixed:(CR)
Change-Id: Id7f1dbbcca6247f0ad22b631fc6d499fc7e9827b
Signed-off-by: Adam Brickman <Adam.Brickman@cirrus.com>
Reviewed-on: https://gerrit.mot.com/1253047
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Guobin Zhang <zhanggb@motorola.com>
Submit-Approved: Jira Key
Reviewed-on: https://gerrit.mot.com/1253077
Reviewed-by: Rav(CR) Vembu <raviv@motorola.com>
Reviewed-by: Yuesheng Huang <huangys@motorola.com>
cs35l41 supports both DSP A and TDM 1.5 modes.
To distinguish between the 2 modes, rename TDM to DSP A mode,
which is currently used by driver.
SQA-1109
Mot-Crs-fixed:(CR)
Change-Id: I0636c067ec1845a1180e40891c08d9818f7f7b08
Signed-off-by: Li Xu <li.xu@cirrus.com>
Reviewed-on: https://gerrit.mot.com/1253044
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Guobin Zhang <zhanggb@motorola.com>
Submit-Approved: Jira Key
Reviewed-on: https://gerrit.mot.com/1253074
Reviewed-by: Rav(CR) Vembu <raviv@motorola.com>
Reviewed-by: Yuesheng Huang <huangys@motorola.com>
as ilitek vendor suggested, here we extend the g_flash_block_info to 6.
and this will compatible the other products.
Change-Id: Ic33de3d3f32b43a7ee9f5f80c1070d93bf7d44ab
Signed-off-by: dengwei1 <dengwei1@motorola.com>
Reviewed-on: https://gerrit.mot.com/1253027
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Xiangpo Zhao <zhaoxp3@motorola.com>
Submit-Approved: Jira Key
Vibrator HAL will set activate as 1 after set the duration.
If we cancle the hrtimer, it will cause vibrator can't stop as the expected time
until vibrator HAL turn off the vibrator.
Change-Id: I2d5635c766ef0b30d14170c1dd82a25d6c2481aa
Signed-off-by: Weilong Wu <wuwl10@motorola.com>
Reviewed-on: https://gerrit.mot.com/1251886
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Wen Xie <xiewen3@motorola.com>
Reviewed-by: Jialei Hao <haojl2@motorola.com>
Reviewed-by: Hujun Liao <liaohj@motorola.com>
Reviewed-by: Jianqi Yang <yangj@motorola.com>
Submit-Approved: Jira Key
When Charger is removed the Switcher can reverse boost back
out the USB port. Add a check for voltage on the USB port
so that this state can be cleared.
Change-Id: Ib20d8d91a08d1f40ce5ba3bc3ec41ffa8e930c85
Signed-off-by: Kenny Kessler <kenny.kessler@motorola.com>
Reviewed-on: https://gerrit.mot.com/1250814
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Curtis Porter <porterc@motorola.com>
Reviewed-by: Kenneth Kessler <kennykessler@motorola.com>
Submit-Approved: Jira Key
After bq25997x is removed, mmi_pl_charger driver will still
access bq25997x power supply pointer, which will cause panic.
To avoid this situation, get the power supply before use it
at any time.
Change-Id: Ia1672fc458dce3c86647b8e31c57ac283b910fa2
Signed-off-by: yanyh2 <yanyh2@lenovo.com>
Reviewed-on: https://gerrit.mot.com/1247691
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Jianqi Yang <yangj@motorola.com>
Submit-Approved: Jira Key
As for the vibrating fail issue is difficult to reproduce, add debug
codes from awinic to find more if it's reproduced by user.
Change-Id: I588875a1baa201fb2088f0fdc0ac4dc27e0537a7
Signed-off-by: yangjq <yangjq@lenovo.com>
Reviewed-on: https://gerrit.mot.com/1247441
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Jianqi Yang <yangj@motorola.com>
Submit-Approved: Jira Key
SoC now supports autodisable muxes so we can use these instead
of the handcrafted version inherited from older kernels.
Mot-Crs-fixed: (CR)
Change-Id: Idbd97fbc9d99a2b18e8ca6b14f20bf20b29b4c05
Signed-off-by: Richard Fitzgerald <rf@opensource.wolfsonmicro.com>
Reviewed-on: https://gerrit.mot.com/1246554
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Guobin Zhang <zhanggb@motorola.com>
Submit-Approved: Jira Key
(cherry picked from commit 6a4aa23a4a72bacab39fd23749937683ca6db2a9)
Reviewed-on: https://gerrit.mot.com/1246647
pre_finger_mask is overwritten to 0 when all finger leave.
So input_mt_report_slot_state will not called in himax_finger_leave func
Use old_finger instead.
Change-Id: Ic2db89273ea8fd91e88d1ce0dd9774f6b276d051
Signed-off-by: haojl2 <haojl2@motorola.com>
Reviewed-on: https://gerrit.mot.com/1246456
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Jianqi Yang <yangj@motorola.com>
Submit-Approved: Jira Key
Get the DC Power Supply and then check the PSY
for POWER_SUPPLY_PROP_PRESENT. This will signal
to the MUC that the AP is seeing DCIN.
Change-Id: I9048b6f935af68783c927bdc6c420e929857b50e
Signed-off-by: Kenny Kessler <kenny.kessler@motorola.com>
Reviewed-on: https://gerrit.mot.com/1245816
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
put sensor_class.ko and sx933x_sar.ko to TARGET_OUT_VENDOR
default will put in system
Change-Id: If5e8d483f8f78137f4caa60d7e49a2dedb1800d3
Signed-off-by: cuijy2 <cuijy1@motorola.com>
Reviewed-on: https://gerrit.mot.com/1245176
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Guoyue Liu <liugy11@motorola.com>
Reviewed-by: Master Yoda
Reviewed-by: Jianqi Yang <yangj@motorola.com>
Reviewed-by: Tao Sun <suntao2@motorola.com>
Submit-Approved: Jira Key