summaryrefslogtreecommitdiff
path: root/drivers/power (follow)
Commit message (Collapse)AuthorAge
...
* | | | | Merge "power: qpnp-fg-gen3: Fix possible integer overflow"Linux Build Service Account2017-06-07
|\| | | |
| * | | | power: qpnp-fg-gen3: Fix possible integer overflowSubbaraman Narayanamurthy2017-06-05
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, DIV_ROUND_CLOSEST is used while finding the delta between initial and final cc_soc_sw in terms of percentage. This can go beyond 32 bits with the intermediate multiplication before it is down-converted back to less than 32 bits. Fix this. Also, when the cc_soc_sw delta is less than 50 %, discard the data so that the last learned capacity won't be updated. While at it, fix a similar use of DIV_ROUND_CLOSEST in another place fg_encode_default() where an integer overflow can happen if it is passed with large integer values. Change-Id: Ia2b0f5456663a90bcd32a4fed52d1e579cff4e1f Signed-off-by: Subbaraman Narayanamurthy <subbaram@codeaurora.org>
* | | | | Merge "drivers: Warning fixes to disable CC_OPTIMIZE_FOR_SIZE"Linux Build Service Account2017-06-07
|\ \ \ \ \
| * | | | | drivers: Warning fixes to disable CC_OPTIMIZE_FOR_SIZEPrasad Sodagudi2017-05-31
| | |/ / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These are all driver changes needed for disablement of CONFIG_CC_OPTIMIZE_FOR_SIZE. CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE is enabled by default once CONFIG_CC_OPTIMIZE_FOR_SIZE is disabled. Change-Id: Ia46a1f24e8a082a29ea6151e41e6d3a85a05fd4f Signed-off-by: Prasad Sodagudi <psodagud@codeaurora.org> Signed-off-by: Sridhar Parasuram <sridhar@codeaurora.org>
* | | | | Merge "smb-lib: clear EXIT_SNK_BASED_ON_CC BIT after cable removal"Linux Build Service Account2017-06-06
|\ \ \ \ \
| * | | | | smb-lib: clear EXIT_SNK_BASED_ON_CC BIT after cable removalAbhijeet Dharmapurikar2017-06-05
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | EXIT_SNK_BASED_ON_CC bit is only to be used while we are in hard reset. There is a possibility for that bit to remain set if cable were removed while a hard reset was in progress. Clear that bit in removal path Change-Id: I5e0776de9322a8015f851312df51a202e35c7a78 Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
* | | | | | Merge "battery: remove 20ms delay for running AICL"Linux Build Service Account2017-06-06
|\ \ \ \ \ \
| * | | | | | battery: remove 20ms delay for running AICLAbhijeet Dharmapurikar2017-06-04
| |/ / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The driver waits 20mS after setting ICL to a step lower than settled value before increasing it back to the effective value. That 20mS delay is not required and causes PR_SWAP compliance tests to fail. Remove it. Change-Id: I8bd43a885c554df3590499ddf2a219e816e28734 Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
* | | | | | Merge "smb-lib: change debounce time to 20mS while in pr_swap"Linux Build Service Account2017-06-06
|\ \ \ \ \ \
| * | | | | | smb-lib: change debounce time to 20mS while in pr_swapAbhijeet Dharmapurikar2017-05-31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We observe that while PR_SWAP is done from PD stack, the typeC block could be running its tCC debounce timer. This causes the driver to prematurely declare that the cable is removed. Fix this by reducing the tCC debounce time to 20mS while in PR_SWAP. Change-Id: Ie8b3628cd6931ff2da92d95c153d0d2c7ddb20b2 Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
* | | | | | | Merge "power: qcom: smb-lib: check for USB removal after legacy WA"Linux Build Service Account2017-06-06
|\ \ \ \ \ \ \
| * | | | | | | power: qcom: smb-lib: check for USB removal after legacy WANicholas Troast2017-06-02
| | |/ / / / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If the USB Type-C cable is removed while the legacy workaround is running the IRQ will be ignored and the removal will not be detected. Check for USB Type-C removal by manually triggering the IRQ when the legacy workaround finishes. Change-Id: Ie2e399915da88a9d7fc480767e4fad8abf23024d Signed-off-by: Nicholas Troast <ntroast@codeaurora.org>
* | | | | | | Merge "qcom: smb1351: add support for reporting INPUT_SUSPEND property"Linux Build Service Account2017-06-04
|\ \ \ \ \ \ \ | |/ / / / / / |/| | | | | |
| * | | | | | qcom: smb1351: add support for reporting INPUT_SUSPEND propertyAshay Jaiswal2017-06-01
| |/ / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add support to report INPUT_SUSPEND state in case of slave charger configuration. This is used by user-space to determine parallel charger state. Change-Id: I97a7c18180c0aceddd2b90177949f87487aad22b Signed-off-by: Ashay Jaiswal <ashayj@codeaurora.org>
* | | | | | Merge "power: qcom: smb138x-charger: do not enable parallel thermal regulation"Linux Build Service Account2017-06-01
|\ \ \ \ \ \
| * | | | | | power: qcom: smb138x-charger: do not enable parallel thermal regulationNicholas Troast2017-06-01
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | USB connector HW based thermal regulation is active which will throttle the input current on USBIN-USBIN configurations. This was enabled for MID-MID configurations to enable the comparator output for USB connector temperature mitigation, but since the input is bypassed it does not throttle the input current. The comparator output is no longer used since the ADC values are used directly, so neither configuration needs this HW feature to be enabled. Remove the write to enable this HW feature. Change-Id: Ia7f6b3812ae222fbd8233d07dd6daa67e65ce08b Signed-off-by: Nicholas Troast <ntroast@codeaurora.org>
* | | | | | | Merge "qpnp-fg-gen3: configure ESR timers dynamically based on charge ↵Linux Build Service Account2017-06-01
|\ \ \ \ \ \ \ | |/ / / / / / |/| | | | | | | | | | | | | termination"
| * | | | | | qpnp-fg-gen3: configure ESR timers dynamically based on charge terminationSubbaraman Narayanamurthy2017-05-31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | With ESR discharge timer retry, max having same value, ESR pulse can fire frequently when battery FET is open past charge termination. This frequent ESR pulses increase power consumption when the device is idle. Upon charge termination, change the ESR discharging timer retry to 0 so that ESR pulse can fire less frequently saving power. Add support for this through fg_esr_timer_config() based on end of charge and sleep conditions. Currently, retry/max for ESR charging and discharging timers are configured with the same value specified through device tree. Extend the device tree property to take in different retry/max values for those timers. Change-Id: Ib30b8ae7d893b5cab00ed83dd7318b53e3b63ac1 Signed-off-by: Subbaraman Narayanamurthy <subbaram@codeaurora.org>
* | | | | | | power: supply: qcom: use typec mode instead of debounce doneNicholas Troast2017-05-31
| |/ / / / / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When the CC state change IRQ fires on USB removal the debounce done status may still be high, and the removal cleanup will not be called. Use the UFP/DFP status bits to determine whether the CC lines are present or not instead. While at it cache the CC state so it doesn't have to be derived everywhere it is needed. The status bits are already cached, so there should be no functional difference. Change-Id: Ifb89c78a032ae9d38fbc8c281518698941e131c2 Signed-off-by: Nicholas Troast <ntroast@codeaurora.org>
* | | | | | battery: don't wait for aicl rerunAbhijeet Dharmapurikar2017-05-26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In the callback to change the usb icl, the current code waits to rerun AICL. These waits were to ensure that AICL completes and we can restore parallel charger once done. However, these waits are unnecessary since we invoke code to enable USBIN_I_VOTER for parallel charger in a workqueue. Moreover, these wait causes compliance failures. Remove those waits. Change-Id: Id2e3ca87e111aa415c47683a2cc365a9bece7ffb Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
* | | | | | smb-lib: ignore disconnects during power role swapAbhijeet Dharmapurikar2017-05-26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | During a power_role swap, the CC lines get disconnected for a bit. This causes the charger driver to prematurely declare a disconnection and it resets back to disconnected state. Update the code to distinguish a disconnect caused during PR_SWAP vs a real disconnect. Avoid - resetting the CC line to HW control - switching DRP mode - enabling the crude sensor workaround - enabling APSD during a discconnet caused by PR_SWAP Note that PR_SWAP setting/unsetting needs to done regardless of the connected state of the CC line. When PR_SWAP is notified to be completed and the CC lines are still seen disconnected call the real disconnect code. While at it Vconn can be disabled too in the real disconnect code path. Change-Id: I97ab7ee343c5b2bcf25797e6acbb1de37f5ba00a Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
* | | | | | power_supply: introduce PR_SWAP propertyAbhijeet Dharmapurikar2017-05-26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Introduce POWER_SUPPLY_PROP_PR_SWAP to notify if the device is in power role swap. Change-Id: I8d0cb3a71ec1a646b7ec37405e66cb00ddc40e0d Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
* | | | | | smb-lib: reset SDP draw to 100mAAbhijeet Dharmapurikar2017-05-26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The driver could leave SDP's current draw to a higher value once its removed. This is because the code to reset the current limit needs the type to be SDP to reset it which is not going to be the case after removal. So reset SDPs current limit back to 100mA in the code path for non-SDP chargers. Change-Id: Idfb9df1b72a17f1db63265b85f6546cbb77c4018 Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
* | | | | | Merge "qpnp: smb2: fix ICL recovery mechanism"Linux Build Service Account2017-05-26
|\ \ \ \ \ \
| * | | | | | qpnp: smb2: fix ICL recovery mechanismAshay Jaiswal2017-05-23
| | |/ / / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ICL recovery mechanism is used by user space daemon to recover from adapter collapse during voltage increment event by reducing the USB ICL. There could be a situation where nobody votes on usb_icl_votable and this could lead to a negative ICL value. Fix this by reading "HW_CURRENT_MAX" property to get ICL in situations where usb_icl_votable is not voted by any client, this ensures ICL reduction will always vote a valid ICL. CRs-Fixed: 2048330 Change-Id: I8e53a945530c1685aaaba0537d16ac5fb11858df Signed-off-by: Ashay Jaiswal <ashayj@codeaurora.org>
* | | | | | Merge "qpnp-smb2: update AICL rerun logic for PM660"Linux Build Service Account2017-05-26
|\ \ \ \ \ \
| * | | | | | qpnp-smb2: update AICL rerun logic for PM660Ashay Jaiswal2017-05-23
| |/ / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Current AICL re-run design for PM660 uses AICL restart mechanism which starts AICL algorithm from Min ICL value to the configure ICL value one step (25mA) at a time, this adds considerable amount of delay for algorithm to reach a settled ICL value. Fix this by using PMI8998 based AICL re-run design. Change-Id: I84f612c275fa0d9785a6688a56c9da90df1b86d4 Signed-off-by: Ashay Jaiswal <ashayj@codeaurora.org>
* | | | | | Merge "power: qpnp-fg-gen3: update default empty voltage to 2.85 V"Linux Build Service Account2017-05-25
|\ \ \ \ \ \ | | |/ / / / | |/| | | |
| * | | | | power: qpnp-fg-gen3: update default empty voltage to 2.85 VSubbaraman Narayanamurthy2017-05-22
| | |/ / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Based on the hardware recommendation, update the default empty voltage from 2.8 V to 2.85 V. This is to prevent undervolting in low temperatures (e.g. -20 C) when battery voltage drops below 2.8 V but the battery SOC may not reach 0% as the charger is configured to issue GP_FAULT2 when battery voltage goes below 2.8 V. This helps in shutting down graciously. Change-Id: Ifc68b825541c09d985d890ee7200ff8e0af2ba0f Signed-off-by: Subbaraman Narayanamurthy <subbaram@codeaurora.org>
* | | | | Merge "power: qpnp-smb2: remove workaround for USBIN supplied VCONN"Linux Build Service Account2017-05-25
|\ \ \ \ \
| * | | | | power: qpnp-smb2: remove workaround for USBIN supplied VCONNNicholas Troast2017-05-09
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | VCONN is supplied by USBIN on MTP8998 which causes removal issues when PMI8998 is in source mode and VCONN is enabled. The workaround is to ensure VCONN is disabled when OTG is disabled which has implications on PD power role swap when PMI8998 is sourcing VCONN. The reference schematic has been updated to address this issue therefore the workaround should be removed. Change-Id: Ibe2309f3618d840340bd083cca0df8a8644dd9c8 Signed-off-by: Nicholas Troast <ntroast@codeaurora.org>
* | | | | | Merge "Merge remote-tracking branch 'origin/tmp-285c137' into msm-4.4"Linux Build Service Account2017-05-25
|\ \ \ \ \ \ | |_|_|/ / / |/| | | | |
| * | | | | Merge remote-tracking branch 'origin/tmp-285c137' into msm-4.4Kyle Yan2017-05-15
| |\ \ \ \ \ | | | |_|/ / | | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * origin/tmp-285c137: Linux 4.4.68 block: get rid of blk_integrity_revalidate() drm/ttm: fix use-after-free races in vm fault handling f2fs: sanity check segment count bnxt_en: allocate enough space for ->ntp_fltr_bmap ipv6: reorder ip6_route_dev_notifier after ipv6_dev_notf ipv6: initialize route null entry in addrconf_init() rtnetlink: NUL-terminate IFLA_PHYS_PORT_NAME string ipv4, ipv6: ensure raw socket message is big enough to hold an IP header tcp: do not inherit fastopen_req from parent tcp: fix wraparound issue in tcp_lp bpf, arm64: fix jit branch offset related to ldimm64 tcp: do not underestimate skb->truesize in tcp_trim_head() ALSA: hda - Fix deadlock of controller device lock at unbinding staging: emxx_udc: remove incorrect __init annotations staging: wlan-ng: add missing byte order conversion brcmfmac: Make skb header writable before use brcmfmac: Ensure pointer correctly set if skb data location changes MIPS: R2-on-R6 MULTU/MADDU/MSUBU emulation bugfix scsi: mac_scsi: Fix MAC_SCSI=m option when SCSI=m serial: 8250_omap: Fix probe and remove for PM runtime phy: qcom-usb-hs: Add depends on EXTCON USB: serial: io_edgeport: fix descriptor error handling USB: serial: mct_u232: fix modem-status error handling USB: serial: quatech2: fix control-message error handling USB: serial: ftdi_sio: fix latency-timer error handling USB: serial: ark3116: fix open error handling USB: serial: ti_usb_3410_5052: fix control-message error handling USB: serial: io_edgeport: fix epic-descriptor handling USB: serial: ssu100: fix control-message error handling USB: serial: digi_acceleport: fix incomplete rx sanity check USB: serial: keyspan_pda: fix receive sanity checks usb: chipidea: Handle extcon events properly usb: chipidea: Only read/write OTGSC from one place usb: host: ohci-exynos: Decrese node refcount on exynos_ehci_get_phy() error paths usb: host: ehci-exynos: Decrese node refcount on exynos_ehci_get_phy() error paths KVM: nVMX: do not leak PML full vmexit to L1 KVM: nVMX: initialize PML fields in vmcs02 Revert "KVM: nested VMX: disable perf cpuid reporting" x86/platform/intel-mid: Correct MSI IRQ line for watchdog device kprobes/x86: Fix kernel panic when certain exception-handling addresses are probed clk: Make x86/ conditional on CONFIG_COMMON_CLK x86/pci-calgary: Fix iommu_free() comparison of unsigned expression >= 0 x86/ioapic: Restore IO-APIC irq_chip retrigger callback mwifiex: Avoid skipping WEP key deletion for AP mwifiex: remove redundant dma padding in AMSDU mwifiex: debugfs: Fix (sometimes) off-by-1 SSID print ARM: OMAP5 / DRA7: Fix HYP mode boot for thumb2 build leds: ktd2692: avoid harmless maybe-uninitialized warning power: supply: bq24190_charger: Handle fault before status on interrupt power: supply: bq24190_charger: Don't read fault register outside irq_handle_thread() power: supply: bq24190_charger: Call power_supply_changed() for relevant component power: supply: bq24190_charger: Install irq_handler_thread() at end of probe() power: supply: bq24190_charger: Call set_mode_host() on pm_resume() power: supply: bq24190_charger: Fix irq trigger to IRQF_TRIGGER_FALLING powerpc/powernv: Fix opal_exit tracepoint opcode cpupower: Fix turbo frequency reporting for pre-Sandy Bridge cores ARM: 8452/3: PJ4: make coprocessor access sequences buildable in Thumb2 mode 9p: fix a potential acl leak ANDROID: android-base.cfg: remove spurious CONFIG_MODULES line ANDROID: memory_state_time: fix undefined behavior with missing DT properties ANDROID: rfkill: fix unused function warning ANDROID: make PF_KEY SHA256 use RFC-compliant truncation. ANDROID: sdcardfs: fix sdcardfs_destroy_inode for the inode RCU approach ANDROID: android-base.cfg: remove NETFILTER_XT_MATCH_QUOTA2_LOG ANDROID: sdcardfs: Don't iput if we didn't igrab ANDROID: Add untag hacks to inet_release function Change-Id: I6d750f8bb186774ff9630beeb0ed8e680af26231 Signed-off-by: Kyle Yan <kyan@codeaurora.org>
| | * | | | Merge 4.4.68 into android-4.4Greg Kroah-Hartman2017-05-15
| | |\ \ \ \ | | | | |_|/ | | | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Changes in 4.4.68 9p: fix a potential acl leak ARM: 8452/3: PJ4: make coprocessor access sequences buildable in Thumb2 mode cpupower: Fix turbo frequency reporting for pre-Sandy Bridge cores powerpc/powernv: Fix opal_exit tracepoint opcode power: supply: bq24190_charger: Fix irq trigger to IRQF_TRIGGER_FALLING power: supply: bq24190_charger: Call set_mode_host() on pm_resume() power: supply: bq24190_charger: Install irq_handler_thread() at end of probe() power: supply: bq24190_charger: Call power_supply_changed() for relevant component power: supply: bq24190_charger: Don't read fault register outside irq_handle_thread() power: supply: bq24190_charger: Handle fault before status on interrupt leds: ktd2692: avoid harmless maybe-uninitialized warning ARM: OMAP5 / DRA7: Fix HYP mode boot for thumb2 build mwifiex: debugfs: Fix (sometimes) off-by-1 SSID print mwifiex: remove redundant dma padding in AMSDU mwifiex: Avoid skipping WEP key deletion for AP x86/ioapic: Restore IO-APIC irq_chip retrigger callback x86/pci-calgary: Fix iommu_free() comparison of unsigned expression >= 0 clk: Make x86/ conditional on CONFIG_COMMON_CLK kprobes/x86: Fix kernel panic when certain exception-handling addresses are probed x86/platform/intel-mid: Correct MSI IRQ line for watchdog device Revert "KVM: nested VMX: disable perf cpuid reporting" KVM: nVMX: initialize PML fields in vmcs02 KVM: nVMX: do not leak PML full vmexit to L1 usb: host: ehci-exynos: Decrese node refcount on exynos_ehci_get_phy() error paths usb: host: ohci-exynos: Decrese node refcount on exynos_ehci_get_phy() error paths usb: chipidea: Only read/write OTGSC from one place usb: chipidea: Handle extcon events properly USB: serial: keyspan_pda: fix receive sanity checks USB: serial: digi_acceleport: fix incomplete rx sanity check USB: serial: ssu100: fix control-message error handling USB: serial: io_edgeport: fix epic-descriptor handling USB: serial: ti_usb_3410_5052: fix control-message error handling USB: serial: ark3116: fix open error handling USB: serial: ftdi_sio: fix latency-timer error handling USB: serial: quatech2: fix control-message error handling USB: serial: mct_u232: fix modem-status error handling USB: serial: io_edgeport: fix descriptor error handling phy: qcom-usb-hs: Add depends on EXTCON serial: 8250_omap: Fix probe and remove for PM runtime scsi: mac_scsi: Fix MAC_SCSI=m option when SCSI=m MIPS: R2-on-R6 MULTU/MADDU/MSUBU emulation bugfix brcmfmac: Ensure pointer correctly set if skb data location changes brcmfmac: Make skb header writable before use staging: wlan-ng: add missing byte order conversion staging: emxx_udc: remove incorrect __init annotations ALSA: hda - Fix deadlock of controller device lock at unbinding tcp: do not underestimate skb->truesize in tcp_trim_head() bpf, arm64: fix jit branch offset related to ldimm64 tcp: fix wraparound issue in tcp_lp tcp: do not inherit fastopen_req from parent ipv4, ipv6: ensure raw socket message is big enough to hold an IP header rtnetlink: NUL-terminate IFLA_PHYS_PORT_NAME string ipv6: initialize route null entry in addrconf_init() ipv6: reorder ip6_route_dev_notifier after ipv6_dev_notf bnxt_en: allocate enough space for ->ntp_fltr_bmap f2fs: sanity check segment count drm/ttm: fix use-after-free races in vm fault handling block: get rid of blk_integrity_revalidate() Linux 4.4.68 Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
| | | * | | power: supply: bq24190_charger: Handle fault before status on interruptLiam Breck2017-05-14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | commit ba52e75718784fda1b683ee0bfded72a0b83b047 upstream. Reading both fault and status registers and logging any fault should take priority over handling status register update. Fix by moving the status handling to later in interrupt routine. Fixes: d7bf353fd0aa3 ("bq24190_charger: Add support for TI BQ24190 Battery Charger") Signed-off-by: Liam Breck <kernel@networkimprov.net> Acked-by: Mark Greer <mgreer@animalcreek.com> Acked-by: Tony Lindgren <tony@atomide.com> Signed-off-by: Sebastian Reichel <sre@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| | | * | | power: supply: bq24190_charger: Don't read fault register outside ↵Liam Breck2017-05-14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | irq_handle_thread() commit 68abfb8015832ddf728b911769659468efaf8bd9 upstream. Caching the fault register after a single I2C read may not keep an accurate value. Fix by doing two reads in irq_handle_thread() and using the cached value elsewhere. If a safety timer fault later clears itself, we apparently don't get an interrupt (INT), however other interrupts would refresh the register cache. From the data sheet: "When a fault occurs, the charger device sends out INT and keeps the fault state in REG09 until the host reads the fault register. Before the host reads REG09 and all the faults are cleared, the charger device would not send any INT upon new faults. In order to read the current fault status, the host has to read REG09 two times consecutively. The 1st reads fault register status from the last read [1] and the 2nd reads the current fault register status." [1] presumably a typo; should be "last fault" Fixes: d7bf353fd0aa3 ("bq24190_charger: Add support for TI BQ24190 Battery Charger") Signed-off-by: Liam Breck <kernel@networkimprov.net> Acked-by: Mark Greer <mgreer@animalcreek.com> Acked-by: Tony Lindgren <tony@atomide.com> Signed-off-by: Sebastian Reichel <sre@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| | | * | | power: supply: bq24190_charger: Call power_supply_changed() for relevant ↵Liam Breck2017-05-14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | component commit 2d9fee6a42ea170e4378b3363a7ad385d0e67281 upstream. We wrongly get uevents for bq24190-charger and bq24190-battery on every register change. Fix by checking the association with charger and battery before emitting uevent(s). Fixes: d7bf353fd0aa3 ("bq24190_charger: Add support for TI BQ24190 Battery Charger") Signed-off-by: Liam Breck <kernel@networkimprov.net> Acked-by: Mark Greer <mgreer@animalcreek.com> Acked-by: Tony Lindgren <tony@atomide.com> Signed-off-by: Sebastian Reichel <sre@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| | | * | | power: supply: bq24190_charger: Install irq_handler_thread() at end of probe()Liam Breck2017-05-14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | commit d62acc5ef0621463446091ebd7a345e06e9ab80c upstream. The device specific data is not fully initialized on request_threaded_irq(). This may cause a crash when the IRQ handler tries to reference them. Fix the issue by installing IRQ handler at the end of the probe. Fixes: d7bf353fd0aa3 ("bq24190_charger: Add support for TI BQ24190 Battery Charger") Signed-off-by: Liam Breck <kernel@networkimprov.net> Acked-by: Mark Greer <mgreer@animalcreek.com> Acked-by: Tony Lindgren <tony@atomide.com> Signed-off-by: Sebastian Reichel <sre@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| | | * | | power: supply: bq24190_charger: Call set_mode_host() on pm_resume()Liam Breck2017-05-14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | commit e05ad7e0741ce0505e1df157c62b22b95172bb97 upstream. pm_resume() does a register_reset() which clears charger host mode. Fix by calling set_mode_host() after the reset. Fixes: d7bf353fd0aa3 ("bq24190_charger: Add support for TI BQ24190 Battery Charger") Signed-off-by: Liam Breck <kernel@networkimprov.net> Acked-by: Mark Greer <mgreer@animalcreek.com> Acked-by: Tony Lindgren <tony@atomide.com> Signed-off-by: Sebastian Reichel <sre@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| | | * | | power: supply: bq24190_charger: Fix irq trigger to IRQF_TRIGGER_FALLINGLiam Breck2017-05-14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | commit 767eee362fd72bb2ca44cc80419ca4b38c6d8369 upstream. The interrupt signal is TRIGGER_FALLING. This is is specified in the data sheet PIN FUNCTIONS: "The INT pin sends active low, 256us pulse to host to report charger device status and fault." Also the direction can be seen in the data sheet Figure 37 "BQ24190 with D+/D- Detection and USB On-The-Go (OTG)" which shows a 10k pull-up resistor installed for the sample configurations. Fixes: d7bf353fd0aa3 ("bq24190_charger: Add support for TI BQ24190 Battery Charger") Signed-off-by: Liam Breck <kernel@networkimprov.net> Acked-by: Mark Greer <mgreer@animalcreek.com> Acked-by: Tony Lindgren <tony@atomide.com> Signed-off-by: Sebastian Reichel <sre@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* | | | | | qpnp-smb2: fix FV and FCC reportingAbhijeet Dharmapurikar2017-05-19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently the read of battery's voltage_max property (FV) and battery's current_max property (FCC) returns the value of DEFAULT_VOTER voter. But such a voter doesn't exist on battery's voltage_max property. Fix it by returning the value voted by BATT_PROFILE_VOTER. Change-Id: I2dac98f2ce9a423d5045788dbe120591f10c5a9e Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
* | | | | | smb-lib: do not disable parallel based only on main's settled currentAbhijeet Dharmapurikar2017-05-19
| |_|_|_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently main charger ends up voting to disable parallel(USBIN_I_VOTER) if the settled current is less than 1.4Amps. It could be that the parallel path is drawing some current and the draw is higher than 1.4Amps. Move this disabling to battery, where the parallel charger's input current is taken in to consideration. Also while voting to disable, make sure that the main's input is limited. If there is more room for ICL to increase that means more power could be drawn from the charger and so we must keep the parallel charging enabled. If the ICL ceiling itself if 1.4Amps then disable parallel charging, because even if ICL has room to increase it wont cross 1.4Amps. The main's input limited state is set while AICL steps up - this ensures that we keep parallel disabled while AICL is running and settled is less than 1.4Amps. When the charger is removed, the main's input limited status is unset, however we want to keep the parallel charger disabled. In such situations the main's settled current is 0mA - use this to vote for disabling parallel charging. For any ICL change vote request: Disable parallel using USBIN_I_VOTER if requested current is less than 1.4Amps and to un-vote (i.e. when ICL vote is higher than 1.4Amps) rely on event from AICL done or status_change delayed work. Note that USBIN_I_VOTER is effective only for non-QC chargers. For QC chargers USBIN_V_VOTER continues to keep charging enabled since parallel need not be disabled is a lower current is requested with a QC charger. Change-Id: I61d7cd161a87de2904470b2d870058a0fe199116 Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
* | | | | qpnp-smb2: Add software based glitch filter for OTG detectionAshay Jaiswal2017-05-12
|/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When the USB_ID line is pulled low for a very short time there is a possibility that the SW misses rising edge(removal) event. This may lead to the state where charger is stuck in the boost-mode forever. Fix this my adding a SW based glitch logic which checks for the USB_ID after a SW debounce time and then notifies its presence/removal to the USB driver. CRs-Fixed: 2044958 Change-Id: I31974f7d68b435bbef329278cedbd726ada02e3f Signed-off-by: Ashay Jaiswal <ashayj@codeaurora.org>
* | | / power: qpnp-fg-gen3: Disable ESR pulldown for debug battery idSubbaraman Narayanamurthy2017-05-05
| |_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Even with proper ESR pulse qualification threshold and ESR pulse amplitude, ESR pulses are still seen occasionally on devices that use battery with debug battery id. Disable ESR pulldown when debug battery id is found. This helps saving power by stopping ESR pulses. Change-Id: I2b9588ec39a2268123d94c06517b0dbb43d66fc7 Signed-off-by: Subbaraman Narayanamurthy <subbaram@codeaurora.org>
* | | Merge "Revert "smb138x: introduce support for smb1355""Linux Build Service Account2017-05-03
|\ \ \
| * | | Revert "smb138x: introduce support for smb1355"Abhijeet Dharmapurikar2017-05-03
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 566b44214cc08786375ac8266ee387e431413078 (smb138x: introduce support for smb1355). This is not required since smb1355 support is moved to its own driver. Change-Id: Ibad8595c09a865e273adb6f30d6a75f931220131 Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
* | | | Merge "Revert "smb138x: use chg src bit to disable parallel charger""Linux Build Service Account2017-05-03
|\| | |
| * | | Revert "smb138x: use chg src bit to disable parallel charger"Abhijeet Dharmapurikar2017-05-03
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 0f0e36134d8a1082f099d543a122cd10d777beda ("smb138x: use chg src bit to disable parallel charger) This is not required, since smb1355 support is moved to its own driver. Change-Id: I1bd454030d29195f03be132d167ec8294169b9d5 Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
| * | | qpnp-smb2: Support faking input current limited stateAbhijeet Dharmapurikar2017-05-03
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Support faking input current limited state. This is very helpful in testing/debugging the software based vbus changing algorithms. Change-Id: I7cf548c94397ee680c9d65343c49ec7b16873e88 Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
| * | | power: qcom: smb2: Add REAL_TYPE property for usb power_supplyFenglin Wu2017-05-03
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add POWER_SUPPLY_PROP_REAL_TYPE property for usb_psy to present its real charger type. POWER_SUPPLY_PROP_TYPE in usb_psy is always set to POWER_SUPPLY_TYPE_USB_PD for healthd to recognize it as an AC charger. Also add usb_port_psy with POWER_SUPPLY_TYPE_USB type is added for healthd to recognize it as an USB host. Their ONLINE properties will be updated according to the VBUS status, type-c mode and real charger type. With this type being set statically, update the usb phy and pd policy engine code to look at real type. Change-Id: I90aa69325cc82b09dfb513c0eeecbc61e092a57f Signed-off-by: Fenglin Wu <fenglinw@codeaurora.org> Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>