Commit graph

440480 commits

Author SHA1 Message Date
Linux Build Service Account 182099f21d Merge "ASoC: wcd9335: re-set micb_ref to zero post SSR" 2015-12-04 12:44:20 -08:00
Linux Build Service Account d8a3173b68 Merge "power: smbcharger: Re-run AICL irrespective of the AICL status" 2015-12-04 12:44:00 -08:00
Linux Build Service Account 0fb91456df Merge "ASoC: wcd9335: add fixes for TX pop and spkr gain updates" 2015-12-04 12:43:59 -08:00
Linux Build Service Account 8bdc809e8d Merge "mmc: core: disable clock scaling before mmc suspend" 2015-12-04 12:43:58 -08:00
Linux Build Service Account 8fa34efd7f Merge "net: rmnet_data: Add RXCSUM capability to netdevices" 2015-12-04 12:43:56 -08:00
Linux Build Service Account e4dafef3a2 Merge "clk: qcom: clock-cpu-8976: Add required fmax rates to OPP" 2015-12-04 12:43:55 -08:00
Linux Build Service Account 1bc0c933d6 Merge "msm: vidc: disable CPU L2 cache PC during video sessions" 2015-12-04 12:43:49 -08:00
Linux Build Service Account e6fca824a2 Merge "ARM: dts: msm: update mincpubw voting for MSM8976/8956" 2015-12-04 12:43:48 -08:00
Linux Build Service Account aeccea23eb Merge "ARM: dts: msm: configure pc disable latency for 8976" 2015-12-04 12:43:42 -08:00
Linux Build Service Account e123198888 Merge "sched: encourage idle load balance and discourage active load balance" 2015-12-04 12:43:41 -08:00
Linux Build Service Account e6a6903795 Merge "ARM: dts: msm: Add pm-qos for msm8976" 2015-12-04 12:43:41 -08:00
Linux Build Service Account fa81b52e1f Merge "ARM: dts: msm: Remove 133Mhz power level" 2015-12-04 12:43:40 -08:00
Linux Build Service Account 7afb657e81 Merge "ARM: dts: msm: Modify floor values for gpu bus votes" 2015-12-04 12:43:39 -08:00
Linux Build Service Account 18f76fb4ea Merge "clk: qcom: clock-pll: Print PLL registers in case of pll lock failure" 2015-12-04 12:43:38 -08:00
Linux Build Service Account 10bf84649e Merge "mmc: block: Do not call post_req in DCMD case" 2015-12-04 12:43:34 -08:00
Linux Build Service Account 526d5408f4 Merge "dma-buf: Check return value of anon_inode_getfile" 2015-12-04 12:43:33 -08:00
Linux Build Service Account 953d2255a4 Merge "ASoC: msm: increase slimbus channel FIFO watermark value" 2015-12-04 12:43:28 -08:00
Linux Build Service Account 75b4505e08 Merge "ASoC: msm-cpe-lsm: Queue 2 buffers with slimbus before afe start" 2015-12-04 12:43:27 -08:00
Linux Build Service Account 36a98dc86c Merge "ASoC: msm: add support for faster CPE data transfer rate" 2015-12-04 12:43:26 -08:00
Linux Build Service Account 8d251d3cf2 Merge "ASoC: wcd9335: reset CPE TX PP buffer memory" 2015-12-04 12:43:24 -08:00
Junjie Wu d6e56a4f37 qcom: core_ctl_helper: Add wrapper for CPU hotplug
Different kernel version needs to use different kernel APIs for
hotplug. Add wrapper for CPU hotplug so that external module can be
used across different kernel releases.

Use cpu_up/cpu_down() API for CPU hotplug.

Change-Id: Ib36a875027f67b96e2d108de8b7d902978e50005
Signed-off-by: Junjie Wu <junjiew@codeaurora.org>
2015-12-04 11:39:08 -08:00
Weiyin Jiang 770f089006 ASoC: msm: qdsp6v2: extend wakelock hook to all misc drivers
Extend PM_AWAKE and PM_RELAX interfaces to all misc drivers as to allow
their clients in user space to hold ARM core during time out count down.

Change-Id: I754f6198201e47826857459ef0fd18a7c7834310
Signed-off-by: Weiyin Jiang <wjiang@codeaurora.org>
2015-12-04 07:38:03 -08:00
zhaoyuan 610106503f ARM: dts: msm: defer touch resume on msm8952 QRD and msm8976 QRD
Add support for deferring touch resume to a workqueue on
msm8952 QRD and msm8976 QRD.

Change-Id: I718f2a5efc13c906025ad17932a36612b6115f8c
Signed-off-by: Himanshu Aggarwal <haggarwa@codeaurora.org>
Signed-off-by: zhaoyuan <yzhao@codeaurora.org>
2015-12-04 10:30:40 +05:30
zhaoyuan 38fb912361 input: ft5x06: defer touch resume to workqueue
During device resume, the touch resume function is called after display's
resume. In this case, the ft5x06's resume function needs to wait for
200ms because of reset requirement. Defer the touch resume to a workqueue
to reduce the total device resume time. For this an optional DT property
is added to enable this on targets that need this feature.

Change-Id: Ib0677ca792aea83ece1caf8a0afff341302747fb
Signed-off-by: Himanshu Aggarwal <haggarwa@codeaurora.org>
Signed-off-by: zhaoyuan <yzhao@codeaurora.org>
2015-12-04 10:24:59 +05:30
Anirudh Ghayal 3b95baa5ec power: smbcharger: Re-run AICL irrespective of the AICL status
In the current implementation AICL is not re-run if its already
in progress. However in case where ICL gets updated while AICL
is in progress, the updated ICL value is not considered unless
AICL re-runs again. Handle this by re-running AICL irrespective of
the AICL status.

CRs-Fixed: 907473
Change-Id: I4a021e6ca148d0c218701cfb8a671d1e2dac6fee
Signed-off-by: Anirudh Ghayal <aghayal@codeaurora.org>
2015-12-03 04:16:14 -08:00
Ashay Jaiswal 7b016b58b5 ARM: dts: msm: enable AICL reruns for PMi8950 smbcharger
Enable AICL reruns for the PMi8950 smbcharger in order to allow it to
recover any current loss from glitchy AICL results.
Set the AICL rerun period to 180 seconds on PMI8950 to avoid waking
up all the time when charging.

CRs-Fixed: 920791
Change-Id: I24a734f3ed489ca50eb00aa9421816162c3fc9e5
Signed-off-by: Ashay Jaiswal <ashayj@codeaurora.org>
2015-12-03 04:15:23 -08:00
Xiaozhe Shi bbb7583442 power: qpnp-smbcharger: add module params for default ICL
Add module parameters to configure default ICLs for USB DCP and HVDCPs
in order to facilitate testing.

CRs-Fixed: 930588
Change-Id: I5fa1cdef010821211d3baa1797fdb72110d86a10
Signed-off-by: Xiaozhe Shi <xiaozhes@codeaurora.org>
2015-12-03 04:14:57 -08:00
Xiaozhe Shi 77f591822f power: qpnp-smbcharger: vote for FCC as BATT_TYPE
Use the BATT_TYPE voter for FCC instead of USER. This way the user can
set FCCs higher than the device tree limit.

Change-Id: Id386f8afd1bef2d1774730b214f1b97d64a6476b
Signed-off-by: Xiaozhe Shi <xiaozhes@codeaurora.org>
2015-12-03 04:14:41 -08:00
Xiaozhe Shi c8cb98c268 power: qpnp-smbcharger: support ICL adjustments through DP_DM
Support adjusting the usb ICL up and down through the DP_DM interface for
HVDCP 3.0.

CRs-Fixed: 930588
Change-Id: Ic24f946522d7ae0ec0a52f127118ac5a0d908277
Signed-off-by: Xiaozhe Shi <xiaozhes@codeaurora.org>
2015-12-03 04:14:22 -08:00
Xiaozhe Shi 442f488036 power: power_supply: add new enums for DP_DM
Add the ICL_DOWN and ICL_UP enums for POWER_SUPPLY_PROP_DP_DM in order
to allow hvdcpd to configure the relative input current limit.

CRs-Fixed: 930588
Change-Id: I80e37e241e145a81d6defe69fe5cbab1127cf933
Signed-off-by: Xiaozhe Shi <xiaozhes@codeaurora.org>
2015-12-03 04:14:00 -08:00
Xiaozhe Shi 6f21b4137a power: qpnp-smbcharger: draw more current from PMi in parallel chg
Current the smbcharger is splitting the ICL and charge current fairly
naively. This can cause problems where one charger is FCC limited and
another charger is ICL limited, causing a lot of wasted charge current.

Do a better current distribution to maximize the amount of charge
current going into the battery. By default, raise the ICL ratio of the
primary charger up to 60% to avoid issues with system load prematurely
causing the charger to current limit. Lower the FCC ratio back to 50% to
accommodate this.

Also, make both of these properties configurable through module
parameters and device tree in order to accommodate differences in pcb
and battery limitation.

CRs-Fixed: 930588
Change-Id: I77ec8483232e4297936baaad1e9bb4399474d444
Signed-off-by: Xiaozhe Shi <xiaozhes@codeaurora.org>
2015-12-03 04:13:37 -08:00
Xiaozhe Shi 8855a2d303 power: qpnp-smbcharger: optimize HVDCP 2.0 efficiency
At 9V, the smbcharger is more efficient at a switching frequency of
1MHz. Switch to this when the driver detects that it is in HVDCP 2.0
mode. Also, switch the VFIX clamping voltage threshold so that the
frequency is maintained.

CRs-Fixed: 910651
Change-Id: I4b8e1d360fe301671e882f20b2460cdb737204b0
Signed-off-by: Xiaozhe Shi <xiaozhes@codeaurora.org>
2015-12-03 04:12:57 -08:00
Xiaozhe Shi 76670c43fe power: qpnp-smbcharger: charge at 3A for HVDCP chargers
Allow the charger to pull 3A of charge current from HVDCP chargers,
since they are certified to handle that much current.

CRs-Fixed: 918587
Change-Id: I411da6ffe0756ed8c3f3b23d1ed13cd31dbb7fa1
Signed-off-by: Xiaozhe Shi <xiaozhes@codeaurora.org>
2015-12-03 04:12:29 -08:00
Devesh Jhunjhunwala f02f1565b9 power: qpnp-smbcharger: fix bug in find_closest_in_array
This method uses a variable to track the current closest value's
index. The implementation was checking the distance between the
value and this index instead of the value at that index. Fix
this bug.

CRs-Fixed: 923805
Change-Id: Iac3cc125c4c5fabbe027ec38890d5c47e199187e
Signed-off-by: Devesh Jhunjhunwala <deveshj@codeaurora.org>
2015-12-03 04:12:05 -08:00
Xiaozhe Shi a1206eb583 power: qpnp-smbcharger: ignore battery ov
The smbcharger's battery overvoltage detection cannot be trusted.
Many times, it will trip even though the battery voltage is still well
within safe limits. Because of this, simply ignore the interrupt if it
fires.

CRs-Fixed: 924317
Change-Id: I57decb3a11f6b7bacbe82b0fe69c844f308e890d
Signed-off-by: Xiaozhe Shi <xiaozhes@codeaurora.org>
2015-12-03 04:11:41 -08:00
Nicholas Troast d2d51db4a3 power: pmic-voter: handle scenarios where voter state is invalid
After the voter is initialized and before the first valid vote
is made, the voter state is invalid. Introduce some changes to
accommodate this state:

1. Initialize effective_result and all client states to -EINVAL.
2. If the current vote does not change effective_result, or if
   there are no valid votes in the array, skip the callback and
   maintain the current effective result.
3. Allow the user to provide a default_value, which is returned
   in the scenario where the effective_result is queried before
   making a valid vote.

CRs-Fixed: 927044
Change-Id: Ic00064d95e5a9234bcf44a415ad2bbff6e84a2f3
Signed-off-by: Nicholas Troast <ntroast@codeaurora.org>
2015-12-03 04:11:14 -08:00
Xiaozhe Shi 0d08b01bc8 power: qpnp-smbcharger: register aicl_done for rising edge only
The AICL done interrupt rises when an valid AICL measurement or collapse
occurs, and falls when a new AICL measurement starts. The software is
only interested in when a valid AICL measurement becomes available.
Disable the falling edge case for this interrupt since it just becomes
more noise for the driver.

CRs-Fixed: 920791
Change-Id: Idf8471dfe4bba731480a09e43af8d791a71a122e
Signed-off-by: Xiaozhe Shi <xiaozhes@codeaurora.org>
2015-12-03 04:10:57 -08:00
Xiaozhe Shi 0b006c7b0e power: qpnp-smbcharger: read realtime status for battery ov
Some times the battery ov status appears to not change even though the
status changes. This could be attributed to a fast battery ov pulse not
triggering the down interrupt.

Read the batt-ov status instead for reporting to the userspace.

Change-Id: I5bdb8cc6564ad37dde0e5901f0543a1c1b7b8761
Signed-off-by: Xiaozhe Shi <xiaozhes@codeaurora.org>
2015-12-03 04:10:43 -08:00
Xiaozhe Shi 07d385bc55 power: qpnp-smbcharger: allow configuration of aicl rerun period
Add the dtsi property qcom,aicl-rerun-period-s in order to allow for the
configuration of how often AICL is reran in hardware.

CRs-Fixed: 920791
Change-Id: Id262f26b409d75f7c82ee79b25c4258baed43840
Signed-off-by: Xiaozhe Shi <xiaozhes@codeaurora.org>
2015-12-03 04:10:27 -08:00
Xiaozhe Shi c713db87db power: qpnp-smbcharger: allow icl to recover during parallel charging
Currently, if the charger gets a lower AICL setting due to a temporary
glitch or dip in the amount of current provided by the charging source,
the parallel charger can never recover the original AICL setting. This
is because the primary charger caps the input current limit to half of
the original AICL result for both the parallel charger and the primary
charger. Subsequent runs of AICL during parallel charging can never
exceed the original ICL setpoint because AICL can never be higher than
the configured ICL.

Fix this by setting the primary charger to (targeted ICL - parallel ICL).
This way, if the AICL is reran, either through the hardware feature or
through software, any extra available current can be recovered by the
algorithm to be rebalanced again.

This change can cause the AICL to collapse multiple times after enabling
parallel charging, so also change the algorithm to make sure the AICL is
settled before changing parallel charging. More specifically, when the
algorithm needs to change parallel charging settings, it will take two
AICL samples with 500ms between each sample. It will wait until
these two samples match before making any changes.

Furthermore, since the AICL is now more stable, we can remove the 100mA
decrements to the parallel charging current, and allow it to go to the
requested amount immediately.

Finally, remove the AICL rerun at the end of smbchg_parallel_usb_enable()
since AICL results can no longer be higher than the input current limit
anyways.

CRs-Fixed: 920791
Change-Id: I93e9f926b6f5ed520e4d6c2495087df25debf29d
Signed-off-by: Xiaozhe Shi <xiaozhes@codeaurora.org>
2015-12-03 04:10:06 -08:00
Xiaozhe Shi f888a9ceab power: qpnp-smbcharger: turn off AICL ADC measurements
The hardware AICL algorithm can use an internal ADC in order to jump to
the optimal AICL setpoint faster by doing a conversion when the collapse
happens and guessing the correct current limit from the data.

However, these ADC measurements can cause glitches in the AICL feature,
sometimes forcing the results to be 1-2 setpoints off from optimal.

Turn this feature off, and allow thet AICL algorithm to scan every
possible setpoint for a more accurate result.

CRs-Fixed: 920791
Change-Id: Ief47e8455bf89e8bd7703ec30e0fe3770b7895d6
Signed-off-by: Xiaozhe Shi <xiaozhes@codeaurora.org>
2015-12-03 04:09:44 -08:00
Nicholas Troast a299e00b4d power: qpnp-smbcharger: retract HVDCP ICL vote on pulsing failure
If an error occurs while preparing for pulsing then HVDCP's vote
for ICL does not get retracted, and ICL is stuck at 300mA.
Fix it.

Change-Id: Icd22105bf6a51920481c6668f985c8ff40a72957
Signed-off-by: Nicholas Troast <ntroast@codeaurora.org>
2015-12-03 04:09:28 -08:00
Xiaozhe Shi 5356d17559 power: qpnp-smbcharger: fix parallel charging with HVDCP
Booting with an HVDCP will make the very first attempt at doing parallel
charging always fail due to the HVDCP 3.0 APSD rerun algorithm. This is
due to the parallel charging last_disabled timer in the driver
preventing reenabling of parallel charging 30 seconds after it has been
disabled. Historically this had been a problem with bad AICL values
after immediately rerunning AICL when parallel charging was disabled.

However, with the rearchitected parallel charging algorithm, this is no
longer a big issue. Lower the last_disabled time threshold from 30
seconds to 1 second in order to catch more cases where parallel charging
can be enabled.

Additionally, reset the enabled once flag for parallel charging after
HVDCP pulsing is done and normal charging is reenabled, so that parallel
charging can be immediately reenabled afterwards.

Change-Id: I002e7dbbba0cbefd4fe399759a9a504ba803f539
Signed-off-by: Xiaozhe Shi <xiaozhes@codeaurora.org>
Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
2015-12-03 04:09:10 -08:00
Xiaozhe Shi d676bd2f1d power: qpnp-smbcharger: do not disable parallel charging during hotswap
Currently the parallel charging algorithm stops if the battery charging
stops. However, this can create issues with hotswap. When turning on and
off the parallel charger without a battery, any delay in raising the
input current of the primary charger with the secondary charger turned
off could cause the device to UVLO.

To fix this, try to not disable the parallel charger when it's active
and there is no battery present. Also, allow the input current to rise
during a hotswap so that if parallel charging does need to be disabled
for a different reason, the main charger can still recover all of its
ICL.

Change-Id: I97e19c792337436389d0c9b4931162a44ac62a15
Signed-off-by: Xiaozhe Shi <xiaozhes@codeaurora.org>
2015-12-03 04:08:53 -08:00
Xiaozhe Shi bf602f877c power: pmic-voter: add debug logs for votes
Add a name for each pmic votable registered, and add some debug logs
when votes are cast and when the final value is changed.

Change-Id: I0cce9c6140162d8409af4060ebc6247b18ddfa3a
Signed-off-by: Xiaozhe Shi <xiaozhes@codeaurora.org>
Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
2015-12-03 04:08:33 -08:00
Nicholas Troast bf624124df power: qpnp-smbcharger: avoid suspending charging after max AICL irqs
Currently after we receive 25 AICL interrupts within 60 seconds
we declare the charger to be very weak and disable AICL rerun.
If an AICL event happens again, it will suspend charging until
the charger is removed. AICL lowers the input current to a
minimum of 300mA and it suspends charging if the voltage doesn't
recover.

However, there could be chargers that work fine at 100mA, but we
end up suspending such chargers too.

Change the code to vote for 100mA current limit after declaring a
very weak charger. AICL gets disabled for any input settings
below 300mA. If the charger still collapses, we will get a UV
interrupt and there we will declare the charger as weak and
suspend charging.

CRs-Fixed: 869191
Change-Id: Ic3809fdc11d88538c0dcca43a20a23632c1a2d78
Signed-off-by: Nicholas Troast <ntroast@codeaurora.org>
2015-12-03 04:08:13 -08:00
Devesh Jhunjhunwala 435a312d2f power: qpnp-smbcharger: Use new voting scheme for charging enable/suspend
Update the charger driver to use the new voting scheme implemented
to vote for dc_suspend, usb_suspend and charging_enable.

Change-Id: Ib5ac575ba640d563f4a757b52e12715924562e67
Signed-off-by: Devesh Jhunjhunwala <deveshj@codeaurora.org>
2015-12-03 04:07:45 -08:00
Devesh Jhunjhunwala 8864d13169 power: qpnp-smbcharger: Add support for restricted_charging
Add functionality to support the restricted_charging battery
property.

Change-Id: If897c6e9a31c933f1b96b675683d62119e7c2d06
Signed-off-by: Devesh Jhunjhunwala <deveshj@codeaurora.org>
2015-12-03 04:07:30 -08:00
Devesh Jhunjhunwala ef362efcad power_supply: Introduce property for restricted charging
Create a new property called restriced_charging that, when
asserted, halves the current output to the battery.

Change-Id: I1a877f34f3a0d7ba3966aa85c10b35ad17ed1452
Signed-off-by: Devesh Jhunjhunwala <deveshj@codeaurora.org>
2015-12-03 04:07:15 -08:00
Nicholas Troast 56ced396bb power: qpnp-smbcharger: introduce ICL voting
Currently input current limit (ICL) is tracked and updated in
various locations throughout the driver.

Use the pmic-voter to centralize the ICL for better consistency
and maintainability.

Change-Id: Ic7dfd223c22093fcc2f6c16acff92202f13abf15
Signed-off-by: Nicholas Troast <ntroast@codeaurora.org>
2015-12-03 04:06:57 -08:00