summaryrefslogtreecommitdiff
path: root/drivers/power/supply (follow)
Commit message (Collapse)AuthorAge
* Merge lineage-20 of git@github.com:LineageOS/android_kernel_qcom_msm8998.git ↵Davide Garberi2023-08-06
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | into lineage-20 7d11b1a7a11c Revert "sched: cpufreq: Use sched_clock instead of rq_clock when updating schedutil" daaa5da96a74 sched: Take irq_sparse lock during the isolation 217ab2d0ef91 rcu: Speed up calling of RCU tasks callbacks 997b726bc092 kernel: power: Workaround for sensor ipc message causing high power consume b933e4d37bc0 sched/fair: Fix low cpu usage with high throttling by removing expiration of cpu-local slices 82d3f23d6dc5 sched/fair: Fix bandwidth timer clock drift condition 629bfed360f9 kernel: power: qos: remove check for core isolation while cluster LPMs 891a63210e1d sched/fair: Fix issue where frequency update not skipped b775cb29f663 ANDROID: Move schedtune en/dequeue before schedutil update triggers ebdb82f7b34a sched/fair: Skip frequency updates if CPU about to idle ff383d94478a FROMLIST: sched: Make iowait_boost optional in schedutil 9539942cb065 FROMLIST: cpufreq: Make iowait boost a policy option b65c91c9aa14 ARM: dts: msm: add HW CPU's busy-cost-data for additional freqs 72f13941085b ARM: dts: msm: fix CPU's idle-cost-data ab88411382f7 ARM: dts: msm: fix EM to be monotonically increasing 83dcbae14782 ARM: dts: msm: Fix EAS idle-cost-data property length 33d3b17bfdfb ARM: dts: msm: Add msm8998 energy model c0fa7577022c sched/walt: Re-add code to allow WALT to function d5cd35f38616 FROMGIT: binder: use EINTR for interrupted wait for work db74739c86de sched: Don't fail isolation request for an already isolated CPU aee7a16e347b sched: WALT: increase WALT minimum window size to 20ms 4dbe44554792 sched: cpufreq: Use per_cpu_ptr instead of this_cpu_ptr when reporting load ef3fb04c7df4 sched: cpufreq: Use sched_clock instead of rq_clock when updating schedutil c7128748614a sched/cpupri: Exclude isolated CPUs from the lowest_mask 6adb092856e8 sched: cpufreq: Limit governor updates to WALT changes alone 0fa652ee00f5 sched: walt: Correct WALT window size initialization 41cbb7bc59fb sched: walt: fix window misalignment when HZ=300 43cbf9d6153d sched/tune: Increase the cgroup limit to 6 c71b8fffe6b3 drivers: cpuidle: lpm-levels: Fix KW issues with idle state idx < 0 938e42ca699f drivers: cpuidle: lpm-levels: Correctly check for list empty 8d8a48aecde5 sched/fair: Fix load_balance() affinity redo path eccc8acbe705 sched/fair: Avoid unnecessary active load balance 0ffdb886996b BACKPORT: sched/core: Fix rules for running on online && !active CPUs c9999f04236e sched/core: Allow kthreads to fall back to online && !active cpus b9b6bc6ea3c0 sched: Allow migrating kthreads into online but inactive CPUs a9314f9d8ad4 sched/fair: Allow load bigger task load balance when nr_running is 2 c0b317c27d44 pinctrl: qcom: Clear status bit on irq_unmask 45df1516d04a UPSTREAM: mm: fix misplaced unlock_page in do_wp_page() 899def5edcd4 UPSTREAM: mm/ksm: Remove reuse_ksm_page() 46c6fbdd185a BACKPORT: mm: do_wp_page() simplification 90dccbae4c04 UPSTREAM: mm: reuse only-pte-mapped KSM page in do_wp_page() ebf270d24640 sched/fair: vruntime should normalize when switching from fair cbe0b37059c9 mm: introduce arg_lock to protect arg_start|end and env_start|end in mm_struct 12d40f1995b4 msm: mdss: Fix indentation 620df03a7229 msm: mdss: Treat polling_en as the bool that it is 12af218146a6 msm: mdss: add idle state node 13e661759656 cpuset: Restore tasks affinity while moving across cpusets 602bf4096dab genirq: Honour IRQ's affinity hint during migration 9209b5556f6a power: qos: Use effective affinity mask f31078b5825f genirq: Introduce effective affinity mask 58c453484f7e sched/cputime: Mitigate performance regression in times()/clock_gettime() 400383059868 kernel: time: Add delay after cpu_relax() in tight loops 1daa7ea39076 pinctrl: qcom: Update irq handle for GPIO pins 07f7c9961c7c power: smb-lib: Fix mutex acquisition deadlock on PD hard reset 094b738f46c8 power: qpnp-smb2: Implement battery charging_enabled node d6038d6da57f ASoC: msm-pcm-q6-v2: Add dsp buf check 0d7a6c301af8 qcacld-3.0: Fix OOB in wma_scan_roam.c Change-Id: Ia2e189e37daad6e99bdb359d1204d9133a7916f4
| * power: smb-lib: Fix mutex acquisition deadlock on PD hard resetUmang Agrawal2023-07-16
| | | | | | | | | | | | | | | | | | | | | | | | | | Mutex acquisition deadlock can happen while cancelling cc_dettach work during pd_hard_reset from the function usbin_plugin_hard_reset _locked on vbus rise which is called in the same lock context that we try to acquire in the cc_dettach work routine. Check if cc_dettach work is running during pd_hard_reset and use trylock instead of mutex_lock to prevent any deadlock if mutext is already held. Change-Id: I5530deb9e654d3d12ba1b4bc6876f36127a0d5a5 Signed-off-by: Umang Agrawal <uagrawal@codeaurora.org>
| * power: qpnp-smb2: Implement battery charging_enabled nodeMichael Bestas2023-06-09
| | | | | | | | Change-Id: Id08c169f0c507390eab070d1ae77bfb992b50b81
* | power: qpnp-fg: Implement SUPPORT_SOC_SHOW_OPTIMIZATIONDavide Garberi2022-07-27
| | | | | | | | | | | | * Without this the battery is sometimes being reported as charged when it is at 98% or 99% Change-Id: I81e70d1a044c642716b3a920b49f8583c083d4a5
* | power: qpnp-smbcharger: Limit the charging to 5V for z2_plusDavide Garberi2022-07-27
| | | | | | | | | | | | | | | | * Apparently the z2_plus doesn't support this * Thanks YaroST12 for the suggestion Signed-off-by: Davide Garberi <dade.garberi@gmail.com> Change-Id: I820a7eac25c8a437d40885dd36577ccb218e36a0
* | power: qpnp-fg: Use default DELTA_SOC without rounding the valueBruno Martins2022-07-27
| | | | | | | | | | | | | | | | | | | | | | * Using soc_to_setpoint function to determine DELTA_SOC value is resulting into a value of 3, which sometimes causes the battery percentage to instantly drop 2% instead of 1% Change-Id: I56156a51dbd8c67e362fce28e408234bbf6211cb Signed-off-by: Harsh Shandilya <harsh@prjkt.io> Signed-off-by: Yaroslav Furman <yaro330@gmail.com> Signed-off-by: Davide Garberi <dade.garberi@gmail.com>
* | power: qpnp-smbcharger: init power supply type as USBdukwung.kim2022-07-27
| | | | | | | | | | | | | | | | | | | | | | | | If power supply type is POWER_SUPPLY_TYPE_UNKNOWN at bootup, some userspace apps, such as heathd, fail to parse power supply properties. So, set power supply type to USB when the charger is not plugged during bootup. Change-Id: Iad3881b0fadb36ace6e5f2de6eaeac11f33a532c Signed-off-by: dukwung.kim <dukwung.kim@lge.com> Signed-off-by: choongryeol.lee <choongryeol.lee@lge.com> Signed-off-by: Davide Garberi <dade.garberi@gmail.com>
* | power: qpnp-smbcharger: Update current_now correctlyLuK13372022-07-27
| | | | | | | | | | | | | | * /sys/class/power_supply/battery/current_now wasn't being updated unless device is booted with USB cable connected. Change-Id: Ie55a56943970313b7d6680f8f6c46bc838d40ab6 Signed-off-by: Davide Garberi <dade.garberi@gmail.com>
* | power: supply: Import minimal edits from zukDavide Garberi2022-07-27
| | | | | | | | | | | | * Re-apply in the new directories for 4.4 Signed-off-by: Davide Garberi <dade.garberi@gmail.com>
* | cclogic: Add some edits from ZUKDavide Garberi2022-07-27
|/ | | | | | | * Reworked from ZUK sources to make it looks a bit better * Also adapted to 4.4 and moved to the new directory Signed-off-by: Davide Garberi <dade.garberi@gmail.com>
* Merge tag 'LA.UM.9.2.r1-02000-SDMxx0.0' of ↵Michael Bestas2021-02-06
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | https://source.codeaurora.org/quic/la/kernel/msm-4.4 into lineage-18.1-caf-msm8998 * tag 'LA.UM.9.2.r1-02000-SDMxx0.0' of https://source.codeaurora.org/quic/la/kernel/msm-4.4: net: ipv6: Use passed in table for nexthop lookups ipv6: addrconf: use stable address generator for ARPHRD_NONE msm: kgsl: Protect the memdesc->gpuaddr in SVM use cases msm: kgsl: Stop using memdesc->usermem msm: kgsl: Correct the refcount on current process PID HID: sony: Update hid_have_special_driver UPSTREAM: HID: input: map digitizer battery usage HID: input: ignore the battery in OKLICK Laser BTmouse defconfig: Enable CONFIG_HID_NINTENDO for msm8998 iio: qcom-rradc: Update logic to monitor health of RRADC peripheral qcom: fg-memif: Correct timeout condition for memory grant power: qpnp-fg-gen3: Add a property to reset FG BCL device msm: ipa3: Add check to validate rule_cnt power_supply: add FG_RESET_CLOCK property defconfig: Enable CONFIG_HID_NINTENDO for SDM660 FROMLIST: HID: nintendo: add nintendo switch controller driver defconfig: Enable UTS_NS for sdm660 Conflicts: drivers/hid/hid-input.c drivers/power/power_supply_sysfs.c include/linux/power_supply.h Change-Id: I577e4b1d9410887224dbdb192c6eea1f2de6aded
| * qcom: fg-memif: Correct timeout condition for memory grantJishnu Prakash2020-12-11
| | | | | | | | | | | | | | Correct logic to handle timeout when trying for DMA access. Change-Id: I10e55e542a96b824db9f7b2abd3fef86286eac6b Signed-off-by: Jishnu Prakash <jprakash@codeaurora.org>
| * power: qpnp-fg-gen3: Add a property to reset FG BCL deviceAshay Jaiswal2020-12-11
| | | | | | | | | | | | | | | | Add support to allow client to request FG to reset BCL device through a power supply property. Change-Id: I7c51adb1e9739c592c28943da8af8219661d38cc Signed-off-by: Ashay Jaiswal <ashayj@codeaurora.org>
* | Merge tag 'LA.UM.8.4.r1-05900-8x98.0' of ↵Michael Bestas2020-08-23
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | https://source.codeaurora.org/quic/la/kernel/msm-4.4 into lineage-17.1-caf-msm8998 * tag 'LA.UM.8.4.r1-05900-8x98.0' of https://source.codeaurora.org/quic/la/kernel/msm-4.4: msm: kgsl: Mark the scratch buffer as privileged power: qcom: Add the QPNP QGAUGE (QG) headers msm: ipa: update msm_ipa.h with latest IPA versions constants nl80211: add NL80211_CMD_UPDATE_FT_IES to supported commands msm: mdss: hdmi: proper error logging ASoC: Fix warnings and errors with llvm sdm660_cdc: Reset cache_only mode for non SSR scenario include: Fix for compilation issue Makefile: Suppress few warnings with clang kbuild: Add -Werror=unknown-warning-option to CLANG_FLAGS kbuild: initialize CLANG_FLAGS correctly in the top Makefile kbuild: consolidate Clang compiler flags kbuild: add -no-integrated-as Clang option unconditionally power: qpnp-fg-gen3: Fix warning with llvm lkdtm: Fix warning with llvm AndroidKernel: Explicitly mark certain targets as phony dsp: q6asm: Change to increase asm sessions allowed dsp: q6adm: Channel map configuration for multi-channel defconfig: Create symbolic link for arm64 defconfigs scripts/build-all: remove pattern-based defconfig detection scripts/build-all: look for nested vendor/ defconfig directories scripts/build-all: remove all defconfig manipulation options scripts: build-all.py: update regex to compile all defconfigs scripts: build-all.py: append llvm to the config file scripts: Clean up the gcc-wrapper white list scripts: set clang as REAL_CC to support LLVM by default defconfig: auto: remove auto defconfigs vgacon: Fix a UAF in vgacon_invert_region soc: qcom: Reset string table index for each dump collection request msm: adsprpc: Fix array index underflow problem ath10k: remove unnecessary code drm/msm/dsi: use correct enum in dsi_get_cmd_fmt btrfs: Remove extra parentheses from condition in copy_items() do_last(): fetch directory ->i_mode and ->i_uid before it's too late Conflicts: fs/namei.c scripts/gcc-wrapper.py Change-Id: Icfb78abcc0f2cf980b5c0ceaf40f108038b1b527
| * power: qpnp-fg-gen3: Fix warning with llvmKishor Krishna Bhat2020-07-10
| | | | | | | | | | | | | | Fix Wsizeof-array-div, type cast error when llvm is enabled. Change-Id: Ia01af9b84161ae4cad978d4b652b9e21107d9bbb Signed-off-by: Kishor Krishna Bhat <kishkris@codeaurora.org>
* | Merge tag 'LA.UM.8.4.r1-05700-8x98.0' of ↵Michael Bestas2020-07-23
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | https://source.codeaurora.org/quic/la/kernel/msm-4.4 into lineage-17.1-caf-msm8998 * tag 'LA.UM.8.4.r1-05700-8x98.0' of https://source.codeaurora.org/quic/la/kernel/msm-4.4: msm: adsprpc: Fix array index underflow problem profiler: Fix compilation errors fbdev: msm: fix ret value while translating to mdp format clk: msm: Fix compilation errors with clang ath10k: Fix compilation issue drm/msm/sde: Fix clang compilation in SDE driver ais: cam_soc_api: Fix compilation error msm: camera: reset atomic variable msm: v4l2loopback: Fix clang compilation error msm: Fix compilation error asoc: msm-8998: Add new FE's for TDM Primary diag: dci: Synchronize dci mempool buffers alloc and free headers_lib: rename Android.bp kbuild: skip install/check of headers right under uapi directories uapi: export all arch specifics directories kernel_headers: Fix headers not detected in incremental builds kernel headers: Update comparison logic Kbuild : Use no-export-headers to avoid exporting headers kernel_headers: kernel headers library package kbuild: replace genhdr-y with generated-y uapi: export all headers under uapi directories uapi: sound: move necessary sound headers under uapi kernel: Fix build errors with LLVM Revert "ARM: dts: msm: Remove cpu max frequency restriction on cold temp for msm8996." ARM: dts: msm: Remove cpu max frequency restriction on cold temp for msm8996. input: touchpanel: Fix compilation errors with clang asoc: msm-8998: TDM device grouping changes for capture path kbuild, x86: Track generated headers with generated-y kbuild: Remove stale asm-generic wrappers ARM: put types.h in uapi msm: ais: jpegdma: Fix uninitialized variable Makefile.headersinst: remove destination-y option msm: adsprpc: DSP device node to provide restricted access to ADSP/SLPI Conflicts: .gitignore drivers/mmc/core/sdio_cis.c Change-Id: I70cf2a0fbcfcbc834a21cf7fa8db9bd2e1c755b1
| * kernel: Fix build errors with LLVMSwetha Chikkaboraiah2020-05-21
| | | | | | | | | | | | | | | | This patch intends to fix compilation errors while building kernel with LLVM toolchain. Change-Id: I76c4f97d8a0efb44434d54fb07cae23b050d2003 Signed-off-by: Swetha Chikkaboraiah <schikk@codeaurora.org>
* | Revert "power: supply: qcom: Remove useless NULL checks against thresh array ↵Michael Bestas2020-07-23
| | | | | | | | | | | | in msm_bcl_enable" This reverts commit e888051ea71eea569dcfd0445bbd672585a39041.
* | power: qpnp-fg-gen3: Silence an instance of -Wsizeof-array-div in ↵Nathan Chancellor2020-02-02
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | clear_cycle_counter Clang warns: ../drivers/power/supply/qcom/qpnp-fg-gen3.c:2611:32: warning: expression does not compute the number of elements in this array; element type is 'u16' (aka 'unsigned short'), not 'u8 *' (aka 'unsigned char *') [-Wsizeof-array-div] sizeof(chip->cyc_ctr.count) / sizeof(u8 *), ~~~~~~~~~~~~~~~~~~~ ^ ../drivers/power/supply/qcom/qpnp-fg-gen3.c:2611:32: note: place parentheses around the 'sizeof(u8 *)' expression to silence this warning 1 warning generated. Odds are this is intentional given the casting so silence the warning. Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
* | power: supply: qcom: Remove useless NULL checks against thresh array in ↵Nathan Chancellor2020-02-02
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | msm_bcl_enable Clang warns: ../drivers/power/supply/qcom/msm_bcl.c:230:42: warning: address of array 'bcl[BCL_PARAM_VOLTAGE]->thresh' will always evaluate to 'true' [-Wpointer-bool-conversion] if (!bcl[i] || !bcl[BCL_PARAM_VOLTAGE]->thresh ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~ ../drivers/power/supply/qcom/msm_bcl.c:231:31: warning: address of array 'bcl[BCL_PARAM_CURRENT]->thresh' will always evaluate to 'true' [-Wpointer-bool-conversion] || !bcl[BCL_PARAM_CURRENT]->thresh) { ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~ 2 warnings generated. Fixes: 77dd35597191 ("qpnp: Add snapshot of some qpnp, regulator and charger drivers") Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
* | Fix bugs about step-chg-jeitaEssential kernel team2019-12-23
|/ | | | | | | | 1. JEITA FV compensation cannot work 2. Cannot charge when battery capacity is 0% 3. Wrong debug message Change-Id: I32ecb77b4c1dd8073cbf5aec070c3e6fcadc1dd2
* power: battery: Initialize work struct before cancelling workUmang Chheda2019-10-15
| | | | | | | | Votable callback accesses work structure as part of their callback, initialize work before creation of votables. Change-Id: I91741b3d54c73aab5c695a31292a32752edc77cd Signed-off-by: Umang Chheda <uchheda@codeaurora.org>
* power: qpnp-smbcharger: Change ordering of EXTCON_USB_SPEEDChetan C R2019-07-10
| | | | | | | | USB presence is notified before setting EXTCON_USB_SPEED, this prevents the SS PHY resume. Fix this ordering. Change-Id: I4ad7bc065b968c6a7a461a2a436b7f2c755bab67 Signed-off-by: Chetan C R <cravin@codeaurora.org>
* Merge "power: qpnp-smbcharger: Add support for dpdm pulsing"Linux Build Service Account2019-06-03
|\
| * power: qpnp-smbcharger: Add support for dpdm pulsingKavya Nunna2019-05-29
| | | | | | | | | | | | | | | | | | The charger for msm8996 doesn't support HVDCP detection by default. It depends on usb driver for dpdm pulsing, set the dpdm property so that usb driver can initiate pulsing. Change-Id: Ib2561f0429338375982dafbf8e71fd2d7ad32ef0 Signed-off-by: Kavya Nunna <knunna@codeaurora.org>
* | power: qpnp-smbcharger: Add voltage now property in usb psyKavya Nunna2019-05-22
| | | | | | | | | | | | | | Add VOLTAGE_NOW power supply property to expose the USB voltage. Change-Id: I3041aafaf365c205e53451a5d4ee79dcfe6b78bf Signed-off-by: Kavya Nunna <knunna@codeaurora.org>
* | power: qpnp-smbcharger: Add support for float charger detectionKavya Nunna2019-05-21
|/ | | | | | | | | | PMI8996 charger does not detect FLOAT adapter. To support it, FLOAT detection is done by the USB driver and notified to PMIC by reporting -ETIMEDOUT through the CURRENT_MAX power-supply property. Charger then configures the charge current to 1500mA. Change-Id: I6abd4668b41988d98465f00402aa2be558054cdd Signed-off-by: Kavya Nunna <knunna@codeaurora.org>
* drivers: qpnp-smbcharger: Fix USB3.0 device does not enumerate in SS modeNaitik Bharadiya2019-05-02
| | | | | | | | | | The max speed for the USB device is high speed. So the device is always enumerated in high speed indpendent of the connection. Fix this by setting the EXTCON_USB_SPEED to 1 which in turn sets the max speed as super speed. Change-Id: I9bf935add569f70c14bf9cd4197d6e86163da6f5 Signed-off-by: Naitik Bharadiya <bharad@codeaurora.org>
* power: qpnp-smb2: Reverse the sign of CURRENT_NOWKavya Nunna2019-02-20
| | | | | | | | Userspace expects CURRENT_NOW to report positive value when battery is charging and negative during discharge. Change-Id: I3490ab34699035aea986910683e3244350def73e Signed-off-by: Kavya Nunna <knunna@codeaurora.org>
* drivers: qpnp-smbcharger.c : Bring in from 4.9Shilpa Suresh2019-02-15
| | | | | | | | Bring in the qpnp-smbcharger.c file from 4.9 kernel to 4.4 kernel branch. Change-Id: I2ee8342a034e77b67b2c2a3851b2babb67081551 Signed-off-by: Shilpa Suresh <sbsure@codeaurora.org>
* drivers: fix 32bit compilation for QPNP driversTirupathi Reddy2019-02-15
| | | | | | | | | | Use div_s64() for signed 64bit division with 32bit divider and div64_s64() for signed 64bit division with 64bit divider. CRs-Fixed: 2170745 Change-Id: I1dcf9e83ba492559df2a8b6be9484196f53d6193 Signed-off-by: Tirupathi Reddy <tirupath@codeaurora.org> Signed-off-by: Shilpa Suresh <sbsure@codeaurora.org>
* power: qpnp-fg: Add snapshot of the FG driverVamshi Krishna B V2019-02-15
| | | | | | | | | | | | | | | This is the snapshot of the fg driver as of msm-3.18 kernel 'commit d03fafd27cf9 ("qpnp-fg: fix integer overflow")' Fix compilation errors on msm-4.9 by replacing deprecated do_div() calls and replace spmi_dev with pdev. Also fix checkpatch errors. CRs-Fixed: 2246295 Change-Id: I8f946c8919321b9f0df2bc570dd191904f690dd7 Signed-off-by: Vamshi Krishna B V <vbv@codeaurora.org> Signed-off-by: Shilpa Suresh <sbsure@codeaurora.org>
* power: qpnp-fg: Fix general coding style issuesKiran Gunda2019-02-05
| | | | | | | | | Fix the general coding style issues reported by the checkpatch tool. Change-Id: I61e99f6ec9873478fe53a0fb409fe5972a907534 Signed-off-by: Kiran Gunda <kgunda@codeaurora.org> Signed-off-by: Shilpa Suresh <sbsure@codeaurora.org>
* power: smb2: expose CHARGE_FULL/CYCLE_COUNT propertiesAshay Jaiswal2018-07-16
| | | | | | | | | | | Expose CHARGE_FULL/CYCLE_COUNT properties via "battery" power_supply class. While at it, create a common function to read properties from "bms" power_supply_class. Change-Id: I377ecea6e62c1eb8716982b79ec4c236c14bc2d5 Signed-off-by: Ashay Jaiswal <ashayj@codeaurora.org>
* power: battery: Add support for FCC steppingUmang Agrawal2018-06-14
| | | | | | | | | | | | | On some PMIC designs a sudden increase or decrease in FCC can impact the PMIC die thermally, causing the XO to drift. Introduce a logic which gradually ramps up/down the FCC whenever there is a change in its value, this spreads out the thermals over-time. The default step rate is 100mA/sec and the feature can be enabled using the DT property "qcom,fcc-stepping-enable". Change-Id: I59ee932b60766208912054f7031cd34151fb5deb Signed-off-by: Umang Agrawal <uagrawal@codeaurora.org>
* power: smb-lib: Modify usb max voltage reflected for QC 3.0 chargerUmang Agrawal2018-06-07
| | | | | | | | | Modify usb VOLTAGE_MAX property's reporting function to add support for QC 3.0 chargers to reflect maximum VBUS voltage that can be attained by QC3.0 chargers. Change-Id: I45c15b4d8daab6eeec5c0bc5b0c19c4baa4ca15f Signed-off-by: Umang Agrawal <uagrawal@codeaurora.org>
* Merge "power: qpnp-fg-gen3: Restore recharge SOC only when not in JEITA"Linux Build Service Account2018-05-25
|\
| * power: qpnp-fg-gen3: Restore recharge SOC only when not in JEITASubbaraman Narayanamurthy2018-05-24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, recharge SOC is adjusted (lowered) based on the SOC where charging terminates. It is restored back to the original threshold when the charge termination condition goes away. This works fine in most cases. However there are certain conditions where the charger fluctuates between fast and taper regions along with the charge termination status. Handle this by checking if battery is out of JEITA as well before restoring back the original recharge SOC threshold. CRs-Fixed: 2213369 Change-Id: Ic64151ddbbff09c26d6ebfcd3e6d4e70e0be8c9d Signed-off-by: Subbaraman Narayanamurthy <subbaram@codeaurora.org>
* | power: smb-lib: Allow PD enable/disable for typeC devices onlyUmang Agrawal2018-05-21
|/ | | | | | | | | | | Currently if pd is not allowed, we force pd_active to 0 inorder to run the legacy workaround and rerun apsd. But, this workaround is required only for typeC devices. Add a check to prevent PD disable for micro usb device. Change-Id: I842166f66065c281ab366da327080b09a5e282e1 Signed-off-by: Umang Agrawal <uagrawal@codeaurora.org>
* Merge "battery: handle early/late suspend/resume of i2c bus"Linux Build Service Account2018-05-16
|\
| * battery: handle early/late suspend/resume of i2c busVic Wei2018-04-28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The i2c bus could suspend right after the parallel charger's suspend i.e. no i2c access available during suspend_noirq stages. Similarly on the resume path, there is no i2c access until resume() callback. However the PMI can handle interrupts right before its own suspend_irq and right after its own resume_irq. Those interrupts could invoke transactions for parallel charger but that is either too late or very early for any i2c transactions. To fix this, hold a wakelock once parallel is enabled and release the wakelock 5 seconds after parallel is disabled. Change-Id: Id517b5afca090d7f3ccb31e640512bdb9f902377 Signed-off-by: Harry Yang <harryy@codeaurora.org> Signed-off-by: Vic Wei <vwei@codeaurora.org>
* | power: smb-lib: Enable TypeC crude sensor PBS WA based on PMIC typeUmang Agrawal2018-05-08
| | | | | | | | | | | | | | | | Enable TypeC crude sensor PBS WA based on PMIC type since it is required for PM660 and PMI8998 only. Change-Id: Ib4f170ddba893e5b96372eecee9b9b74cb2a97e2 Signed-off-by: Umang Agrawal <uagrawal@codeaurora.org>
* | power: smb-lib: Add support for SW based OV detectionUmang Agrawal2018-05-08
| | | | | | | | | | | | | | | | | | Add support for software based USBIN OV detection, once OV condition is detected, software will force USBIN to 5V and continue charging with 5V. Change-Id: Ie8f00f69db4ac6330d9da82b3455e4efab43861a Signed-off-by: Umang Agrawal <uagrawal@codeaurora.org>
* | smb-lib: add support of DP/DM pulsing for fix 5V, 9V and 12VUmang Agrawal2018-05-08
|/ | | | | | | | | This change will enable userspace to control adapter's output voltage. Userspace can force adapter's output voltage to 5V/9V/12V. Change-Id: I4a60a681c136df6864294dbd19849503a2be2e7b Signed-off-by: Umang Agrawal <uagrawal@codeaurora.org>
* power: smb1351-charger: Fix check in shutdown path for parallel disableUmang Agrawal2018-01-22
| | | | | | | | | | Change in parameter checked while disabling parallel charger in the shutdown path as the charger present flag is not updated in parallel charger mode. CRs-Fixed: 2172956 Change-Id: I79ff909abae5dcc2692c69a81ea70ee56ca34522 Signed-off-by: Umang Agrawal <uagrawal@codeaurora.org>
* Merge "power: qpnp-fg-gen3: add support for configuring cutoff current"Linux Build Service Account2018-01-19
|\
| * power: qpnp-fg-gen3: add support for configuring cutoff currentSubbaraman Narayanamurthy2017-12-20
| | | | | | | | | | | | | | | | | | Add support to configure cutoff current that will be used for cutoff SOC estimate. CRs-Fixed: 2160773 Change-Id: I26730f35659a227717a33682683746f13f1175eb Signed-off-by: Subbaraman Narayanamurthy <subbaram@codeaurora.org>
* | Merge "power: smb1351-charger: Disable parallel charging in shutdown path"Linux Build Service Account2018-01-19
|\ \
| * | power: smb1351-charger: Disable parallel charging in shutdown pathUmang Agrawal2018-01-09
| | | | | | | | | | | | | | | | | | | | | | | | | | | Add parallel charger disabling logic to the shutdown path for disabling parallel charger earlier to prevent over volatge lockout issues. Change-Id: I2f6838780f35b0a86baaa663d320316e51e38675 Signed-off-by: Umang Agrawal <uagrawal@codeaurora.org>
* | | power: qpnp-fg-gen3: Adjust recharge SOC after early terminationSubbaraman Narayanamurthy2018-01-15
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, recharge SOC is adjusted based on the SOC at which charge termination occurs. However, it gets reset back to the original threshold only if input is removed. This does not work well if charging resumes again once the battery is out of JEITA as the recharge SOC threshold stays configured at a lower value. Fix it by adjusting recharge SOC to the original threshold once charging begins. CRs-Fixed: 2163058 Change-Id: I07c714d32ba0005d3b0ff61142928eda58f049d0 Signed-off-by: Subbaraman Narayanamurthy <subbaram@codeaurora.org>