summaryrefslogtreecommitdiff
path: root/drivers/power (follow)
Commit message (Collapse)AuthorAge
...
| * | | | | | | qpnp-fg-gen3: fix a possible wake source count leakSubbaraman Narayanamurthy2016-12-12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, in the power supply notifier callback, GEN3 FG driver calls pm_stay_awake() which increases the wake source count on its device before it schedules status_change_work. In case, if status_change_work is already pending, then pm_stay_awake() will not have a balanced pm_relax() call as the work will not get scheduled again if it's pending already. Fix this by scheduling status_change_work and hence call pm_stay_awake() only if it is not pending. Change-Id: I2b8e28f6bfe1a5813410c7b1276d4e229eb67e84 Signed-off-by: Subbaraman Narayanamurthy <subbaram@codeaurora.org>
| * | | | | | | qpnp-fg-gen3: add support to configure RconnSubbaraman Narayanamurthy2016-12-12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add support to configure battery connector resistance (Rconn) so that battery resistance can take into account of that along with ESR and Rslow. Change-Id: Ib330c4f9b6d55c75aeb8e8fd5cea4dd92b0f64cf Signed-off-by: Subbaraman Narayanamurthy <subbaram@codeaurora.org>
* | | | | | | | Merge "qpnp-fg-gen3: Read debug battery id thresholds from RR_ADC registers"Linux Build Service Account2016-12-19
|\| | | | | | | | |_|/ / / / / |/| | | | | |
| * | | | | | qpnp-fg-gen3: Read debug battery id thresholds from RR_ADC registersSubbaraman Narayanamurthy2016-12-12
| | |/ / / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, GEN3 FG driver uses a debug battery id threshold of 7 KOhms. However, depending on the battery id chosen by the user this threshold can be modified in the bootloader. Hence, add support to read the debug battery id thresholds directly from RR_ADC peripheral registers. This can be used to decide whether a fake battery SOC (67) can be displayed to the user. Change-Id: I22ab702e10c310e4f847c6c81a48a8f0f3188429 Signed-off-by: Subbaraman Narayanamurthy <subbaram@codeaurora.org>
* | | | | | Merge "qpnp-fg-gen3: Use the correct property name to get fastcharge current"Linux Build Service Account2016-12-13
|\ \ \ \ \ \
| * | | | | | qpnp-fg-gen3: Use the correct property name to get fastcharge currentSubbaraman Narayanamurthy2016-12-09
| | |_|_|_|/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently GEN3 FG driver reads "qcom,nom-batt-capacity-mah" property from the battery profile device node to use that for notifying fastcharge current to the charger driver. Change that to use "qcom,fastchg-current-ma" property which seems to be more appropriate. Update all the battery profiles that are used with GEN3 FG to follow that. Change-Id: I119e6af297b37a06a227475f712f938367fb65bc Signed-off-by: Subbaraman Narayanamurthy <subbaram@codeaurora.org>
* | | | | | Merge "smb-lib: revert the boost back workaround for dc path"Linux Build Service Account2016-12-13
|\ \ \ \ \ \ | |_|/ / / / |/| | | | |
| * | | | | smb-lib: revert the boost back workaround for dc pathAbhijeet Dharmapurikar2016-12-06
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It is expected to get 3 switcher-power-ok interrupts in a span of 1 second for Wipower. This causes the boost back workaround to suspend dc path. The boost back problem was never seen on Wipower. Revert the boost back workaround for Wipower until a proper fix is in place. Change-Id: I81b4a3184a709a5328b04c389b0e5277d65a675d Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
* | | | | | Merge "power: bcl: Add frequency mitigation as an optional property for BCL"Linux Build Service Account2016-12-10
|\ \ \ \ \ \
| * | | | | | power: bcl: Add frequency mitigation as an optional property for BCLManaf Meethalavalappu Pallikunhi2016-12-09
| | |/ / / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For targets with LMH DCVSh hardware and OSM, BCL software frequency mitigation is not required. Since hardware is doing the frequency mitigation, there is no need for the HLOS BCL frequency mitigation. So make the properties "qcom,mitigation-freq-khz" and "qcom,thermal-handle" as optional properties. Change-Id: I0062f3b39f00ff2f0e74affcffbcf1afd89d3b2f Signed-off-by: Manaf Meethalavalappu Pallikunhi <manafm@codeaurora.org>
* | | | | | Merge "power_supply: Add BOOST_CURRENT property"Linux Build Service Account2016-12-09
|\ \ \ \ \ \
| * | | | | | power_supply: Add BOOST_CURRENT propertyHarry Yang2016-12-07
| |/ / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This property will be used to indicate to the boost current after the boost is turned on. CRs-Fixed: 1095917 Change-Id: Ie667fa49c4a8e8c008e8866f655e3bbe3e69e156 Signed-off-by: Harry Yang <harryy@codeaurora.org>
* | | | | | Merge "qpnp-fg-gen3: Add support for PMFALCON in Fuel Gauge"Linux Build Service Account2016-12-09
|\ \ \ \ \ \
| * | | | | | qpnp-fg-gen3: Add support for PMFALCON in Fuel GaugeAshay Jaiswal2016-12-08
| |/ / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add support of PMFALCON PMIC in FG driver. PMFALCON FG core uses same SRAM map as PMI8998v2.0. While at it, add workaround flag variable to keep track of all hardware specific workarounds. CRs-Fixed: 1096793 Change-Id: I8ba73276fd30f6eaf935ed77b75601f1322c0ba6 Signed-off-by: Ashay Jaiswal <ashayj@codeaurora.org>
* / / / / / msm-core: use get_user() API to read userspace data/settingsMohammed Khajapasha2016-12-06
|/ / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently userspace data is getting accessed directly and leading to crash, So use get_user() API to copy userspace data/settings to kernel space. Change-Id: I3a75ec9503d8207829640bf88e1c3160bf72c9f0 Signed-off-by: Mohammed Khajapasha <mkhaja@codeaurora.org>
* | / / / qcom-charger: smb2: add support of PMFALCONAshay Jaiswal2016-12-02
| |/ / / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | Add support of PMFALCON PMIC and enable PMIC specific workarounds in charger driver. Change-Id: Id21fde25b9b741b9cb570ab5348959715e53e6cb Signed-off-by: Ashay Jaiswal <ashayj@codeaurora.org>
* | | | Merge "qpnp-fg-gen3: Add support to configure auto recharge voltage"Linux Build Service Account2016-11-29
|\ \ \ \
| * | | | qpnp-fg-gen3: Add support to configure auto recharge voltageSubbaraman Narayanamurthy2016-11-28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Auto recharge happens when the charging is complete and the battery SOC or voltage had dropped below certain threshold. Along with having an option to configure recharge SOC threshold, a way to configure recharge voltage threshold is required. Add it. By default, charger is configured to resume charging only based on the signal from FG based on battery voltage. Change-Id: I0cd6ca6679c19bbdf4ad980a22d9976396028316 Signed-off-by: Subbaraman Narayanamurthy <subbaram@codeaurora.org>
* | | | | Merge "smb-lib: fix vbus-error handler"Linux Build Service Account2016-11-28
|\ \ \ \ \ | |/ / / / |/| | | |
| * | | | smb-lib: fix vbus-error handlerNicholas Troast2016-11-21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Reading TYPE_C_STATUS_5_REG overwrites what was read from TYPE_C_STATUS_4_REG therefore, the incorrect register is masked when determining whether a vbus-error had occurred. Re-arrange the USB Type-C changed handler so that function calls which could fail are called first and store the status separately. Change-Id: I302e06498b2696d6af06c0360c12f82711b0911d Signed-off-by: Nicholas Troast <ntroast@codeaurora.org>
| * | | | qpnp-smb2: stay in Attached.SRC state when OC is detected on VCONNNicholas Troast2016-11-21
| |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently when OC is detected on VCONN the hardware will disable OTG and exit Attached.SRC state and go back to DRP toggling. If the OC persists then the hardware will enter an infinite cycle of trying to enable OTG. Fix this by changing the behavior such that the hardware remains in Attached.SRC state when OC is detected on VCONN. In this case VBUS will remain on and the OTG device may continue to work in a limited capacity without VCONN. Change-Id: If371ec24040ea6d45d64dec6fa32b7f9f2276dfa Signed-off-by: Nicholas Troast <ntroast@codeaurora.org>
* | | | Merge "smb-lib: fix null ptr access while handling src change interrupt"Linux Build Service Account2016-11-25
|\ \ \ \
| * | | | smb-lib: fix null ptr access while handling src change interruptAbhijeet Dharmapurikar2016-11-01
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The apsd done handling could end up accessing a null ptr returned from smblib_update_usb_type(). Fix it so that smblib_update_usb_type() never returns a null pointer. Change-Id: I53cd6ed709263669edbc34f096a21cddffcf4489 Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
* | | | | Merge "qpnp-smb2: force UFP mode before shutdown"Linux Build Service Account2016-11-25
|\ \ \ \ \
| * | | | | qpnp-smb2: force UFP mode before shutdownNicholas Troast2016-11-21
| | |/ / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If a legacy Type-A to Type-C cable is attached to the phone, but the Type-A end is left disconnected, then the VBUS capacitor will be charged when DRP toggles to DFP mode. Since VBUS is charged it will prevent the device from staying in power off state when shutdown. Fix this by forcing UFP mode before shutdown so the VBUS capacitor will be discharged, and therefore it will not trigger PON to restart the device. Change-Id: I53f89cf6b7c11f32c5e8e5a51a5986fa31424b92 Signed-off-by: Nicholas Troast <ntroast@codeaurora.org>
* | | | | Merge "qpnp-smb2: add support to configure auto recharge"Linux Build Service Account2016-11-25
|\ \ \ \ \
| * | | | | qpnp-smb2: add support to configure auto rechargeSubbaraman Narayanamurthy2016-11-21
| |/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, smb2 charger uses VBT_LT_CHG_RECHARGE_THRESH signal from FG to enable auto recharge by default. Add support to configure smb2 charger to use SOC_LT_CHG_RECHARGE_THRESH signal from FG if needed. This will enable charging to resume again when battery SOC drops below the automatic recharge SOC threshold (configured in FG) while charger is inserted and SOC goes down after the charge termination had happened. Change-Id: Ic68cd12cc861d04e107b70e2b96200483f13da26 Signed-off-by: Subbaraman Narayanamurthy <subbaram@codeaurora.org>
* / / / / msm: 8998: Replace cobalt with 8998Runmin Wang2016-11-22
|/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Update the code name from msmcobalt to msm8998. As a result, update the filename containing "cobalt" and files content containing "cobalt". CRs-Fixed: 1070840 Change-Id: I2c7b95e3e2a2fec7730724da9eeb86a39a77faf1 Signed-off-by: Runmin Wang <runminw@codeaurora.org> Signed-off-by: Kyle Yan <kyan@codeaurora.org> Signed-off-by: Jeevan Shriram <jshriram@codeaurora.org>
* | | | Merge "qcom-charger: smb2: Disable try.SINK mode in the probe"Linux Build Service Account2016-11-18
|\ \ \ \
| * | | | qcom-charger: smb2: Disable try.SINK mode in the probeHarry Yang2016-11-17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently we disable try.SINK right before pd becomes active and re-enable it right after inactive. This breaks typec compliance. To fix it, disable try.SINK mode in the probe and never enable it. Change-Id: I61523188f45daca026b90943c845b43a8327f51e Signed-off-by: Harry Yang <harryy@codeaurora.org>
| * | | | qcom-charger: Change usb_icl votable for PD voteHarry Yang2016-11-17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently there is an issue introduced by forcing the results of the icl_votable while pd is active. icl_votable is a min voter and since the DEFAULT_VOTER votes 1.5Amps that becomes the max one could draw when pd is active. This is incorrect and hence the issue. Note that DEFAULT_VOTER is only needed while DCP is present. So, to fix it, rename DEFAULT_VOTER to DCP_VOTER and make DCP_VOTER unvote and vote when pd_active is set and unset respectively. CRs-Fixed: 1091477 Change-Id: I7435f05f20e12a7704ae5d9597b5cdc9b5a61d00 Signed-off-by: Harry Yang <harryy@codeaurora.org>
* | | | | Merge "qcom-charger: WA for legacy bit set on hard reboot"Linux Build Service Account2016-11-18
|\ \ \ \ \ | |/ / / / |/| | | |
| * | | | qcom-charger: WA for legacy bit set on hard rebootHarry Yang2016-11-09
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | After cold reboot with typec attached, HW can not tell typec from legacy cable. The workaround is to reset and re-initiate legacy cable detection. CRs-Fixed: 1079373 Change-Id: Ifd7b2b88e7ab4c952b743fede6e24795069d653a Signed-off-by: Harry Yang <harryy@codeaurora.org>
* | | | | Merge "qpnp-fg-gen3: add support to show time to full and empty"Linux Build Service Account2016-11-15
|\ \ \ \ \
| * | | | | qpnp-fg-gen3: add support to show time to full and emptyNicholas Troast2016-11-14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Estimate the amount of time it will take to charge or discharge the battery. These values are exposed through power supply properties time_to_full_avg and time_to_empty_avg. Change-Id: I53c24deb1cfbd7fea1b2a598ed58c6352c5ff9a2 Signed-off-by: Nicholas Troast <ntroast@codeaurora.org> Signed-off-by: Subbaraman Narayanamurthy <subbaram@codeaurora.org>
* | | | | | Merge "qpnp-smb2: allow parallel charging during supplemental mode"Linux Build Service Account2016-11-15
|\ \ \ \ \ \
| * | | | | | qpnp-smb2: allow parallel charging during supplemental modeNicholas Troast2016-11-14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | PMI8998 register 0x1690 BIT(2) is incorrectly documented. This bit enables a feature to disable the parallel charger via STAT when the PMI is supplementing a system load using the battery. This feature is not recommended since SW is limiting the power that the parallel charger can draw based on the input power available, and the default power distribution ensures that 50% of the available input power is allocated to the PMI. Disable this feature. Change-Id: I1e5400eb64b6b61076617b5b26fc750c6e8d0270 Signed-off-by: Nicholas Troast <ntroast@codeaurora.org>
| * | | | | | qpnp-smb2: clear the ICL override during probeNicholas Troast2016-11-14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When PD negotiates a higher input current limit the ICL override bit will be set. If a reboot happens then the ICL override will still be set after the reboot. Clear the ICL override during probe to ensure that the correct ICL is honored since PD is neither enabled nor has it negotiated a higher ICL yet. Change-Id: Iaa5f221d530721f7ff4a413a609192baf98ff359 Signed-off-by: Nicholas Troast <ntroast@codeaurora.org>
| * | | | | | smb-lib: remove cached vbus present statusNicholas Troast2016-11-14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | USBIN_INT_RT_STS_REG can be read to determine whether vbus is present therefore caching the result is unnecessary. Remove it. Change-Id: Idace48373333dc3ab36aa10e0d90098a68af315d Signed-off-by: Nicholas Troast <ntroast@codeaurora.org>
| * | | | | | smb-lib: use plugin real time status for USB present propNicholas Troast2016-11-14
| |/ / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The USB and DC power supplies should reflect the real time plugin status in POWER_SUPPLY_PROP_PRESENT. Change-Id: I08987a383edff181e8e4867d8d795dae58ecf084 Signed-off-by: Nicholas Troast <ntroast@codeaurora.org>
* | | | | | Merge "qcom-charger: WA for cc2 removal with medium and high rd"Linux Build Service Account2016-11-15
|\ \ \ \ \ \
| * | | | | | qcom-charger: WA for cc2 removal with medium and high rdHarry Yang2016-11-14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In PMICv2, typec removal is known when CC detachment is detected, but this does not work due to a HW bug, when orientation is CC2 with medium or high rd. Currently in HW, after cable is removed, rd reading switches to std from medium or high. The software workaround is to catch this very change in cc state update, and then force a cc detach irq. CRs-Fixed: 1079913 Change-Id: I284ca8f2221f596432d67117d89e7d501d2bd9a8 Signed-off-by: Harry Yang <harryy@codeaurora.org>
* | | | | | | Merge "qcom-charger: WA for typec cc2 sink removal with rdstd"Linux Build Service Account2016-11-15
|\| | | | | |
| * | | | | | qcom-charger: WA for typec cc2 sink removal with rdstdHarry Yang2016-11-14
| |/ / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In PMICv2, typec removal relies on CC detachment detection, but CC removal event does not fire when orientation is CC2 with rdstd, due to a HW bug. The software workaround is to force typec sink cycles and poll CC states, until cc status reading confirms detachment, and PD is notified of typec removal. CRs-Fixed: 1079913 Change-Id: Ie9ed65d421df57c9bfa4db8e44d358da3b0cdc36 Signed-off-by: Harry Yang <harryy@codeaurora.org>
* | | | | | Merge "qpnp-smb2: increase VCONN softstart"Linux Build Service Account2016-11-15
|\ \ \ \ \ \ | |/ / / / / |/| | | | |
| * | | | | qpnp-smb2: increase VCONN softstartNicholas Troast2016-11-08
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some USB OTG devices fail to start due to high capacitance on VCONN which causes an in-rush of current and triggers the over-current protection. Increase the softstart to mitigate the current in-rush caused by these devices. Change-Id: Ia29c08702db44538fcb467fc38d3933be9df26d7 Signed-off-by: Nicholas Troast <ntroast@codeaurora.org>
* | | | | | Merge "qpnp-fg-gen3: Fix empty SOC handling"Linux Build Service Account2016-11-11
|\ \ \ \ \ \
| * | | | | | qpnp-fg-gen3: Fix empty SOC handlingSubbaraman Narayanamurthy2016-11-10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, a flag is set when the empty SOC interrupt fires to indicate SOC 0 to the users. This is not cleared when the battery voltage goes up. This needs to be fixed. Remove the flag and use the realtime status of BATT_SOC peripheral to decide it. To make that even more robust, validate the battery voltage with the cutoff voltage. While at it, add a print in the driver's probe to print the battery SOC and voltage. This will be helpful to debug different battery charging scenarios. CRs-Fixed: 1086715 Change-Id: Icbbe0d4ab74c6f9bf6f2278a11020a9bc6c41930 Signed-off-by: Subbaraman Narayanamurthy <subbaram@codeaurora.org>
* | | | | | | qcom-charger: smblib: add support for pd current settingHarry Yang2016-11-10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Forcing a certain current limit is not supported in the current driver, but well needed in when pd is active. In this change, ICL_OVERRIDE/APSD and USB mode are updated, so that PD can alter current limit by simply voting the ICL setting. Change-Id: I8d3ec938d433fe9bdbb8c091873c07e75c49d632 Signed-off-by: Harry Yang <harryy@codeaurora.org>
* | | | | | | Merge "qcom-charger: smblib: lower delay in OTG soft-start check"Linux Build Service Account2016-11-10
|\ \ \ \ \ \ \