M7350v1_en_gpl

This commit is contained in:
T
2024-09-09 08:52:07 +00:00
commit f9cc65cfda
65988 changed files with 26357421 additions and 0 deletions
@@ -0,0 +1,23 @@
TI BQ28400 Battery Gas Gauge
The bq28400 monitors the battery temperature, capacity, voltage, current etc.
The device interface is I2C, its I2C slave 7-bit address is 0xb.
The device is usually embedded inside the "smart battery" pack.
Required properties:
- compatible : Must be "ti,bq28400-battery" or "ti,bq30z55-battery"
- reg : I2C Address must be 0xb.
- ti,temp-cold : Cold temperature limit in celsius degree
- ti,temp-hot : Hot temperature limit in celsius degree
Example:
i2c@f9967000 {
battery@b {
compatible = "ti,bq28400-battery", "ti,bq30z55-battery";
reg = <0xb>;
ti,temp-cold = <2>;
ti,temp-hot = <43>;
};
};
@@ -0,0 +1,25 @@
* Generic OPP Interface
SoCs have a standard set of tuples consisting of frequency and
voltage pairs that the device will support per voltage domain. These
are called Operating Performance Points or OPPs.
Properties:
- operating-points: An array of 2-tuples items, and each item consists
of frequency and voltage like <freq-kHz vol-uV>.
freq: clock frequency in kHz
vol: voltage in microvolt
Examples:
cpu@0 {
compatible = "arm,cortex-a9";
reg = <0>;
next-level-cache = <&L2>;
operating-points = <
/* kHz uV */
792000 1100000
396000 950000
198000 850000
>;
};
@@ -0,0 +1,154 @@
Qualcomm's QPNP PMIC Battery Management System driver
QPNP PMIC BMS provides interface to clients to read properties related
to the battery. It's main function is to calculate the State of Charge (SOC),
a 0-100 percentage representing the amount of charge left in the battery.
There are two required peripherals in the BMS driver, both implemented as
subnodes in the example. These peripherals must not be disabled if the BMS
device is to enabled:
- qcom,bms-bms : The main BMS device. Supports battery monitoring controls and
sensors.
- qcom,bms-iadc : The BMS IADC peripheral in the IADC device. This is required
to determine whether the BMS is using an internal or external
rsense to accumulate the Coulomb Counter and read current.
Parent node required properties:
- compatible : should be "qcom,qpnp-bms" for the BM driver.
- qcom,r-sense-uohm : sensor resistance in in micro-ohms.
- qcom,v-cutoff-uv : cutoff voltage where the battery is considered dead in
micro-volts.
- qcom,max-voltage-uv : maximum voltage for the battery in micro-volts.
- qcom,r-conn-mohm : connector resistance in milli-ohms.
- qcom,shutdown-soc-valid-limit : If the ocv upon restart is within this
distance of the shutdown ocv, the BMS will try to force
the new SoC to the old one to provide charge continuity.
That is to say,
if (abs(shutdown-soc - current-soc) < limit)
then use old SoC.
- qcom,adjust-soc-low-threshold : The low threshold for when the BMS algorithm
starts adjusting. If the estimated SoC is not below
this percentage, do not adjust.
- qcom,ocv-voltage-low-threshold-uv : The low voltage threshold for the
"flat portion" of the discharge curve. The bms will not
accept new ocvs between these thresholds.
- qcom,ocv-voltage-high-threshold-uv : The high voltage threshold for
the "flat portion" of the discharge curve.
The bms will not accept new ocvs between these
thresholds.
- qcom,low-soc-calculate-soc-threshold : The SoC threshold for when
the periodic calculate_soc work speeds up. This ensures
SoC is updated in userspace constantly when we are near
shutdown.
- qcom,low-voltage-threshold : The battery voltage threshold in micro-volts for
when the BMS tries to wake up and hold a wakelock to
ensure a clean shutdown.
- qcom,low-soc-calculate-soc-ms : The time period between subsequent
SoC recalculations when the current SoC is below
qcom,low-soc-calculate-soc-threshold or when battery
voltage is below qcom,low-voltage-threshold.
- qcom,calculate-soc-ms : The time period between subsequent SoC
recalculations when the current SoC is above or equal
qcom,low-soc-calculate-soc-threshold.
- qcom,chg-term-ua : current in micro-amps when charging is considered done.
As soon as current passes this point, charging is
stopped.
- qcom,batt-type: Type of battery used. This is an integer that corresponds
to the enum defined in
include/linux/mfd/pm8xxx/batterydata-lib.h
- qcom,high-ocv-correction-limit-uv: how much the bms will correct OCV when
voltage is above the flat portion of the discharge
curve.
- qcom,low-ocv-correction-limit-uv: how much the bms will correct OCV when
voltage is below the flat portion of the discharge
curve.
- qcom,hold-soc-est: if the voltage-based estimated SoC is above this percent,
the BMS will clamp SoC to be at least 1.
- qcom,tm-temp-margin: if the pmic die temperature changes by more than this
value, recalibrate the ADCs. The unit of this property
is in millidegrees celsius.
Parent node optional properties:
- qcom,ignore-shutdown-soc: A boolean that controls whether BMS will
try to force the startup SoC to be the same as the
shutdown SoC. Defining it will make BMS ignore the
shutdown SoC.
- qcom,use-voltage-soc : A boolean that controls whether BMS will use
voltage-based SoC instead of a coulomb counter based
one. Voltage-based SoC will not guarantee linearity.
- qcom,use-external-rsense : A boolean that controls whether BMS will use
an external sensor resistor instead of the default
RDS of the batfet.
- qcom,use-ocv-thresholds : A boolean that controls whether BMS will take
new OCVs only between the defined thresholds.
All sub node required properties:
- reg : offset and length of the PMIC peripheral register map.
qcom,bms-bms node required properties:
- interrupts : the interrupt mappings.
The format should be
<slave-id peripheral-id interrupt-number>.
- interrupt-names : names for the mapped bms interrupt
The following interrupts are required:
0 : vsense_for_r
1 : vsense_avg
2 : sw_cc_thr
3 : ocv_thr
4 : charge_begin
5 : good_ocv
6 : ocv_for_r
7 : cc_thr
Example:
pm8941_bms: qcom,bms {
spmi-dev-container;
compatible = "qcom,qpnp-bms";
#address-cells = <1>;
#size-cells = <1>;
status = "disabled";
qcom,r-sense-uohm = <10000>;
qcom,v-cutoff-uv = <3400000>;
qcom,max-voltage-uv = <4200000>;
qcom,r-conn-mohm = <18>;
qcom,shutdown-soc-valid-limit = <20>;
qcom,ocv-voltage-low-threshold-uv = <3650000>;
qcom,ocv-voltage-high-threshold-uv = <3750000>;
qcom,adjust-soc-low-threshold = <15>;
qcom,low-soc-calculate-soc-threshold = <15>;
qcom,low-voltage-threshold = <3420000>;
qcom,low-soc-calculate-soc-ms = <5000>;
qcom,calculate-soc-ms = <20000>;
qcom,chg-term-ua = <100000>;
qcom,batt-type = <0>;
qcom,low-ocv-correction-limit-uv = <100>;
qcom,high-ocv-correction-limit-uv = <50>;
qcom,hold-soc-est = <3>;
qcom,tm-temp-margin = <5000>;
qcom,bms-iadc@3800 {
reg = <0x3800 0x100>;
};
qcom,bms-bms@4000 {
reg = <0x4000 0x100>;
interrupts = <0x0 0x40 0x0>,
<0x0 0x40 0x1>,
<0x0 0x40 0x2>,
<0x0 0x40 0x3>,
<0x0 0x40 0x4>,
<0x0 0x40 0x5>,
<0x0 0x40 0x6>,
<0x0 0x40 0x7>;
interrupt-names = "vsense_for_r",
"vsense_avg",
"sw_cc_thr",
"ocv_thr",
"charge_begin",
"good_ocv",
"ocv_for_r",
"cc_thr";
};
};
@@ -0,0 +1,285 @@
Qualcomm QPNP Charger
The charger supports the switch mode battery charger and boost (SMBB)
peripherals on Qualcomm PMIC chips.
There are seven different peripherals adding the following functionality.
Each of these peripherals are implemented as subnodes in the example at the
end of this file.
- qcom,chgr: Supports charging control and status
reporting.
- qcom,bat-if: Battery status reporting such as presence,
temperature reporting and voltage collapse
protection.
- qcom,buck: Charger buck configuration and status
reporting with regards to several regulation
loops such as vdd, ibat etc.
- qcom,usb-chgpth: USB charge path detection and input current
limiting configuration.
- qcom,dc-chgpth: DC charge path detection and input current
limiting configuration.
- qcom,chg-misc: Miscellaneous features such as buck frequency
settings, comparator override features etc.
Parent node required properties:
- qcom,vddmax-mv: Target voltage of battery in mV.
- qcom,vddsafe-mv: Maximum Vdd voltage in mV.
- qcom,vinmin-mv: Minimum input voltage in mV.
- qcom,ibatmax-ma: Maximum battery charge current in mA
- qcom,ibatsafe-ma: Safety battery current setting
- qcom,thermal-mitigation: Array of ibatmax values for different
system thermal mitigation level.
Parent node optional properties:
- qcom,ibatterm-ma: Current at which charging is terminated when
the analog end of charge option is selected.
- qcom,maxinput-usb-ma: Maximum input current USB.
- qcom,maxinput-dc-ma: Maximum input current DC.
- qcom,vbatdet-delta-mv: Battery charging resume delta.
- qcom,charging-disabled: Set this property to disable charging
by default. This can then be overriden
writing the the module parameter
"charging_disabled".
- qcom,duty-cycle-100p: Set this property to enable the 100% duty
cycle feature.
- qcom,use-default-batt-values: Set this flag to force reporting of
battery temperature of 250 decidegree
Celsius, state of charge to be 50%
and disable charging.
- qcom,warm-bat-decidegc: Warm battery temperature in decidegC.
- qcom,cool-bat-decidegc: Cool battery temperature in decidegC.
Note that if both warm and cool battery
temperatures are set, the corresponding
ibatmax and bat-mv properties are
required to be set.
- qcom,ibatmax-cool-ma: Maximum cool battery charge current.
- qcom,ibatmax-warm-ma: Maximum warm battery charge current.
- qcom,warm-bat-mv: Warm temperature battery target voltage.
- qcom,cool-bat-mv: Cool temperature battery target voltage.
- qcom,tchg-mins: Maximum total software initialized charge time.
- qcom,bpd-detection: Select a battery presence detection scheme by
specifying either "bpd_thm", "bpd_id" or
"bpd_thm_id". "bpd_thm" selects the temperature
pin, "bpd_id" uses the id pin for battery presence
detection, "bpd_thm_id" selects both.
If the property is not set, the temperatue pin will
be used.
- otg-parent-supply Specify a phandle to a parent supply regulator
for the OTG regulator.
- boost-parent-supply Specify a phandle to a parent supply regulator
for the boost regulator.
Sub node required structure:
- A qcom,chg node must be a child of an SPMI node that has specified
the spmi-dev-container property. Each subnode reflects
a hardware peripheral which adds a unique set of features
to the collective charging device. For example USB detection
and the battery interface are each seperate peripherals and
each should be their own subnode.
Sub node required properties:
- compatible: Must be "qcom,qpnp-charger".
- reg: Specifies the SPMI address and size for this peripheral.
- interrupts: Specifies the interrupt associated with the peripheral.
- interrupt-names: Specifies the interrupt names for the peripheral. Every
available interrupt needs to have an associated name
with it to indentify its purpose.
The following lists each subnode and their corresponding
required interrupt names:
qcom,usb-chgpth:
- usbin-valid
qcom,chgr:
- chg-done
- chg-failed
The following interrupts are available:
qcom,chgr:
- chg-done: Triggers on charge completion.
- chg-failed: Notifies of charge failures.
- fast-chg-on: Notifies of fast charging state.
- trkl-chg-on: Indicates trickle charging.
- state-change: Notifies of a state change in
the charger state machine.
- chgwdog: Charger watchdog interrupt.
- vbat-det-hi: Triggers on vbat-det-hi voltage
setting,can be used as
battery alarm.
- vbat-det-hi: Triggers on vbat-det-low voltage
setting, can be used as
battery alarm.
qcom,buck:
- vdd-loop: VDD loop change interrupt.
- ibat-loop: Ibat loop change interrupt.
- ichg-loop: Charge current loop change.
- vchg-loop: Charge voltage loop change.
- overtemp: Overtemperature interrupt.
- vref-ov: Reference overvoltage interrupt.
- vbat-ov: Battery overvoltage interrupt.
qcom,bat-if:
- psi: PMIC serial interface interrupt.
- vcp-on: Voltage collapse protection
status interrupt.
- bat-fet-on: BATFET status interrupt.
- bat-temp-ok: Battery temperature status
interrupt.
- batt-pres: Battery presence status
interrupt.
qcom,usb-chgpth:
- usbin-valid: Indicates valid USB connection.
- coarse-det-usb: Coarse detect interrupt triggers
at low voltage on USB_IN.
- chg-gone: Triggers on VCHG line.
qcom,dc-chgpth:
- dcin-valid: Indicates a valid DC charger
connection.
- coarse-det-dc: Coarse detect interrupt triggers
at low voltage on DC_IN.
qcom,boost:
- limit-error: Limiting error on SMBB boost.
- boost-pwr-ok: Status of boost power.
Sub node optional properties:
qcom,usb-chgpth:
- regulator-name: A string used as a descriptive name
for the OTG regulator.
qcom,boost:
- regulator-min-microvolt: Minimum boost voltage setting.
- regulator-max-microvolt: Maximum boost voltage setting.
- regulator-name: A string used as a descriptive name
for the boost regulator.
Example:
pm8941-chg {
spmi-dev-container;
compatible = "qcom,qpnp-charger";
#address-cells = <1>;
#size-cells = <1>;
otg-parent-supply = <&pm8941_boost>;
boost-parent-supply = <&foo_parent_reg>;
qcom,vddmax-mv = <4200>;
qcom,vddsafe-mv = <4200>;
qcom,vinmin-mv = <4200>;
qcom,ibatmax-ma = <1500>;
qcom,ibatterm-ma = <200>;
qcom,ibatsafe-ma = <1500>;
qcom,thermal-mitigation = <1500 700 600 325>;
qcom,cool-bat-degc = <10>;
qcom,cool-bat-mv = <4100>;
qcom,ibatmax-warm-ma = <350>;
qcom,warm-bat-degc = <45>;
qcom,warm-bat-mv = <4100>;
qcom,ibatmax-cool-ma = <350>;
qcom,vbatdet-delta-mv = <60>;
qcom,chgr@1000 {
reg = <0x1000 0x100>;
interrupts = <0x0 0x10 0x0>,
<0x0 0x10 0x1>,
<0x0 0x10 0x2>,
<0x0 0x10 0x3>,
<0x0 0x10 0x4>,
<0x0 0x10 0x5>,
<0x0 0x10 0x6>,
<0x0 0x10 0x7>;
interrupt-names = "chg-done",
"chg-failed",
"fast-chg-on",
"trkl-chg-on",
"state-change",
"chgwdog",
"vbat-det-hi",
"vbat-det-lo";
};
qcom,buck@1100 {
reg = <0x1100 0x100>;
interrupts = <0x0 0x11 0x0>,
<0x0 0x11 0x1>,
<0x0 0x11 0x2>,
<0x0 0x11 0x3>,
<0x0 0x11 0x4>,
<0x0 0x11 0x5>,
<0x0 0x11 0x6>;
interrupt-names = "vdd-loop",
"ibat-loop",
"ichg-loop",
"vchg-loop",
"overtemp",
"vref-ov",
"vbat-ov";
};
qcom,bat-if@1200 {
reg = <0x1200 0x100>;
interrupts = <0x0 0x12 0x0>,
<0x0 0x12 0x1>,
<0x0 0x12 0x2>,
<0x0 0x12 0x3>,
<0x0 0x12 0x4>;
interrupt-names = "psi",
"vcp-on",
"bat-fet-on",
"bat-temp-ok",
"batt-pres";
};
pm8941_chg_otg: qcom,usb-chgpth@1300 {
reg = <0x1300 0x100>;
interrupts = <0 0x13 0x0>,
<0 0x13 0x1>,
<0x0 0x13 0x2>;
interrupt-names = "usbin-valid",
"coarse-det-usb",
"chg-gone";
};
qcom,dc-chgpth@1400 {
reg = <0x1400 0x100>;
interrupts = <0x0 0x14 0x0>,
<0x0 0x14 0x1>;
interrupt-names = "dcin-valid",
"coarse-det-dc";
};
pm8941_chg_boost: qcom,boost@1500 {
reg = <0x1500 0x100>;
interrupts = <0x0 0x15 0x0>,
<0x0 0x15 0x1>;
interrupt-names = "limit-error",
"boost-pwr-ok";
};
qcom,misc@1600 {
reg = <0x1600 0x100>;
};
};
In regulator specific device tree file:
&pm8941_chg_boost {
regulator-min-microvolt = <5000000>;
regulator-max-microvolt = <5000000>;
regulator-name = "8941_smbb_boost";
};
&pm8941_chg_otg {
regulator-name = "8941_smbb_otg";
};
@@ -0,0 +1,86 @@
Summit SMB137C Battery Charger
The SMB137C is controlled via an I2C bus. Its 7-bit I2C slave address is
programmed during manufacturing.
Required properties:
- compatible: Must be "summit,smb137c".
- reg: The device's 7-bit I2C address.
Optional properties:
- summit,chg-current-ma Maximum battery charging current in milliamps.
Supported values are: 500, 650, 750, 850, 950,
1100, 1300, and 1500.
- summit,term-current-ma Charging terminaton current in milliamps.
Supported values are: 0, 35, 50, 100, and 150.
A value of 0 means no termination current is
used.
- summit,pre-chg-current-ma Maximum battery pre-charging current in
milliamps. This current limit is applied while
the battery voltage is below the pre-charge /
fast-charge threshold. Supported values are:
50, 100, 150, and 200.
- summit,float-voltage-mv Battery voltage threshold in millivolts at which
point charging switches from constant current to
constant voltage. Supported values are: 3460 up
through 4730 in 10 mV steps.
- summit,thresh-voltage-mv Threshold voltage in millivolts which is used to
switch between pre-charge and fast-charge
current limits. Supported values are: 2400 up
to 3100 in 100 mV steps.
- summit,recharge-thresh-mv Specifies the minimum voltage drop in millivolts
below the float voltage that is required in
order to initiate a new charging cycle.
Supported values are: 75 and 120.
- summit,system-voltage-mv Regulated voltage output on the VOUTL pin in
millivolts. Supported values are 4250 and 4460.
- summit,charging-timeout Maximum duration in minutes that a single charge
cycle may last. Supported values are: 0, 382,
764, and 1527. A value of 0 means that no
charge cycle timeout is used and charging can
continue indefinitely.
- summit,pre-charge-timeout Maximum time in minutes spent in the pre-charge
state in any given charge cycle. Supports
values are: 0, 48, 95, and 191. A value of 0
means that there is no limit to the amount of
time that may be spent in the pre-charge state.
- summit,therm-current-ua Thermistor current in microamps to be used for
battery temperature monitoring. Supported
values are 10, 20, 40, and 100. These values
correspond to 100, 50, 25, and 10 kohm NTC
thermistors respectively.
- summit,temperature-min Specifies the minimum temperature at which
charging is allowed. Supported values are
0 to 7. These values correspond to -20 C to
+15 C in 5 C increments for an NTC thermistor
with beta = 4400.
- summit,temperature-max Specifies the maximum temperature at which
charging is allowed. Supported values are
0 to 7. These values correspond to +30 C to
+65 C in 5 C increments for an NTC thermistor
with beta = 4400.
Note: If an optional property is not specified, then the hardware default value
will be used.
Example:
/ {
i2c@f9925000 {
charger@57 {
compatible = "summit,smb137c";
reg = <0x57>;
summit,chg-current-ma = <1500>;
summit,term-current-ma = <50>;
summit,pre-chg-current-ma = <100>;
summit,float-voltage-mv = <4200>;
summit,thresh-voltage-mv = <3000>;
summit,recharge-thresh-mv = <75>;
summit,system-voltage-mv = <4250>;
summit,charging-timeout = <382>;
summit,pre-charge-timeout = <48>;
summit,therm-current-ua = <10>;
summit,temperature-min = <4>; /* 0 C */
summit,temperature-max = <3>; /* 45 C */
};
};
};
@@ -0,0 +1,43 @@
Summit smb350 battery charger
The smb350 charger supports stack-cell battery charging.
The smb350 interface is via I2C bus.
The i2c slave 7-bit address is programmable at manufacture.
Node required properties:
- compatible: Must be "summit,smb350-charger".
- reg: The device 7-bit I2C address.
- summit,stat-gpio gpio which smb350 STAT pin connects to.
- summit,chg-en-n-gpio gpio which control charging enable.
- summit,chg-susp-n-gpio gpio which control device shutdown
- summit,chg-current-ma charging current in milliamps.
- summit,term-current-ma charging termination current in milliamps.
valid values are 200/300/400/500/600/700.
A value of zero means no termination current.
Example:
i2c@f9967000 {
cell-index = <0>;
compatible = "qcom,i2c-qup";
reg = <0Xf9967000 0x1000>;
#address-cells = <1>;
#size-cells = <0>;
reg-names = "qup_phys_addr";
interrupts = <0 105 0>;
interrupt-names = "qup_err_intr";
qcom,i2c-bus-freq = <100000>;
qcom,i2c-src-freq = <24000000>;
label = "blsp_11";
smb350-charger@2b {
compatible = "summit,smb350-charger";
reg = <0x2b>; /* 0x56/0x57 */
summit,stat-gpio = <&pm8941_gpios 30 0x00>;
summit,chg-en-n-gpio = <&pm8941_gpios 10 0x00>;
summit,chg-susp-n-gpio = <&pm8941_gpios 13 0x00>;
summit,chg-current-ma = <1600>;
summit,term-current-ma = <200>;
};
};