summaryrefslogtreecommitdiff
path: root/drivers/power (follow)
Commit message (Collapse)AuthorAge
...
* | | | | | Merge "defconfig: msmcortex: Enable FG_GEN3 driver"Linux Build Service Account2016-07-27
|\ \ \ \ \ \
| * | | | | | power: qcom-charger: fix possible out of bounds access for GEN3 FG driverSubbaraman Narayanamurthy2016-07-27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix the following things in fg-util.c which is included by GEN3 FG driver: - Possible out of bounds access in fg_sram_dfs_reg_write() when using bytes_read from sscanf - Fix uninitialized usage of variable in write_next_line_to_log() Change-Id: If9e7ba5632d1b5f99d91bda6276d9123c37e4dc7 Signed-off-by: Subbaraman Narayanamurthy <subbaram@codeaurora.org>
* | | | | | | Merge "smb-lib: account for Jeita while distributing FCC"Linux Build Service Account2016-07-27
|\ \ \ \ \ \ \ | | |/ / / / / | |/| | | | |
| * | | | | | smb-lib: account for Jeita while distributing FCCAbhijeet Dharmapurikar2016-07-20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The master charger has built in Jeita compensation where it reduces FCC when the battery is in cool/warm Jeita threshold. This skews the distribution of FCC between master and slave in parallel configuration. Fix this by checking if soft Jeita is active. If so reduce the requested fcc so that master and slave get reduced share. However, since master is reducing its FCC, add the reduction again to its share so the net FCC on master is as per the distribution. This also calls to handle the battery temperature change interrupt and redistribute FCC. Change-Id: I413cc0231a9125422efc71ed67717921af939959 Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
| * | | | | | smb-lib: improve handling of usbin plugin interruptAbhijeet Dharmapurikar2016-07-20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently the code disables the dpdm regulator if VBUS is present and regulator is enabled. It could happen that the charger oscillates its VBUS as it settles and based on the delay's in responding to an interrupt, the software could read vbus_present while the regulator was enabled earlier causing an incorrect disable of the dpdm regulator. It is required to ignore the interrupt in such cases. Change-Id: I882780c1bcbc7713973eda5383291d891787f144 Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
* | | | | | | Merge "qcom-charger: smb-lib: fix secure register writes"Linux Build Service Account2016-07-27
|\ \ \ \ \ \ \
| * | | | | | | qcom-charger: smb-lib: fix secure register writesNicholas Troast2016-07-18
| | |_|/ / / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently the entire address is compared to a known secure boundary offset leading to the address always being larger than the offset. Mask the address such that only the offsets are compared. Change-Id: I388d7f809f670c6db45b933d44d15168ae84f061 Signed-off-by: Nicholas Troast <ntroast@codeaurora.org>
* | | | | | | Merge "qcom-charger: qpnp-smb2: update battery charging status on input suspend"Linux Build Service Account2016-07-27
|\ \ \ \ \ \ \ | |_|_|/ / / / |/| | | | | |
| * | | | | | qcom-charger: qpnp-smb2: update battery charging status on input suspendNicholas Troast2016-07-12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When input is suspended the battery will be discharging. Currently consumers are not notified that the charging status has changed. Send a power supply changed event for the battery power supply to notify consumers that it has changed. Change-Id: I6cdf63812cc9dafbb0365c05761cfae18446d31f Signed-off-by: Nicholas Troast <ntroast@codeaurora.org>
* | | | | | | Merge "ARM: dts: msm: add FG GEN3 device on pmicobalt"Linux Build Service Account2016-07-27
|\ \ \ \ \ \ \ | |_|_|_|/ / / |/| | | | | |
| * | | | | | power: qcom-charger: add driver for GEN3 fuel gaugeSubbaraman Narayanamurthy2016-07-26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | GEN3 FG (fuel gauge) is a new hardware peripheral which cannot be supported along with existing GEN1/GEN2 FG supported under qpnp-fg.c. Some of the differences are listed below. - No conventional memory access for accessing SRAM - No OTP region for battery profile - FTRIM registers will be loaded to SRAM - SRAM partitioning and address format got changed completely - Battery id detection done by RR_ADC - Encoding/Decoding changes for battery parameters Hence add a new driver to support this GEN3 FG. This driver reads the battery parameters like voltage, current, temperature, resistance etc. acquired by the FG hardware and expose to the userspace through a power supply class device. Change-Id: Ibcd6e49c7dc7c3520527bcf9553296e846fb7458 Signed-off-by: Subbaraman Narayanamurthy <subbaram@codeaurora.org>
* | | | | | | Merge "qcom-charger: smb2: configure input from wipower"Linux Build Service Account2016-07-26
|\ \ \ \ \ \ \ | |/ / / / / / |/| | | / / / | | |_|/ / / | |/| | | |
| * | | | | qcom-charger: smb2: configure input from wipowerAbhijeet Dharmapurikar2016-07-20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Wipower feeds to the DCIN input of the smb2 charger and relies on input current configurations on six different voltage ranges for optimal power draw. Provide means to configure the current limits in them via a device tree setting. Change-Id: I81d1dc3ed1d588d67525b15120e7d8b947536099 Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
* | | | | | Merge "of_batterydata: Pass battery id directly to find battery profile"Linux Build Service Account2016-07-22
|\ \ \ \ \ \ | |/ / / / / |/| | | | |
| * | | | | of_batterydata: Pass battery id directly to find battery profileSubbaraman Narayanamurthy2016-07-21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently power supply name is passed to get the battery profile in of_batterydata_get_best_profile(). This creates a dependency of waiting for the driver that has the power supply class device. Improve this by passing the battery id directly to the API. This way, getting battery id will be the responsibility of caller. CRs-Fixed: 1043798 Change-Id: I7a8c2b2fcc9b43e2e858114f7312fccf96dc3f78 Signed-off-by: Subbaraman Narayanamurthy <subbaram@codeaurora.org>
* | | | | | qcom-charger: smb138x-charger: change power supply type to usb parallelNicholas Troast2016-07-19
| |_|/ / / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently the type of the parallel power supply is POWER_SUPPLY_TYPE_BATTERY. Change it to POWER_SUPPLY_TYPE_USB_PARALLEL. Change-Id: Ic7652e43781f39d3137fb55f2fec2423e457fac4 Signed-off-by: Nicholas Troast <ntroast@codeaurora.org>
* | | | | qcom-charger: update parallel charging states after bootHarry Yang2016-07-15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If a USB charger is already attached before the master charger probes, the master will miss updating parallel charging states. ICL and charge state change interrupts get triggered before their handlers are registered. Hence these interrupts will not be handled. Obtain the state of missing interrupts by polling status registers. If parallel charging is ready on master side before the parallel charger probes, then parallel charging will not be enabled. Check if parallel charging is ready once the parallel charger probes so parallel charging can be enabled immediately. CRs-Fixed: 1033688 Change-Id: Ic91baeaeb7410b6f265b8bfa8e31e2bcff8dfce2 Signed-off-by: Harry Yang <harryy@codeaurora.org>
* | | | | Merge "qcom-charger: show correct battery status while charging via wireless"Linux Build Service Account2016-07-15
|\ \ \ \ \
| * | | | | qcom-charger: show correct battery status while charging via wirelessHarry Yang2016-07-13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | POWER_SUPPLY_STATUS shows 'Discharging' when DCIN is the only charging input, because current input online report is solely based on USB. DCIN is included to fix the issue. CRs-Fixed: 1034899 Change-Id: I58b8ca712a7900caf37bf79f5281fb3b6dab80f2 Signed-off-by: Harry Yang <harryy@codeaurora.org>
* | | | | | Merge "qcom-charger: qpnp-smb2: enable some irqs as a wakeup source"Linux Build Service Account2016-07-15
|\ \ \ \ \ \ | |_|/ / / / |/| | | | |
| * | | | | qcom-charger: qpnp-smb2: enable some irqs as a wakeup sourceNicholas Troast2016-07-13
| |/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Parallel charging requires the device to wake up when entering taper charging state in order to reduce the parallel charger's FCC. Enable the chg-state-change irq as a wakeup source. Parallel charging requires the device to wake up when the USB ICL changes in order to enable or disable. Enable the usbin-icl-change irq as a wakeup source. When a change is detected on the Type-C CC pins the device should wake up to handle the change. Enable the type-c-change irq as a wakeup source. When VBUS is detected the device should wake up to adjust the state of DP/DM to allow for proper APSD. Enable the usbin-plugin irq as a wakeup source. When APSD finishes the device should wake up to notify the USB, and PD drivers. Enable the usbin-src-change irq as a wakeup source. CRs-Fixed: 1030478 Change-Id: I7cdc08d973b5ea711c877f7f2eabbe0fdbbf6fa0 Signed-off-by: Nicholas Troast <ntroast@codeaurora.org>
* / / / / qcom-charger: smb-lib: fix battery health statusHarry Yang2016-07-12
|/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Battery health shows 'good' in the ranges of both cold and overheat temperatures. This change fixes a bug in its get_prop function. CRs-Fixed: 1040848 Change-Id: If6e6f60170cfb4769456de4c4428831a29489da2 Signed-off-by: Harry Yang <harryy@codeaurora.org>
* / / / qcom-charger: qpnp-smb2: expose AICL settled current through USB psyNicholas Troast2016-07-06
|/ / / | | | | | | | | | | | | | | | | | | | | | There is a requirement to expose the settled input current limit via a power supply property. Add it. Change-Id: I1a7b77e3a64da245afd0c4f73c8d04627a061ada Signed-off-by: Nicholas Troast <ntroast@codeaurora.org>
* | | msm-core: Move get_user out side critical sectionMaulik Shah2016-07-05
| | | | | | | | | | | | | | | | | | | | | | | | | | | get_user is not needed inside critical section. Move it outside to avoid kernel crash due to sleeping function called from invalid context. Change-Id: I29a54dca6620dc75356067ce6ff9a0931b4d0724 Signed-off-by: Maulik Shah <mkshah@codeaurora.org>
* | | qcom-charger: qpnp-smb2: Remove unnecessary watchdog interruptsHarry Yang2016-06-28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Watchdog interrupts bark and snarl get triggered frequently, causing flood messages when enabled in debug_mask. However, neither irq is essentially being used in charger driver. Remove both interrupts by setting their irq handlers to NULL, and skipping irq registration in case of NULL handlers. CRs-Fixed: 1033724 Change-Id: I9414f3238d1568ec29973a7ec74054c779a7a196 Signed-off-by: Harry Yang <harryy@codeaurora.org>
* | | qcom-charger: introduce parallel charging supportHarry Yang2016-06-22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Parallel charging increases charging capacity and efficiency by distributing the current between two charging chips. PMI8998 feeds the parallel charger via its MID input, and handles input current limiting in its front-porch FET. As master charger, PMI8998 is responsible for enabling/disabling the parallel charger, and the FCC distribution. To enable parallel charging in software, the following conditions must be met: - Strong USBIN input - Battery present - In fast or taper charging state - Attached UFP source While the enabling/disabling is always under the control of software the disabling can also be done by hardware in case of fault. Battery current is usually fixed to the battery rating. The FCC distribution is simple, a split of 50/50 by default, which can be changed in runtime. When taper irq kicks in, the algorithm reduces parallel FCC by 25%. This puts the charging back in constant current phase until the next one happens where again the algorithm reduces the FCC by 25%. This continues until the parallel FCC drops to 500mA. At that time parallel charging is disabled and master continues charging the rest of constant voltage phase. CRs-Fixed: 1023703 1030934 Change-Id: Ied7c31d5913df94a288d36ecf06d081d32e07396 Signed-off-by: Harry Yang <harryy@codeaurora.org> Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
* | | qcom-charger: introduce SMB138X charger driverNicholas Troast2016-06-17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This driver supports the SMB138X charger device. This charger peripheral is common among other chips, therefore the driver uses the smb library to support all common functionality. Register access is provided by the parent device via regmap. Interrupts are controlled by the parent device, and handlers are registered by the SMB138X charger driver. The power supply framework is used to communicate battery and usb properties to userspace and other driver consumers such as fuel gauge and USB. VBUS and VCONN regulators are registered for supporting OTG, and powered Type-C cables respectively. CRs-Fixed: 1023141 Change-Id: I119d33cdfdfc874b5d7f6137618ee3e590c72064 Signed-off-by: Nicholas Troast <ntroast@codeaurora.org>
* | | qcom-charger: add two irqs for parallel chargingHarry Yang2016-06-17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add icl handler to report USB input current limit, and charge handler to report charging state changes, providing input to parallel charging algorithm. CRs-Fixed: 1023703 Change-Id: Id51ad3dbd6e2637c105db681082eea98ab161a50 Signed-off-by: Harry Yang <harryy@codeaurora.org>
* | | qcom-charger: smb-lib: add votable for parallel chargingHarry Yang2016-06-17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add a votable structure - one veto to disable or unanimous approval to enable. Provide an open and flexiable machanism to enable/disable parallel charging based on various dynamically changing factors. CRs-Fixed: 1023703 Change-Id: I552467645d6f8f633afe273b173a636e0eb396a7 Signed-off-by: Harry Yang <harryy@codeaurora.org>
* | | qcom-charger: smb-lib: add wakesource votable supportHarry Yang2016-06-17
| | | | | | | | | | | | | | | | | | | | | | | | | | | Implement wake votable on top of PM wakesource APIs for PMIC voters to hold system awake. CRs-Fixed: 1023703 Change-Id: If2c8f65d932f2f0bdad9f0f026d440a2089cec5f Signed-off-by: Harry Yang <harryy@codeaurora.org>
* | | qcom-charger: smb-lib: differentiate between parallel and standalone modesNicholas Troast2016-06-15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Charger drivers can have different operating modes such as standlone, or parallel slave. Add a mode variable to support different operating modes. Change-Id: I885289a1eec68335645912c3ecbbe91a85836647 CRs-Fixed: 1023141 Signed-off-by: Nicholas Troast <ntroast@codeaurora.org>
* | | qcom-charger: pmic-voter: destroy only valid votablesNicholas Troast2016-06-15
| | | | | | | | | | | | | | | | | | | | | | | | | | | Votables that are NULL or have already been destroyed need not be destroyed again. Return immediately when destorying NULL votables. CRs-Fixed: 1023141 Change-Id: I8e367dbe7acf72471a5a474f0e2a00a4004fcbfb Signed-off-by: Nicholas Troast <ntroast@codeaurora.org>
* | | qcom-charger: smb-lib: add get charge param and usb suspendNicholas Troast2016-06-15
| | | | | | | | | | | | | | | | | | | | | | | | | | | The parallel charger does not use voting, therefore register getter and setter functions need to be created or exposed. CRs-Fixed: 1023141 Change-Id: I96a4877196be78c0eeecc3fc08419e8990572aaa Signed-off-by: Nicholas Troast <ntroast@codeaurora.org>
* | | power: qcom: Move power table notification outside of critical sectionArchana Sathyakumar2016-06-15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since the blocking chain notifiers can be called from process context, the notification must not be sent from within a critical section. Move the blocking notification outside the critical section. Change-Id: Ia5679310fc59f25643e7c8d572cc230d262c5937 Signed-off-by: Archana Sathyakumar <asathyak@codeaurora.org>
* | | qcom-charger: enable qnovo bit in the qpnp-smb2 driverAbhijeet Dharmapurikar2016-06-15
| | | | | | | | | | | | | | | | | | | | | | | | | | | The charger peripheral has a bit to control Qnovo pulse engine. Enable it. CRs-Fixed: 1018090 Change-Id: I2ddea8adf1aa9d999cc2fd3fd4f0e0f830147d4c Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
* | | qcom-charger: add qnovo driverAbhijeet Dharmapurikar2016-06-15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Qnovo hardware module controls battery charging pulses. Pulse characteristics are programmed via sysfs files, this driver translates those values to register values and writes to appropriate registers. CRs-Fixed: 1018090 Change-Id: I2573f719f4b2c2fa9a169659a65433fb834ea74e Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
* | | qcom-charger: qpnp-smb2: update usb type on PD_ACTIVEHarry Yang2016-06-09
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There is a race condition between setting PD_ACTIVE = 0 and when losing CC. If PD_ACTIVE is not set to 0 by the time the TYPE_C interrupt fires on disconnect then the POWER_SUPPLY_TYPE will not be set to UNKNOWN. Instead of relying on PD_ACTIVE being set to 0 before the TYPE_C interrupt fires, just update the type upon PD_ACTIVE being set. CRs-Fixed: 1017798 Change-Id: Icd62b9d98d5763d209c7de897653f19f8031e236 Signed-off-by: Harry Yang <harryy@codeaurora.org>
* | | pmic-voter: disassociate device from votablesAbhijeet Dharmapurikar2016-06-08
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently the pmic votables need a device to be created. Votables should be able to work on device less code. Remove the need for device and instead use a void pointer to be passed back to the callback. CRs-Fixed: 1018090 Change-Id: If5dafbcc0d88596332b794ad5b6fdc1f9ff98a45 Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
* | | pmic-voter: remove default valueAbhijeet Dharmapurikar2016-06-08
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The default value was introduced to prevent crashes on the clients where it couldn't handle situations when there were no voters. The default value led to many complicated scenarios in the votable implementation. Remove the concept of default value and return error when there are no votes. Update all the clients to handle error values from votables. Also invoke the callback to inform about no active voters. CRs-Fixed: 1018090 Change-Id: I81f5974f81a697f3698bc58df1d3ed59fa2579a7 Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
* | | pmic-voter: improve pmic-voter api implementationAbhijeet Dharmapurikar2016-06-08
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently the pmic-voter api assumes that the clients are represented as unique integers. Using strings instead of integers adds flexibility. - It enables the votable to be shared across multiple drivers without having a common client enum - Debug prints become more useful While at it - remove the use of num_clients in the apis. All of them default to NUM_CLIENTS. - Create a list of all the votables, this allows for searching for a specific votable. - Error if a votable is already created with the same name earlier. - Add debug prints about current clients and effective results - Remove passing in last_client and last_client_id in the callback. These parameters go unused in all the usecases. - Since clients are assigned sequentially and that they cannot unregister from a votable (clients can only disable their votes, but they cannot remove themselves), a null string in the client string array means there are no more clients. Use this to speed up result calculation by stopping at the id with a null string. - Refactor the vote() implementation. Currently the SET_ANY case flows differently than MIN or MAX, make them uniform. - Create an api to call the callback without casting new votes. CRs-Fixed: 1018090 Change-Id: I8e2bc3366ec12e8485e4be86ee56ba5e4d113c3c Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
* | | qcom-charger: smb2: allow vfloat and fcc via psy propertiesAbhijeet Dharmapurikar2016-06-07
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently the charger driver sets the charge current based on device tree property. Allow setting fast charge current (fcc) via power supply (psy) property. Moreover the current voter for fcc is a min voter, change that to max voter so that values above what device tree has set can be used. Similarly, introduce a max voter for battery float voltage (vfloat) and set it to defaults via device tree. CRs-Fixed: 1018090 Change-Id: I691984543f8beb3c52d3d578c7cc311c285a1fcc Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
* | | qcom-charger: use mutex instead of spinlock when calling the regmap APIHarry Yang2016-06-02
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Slow buses regmap holds a mutex lock, while for fast buses regmap holds a spinlock. In order to remain compatible with slow buses spinlocks should not be held before calling the regmap API. CRs-Fixed: 1017800 Change-Id: I93aa6df8c7ec1916ba23d21d92e477510db949da Signed-off-by: Harry Yang <harryy@codeaurora.org>
* | | qcom-charger: Don't automatically set USB_PD type when PD_ACTIVE=1Jack Pham2016-05-26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The POWER_SUPPLY_PROP_PD_ACTIVE property is intended to be a flag set whenever the PD PHY is in use. But this includes attempts to establish communication, which may involve trying to perform a hard reset to see if the port partner responds. Thus updating the psy_desc.type field to 'USB_PD' right when PD_ACTIVE=1 is premature as the port partner may not be PD-capable and it could be un-set. Instead allow the PD driver to directly update POWER_SUPPLY_PROP_TYPE only after it is sure PD communication has succeeded. Change-Id: Iae6804bcb3121e0852ec5d14d0939623b97a6e67 Signed-off-by: Jack Pham <jackp@codeaurora.org>
* | | qcom-charger: qpnp-smb2: disable Type-C factory modeNicholas Troast2016-05-24
| | | | | | | | | | | | | | | | | | | | | | | | | | | Type-C factory mode is unreliable and causes the Type-C mode to be incorrectly detected in some cases. Disable it. CRs-Fixed: 1019313 Change-Id: I5f66be80899c33816c886df526db9e50d7e9aff9 Signed-off-by: Nicholas Troast <ntroast@codeaurora.org>
* | | power: bcl_peripheral: Support new bcl peripheralRam Chandrasekar2016-05-12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add support for the new version of bcl peripheral introduced in PMIcobalt. The new support includes, 1. support the new address space 2. set the new Ibat too high threshold 3. set the new vbat low comparator threshold 4. set the new vbat too low comparator threshold 5. enable the LMH DCVSh monitor algorithm, when the thresholds are configured. CRs-Fixed: 1010115 Change-Id: I6dad908bbc673ff1b7f7d3d05fecdfc8f48b5815 Signed-off-by: Ram Chandrasekar <rkumbako@codeaurora.org>
* | | power: bcl: snapshot of battery_current_limit driverRam Chandrasekar2016-05-12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This snapshot is taken as of msm-3.18 commit 978d23c. Accommodate the changes in the input arguments for power_supply_register() API and use power_supply_get_property() API to get the SoC information from BMS. CRs-Fixed: 1010115 Change-Id: I1af565ffd3b61e424aca1cbd5ec6cbef8d89f1fa Signed-off-by: Ram Chandrasekar <rkumbako@codeaurora.org>
* | | qcom-charger: introduce QPNP SMB2 charger driverNicholas Troast2016-05-10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The QPNP SMB2 charger driver supports the charger peripheral present in the PMICOBALT chip. This charger peripheral is common among other chips, therefore the driver uses the smb library to support all common functionality. Register access is provided by the parent device via regmap. Interrupts are controlled by the parent device, and handlers are registered by the QPNP SMB2 charger driver. The power supply framework is used to communicate battery and usb properties to userspace and other driver consumers such as fuel gauge, USB, and USB-PD. VBUS and VCONN regulators are registered for supporting OTG, and powered Type-C cables respectively. CRs-Fixed: 1005389 Change-Id: I160ce3c8caae6999f52590099cf6d1de957dbbaf Signed-off-by: Nicholas Troast <ntroast@codeaurora.org> Signed-off-by: Harry Yang <harryy@codeaurora.org>
* | | qcom-charger: introduce SMB charger libraryNicholas Troast2016-05-10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A library of common structures and functions that should be used by all charger drivers that support an SMB charger peripheral. The library includes high level register read/write access, interrupt handlers, voter callbacks, and power supply property getters. It should be extended with any functionality that can be leveraged by an SMB charger peripheral. All drivers that support an SMB charger peripheral should define their own struct smb_charger to interface with the library. CRs-Fixed: 1005389 Change-Id: I36796332af667874c1246ec35984122d45de6938 Signed-off-by: Nicholas Troast <ntroast@codeaurora.org> Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org> Signed-off-by: Harry Yang <harryy@codeaurora.org>
* | | qcom-charger: pmic-voter: allow NULL callbacksNicholas Troast2016-05-10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Consumers may not want to specify a callback, especially for boolean votables which only care about the state of the client votes rather than reacting to a change in the effective result. CRs-Fixed: 1005389 Change-Id: I72274126a382ef8e32d89e1e8aa98348aaaac420 Signed-off-by: Nicholas Troast <ntroast@codeaurora.org>
* | | power: move QTI charger drivers to a new sub-directory againNicholas Troast2016-05-06
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The original commit was reverted due to conflicts in the kernel upgrade process. Now that the upgrade is complete we can introduce this commit again. Original commit: commit 8e10bff71301 ("power: move QTI charger drivers to a new sub-directory qcom-charger") QTI charger drivers have outgrown their home in power and deserve their own sub-directory. Move all QTI charger drivers and their dependencies to a new sub-directory of power called qcom-charger. CRs-Fixed: 1001767 Change-Id: I5465a944a79f622ddf69534075b067db0fb10c95 Signed-off-by: Nicholas Troast <ntroast@codeaurora.org>