Calling find_vma() with out holding the mmap_sem semaphore is
not safe especially when an another thread could be removing
vmas from the list. Remove find_vma in places where it is
being used just for debugging purposes.
Change-Id: I1ac12410a0880d92c7301065aa656b5ad8d521cf
Signed-off-by: Sathish Ambley <sathishambley@codeaurora.org>
Update the compatible string and clock name to upstream.
Change-Id: I693dd6df9e272a09748d74d7ed9d76fe294ec7ee
Signed-off-by: Runmin Wang <runminw@codeaurora.org>
The rest of the driver started using CONFIG_QCOM_KGSL_IOMMU. The
replayed MMU changes didn't get the memo.
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
Enable compilation of the CPRh KBSS regulator driver to manage
power requirements of the KBSS subsystem in the msmcobalt chip.
CRs-Fixed: 967275
Change-Id: I8d0195bfe70148937f5f375e2caf2431e4fcde54
Signed-off-by: Osvaldo Banuelos <osvaldob@codeaurora.org>
Signed-off-by: Subbaraman Narayanamurthy <subbaram@codeaurora.org>
Auto update for the mismatch seen with following defconfigs.
- msm_defconfig
- msm-perf_defconfig
- msm_cortex_defconfig
- msm_cortex-perf_defconfig
Change-Id: Ic702802d48465011b5c15a862c0d12e8536c5139
Signed-off-by: Subbaraman Narayanamurthy <subbaram@codeaurora.org>
qpnp-power-on driver have been moved to drivers/input and no
longer present under drivers/platform/msm. Move the DT binding
documentation as well there.
While at it, fix the indentation so that it pass checkpatch.
Change-Id: I32f416d32a57d7c447563d26e4dad24605cdce50
Signed-off-by: Subbaraman Narayanamurthy <subbaram@codeaurora.org>
Device tree bindings documentation for qpnp-revid/coincell are
missing. Add them. These files are taken as a snapshot from
msm-3.18 commit d5809484bb1b (Merge "msm: ipa: fix race condition
when teardown pipe").
Change-Id: I79eeff64e655808414dd23882939bd952e4e279a
Signed-off-by: Subbaraman Narayanamurthy <subbaram@codeaurora.org>
Mutual exclusion between APM switching and LMH register accesses
is only required for HMSS version 1.2 and below on MSM8996. It
is not required for HMSS version 1.2 on MSM8996-Pro. Add support
for MSM8996-Pro so that the LMH mutex is not locked during APM
switching on MSM8996-Pro parts.
Change-Id: If09454827ed12c4d436c2fc792f5adcd45ef4312
Signed-off-by: David Collins <collinsd@codeaurora.org>
Adjust the floor, ceiling, and open-loop voltages for each corner
of each CPR3 regulator based upon aging measurements. This
allows the fixed open-loop voltage adjustment to be reduced since
it no longer has to account for the maximum possible aging
adjustment. This in turn leads to more situations where LDO mode
may be used for the HMSS CPR3 regulators since the LDO must
always operate at the open-loop voltage.
Change-Id: Iaca0ed4b51f258656b5c44dc58f7361814ca3af7
CRs-Fixed: 949622
Signed-off-by: David Collins <collinsd@codeaurora.org>
Change 64fec1f302ee21759bb4c6d7178a5d8a0aefe779 ("regulator:
cpr3-regulator: add support for CPRh-compliant controllers")
refactored cpr3_parse_common_ctrl_data() and introduced a bug
returning the error code after a VDD regulator get failure.
Fix this.
Change-Id: I486151ce61dab3c3f5a05daa2325386aacdd9960
CRs-Fixed: 984037
Signed-off-by: Osvaldo Banuelos <osvaldob@codeaurora.org>
MSM8996-Pro chips with HMSS CPR revision 1 will also utilize CBF
voltage offset fuses. Update the fuse presence check to include
this revision.
Change-Id: I8a9cd45a961948b39d3ed4cadf1a91706041c9c3
CRs-Fixed: 980901
Signed-off-by: David Collins <collinsd@codeaurora.org>
Add support for the CBF open-loop/closed-loop voltage offset
fuses found on MSM8996-Pro chips. These fuses define independent
open-loop voltages and closed-loop target quotients for the power
cluster and CBF clock which share CPR hardware thread 0. This
independent fusing ensures optimal VDD supply voltage for all
power cluster, performance cluster, CBF corner combinations.
Change-Id: I2e309d683f853f8bd9fd4eb6d12b05c32c7aaf26
CRs-Fixed: 980901
Signed-off-by: David Collins <collinsd@codeaurora.org>
Augment the cpr3-regulator driver to support controllers with full
hardware CPR operation also known as CPR hardening. Also, introduce
the cprh-kbss-regulator driver to handle CPU subsystem specific power
requirements of the msmcobalt chip.
Change-Id: Icac84f9533fa1895ca2466a3793ddaa8b7a4c89c
CRs-Fixed: 967275
Signed-off-by: Osvaldo Banuelos <osvaldob@codeaurora.org>
Voltage boost is a CPR4 hardware feature which raises the VDD supply
voltage when the number of active cores reaches a certain threshold.
It then reduces the voltage back down when the active core count
condition is no longer met. Add support to enable and configure this
feature.
Change-Id: Iccfc2ddddb6621a150235cb2c46adfd1b884dbc2
Signed-off-by: Tirupathi Reddy <tirupath@codeaurora.org>
Add support for hardware managed per-online-core and per-temperature
voltage adjustment. These adjustment methods may be used together or
independently. The configuration data for these adjustments including
the amount of adjustment for a given corner should be parsed from device
tree. Update the cpr3-regulator driver so that it writes the adjustment
values when enabled into the SDELTA hardware registers.
Change-Id: Idae9018f6a185202d38d210834ca337991fe83d9
Signed-off-by: Tirupathi Reddy <tirupath@codeaurora.org>
MSM8996-Pro chips contain a fuse which defines the GPU speed bin.
Each speed bin supports a different GPU maximum frequency. Add
support to read this speed bin fuse and use it to parse device
tree properties appropriately.
Change-Id: Ib9b0ba170287ae30802bdb0c64faead8c9bdee8c
Signed-off-by: David Collins <collinsd@codeaurora.org>
The lower Turbo fuse corner reference voltage for speed bin 1
with CPR revision >= 5 only applies to MSM8996v3 chips. It
should not be used on MSM8996-Pro chips. Therefore, add support
to distinguish MSM8996v3 from MSM8996-Pro and add a V3 check
to the reference voltage selection logic.
Change-Id: Iae7d49fe1b2539727160649cbf60ce57b73d639e
Signed-off-by: David Collins <collinsd@codeaurora.org>
Add TTW configuration for PMI8950. Also, add a DT property
(qcom,labibb-ttw-force-lab-on) to keep LAB always-on in TTW mode.
Presently, this property is only required for PMI8950.
CRs-Fixed: 958285 962662
Change-Id: Iec79a6f752067d96fc62a8e9d629c39f4db5ab9f
Signed-off-by: Anirudh Ghayal <aghayal@codeaurora.org>
Signed-off-by: Subbaraman Narayanamurthy <subbaram@codeaurora.org>
Currently, fan53555 regulator driver always registers for
set_suspend_voltage. This force configures the regulator to
set suspend voltage switching to a different voltage selector.
However, this might not be preferred for certain applications.
Add a device tree parameter "fcs,disable-suspend" for the
regulator which when specified will disable suspend voltage
configuration.
CRs-Fixed: 968575
Change-Id: Ib9f450126482e606f3e057857b7a58800583519a
Signed-off-by: Subbaraman Narayanamurthy <subbaram@codeaurora.org>
Halo HL7509 is a digitally programmable buck converter that
outputs a voltage from 600 to 1230 mV from an input voltage of
2.5 to 5.5 V. Since the register mappings are compatible with
FAN53555, add a new vendor ID to support it.
CRs-Fixed: 968575
Change-Id: I0083a7ada311d624731e43755cfd371b2364fb39
Signed-off-by: Subbaraman Narayanamurthy <subbaram@codeaurora.org>
Currently, fan53555_parse_dt() does a platform data allocation in
addition to reading device tree parameters. Move the memory
allocation out of fan53555_parse_dt() and change it only to parse
device tree parameters to match its name. This helps to expand
the function to read other device tree parameters.
CRs-Fixed: 968575
Change-Id: Id876d54bede15c73a298a6bfa68af7097115e36b
Signed-off-by: Subbaraman Narayanamurthy <subbaram@codeaurora.org>
Currently, rslow compensation active settings are applied and
cleared based on certain conditions. However, if the device goes
for a reset, the flag used by FG driver to save the setting done
will vanish. For e.g. if an active setting is applied and the
device goes for a reset, even if there is a condition present to
clear the active setting, it will not be applied. This is due to
the fact that the flag (rslow_comp.active) is not set in first
place even though FG HW has that setting applied. Fix this by
reading rslow configuration during hw_init and set the flag.
CRs-Fixed: 977626
Change-Id: Ib6d9f7d79335b027f7ed7ee24dfd5c9bb303228d
Signed-off-by: Subbaraman Narayanamurthy <subbaram@codeaurora.org>
Update the fast-charge configuration for SMB1358 used to
index into the battery charge-current.
CRs-Fixed: 978046
Change-Id: I31ffc03d083c955ac1fdcf79ba5287a0107d3524
Signed-off-by: Anirudh Ghayal <aghayal@codeaurora.org>
Add ability to configure the polarity of enable-pin in
parallel-charger configuration.
CRs-Fixed: 978046
Change-Id: Ied82dff7afeaa58ea0815f555791c9a0d15e926a
Signed-off-by: Anirudh Ghayal <aghayal@codeaurora.org>
If insert HVDCP charger when device in sleep, kernel wakes up by the
interrupt and after DCP being detected, there is a chance that kernel
going to sleep again and hvdcp_det_work won't be run. This causes the
HVDCP detection failure and stay at 5V to be acting as normal DCP.
Hold a wake lock before schedule the hvdcp_det_work, and release the
wakelock after it being detected.
CRs-Fixed: 966430
Change-Id: I7ca503a5656ab9031d409079421a24710f2996e6
Signed-off-by: Chunmei Cai <ccai@codeaurora.org>
Currently, ESR is being under-estimated when the battery state of
charge (SOC) is less than 2%. Add a change which can do tuning to
use default ESR values when SOC is less than 2% and switch back
to ESR extraction when SOC goes above 2%. When the SOC is greater
than 2% and less than 5%, apply slow settings for ESR pulse. When
the SOC crosses 5%, apply the default settings.
This will allow the SOC to increase more accurately when the FG
starts with a better ESR value. This feature is supported via
device tree property "qcom,esr-pulse-tuning-en".
CRs-Fixed: 953448
Change-Id: I37da8d2a9d795dc3d4daffeaf80a72d188243bfd
Signed-off-by: Subbaraman Narayanamurthy <subbaram@codeaurora.org>
Currently, a battery profile is loaded when the profile integrity
bit is not present, a new battery is inserted, or battery voltage
is not in range across reboot. When the battery profile loading
happens after the device has booted up, the charger driver is
notified to disable battery charging.
However, in cases like offline mode charging, the device can boot
up again with charging enabled causing battery parameters to be
modified even before the charger driver can probe. This causes
a jump in state of charge (SOC) across reboot and causes the FG
to restart. To help with this scenario, make sure the charger
driver is ready, and charging is kept disabled before the battery
profile loading process start. Enable charging back when there is
no need to reload the battery profile, or the FG has restarted
and the first SOC estimate is done.
CRs-Fixed: 953448
Change-Id: I90b1c81ce502c0f6e96feab3b23cff61054422cb
Signed-off-by: Subbaraman Narayanamurthy <subbaram@codeaurora.org>
When the charger driver haven't been probed yet and batt_psy is
unavailable, batt_profile_init is rescheduled as it depends on
the charger to disable charging while loading profile. However,
this adds a constraint that SRAM parameters needs to be updated
every time just before batt_profile_init is called again. Else,
stale SRAM parameters will be used to decide whether the battery
profile can be loaded or not.
Hence, cancel and schedule the update_sram_data work whenever
battery profile loading is rescheduled again.
CRs-Fixed: 953448
Change-Id: I6e1108601baf744014227155b7b09e0ec4a0a9bb
Signed-off-by: Subbaraman Narayanamurthy <subbaram@codeaurora.org>
The battery missing detection (BMD) is incorrectly
being enabled. Fix it.
CRs-Fixed: 943881
Change-Id: I58407f0b6ca376bc4809073144429cd4cc3483c9
Signed-off-by: Anirudh Ghayal <aghayal@codeaurora.org>
This devicetree documentation snapshot is taken as of msm-3.18
commit 96a424f00642 (regulator: cpr4: Fix highest voltage corner
open-loop voltage calculation).
Change-Id: I7d65e33e9e501a9175730df676490189effbfd44
Signed-off-by: Subbaraman Narayanamurthy <subbaram@codeaurora.org>
This devicetree bindings documentation snapshot is taken as of
msm-3.18 commit 96a424f00642 (regulator: cpr4: Fix highest
voltage corner open-loop voltage calculation).
Change-Id: I9b62013a8049c3a22a62b34cd06b87245bcdc5de
Signed-off-by: Subbaraman Narayanamurthy <subbaram@codeaurora.org>
This devicetree documentation snapshot is taken as of msm-3.18
commit 85b7eb8ac225 ( Merge "ASoC: soc-core: Fix integer
overflow").
Change-Id: I06a15d2668de59db8fca3cae0b69f5d0d3351e05
Signed-off-by: Subbaraman Narayanamurthy <subbaram@codeaurora.org>
This devicetree bindings documentation snapshot is taken as of
msm-3.18 commit 85b7eb8ac225be (Merge "ASoC: soc-core: Fix
integer overflow").
Change-Id: I50640b74ffe7b3aa29f9f6ca29a012c25c52d157
Signed-off-by: Subbaraman Narayanamurthy <subbaram@codeaurora.org>
Since the following drivers are not present under drivers/power,
remove the DT bindings documentation for them.
Change-Id: I41c08c186b649e21ac376a21632df1414904b1c0
Signed-off-by: Subbaraman Narayanamurthy <subbaram@codeaurora.org>
This reverts commit f8aac738feb06363f4db715754f1e91d39ace021 ("net: unix:
Fix uninitialized warnings when building for ARCH=um").
Signed-off-by: David Keitel <dkeitel@codeaurora.org>
This change fixes two corner case handling for the framedrop pattern
a) return the buffer when it is required in the drop frame handling
b) correct an incorrect framedrop pattern update when we miss the reg
update
Change-Id: I6d9b7715d3f0545a673d70e7744141f92bbc3a9d
Signed-off-by: Jing Zhou <jzhou70@codeaurora.org>
Decrement the burst count for dual stream in case of dual vfe. The
count is tracked in both streams and hence should be reduced for
both streams once buffer is done from both vfe.
Change-Id: I681390c2b3a2a0c4861721204ac19302335bf542
Signed-off-by: Shubhraprakash Das <sadas@codeaurora.org>
The ITS HAL3 test failed due to broken frames and green frames. The
root cause of the issue is due to the framedrop pattern setting in the
isp driver. This change fixes the following issues:
a) Keep tracking the hw framedrop pattern even after the reg update ack
miss.
b) Remove a race condition between the framedrop pattern setting and
request frame ioctl handling.
c) Correctly set the framedrop pattern after the request frame.
Change-Id: I862046c718d6e3a28d5f372eb2eb5e371471eb58
Signed-off-by: Jing Zhou <jzhou70@codeaurora.org>
For 14nm CSIPHY, the 5th lane is the clock lane
in combo mode. So update the mask value to 0x10.
Change-Id: I628031b19c1bd99d6c117e8b8db05af95f540106
Signed-off-by: Xu Han <hanxu@codeaurora.org>
Changing csiphy clock lane setting and removing a
register write in combo mode to enable ov2685 on
msm8937.
Change-Id: I8e6d987a8072a0c2679f7b53bfd3522b8dfa5297
Signed-off-by: Vijay kumar Tumati <vtumati@codeaurora.org>
Ping pong mismatch occurs when the interrupts miss happens.
Handle this scenario properly by sending error to userspace.
Change-Id: Idd8f9979a9b0e8c6a1989dd89ed6b98ccaa54ac9
Signed-off-by: Abhishek Kondaveeti <akondave@codeaurora.org>
AXI should be halted whenever all HW streams are stopping. This will
improve KPI even for RDI streams. Currently halt is determined using
Disable_Camif which is only valid for PIX streams. Decouple the two to
improve KPI on RDI and avoid wait.
Also, cleanup after timeout in start_axi. Remove handling of SD_SHUTDOWN
to avoid multiple release.
Change-Id: I09db8adb766d2e7889443f779a716aaa2f6c09d1
Signed-off-by: Harsh Shah <harshs@codeaurora.org>
Add changes to update camera drivers to:
1. Update necessary Kconfig files to support camera driver
compilation.
2. Support minor changes to V4L framework.
3. Export uapi headers to header_install export location.
Signed-off-by: Seemanta Dutta <seemanta@codeaurora.org>
Signed-off-by: Lakshmi Narayana Kalavala <lkalaval@codeaurora.org>
3phase clock is required in CPHY mode but not in DPHY mode.
Decouple 3phase clocks from other CSIPHY clocks in order to
not enable 3phase clock when camera is in DPHY mode.
Change-Id: I10f9a175ef937dab30afd9604cca3e870451b0c2
Signed-off-by: Xu Han <hanxu@codeaurora.org>
Remove the shared list of buffer queue that is used in case of
dual vfe. Whenever a buffer is dequeued from the buffer queue
program it on both vfe and ensure that buffer is dequeued only
once by compositing the buf done irq.
Also, program scratch buffer for stats stream
Change-Id: I96cd0a97b24bf6bc0223cbee8d1fc6bf2ecc7c49
Signed-off-by: Harsh Shah <harshs@codeaurora.org>
Signed-off-by: Shubhraprakash Das <sadas@codeaurora.org>
Signed-off-by: Jing Zhou <jzhou70@codeaurora.org>
The camera generic buffer manager and isp buffer
manager keep references of vb2 buffers locally during
buffer circulation. If for some reason the vb2 buffers
are freed from a cleanup call from mediaserver. The memory
for the buffers is freed. But the camera buffer managers
still access them for a fraction of time before the cleanup
call is triggered from daemon process. Hence make sure
to access the vb2 buffers only after checking for
the existence in vb2 queues to avoid memory corruption.
Change-Id: I7a1e5f9a3af3345e0c37d3208facbab107a6b9ed
Signed-off-by: Lakshmi Narayana Kalavala <lkalaval@codeaurora.org>
When CPU do spin lock irq save, it will disable irq/preemption.
If the same CPU do spin lock (without disabling irq),
then irq context can preempt and acuire the lock hold by user,
which will possibly hang CPU.
Avoid the issue to use spin lock irq save consistantly.
Change-Id: I52e17d189668166ae126dc5948fe51bd79ae9859
Signed-off-by: Peter Liu <pingchie@codeaurora.org>
Signed-off-by: Jing Zhou <jzhou70@codeaurora.org>
Due to the tasklet scheduling, SOF and Epoch irq handling can be out of
order. This causes some false isp error message being reported. This change
removes the false error message due to the out of order irq handling.
This change will remove this unnecessary check.
Change-Id: I7dd7d36692f63a53e54e7afcee4d9ed32cb22bc6
Signed-off-by: Jing Zhou <jzhou70@codeaurora.org>