Commit graph

581726 commits

Author SHA1 Message Date
Ashay Jaiswal
8bb83bb77e qcom: battery: fix parallel psy name
Parallel charger registers to power supply framework with name
"parallel" instead of "usb-parallel" thus update all references
of "usb-parallel" with "parallel".
While at it, remove extra NULL pointer check of pl_psy in
parallel enable path.

CRs-Fixed: 2001651
Change-Id: I4150808f7122cef970296553fb70671df12aced9
Signed-off-by: Ashay Jaiswal <ashayj@codeaurora.org>
2017-02-03 11:32:34 +05:30
Abhijeet Dharmapurikar
f0cf35f592 power: qcom-charger: separate parallel code
Currently the parallel charging code is tightly coupled in the main charger
files.  Update the design to separate parallel charging code. This
parallel charging code will implement few votables and interacts with
the main and parallel charger.

A brief discussion on important changes

Usb main psy
The new design introduces a charger type called USB-Main which exposes all
the properties required to implement parallel charging for the main
charger. These properties are implemented/supported

- CONSTANT_CHARGE_CURRENT_MAX, sets and gets the FCC of the main charger
- ICL_REDUCTION, indicates by how much the main charger should reduce
  its ICL. The parallel charger would draw some portion of the ICL and
  this implementation ensures that the main charger reduce its ICL in
  order to not exceed the adapter limits.
- VOLTAGE_MAX, sets the float voltage of the battery, we continue to
    raise float voltage for the parallel charger so that it operates as
    current source.
- INPUT_CURRENT_SETTLED: indicates the AICL results.
- FCC_DELTA: indicates the value by which the main is correcting the
    FCC. The main reduces FCC by few mA when in Jeita or Step
    charging. This helps in determining the exact FCC which in turn
    helps distribute it correctly.

Slave percent
The new file implements the sysfs entry for slave percent. When
thermal balancer updates it, it ends up calling fcc distribution
and also the icl distribution. Note that the icl distribution too
is dependent on the slave's fcc percent - in that it gives 10
percent point more to the main charger.

ICL
ICL needs to be distributed only in USBIN_USBIN configuration.
As noted above the ICL distribution is based on fcc distribution
aka slave_percent. The main charger is given 10% more ICL since it
caters to system load in addition to charging the battery. This is
similar to our traditional USBIN USBIN implementation where FCC was
distributed 50/50 while ICL was distributed 60/40 percent - the main
got 10% more of the ICL value.
Note that the ICL distribution is invoked when AICL settled current
changes, not when the ICL itself changes. The new code tracks the
aicl settled value and invokes the icl distribution when it changes.
It first requests the main charger to reduce its icl and then updates
the parallel's icl.

FCC Votable
The FCC votable is moved to the new file and is similar to its previous
implementation - It distributes FCC when ever the FCC value changes, the
slave_pct changes or parallel charger is enabled or disabled. If the main
charger is further modifying the FCC from what its registers were
configured, this FCC callback takes that in to account via the
FCC_DELTA property prior to distribution.

FV Votable
Like the FCC votable the FV votable is moved to the new file.
The code is similar as it was implemented in the main file where
it distributes FV when ever the FV value changes.

TAPER entry
The code that stepwise reduces slave's ICL as it enters taper mode
is moved to this file. So that it can correctly do this, the
charge type is tracked in its internal structure.

PL_DISABLE Votable
The PL_DISABLE too is moved to a new file. There are few implementation
changes here.
- Earlier the code used to run the same sequence while enabling and
  disabling. This could create a situation where FCC/ICL is incorrectly
  configured for a brief period. That has been corrected, in that
  the enable configures in this order configures fv, distributes fcc,
  enables parallel, distributes aicl. The disable does that in reverse
  order of enable.
- Charger's presence would vote on enabling/disabling parallel charger.
  This is no more required. Instead a vote from CHG_STATE_VOTER suffices
  for when fast charging begins. The voters that enable/disable parallel
  when typec is present or is in sink mode or when uUSB cable is
  inserted are removed.

CHG_STATE_VOTER and TAPER_END_VOTER
A typical charge cycle enters fast charging, moves to taper charging and
finally goes to end of charging. Parallel charging needs to be
enabled while fast charging starts and needs to be kept enabled during
the portion of taper charging when parallel's FCC is above 500mA threshold.
Note that if charging starts from taper, we only want to run it so long
as the parallel's FCC stays higher than 500mA threshold.

CHG_STATE_VOTER votes to enable parallel charging when fast charging
or parallel charging is in progress. When charging stops (i.e. when its not
in fast or taper charging) CHG_STATE_VOTER votes to disable parallel
charging.

Also the TAPER_END_VOTER votes to disable parallel charging when
parallel's FCC share falls below 500mA. It continues to vote disable on
parallel charging until charging stops. At that point it votes to
enable parallel charging.

Between these two voters, parallel charger
- enables when fast charging starts and remains enabled as it
 transitions to taper charge.
- is disabled once parallel's FCC falls below 500mA threshold and
remains disabled in taper charge until charging stops.

This makes it important that the battery psy provide correct psy
changes when it enters/exit FAST or TAPER type. The PMI chip and its
battery_psy implementation already guarantees that.

PL_TAPER_EARLY_BAD_VOTER
During some runs we see that parallel operates in taper mode. Given that
we sets its FV higher than main's FV, the parallel should never operate
in taper mode. This voter disables parallel charging if this happens.
This voter enables parallel charging when the main charger stops
charging.

Change-Id: If1676cd126d7eeace7c44cf8d819038d03433d7e
Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
2017-01-31 22:23:39 -08:00
Abhijeet Dharmapurikar
684caa6de4 qcom: qpnp-fg-gen3: handle late creation of battery psy
Currently if battery psy is not seen while the profile is loaded during
initialization, it doesn't configure the float voltage and the fast charge
current value when battery psy comes in later.

Fix this by setting those parameters whenever batt_psy is seen for the
first time.

While at it change the name of this function from is_charger_available to
batt_psy_initialized to be in line with the added steps.

Change-Id: I31eb364e5fe33cc4b45aba4027150e4c21e74451
Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
2017-01-30 15:41:50 -08:00
Abhijeet Dharmapurikar
c2ccc0e909 power_supply: Add type and properties for parallel charger
USB Main charger type represents the main charging path. This will
be used to control charging parameters on the main charger.

FCC_DELTA property will be used to indicate whether hw implements
any FCC mitigation. This will be used to calculate the effective FCC
and set the FCC on the PMI.

PARALLEL_MODE property indicates whether the parallel charger chip is
configured in a mid-mid or usbin-usbin configuration.

ICL_REDUCTION property indicates by how much should the main charger
reduce its input current.

Change-Id: I3b064314e6b5c28a7ea9f79ac52f3a26749605fb
Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
2017-01-30 15:41:49 -08:00
Linux Build Service Account
ea4719da1f Merge "ath10k: Add htt tx/rx layer changes for WCN3990 target." 2017-01-30 07:05:36 -08:00
Linux Build Service Account
f9500f4705 Merge "msm: kgsl: Fix incomplete IB2 dump in the snapshot" 2017-01-30 07:05:35 -08:00
Linux Build Service Account
9b80f2b723 Merge "ARM: dts: msm: add truly 1080p panel support for sdm660" 2017-01-30 07:05:34 -08:00
Linux Build Service Account
e3e2337e47 Merge "ARM: dts: msm: Add qrng device node for SDM630" 2017-01-30 07:05:32 -08:00
Linux Build Service Account
ba93fbf5f0 Merge "ufs: add additional sync between ice work queue and pending request" 2017-01-30 07:05:31 -08:00
Linux Build Service Account
d9f73b621e Merge "msm: kgsl: Check GPMU presence before accessing power counters" 2017-01-30 07:05:30 -08:00
Linux Build Service Account
7b317a25ea Merge "wil6210: fix QCA_WLAN_VENDOR_ATTR_FREQ attribute ID" 2017-01-30 07:05:29 -08:00
Linux Build Service Account
e1d0109fdc Merge "adreno_tz: Correct tz_buf pointer type to correct pointer arithmetic" 2017-01-30 07:05:28 -08:00
Linux Build Service Account
520c2d8947 Merge "ARM: dts: msm: change ref threhold to 184K in sdm660" 2017-01-30 07:05:27 -08:00
Linux Build Service Account
f3b8923a2c Merge "ARM: dts: msm: Disable WSA for internal codec SDM660" 2017-01-30 07:05:26 -08:00
Linux Build Service Account
e1e1ad0592 Merge "ath10k: Add host/target CE config and services for WCN3990" 2017-01-30 07:05:24 -08:00
Linux Build Service Account
79e80bf58b Merge "ASoC: msm: Update WCD934X RX and TX Slim channels" 2017-01-30 07:05:24 -08:00
Linux Build Service Account
3ed889b39e Merge "sched: set LBF_IGNORE_PREFERRED_CLUSTER_TASKS correctly" 2017-01-30 07:05:23 -08:00
Linux Build Service Account
564fc4f080 Merge "scsi: ufs: validate input args to queuecommand" 2017-01-30 07:05:22 -08:00
Linux Build Service Account
31a533f0a9 Merge "ARM: dts: msm: Add BCL mitigation configuration for sdm630" 2017-01-30 07:05:21 -08:00
Linux Build Service Account
e0c4785094 Merge "scsi: ufs: check for err state when polling for doorbell" 2017-01-30 07:05:19 -08:00
Linux Build Service Account
165381533f Merge "qpnp-smb2: fix incorrect type detection" 2017-01-30 07:05:18 -08:00
Linux Build Service Account
e90fdbd26f Merge "ARM: dts: msm: Remove SPSS notification for msm8998" 2017-01-30 07:05:13 -08:00
Linux Build Service Account
a3ab00251b Merge "smb-lib: fix unknown APSD result after CC2 workaround" 2017-01-30 07:05:12 -08:00
Linux Build Service Account
f1c56b5374 Merge "msm: mdss: Disable traffic shaper for pipe in command mode" 2017-01-30 07:05:11 -08:00
Linux Build Service Account
51026923d0 Merge "msm: mdss: Fix handling of Doze mode" 2017-01-30 07:05:10 -08:00
Linux Build Service Account
675a5c8af0 Merge "msm: mdss: Add partial update support for dest-scaler" 2017-01-30 07:05:09 -08:00
Linux Build Service Account
b503a4f71e Merge "ARM: dts: msm: Enable APSS-RPM communication for sdm630" 2017-01-30 07:05:08 -08:00
Linux Build Service Account
0f01552919 Merge "memshare: Fix parameters to collect ramdump" 2017-01-30 07:05:07 -08:00
Linux Build Service Account
3f2738720d Merge "cfg80211: Define macro for report better BSS in sched scan" 2017-01-30 07:05:05 -08:00
Linux Build Service Account
50ed1269ef Merge "ARM: dts: msm: Add sdhc1 and sdhc2 for sdm630" 2017-01-30 07:05:04 -08:00
Linux Build Service Account
5779a3e0b9 Merge "ath10k: Add copy engine descriptor for WCN3990 target" 2017-01-30 07:05:03 -08:00
Linux Build Service Account
8a09e46bdb Merge "clk: msm: clock-gcc-8998: Add 60MHz rate for usb3 master clk src" 2017-01-30 07:05:02 -08:00
Linux Build Service Account
0aa66bf039 Merge "icnss: Use right variable in sizeof for allocation" 2017-01-30 07:05:01 -08:00
Linux Build Service Account
f28e77a781 Merge "ARM: dts: msm: Add usb master clock rate in high speed mode for msm8998" 2017-01-30 07:05:00 -08:00
Linux Build Service Account
2026ad674d Merge "usb: dwc3: Reset and initiate lpm while booting up with no usb cable" 2017-01-30 07:04:59 -08:00
Linux Build Service Account
5c307ffbc7 Merge "usb: gadget: f_mass_storage: Add delay before continuing status stage" 2017-01-30 07:04:58 -08:00
Linux Build Service Account
91db9ff3ff Merge "smb138x-charger: enable stacked diode" 2017-01-30 07:04:57 -08:00
Linux Build Service Account
94de58ac69 Merge "ARM: dts: msm: Change pinctrl config for BLSP2 UART1 for sdm660" 2017-01-30 07:04:57 -08:00
Linux Build Service Account
49d5335592 Merge "regulator: cpr4: Support MMSS closed-loop voltage adjustments" 2017-01-30 07:04:56 -08:00
Linux Build Service Account
510fc66816 Merge "regulator: qpnp-labibb: make IBB discharge resistor configuration optional" 2017-01-30 07:04:55 -08:00
Linux Build Service Account
fa18a83d0a Merge "ath10k: Modify htt rx descriptor for WCN3990 target" 2017-01-30 07:04:54 -08:00
Linux Build Service Account
b248e5eaea Merge "Revert "mac80211: Add support for beacon report radio measurement"" 2017-01-30 07:04:53 -08:00
Linux Build Service Account
fbf5f7c2db Merge "arm64: kernel: Save and restore UAO and addr_limit on exception entry" 2017-01-30 07:04:52 -08:00
Linux Build Service Account
f6e3e8bba4 Merge "sysctl: enable strict writes" 2017-01-30 07:04:51 -08:00
Linux Build Service Account
6a190c73c6 Merge "mm: prevent double decrease of nr_reserved_highatomic" 2017-01-30 07:04:50 -08:00
Linux Build Service Account
2a5e60ec70 Merge "ath10k: Add wmi service ready event for HL1.0 fw" 2017-01-30 07:04:49 -08:00
Linux Build Service Account
24ceb13fee Merge "ath10k: Refactor wmi init cmd for WCN3990" 2017-01-30 07:04:48 -08:00
Linux Build Service Account
6c6796dc24 Merge "ath10k: update the Rx ring fill level for wcn3990 target" 2017-01-30 07:04:47 -08:00
Govind Singh
1f5c3fe9cd ath10k: Add htt tx/rx layer changes for WCN3990 target.
WCN3990 target uses 37bit addressing mode, modify htt tx, rx,
frag descriptor and htt ring configuration.

CRs-Fixed: 1117337
Change-Id: Ie1be7b8442e62d46a66c507eaa4662244edec16c
Signed-off-by: Govind Singh <govinds@codeaurora.org>
2017-01-30 17:13:20 +05:30
Hareesh Gundu
c557d3b6b0 msm: kgsl: Fix incomplete IB2 dump in the snapshot
If there is IB2 address overlap with IB object list,
driver is dumping pending dwords size of active IB2
data into snapshot. Fix this by updating IB2 size
while active IB1 parsing instead later point.

Change-Id: Ibb12a876ebf73846424232ef28e00d3dc9f9be59
Signed-off-by: Hareesh Gundu <hareeshg@codeaurora.org>
2017-01-30 03:29:07 -08:00