Use the property POWER_SUPPLY_PROP_MAX_PULSE_ALLOWED to
specify the maximum pulses which can be supported for
HVDCP3. This is used to limit the VBUS to a max value.
CRs-Fixed: 1047232
Change-Id: I85677ba574ff3da2a38e06a2f25a43e80ae150d6
Signed-off-by: Anirudh Ghayal <aghayal@codeaurora.org>
Signed-off-by: Vamshi Krishna B V <vbv@codeaurora.org>
Anirudh Ghayalauthored and Vamshi Krishna B Vcommited 2018-04-23 20:55:27 +05:30
Currently, cycle_count and cycle_count_id are used to get the
cycle counter per SOC bucket. Add a string property cycle_counts
that can return all the cycle counters at once without the client
setting cycle_count_id.
CRs-Fixed: 2225336
Change-Id: If3014a4f865f94dc0895c1f5f7068ce936a0b62d
Signed-off-by: Subbaraman Narayanamurthy <subbaram@codeaurora.org>
Signed-off-by: Vamshi Krishna B V <vbv@codeaurora.org>
Subbaraman Narayanamurthyauthored and Vamshi Krishna B Vcommited 2018-04-23 12:09:16 +05:30
Currently, HVDCP3 detection is enabled by default. Add support
to control it dynamically through a power supply property
"allow_hvdcp3".
CRs-Fixed: 991060
Change-Id: Id283b572cdb51094ad53d590e230104dc3e1beb7
Signed-off-by: Subbaraman Narayanamurthy <subbaram@codeaurora.org>
Subbaraman Narayanamurthyauthored and Vamshi Krishna B Vcommited 2018-04-03 17:02:58 +05:30
Add POWER_SUPPLY_PROP_TOGGLE_STAT to enable userspace to toggle
the STAT pin.
CRs-Fixed: 2200340
Change-Id: I10eead62cf8b8be39e1b2c8652edf69177ed8aef
Signed-off-by: Umang Agrawal <uagrawal@codeaurora.org>
Add POWER_SUPPLY_PROP_BATT_PROFILE_VERSION to report
the version of the battery profile used by Qgauge.
Change-Id: I857c59ba2c4a9b2648f7aa708d6feba7295dd3cc
Signed-off-by: Anirudh Ghayal <aghayal@codeaurora.org>
Add the below power supply properties to be used by Qgauge.
POWER_SUPPLY_PROP_BATT_FULL_CURRENT - To report the current
at which battery reports 100% SOC.
POWER_SUPPLY_PROP_RECHARGE_SOC - To report the SOC at which
the battery restarts charging.
Change-Id: Iacb28b04b34ca603651a0437ee7e97abfd638b21
Signed-off-by: Anirudh Ghayal <aghayal@codeaurora.org>
Add a power supply property to expose the upper limit on the charging
current that the parallel charger can supply.
This is different from POWER_SUPPLY_PROP_CONSTANT_CHARGE_CURRENT_MAX in
that the latter is meant for querying the hardware-defined value, while
this new property is meant to be used to restrict the parallel's share
of FCC to its specified limit much like in SMB1354, for instance.
CRs-Fixed: 2170280
Change-Id: I3a6ed44fbafe0eff4ecc9462bdf9a35f34811d8c
Signed-off-by: Guru Das Srinagesh <gurus@codeaurora.org>
Guru Das Srinageshcommited 2018-02-05 11:02:19 -08:00
This change will enable userspace to control adapter's output
voltage. Userspace can force adapter's output voltage to
5V/9V/12V.
Change-Id: I0c367e252c95b28c3b495578ce6552716e358c70
Signed-off-by: Ashay Jaiswal <ashayj@codeaurora.org>
Add a power supply property to expose USB connector configuration
(TYPEC or MicroUSB).
Change-Id: Ie93b1facb3195d31d227eabc43e17e00c89ccd53
Signed-off-by: Ashay Jaiswal <ashayj@codeaurora.org>
Add POWER_SUPPLY_PROP_COLD_TEMP and POWER_SUPPLY_PROP_HOT_TEMP
properties to represent Cold and Hot JEITA thresholds of the
battery.
Change-Id: Id5e16a4f7b20bb05d997277d20db05fc08db9f33
Signed-off-by: Subbaraman Narayanamurthy <subbaram@codeaurora.org>
Subbaraman Narayanamurthyauthored and Harry Yangcommited 2017-09-11 11:28:18 -07:00
SDP_CURRENT_MAX is used to communicate the maximum current negotiated by
the USB phy. PD_VOLTAGE_MAX is used to communicate the maximum voltage
negotiated by the PD phy. PD_VOLTAGE_MIN is used to communicate the
minimum voltage negotiated by the PD phy.
Change-Id: I8332f7072c99c2c4e009607d92ccfb47534cc23b
Signed-off-by: Nicholas Troast <ntroast@codeaurora.org>
Nicholas Troastauthored and Harry Yangcommited 2017-08-31 12:19:19 -07:00
There are several algorithms which modify the charge current in steps
across the charge cycle. CC_STEP is used to notify of all the upcoming
charge currents.
The CC_STEP_SEL property is used to select the index of the CC_STEP to
read or modify using the CC_STEP property.
Change-Id: Ieeb533b758035c1c408cdfd68f001374bf0987a5
Signed-off-by: Nicholas Troast <ntroast@codeaurora.org>
Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
Signed-off-by: Subbaraman Narayanamurthy <subbaram@codeaurora.org>
Nicholas Troastauthored and Subbaraman Narayanamurthycommited 2017-08-16 11:40:17 -07:00
Add support to register a Floating type charger.
Change-Id: Ib65eff52a42d639a90f162488337a554deab4bfa
Signed-off-by: Ashay Jaiswal <ashayj@codeaurora.org>
Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
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>
Abhijeet Dharmapurikarauthored and Harry Yangcommited 2017-06-07 22:23:00 -07:00
Add REAL_TYPE power_supply property to record the real time charger
type.
Change-Id: I5fb2e3e3e782bcac0f8dd6071a830bcf370ebbd4
Signed-off-by: Fenglin Wu <fenglinw@codeaurora.org>
Fenglin Wuauthored and Harry Yangcommited 2017-05-22 11:20:19 -07:00
Add support for HW_CURRENT_MAX property which returns maximum
input current that can be set for an adapter. This property will
be specifically used by parallel charger to cast an initial ICL
vote.
CRs-Fixed: 2014572
Change-Id: I49e80e6b25f40791d9035bc1567fdf881914b1e8
Signed-off-by: Ashay Jaiswal <ashayj@codeaurora.org>
Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
Signed-off-by: Subbaraman Narayanamurthy <subbaram@codeaurora.org>
Ashay Jaiswalauthored and Subbaraman Narayanamurthycommited 2017-04-10 20:22:34 -07:00
Add the property to enable qnovo algorithm for charging.
Change-Id: I110f386d5cf86a4718e7d55af3068fd357dca8e9
Signed-off-by: Harry Yang <harryy@codeaurora.org>
Signed-off-by: Subbaraman Narayanamurthy <subbaram@codeaurora.org>
Harry Yangauthored and Subbaraman Narayanamurthycommited 2017-04-10 19:47:06 -07:00
USBIN-USBIN parallel configuration can have either an internal current
sensing via main charger's BATFET or an external current sense resistor.
The FCC split between main and parallel charger differs based on current
sensing mode, add support to differentiate internal/external sensing and
the FCC split is done as follows:
- Internal Sensing: Main charger configure to full FCC
Parallel charger configured to 50% FCC.
- External sensing: Main charger configure to 50% FCC
Parallel charger configured to 50% FCC.
Change-Id: Ia0c6234ce6f62af460edd3c4f56e34810899b3e3
Signed-off-by: Ashay Jaiswal <ashayj@codeaurora.org>
Ashay Jaiswalauthored and Harry Yangcommited 2017-03-27 11:04:44 -07:00
The die and connector health properties expose the comparator output of
the thermal regulation. If both die and skin temperature regulation is
enabled then the output of the comparator will be the higher of the two.
The property values can be one of: Unknown, Cool, Warm, Hot, Overheat.
Change-Id: Ic92c9cb08ec42fd2c2f26a54687a17e3b05b388f
Signed-off-by: Nicholas Troast <ntroast@codeaurora.org>
Nicholas Troastauthored and Harry Yangcommited 2017-03-27 11:03:26 -07:00
USB Main charger type represents the main charging path. This will
be used to control charging parameters on the main charger.
FCC_DELTA property will be used to indicate whether hw implements
any FCC mitigation. This will be used to calculate the effective FCC
and set the FCC on the PMI.
PARALLEL_MODE property indicates whether the parallel charger chip is
configured in a mid-mid or usbin-usbin configuration.
ICL_REDUCTION property indicates by how much should the main charger
reduce its input current.
Change-Id: I3b064314e6b5c28a7ea9f79ac52f3a26749605fb
Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
Abhijeet Dharmapurikarauthored and Harry Yangcommited 2017-03-27 11:03:09 -07:00
INPUT_VOLTAGE_SETTLED is the negotiated adapter voltage setting.
Change-Id: I2ac529a77e8ed007c908c4f37eea718a80bc11d3
Signed-off-by: Nicholas Troast <ntroast@codeaurora.org>
Nicholas Troastauthored and Harry Yangcommited 2017-03-27 11:03:09 -07:00
CURRENT_QNOVO - force fast charge current value
VOLTAGE_QNOVO - force float voltage value
CRs-Fixed: 2004173
Change-Id: I7569052fd2cb6d1ce9a3a8e69e79b950a6c62d57
Signed-off-by: Harry Yang <harryy@codeaurora.org>
POWER_SUPPLY_PROP_CTM_CURRENT_MAX is needed by CTM to limit USB input
current. Add it.
Change-Id: I8aac65a91959300676cf7e1c2685a557f322c509
Signed-off-by: Nicholas Troast <ntroast@codeaurora.org>
Nicholas Troastauthored and Harry Yangcommited 2017-03-27 11:03:08 -07:00
The DIE_HEALTH and CONNECTOR_HEALTH properties are used to show the
output of the thermal regulation TEMP_RANGE.
Change-Id: Ice3f159b7775084bdd0099047d4660a1e5edce98
Signed-off-by: Nicholas Troast <ntroast@codeaurora.org>
Nicholas Troastauthored and Harry Yangcommited 2017-03-27 11:03:07 -07:00
There is no need for this property. Remove it.
Change-Id: I656eb51f8b9690d0c1046d1c82d2575fae270a40
Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
Abhijeet Dharmapurikarauthored and Harry Yangcommited 2017-03-27 11:03:07 -07:00
The PARALLEL_PERCENT property is used for the parallel distribution
percentage.
Change-Id: I7d2a7a775437770075ddbd2d1a36ce5d9e44a631
Signed-off-by: Nicholas Troast <ntroast@codeaurora.org>
Nicholas Troastauthored and Harry Yangcommited 2017-03-27 11:03:06 -07:00
The PARALLEL_DISABLE property is used to enable or disable parallel
charging.
Change-Id: If2845efa942abc5849890b45de525222632b32db
Signed-off-by: Nicholas Troast <ntroast@codeaurora.org>
Nicholas Troastauthored and Harry Yangcommited 2017-03-27 11:03:05 -07:00
STEP_CHARGING_ENABLED indicates if step charging is enabled or not.
STEP_CHARGING_STEP reflects step charging phase.
Both properties are added for the purpose of testing and debugging.
CRs-Fixed: 1052854
Change-Id: I7d7517ab3f172016bb2f1c23fb2788bbd2d01086
Signed-off-by: Harry Yang <harryy@codeaurora.org>
Hardware disables the parallel charger via the CHG_EN pin. Add a new
property called PIN_ENABLED which reflects the status of the CHG_EN pin.
Change-Id: I79f95b145176b66d6b8cec5a21922ea16c2c8206
Signed-off-by: Nicholas Troast <ntroast@codeaurora.org>
Nicholas Troastauthored and Harry Yangcommited 2017-03-27 11:03:04 -07:00
CHARGER_TEMP reflects the temperature of the charging chip, and
CHARGER_TEMP_MAX reflects the temperature threshold at which the
hardware will take action to reduce the temperature of the charger.
Change-Id: I9cba8e370c753ac5aa33252fce0ea446f061b4c0
Signed-off-by: Nicholas Troast <ntroast@codeaurora.org>
Nicholas Troastauthored and Harry Yangcommited 2017-03-27 11:03:04 -07:00
POWER_SUPPLY_PROP_CHARGING_ENABLED has been used to indicate enabling
the charge path in some drivers and enabling the input path in others.
This leads to confusion of what charging enabled really means.
POWER_SUPPLY_PROP_BATTERY_CHARGING_ENABLED was introduced to indicate
enabling the charge path, and in this case
POWER_SUPPLY_PROP_CHARGING_ENABLED is used to indicate enabling the
input path. Since these are similarly named it leads to even more
confusion.
In an attempt to fix this confusion we introduce a new power supply
property POWER_SUPPLY_PROP_INPUT_SUSPEND which indicates suspending the
input path of the power supply. POWER_SUPPLY_PROP_CHARGING_ENABLED takes
its original definition of enabling the charge path. Then
POWER_SUPPLY_PROP_BATTERY_CHARGING_ENABLED will be retired from use.
CRs-Fixed: 1005389
Change-Id: I1ca8f5748a56a9395caa8ed8ed18f70e69f0cbe8
Signed-off-by: Nicholas Troast <ntroast@codeaurora.org>
Nicholas Troastauthored and Harry Yangcommited 2017-03-27 11:03:03 -07:00
Snapshot of power_supply.h and power_supply_sysfs.c as of kernel
4.4 commit 683a347835e6 ("power: supply: qcom: implement die and
connector health property") merged to kernel 4.9.
Change-Id: Idd2f467f1f1863a156d1757589dfe78158f0e43f
Signed-off-by: Harry Yang <harryy@codeaurora.org>
Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
Abhijeet Dharmapurikarauthored and Harry Yangcommited 2017-03-27 11:01:08 -07:00
Add a "RESISTANCE" property to the power supply frame work that
signifies the internal resistance of the power supply. The units
for this property should be in micro-ohms.
Change-Id: I2fcd3e7e314e61812d364dc0bd85ef1c8eec1622
Signed-off-by: Xiaozhe Shi <xiaozhes@codeaurora.org>
Signed-off-by: David Collins <collinsd@codeaurora.org>
Xiaozhe Shiauthored and David Collinscommited 2017-03-14 15:08:11 -07:00
Enable clients to vote for TLIM. It is used by
the VADC client to force the charger circuitry before
reading the charger temperature channel.
Change-Id: Id891b797f289d28ddb7ea2be95bd91365653cc02
Signed-off-by: Siddartha Mohanadoss <smohanad@codeaurora.org>
This property will be used to indicate to the boost current
after the boost is turned on.
Change-Id: Ie667fa49c4a8e8c008e8866f655e3bbe3e69e156
Signed-off-by: Harry Yang <harryy@codeaurora.org>
Harry Yangauthored and Gerrit - the friendly Code Review servercommited 2017-02-10 10:33:56 -08:00
This property will be used to indicate to the policy engine that it
should start its activities.
Change-Id: I9deb48f7bff71b022c5899e6eff7617526d02324
Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
Abhijeet Dharmapurikarauthored and Jack Phamcommited 2017-02-09 12:00:46 -08:00
Add additional properties for USB PD usage:
- POWER_SUPPLY_PROP_PD_IN_HARD_RESET is set when PD is
undergoing a hard reset
- POWER_SUPPLY_PROP_PD_CURRENT_MAX used to indicate the
current limit as negotiated over PD
- POWER_SUPPLY_PROP_PD_USB_SUSPEND_SUPPORTED is set when
USB suspend current limit must be honored when USB bus
is suspended
Change-Id: I0a3d98ac1e1202e5b655b2e3a8102691b61359c8
Signed-off-by: Jack Pham <jackp@codeaurora.org>
Introduce the power_supply_typec_mode enum definitions which
will allow a charger to indicate the type of USB Type-C
connection that is established. Also add additional properties
for indicating CC pin orientation, changing source/sink power
role (useful for dynamic power role swap), and a flag to allow
the charger to expect VBUS changes during USB Power Delivery
power negotiation.
Change-Id: Iba9b652335fba4ee4f24a17eba8abdd5c85c21bb
Signed-off-by: Jack Pham <jackp@codeaurora.org>
In ship mode the charger module opens the bat-fet and disconnects the
battery from the system. This is for the non-removable battery designs
to avoid them from being discharged when shipped/on-shelf.
The ship mode is enabled during the final stage of power-off typically
from the PON driver. Hence, add property POWER_SUPPLY_PROP_SET_SHIP_MODE
to force the device into ship-mode.
CRs-Fixed: 1092969
Change-Id: I43893355db063d99b6faf965093fad74ec0c9253
Signed-off-by: Fenglin Wu <fenglinw@codeaurora.org>
Fenglin Wuauthored and David Collinscommited 2017-01-11 13:57:56 -08:00
Add POWER_SUPPLY_PROP_CHARGE_COUNTER_EXT that stores accumulated charge
in nAh units as a signed 64-bit value.
Add generic support for signed 64-bit property values.
Change-Id: I2bd34b1e95ffba24e7bfef81f398f22bd2aaf05e
Signed-off-by: Todd Poynor <toddpoynor@google.com>
Todd Poynorauthored and Amit Pundircommited 2016-08-08 12:02:17 +05:30
power_supply_get_property() should ideally return -EAGAIN if it is
called while the power_supply is being registered. There was no way
previously to determine if use_cnt == 0 meant that the power_supply
wasn't fully registered yet, or if it had already been unregistered.
Add a new boolean to the power_supply struct to simply show if
registration is completed. Lastly, modify the check in
power_supply_show_property() to also ignore -EAGAIN when so it
doesn't complain about not returning the property.
Signed-off-by: Rhyland Klein <rklein@nvidia.com>
Signed-off-by: Sebastian Reichel <sre@kernel.org>
Rhyland Kleinauthored and Sebastian Reichelcommited 2016-07-01 22:44:34 +02:00