Enabling charging from Factory Image. This will allow boots
while in the factory to skip and charge the device if a Wall
Charger is present.
Change-Id: I3fd3d6f2773c38bebdc2d3c93aef7c847051425e
Signed-off-by: Kenny Kessler <kenny.kessler@motorola.com>
Reviewed-on: https://gerrit.mot.com/1267774
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Ryan Lattrel <ryanl@motorola.com>
Reviewed-by: Cesar Augusto Marcelino dos Santos <cmsantos@motorola.com>
Reviewed-by: Ling Jin <lingjin@motorola.com>
Submit-Approved: Jira Key
When there are multiple Synaptics touch ICs present, multiple
instances of driver need to run concurrently. This change is the
initial implementation of multiple driver's instances support.
Temporarily FW upgrade function is now lauched in probe only
for the first instance of driver and RMI device support ceased.
Change-Id: I59cc1521eee1679922fba77418fc111ff850f1cf
Signed-off-by: Konstantin Makariev <hcv867@motorola.com>
Reviewed-on: https://gerrit.mot.com/1266638
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Konstantin Makariev <kmakariev@motorola.com>
Submit-Approved: Jira Key
Touch now can be bound to display using device tree option. DRM
framework API provides display name to allow comparison. If touch
driver has bound display name specified, then probe will fail
whenever bound display name and name reported by DRM API do not
match.
Change-Id: I4b934efdbc38944faae36c49d093099d9ac50834
Signed-off-by: Konstantin Makariev <hcv867@motorola.com>
Reviewed-on: https://gerrit.mot.com/1266671
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Konstantin Makariev <kmakariev@motorola.com>
Submit-Approved: Jira Key
Take control of the Power supply interface.
This will be done by creating a passthrough "battery" that
passes the properties from this driver to the qcom smb driver.
At first there wil be 2 properties that can be caught and replaced.
Status is needed to ensure the mmi algorithim hits FULL.
Capacity is needed in case of dual batteries where it will be
merged into a singular capacity.
Change-Id: Ib20bf6a574c0c74c01b0fc4a959f57706d3ab83f
Signed-off-by: Kenny Kessler <kenny.kessler@motorola.com>
Reviewed-on: https://gerrit.mot.com/1266769
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
Make sure to charge back if battery drops to 99%.
This was found beucase after charge FULL the Flip battery
still needed charge to balance voltage. The Main battery
charged the Flip battery. Then Main battery hits 99% but
because Flip was FULL it was blocked from restarting the
Charge controller.
Change-Id: I58d00acf963afeba1c3bf6bf7fbea98b293d4251
Signed-off-by: Kenny Kessler <kenny.kessler@motorola.com>
Reviewed-on: https://gerrit.mot.com/1266305
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Ryan Lattrel <ryanl@motorola.com>
Reviewed-by: Curtis Porter <porterc@motorola.com>
Reviewed-by: Kenneth Kessler <kennykessler@motorola.com>
Submit-Approved: Jira Key
The Flip Voltage will lag a bit more behind the Main Battery.
This is due to path impedance so adjust the Voltage offset to
consider a Taper condition. For Flip only use twice the 50 mV
or 100 mV of Voltage offset.
Change-Id: I4e2be6ed57bd5e097b7d735af3b00d21fc1f9a4c
Signed-off-by: Kenny Kessler <kenny.kessler@motorola.com>
Reviewed-on: https://gerrit.mot.com/1265427
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Ryan Lattrel <ryanl@motorola.com>
Reviewed-by: Curtis Porter <porterc@motorola.com>
Reviewed-by: Kenneth Kessler <kennykessler@motorola.com>
Submit-Approved: Jira Key
Change pr_info to pr_debug to reduce those too many kernel logs.
Can still enable these logs by the following adb command:
echo "file aw869x.c +p" > /sys/kernel/debug/dynamic_debug/control
Change-Id: I3515457a5c9184022150688b76731363c24249c5
Signed-off-by: yangjq <yangjq@lenovo.com>
Reviewed-on: https://gerrit.mot.com/1266935
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Jianqi Yang <yangj@motorola.com>
Submit-Approved: Jira Key
fix the touch issue
pick up the fix from odm
Change-Id: I76e80f2c3d46055bb592a72d2e05bee31d0e3296
Signed-off-by: dengwei1 <dengwei1@motorola.com>
Reviewed-on: https://gerrit.mot.com/1266915
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Wang Wang <wangwang1@lenovo.com>
Submit-Approved: Jira Key
This patch is released by Vendor.
Without this patch, stack point issue may happen.
Change-Id: I710a36021112dcdc9726e3171a8cbb552b7a4e3d
Signed-off-by: haojl2 <haojl2@motorola.com>
Reviewed-on: https://gerrit.mot.com/1266527
Tested-by: Jira Key
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Reviewed-by: Jianqi Yang <yangj@motorola.com>
Submit-Approved: Jira Key
g_zero_event_count not clear after resume.
This will cause ESD recover triggered after resume device several times.
Change-Id: I79d4c0637763ee23544c0eff367a6eeec75cee19
Signed-off-by: haojl2 <haojl2@motorola.com>
Reviewed-on: https://gerrit.mot.com/1266511
Tested-by: Jira Key
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Reviewed-by: Jianqi Yang <yangj@motorola.com>
Submit-Approved: Jira Key
Because this digital volume adjustment only has 21dB space,
it can't meet SOP-0289 requirements, remove this function,
let's use QCom codec digital gain for ramping tuning.
Change-Id: I90ecc9778bffe218704c71236223666e6af3d4cb
Signed-off-by: zhouwl <zhouwl@lenovo.com>
Reviewed-on: https://gerrit.mot.com/1266429
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Zhihong Kang <kangzh@motorola.com>
Reviewed-by: Hujun Liao <liaohj@motorola.com>
Submit-Approved: Jira Key
Limit number of print messages in run time. If necessary, debug
messages can be truned on dynamically through kernel debug interface
echo "file sx933x.c +p" > /d/dynamic_debug/control
Change-Id: Ic317c4076540600f6838a0dae24ca3aaefcd5f6c
Signed-off-by: Konstantin Makariev <hcv867@motorola.com>
Reviewed-on: https://gerrit.mot.com/1264922
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Konstantin Makariev <kmakariev@motorola.com>
Submit-Approved: Jira Key
remove some DEBUG level logs to INFO level
logs of sx9331
Change-Id: Icba07c38ee19d5b5125221aa0c5daf4cb274a116
Signed-off-by: liugy11 <liugy11@lenovo.com>
Reviewed-on: https://gerrit.mot.com/1264209
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Haichao Li <liuhc3@motorola.com>
Reviewed-by: Tao Sun <suntao2@motorola.com>
Submit-Approved: Jira Key
the POWER_SUPPLY_PROP_STATUS only express charge status,
such as charging,discharging,not charging. and cannot be express
as Charge IC ERROR status.
use the POWER_SUPPLY_PROP_CHARGE_NOW_ERROE to express it
Change-Id: I319e41e903da33f1b052c3b856a0852c3b44c029
Signed-off-by: xuwt2 <xuwt2@lenovo.com>
Reviewed-on: https://gerrit.mot.com/1263621
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Yonghua Yan <yanyh2@motorola.com>
Reviewed-by: Jianqi Yang <yangj@motorola.com>
Submit-Approved: Jira Key
In the bq2597x_mmi drive, the PROP_STATUS was replace with
CHARGE_NOW_ERROR, and the mmi_pl_chg_manager also replace it
Change-Id: Id9cdf2991f54717e2c4ed079b952b633d09efe46
Signed-off-by: xuwt2 <xuwt2@lenovo.com>
Reviewed-on: https://gerrit.mot.com/1263623
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Yonghua Yan <yanyh2@motorola.com>
Reviewed-by: Jianqi Yang <yangj@motorola.com>
Submit-Approved: Jira Key
when the 4-pole headset unplug, APM will receive HEADSET remove event.
then HADPHONE insert and remove event. this cause unnecessary audo route
switch which lead music plyback stuck.
if we change order of madera_cable array, we may remove headphone firstly.
this can avoid this issue.
Change-Id: Icf1af827a3364384b5bc63a8d10dde3a88d38986
Signed-off-by: huangys <huangys@motorola.com>
Reviewed-on: https://gerrit.mot.com/1259458
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Guobin Zhang <zhanggb@motorola.com>
Submit-Approved: Jira Key
Wake up the system from suspend with either the
wake_irq or the attach_irq.
Change-Id: Ia635fdbc24d0bcc138f7416cfa52740175ef126c
Signed-off-by: Ryan Lattrel <ryanl@motorola.com>
Reviewed-on: https://gerrit.mot.com/1261634
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Kenneth Kessler <kennykessler@motorola.com>
Submit-Approved: Jira Key
Change the sleep timeout period from 5s to 500ms.
Before the timeout occurs the driver blocks the transmission
of messages in the tx queue.
Change-Id: Ib35d28c6e0586b1216bbf5cdd769074b6f4629de
Signed-off-by: Ryan Lattrel <ryanl@motorola.com>
Reviewed-on: https://gerrit.mot.com/1262209
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Kenneth Kessler <kennykessler@motorola.com>
Submit-Approved: Jira Key
Don't toss the entire message on a bad magic number.
If there is a bad value in front, look for a valid
magic number in the rest of the data, then throw out
the bytes before it. This is to eliminate any
random bytes that might show up before a valid message.
Change-Id: I70c395de146d7368d0d2a6433be329b8d69b5729
Signed-off-by: Ryan Lattrel <ryanl@motorola.com>
Reviewed-on: https://gerrit.mot.com/1258434
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Kenneth Kessler <kennykessler@motorola.com>
Submit-Approved: Jira Key
This reverts commit 987d71921e6d284257daff68be69375138ce3d56.
This is not needed anymore since the clk is always on 32K clk.
Change-Id: I7aedfd7d10d558ed1e780637f4b57dfdd3989faf
Mot-CRs-Fixed: (CR)
Reviewed-on: https://gerrit.mot.com/1262244
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Rav(CR) Vembu <raviv@motorola.com>
Submit-Approved: Jira Key
Ensure the the SW JEITA is disabled in QCOM driver.
Also forcibly Disable the HW JEITA since the QCOM driver
will enable it when the SW JEITA is disabled. The MMI
State Machine in this driver is superior.
Change-Id: Idfe42c08f720990a5edfd6cfb01491a89f5cf524
Signed-off-by: Kenny Kessler <kenny.kessler@motorola.com>
Reviewed-on: https://gerrit.mot.com/1261048
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Curtis Porter <porterc@motorola.com>
Reviewed-by: Ryan Lattrel <ryanl@motorola.com>
Reviewed-by: Kenneth Kessler <kennykessler@motorola.com>
Submit-Approved: Jira Key
Check the VOLTAGE_NOW property and if it is above 2 V
send back to MUC that VBUS is present. This is needed
mostly for Factory test but might come in hPerry later on.
Change-Id: I16688520611e6087fb04a7cf8006db71496ec519
Signed-off-by: Kenny Kessler <kenny.kessler@motorola.com>
Reviewed-on: https://gerrit.mot.com/1259770
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Ryan Lattrel <ryanl@motorola.com>
Reviewed-by: Sridhar Vashist <svashist@motorola.com>
Reviewed-by: Kenneth Kessler <kennykessler@motorola.com>
Submit-Approved: Jira Key
This is for factory test.
Set gpio 35,36,136 as output.
Change-Id: Iacdcaf62fa75f46e8aeebff26d152ae9c6c87b95
Reviewed-on: https://gerrit.mot.com/1258547
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Moon Do Seo <moon@motorola.com>
Reviewed-by: Kenneth Kessler <kennykessler@motorola.com>
Submit-Approved: Jira Key
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