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

View File

@@ -0,0 +1,141 @@
Qualcomm's QPNP PMIC thermal monitor ADC driver (VADC_TM)
QPNP PMIC thermal monitoring (TM) provides interface to thermal clients
to set temperature thresholds and receive notification when the thresholds
are crossed. A 15 bit ADC is used for measurements. The driver is part
of the sysfs thermal framework that provides support to read the trip
points, set threshold for the trip points and enable the trip points.
Seperate kernel api's are provided to usb_id and batt_therm
to set thresholds and receive threshold notifications.
VADC_TM node
Required properties:
- compatible : should be "qcom,qpnp-adc-tm" for thermal ADC driver.
- reg : offset and length of the PMIC Aribter register map.
- address-cells : Must be one.
- size-cells : Must be zero.
- interrupts : The thermal ADC bank peripheral interrupts for eoc, high and low interrupts.
- interrupt-names : Should be "eoc-int-en-set", "high-thr-en-set" and "low-thr-en-set".
- qcom,adc-bit-resolution : Bit resolution of the ADC.
- qcom,adc-vdd-reference : Voltage reference used by the ADC.
Optional properties:
- qcom,thermal-node : If present a thermal node is created and the channel is registered as
part of the thermal sysfs which allows clients to use the thermal framework
to set temperature thresholds and receive notification when the temperature
crosses a set threshold, read temperature and enable/set trip types supported
by the thermal framework.
Channel nodes
NOTE: Atleast one Channel node is required.
Required properties:
- label : Channel name used for sysfs entry.
- reg : AMUX channel number.
- qcom,decimation : Sampling rate to use for the individual channel measurement.
Select from the following unsigned int.
0 : 512
1 : 1K
2 : 2K
3 : 4K
- qcom,pre-div-channel-scaling : Pre-div used for the channel before the signal is being measured.
Select from the following unsigned int for the corresponding
numerator/denominator pre-div ratio.
0 : pre-div ratio of {1, 1}
1 : pre-div ratio of {1, 3}
2 : pre-div ratio of {1, 4}
3 : pre-div ratio of {1, 6}
4 : pre-div ratio of {1, 20}
- qcom,calibration-type : Reference voltage to use for channel calibration.
Channel calibration is dependendent on the channel.
Certain channels like XO_THERM, BATT_THERM use ratiometric
calibration. Most other channels fall under absolute calibration.
Select from the following strings.
"absolute" : Uses the 625mv and 1.25V reference channels.
"ratiometric" : Uses the reference Voltage/GND for calibration.
- qcom,scale-function : Scaling fuction used to convert raw ADC code to units specific to
a given channel.
Select from the following unsigned int.
0 : Default scaling to convert raw adc code to voltage.
1 : Conversion to temperature based on btm parameters.
2 : Returns result in milli degree's Centigrade.
3 : Returns current across 0.1 ohm resistor.
4 : Returns XO thermistor voltage in degree's Centigrade.
- qcom,hw-settle-time : Settling period for the channel before ADC read.
Select from the following unsigned int.
0 : 0us
1 : 100us
2 : 200us
3 : 300us
4 : 400us
5 : 500us
6 : 600us
7 : 700us
8 : 800us
9 : 900us
0xa : 1ms
0xb : 2ms
0xc : 4ms
0xd : 6ms
0xe : 8ms
0xf : 10ms
- qcom,fast-avg-setup : Average number of samples to be used for measurement. Fast averaging
provides the option to obtain a single measurement from the ADC that
is an average of multiple samples. The value selected is 2^(value)
Select from
0 : 1
1 : 2
2 : 4
3 : 8
4 : 16
5 : 32
6 : 64
7 : 128
8 : 256
- qcom,btm-channel-number : There are 5 BTM channels. The BTM channel numbers are statically
allocated to the corresponding channel node.
Example:
/* Main Node */
qcom,vadc@3400 {
compatible = "qcom,qpnp-adc-tm";
reg = <0x3400 0x100>;
#address-cells = <1>;
#size-cells = <0>;
interrupts = <0x0 0x34 0x0>,
<0x0 0x34 0x3>,
<0x0 0x34 0x4>;
interrupt-names = "eoc-int-en-set",
"high-thr-en-set",
"low-thr-en-set";
qcom,adc-bit-resolution = <15>;
qcom,adc-vdd-reference = <1800>;
/* Channel Node to be registered as part of thermal sysfs */
chan@b5 {
label = "pa_therm1";
reg = <0xb5>;
qcom,decimation = <0>;
qcom,pre-div-channel-scaling = <0>;
qcom,calibration-type = "absolute";
qcom,scale-function = <2>;
qcom,hw-settle-time = <0>;
qcom,fast-avg-setup = <0>;
qcom,btm-channel-number = <0x70>;
qcom,thermal-node;
};
/* Channel Node */
chan@6 {
label = "vbat_sns";
reg = <6>;
qcom,decimation = <0>;
qcom,pre-div-channel-scaling = <1>;
qcom,calibration-type = "absolute";
qcom,scale-function = <3>;
qcom,hw-settle-time = <0>;
qcom,fast-avg-setup = <0>;
qcom,btm-channel-number = <0x78>;
};
};

View File

@@ -0,0 +1,66 @@
Qualcomm QPNP Temperature Alarm
QPNP temperature alarm peripherals are found inside of Qualcomm PMIC chips that
utilize the MSM SPMI implementation. These peripherals provide an interrupt
signal and status register to identify high PMIC die temperature.
Required properties:
- compatible: Must be "qcom,qpnp-temp-alarm".
- reg: Specifies the SPMI address and size for this temperature
alarm device.
- interrupts: PMIC temperature alarm interrupt
- label: A string used as a descriptive name for this thermal device.
This name should be 19 characters or less.
Required structure:
- A qcom,qpnp-temp-alarm node must be a child of an SPMI node that has specified
the spmi-slave-container property
Optional properties:
- qcom,channel-num: VADC channel number associated PMIC DIE_TEMP thermistor.
If no channel is specified, then the die temperature
must be estimated based on the over temperature stage.
- qcom,threshold-set: Integer value which specifies which set of threshold
temperatures to use for the over temperature stages.
Possible values (x = {stage 1 threshold temperature,
stage 2 threshold temperature,
stage 3 threshold temperature}):
0 = {105 C, 125 C, 145 C}
1 = {110 C, 130 C, 150 C}
2 = {115 C, 135 C, 155 C}
3 = {120 C, 140 C, 160 C}
- qcom,allow-override: Boolean which controls the ability of software to
override shutdowns. If present, then software is
allowed to override automatic PMIC hardware stage 2 and
stage 3 over temperature shutdowns. Otherwise, software
is not allowed to override automatic shutdown.
- qcom,default-temp: Specifies the default temperature in millicelcius to use
if no ADC channel is present to read the real time
temperature.
Note, if a given optional qcom,* binding is not present, then the default
hardware state for that feature will be maintained.
Example:
&spmi_bus {
#address-cells = <1>;
#size-cells = <0>;
interrupt-controller;
#interrupt-cells = <3>;
qcom,pm8941@0 {
spmi-slave-container;
reg = <0x0>;
#address-cells = <1>;
#size-cells = <1>;
qcom,temp-alarm@2400 {
compatible = "qcom,qpnp-temp-alarm";
reg = <0x2400 0x100>;
interrupts = <0x0 0x24 0x0>;
label = "pm8941_tz";
qcom,channel-num = <8>;
qcom,threshold-set = <0>;
};
};
};

View File

@@ -0,0 +1,63 @@
Qualcomm's TSENS driver
The TSENS driver supports reading temperature from sensors across
the MSM. The driver defaults to support a 10 bit ADC.
The driver uses the Thermal sysfs framework to provide thermal
clients the ability to enable/disable the sensors, read trip zones,
read cool/warm temperature thresholds, set temperature thresholds
for cool/warm notification and receive notification on temperature
threshold events.
TSENS node
Required properties:
- compatible : should be "qcom,msm-tsens" for MSM8974 TSENS driver.
- reg : offset and length of the TSENS registers.
- reg : offset and length of the QFPROM registers used for storing
the calibration data for the individual sensors.
- reg-names : resource names used for the physical address of the TSENS
registers, the QFPROM efuse primary calibration address region,
Should be "tsens_physical" for physical address of the TSENS,
"tsens_eeprom_physical" for physical address where primary
calibration data is stored. This includes the backup
calibration address region if TSENS calibration data is stored
in the region.
- interrupts : TSENS interrupt for cool/warm temperature threshold.
- qcom,sensors : Total number of available Temperature sensors for TSENS.
- qcom,slope : One point calibration characterized slope data for each
sensor used to compute the offset. Slope is represented
as ADC code/DegC and the value is multipled by a factor
of 1000.
- qcom,calib-mode : Calibration masks to use to abstract the offset data from efuse.
Select from the following strings.
"fuse_map1" : Used for 8974/9x25 fuse calibration map.
"fuse_map2" : Used for 8x26 fuse calibration map.
"fuse_map3" : Used for 8x10 fuse calibration map.
Optional properties:
- qcom,calibration-less-mode : If present the pre-characterized data for offsets
are used else it defaults to use calibration data from QFPROM.
- qcom,tsens-local-init : If the flag is present the TSENS control registers are
initialized. If the boot configures the control register there is
no need to re-initialize them. The control registers are also
under a secure domain which can prevent them from being initialized
locally.
- qcom,sensor-id : If the flag is present map the TSENS sensors based on the
remote sensors that are enabled in HW. Ensure the mapping is not
more than the number of supported sensors.
Example:
tsens@fc4a8000 {
compatible = "qcom,msm-tsens";
reg = <0xfc4a8000 0x2000>,
<0xfc4b8000 0x1000>;
reg-names = "tsens_physical",
"tsens_eeprom_physical";
interrupts = <0 184 0>;
qcom,calibration-less-mode;
qcom,sensors = <11>;
qcom,slope = <3200 3200 3200 3200 3200 3200 3200 3200 3200
3200>;
qcom,calib-mode = "fuse_map1";
};