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,73 @@
ADS1015 (I2C)
This device is a 12-bit A-D converter with 4 inputs.
The inputs can be used single ended or in certain differential combinations.
For configuration all possible combinations are mapped to 8 channels:
0: Voltage over AIN0 and AIN1.
1: Voltage over AIN0 and AIN3.
2: Voltage over AIN1 and AIN3.
3: Voltage over AIN2 and AIN3.
4: Voltage over AIN0 and GND.
5: Voltage over AIN1 and GND.
6: Voltage over AIN2 and GND.
7: Voltage over AIN3 and GND.
Each channel can be configured individually:
- pga is the programmable gain amplifier (values are full scale)
0: +/- 6.144 V
1: +/- 4.096 V
2: +/- 2.048 V (default)
3: +/- 1.024 V
4: +/- 0.512 V
5: +/- 0.256 V
- data_rate in samples per second
0: 128
1: 250
2: 490
3: 920
4: 1600 (default)
5: 2400
6: 3300
1) The /ads1015 node
Required properties:
- compatible : must be "ti,ads1015"
- reg : I2C bus address of the device
- #address-cells : must be <1>
- #size-cells : must be <0>
The node contains child nodes for each channel that the platform uses.
Example ADS1015 node:
ads1015@49 {
compatible = "ti,ads1015";
reg = <0x49>;
#address-cells = <1>;
#size-cells = <0>;
[ child node definitions... ]
}
2) channel nodes
Required properties:
- reg : the channel number
Optional properties:
- ti,gain : the programmable gain amplifier setting
- ti,datarate : the converter data rate
Example ADS1015 channel node:
channel@4 {
reg = <4>;
ti,gain = <3>;
ti,datarate = <5>;
};
@@ -0,0 +1,25 @@
Embedded Power Measurement(EPM) using Cypress Progammable System on a chip (PSOC)
The EPM using the PSoC5 is used by clients to measure on target power
measurement on supported channels. The PSoC5 is a microcontroller
that is communicated over the SPI from the MSM. Primary configuration
supports upto 31 channels and the scope of the driver is to support
userspace clients.
EPM node
Required properties:
- compatible : should be "cy,epm-adc-cy8c5568lti-114" for EPM using PSoC5.
- reg : chip select for the device.
- interrupt-parent : should be phandle of the interrupt controller
servicing the interrupt for this device.
- spi-max-frequency : existing support is set for 960kHz.
- qcom,channels : The number of voltage and current channels that
are supported.
- qcom,gain : The gain for each of the supported channels.
- qcom,rsense : The rsense value for each channel. The current channels
rsense values units are in milliohms. The voltage channels
rsense value is 1.
- qcom,channel-type : Bitmak of channels to set as voltage and current.
These are platform dependent and the appropriate scaling
functions are used for returning voltage and current.
@@ -0,0 +1,113 @@
Qualcomm's QPNP PMIC current ADC driver
QPNP PMIC current ADC (IADC) provides interface to clients to read
current. A 16 bit ADC is used for current measurements. There are multiple
peripherals to the IADC and the scope of the driver is to provide interface
for the USR peripheral of the IADC.
IADC node
Required properties:
- compatible : should be "qcom,qpnp-iadc" for Current ADC driver.
- reg : offset and length of the PMIC Aribter register map.
- address-cells : Must be one.
- size-cells : Must be zero.
- interrupts : The USR bank peripheral IADC interrupt.
- interrupt-names : Should contain "eoc-int-en-set".
- qcom,adc-bit-resolution : Bit resolution of the ADC.
- qcom,adc-vdd-reference : Voltage reference used by the ADC.
Optional properties:
- qcom,rsense : Use this property when external rsense should be used
for current calculation and specify the units in nano-ohms.
- qcom,iadc-poll-eoc: Use polling instead of interrupts for End of Conversion completion.
Channel node
NOTE: Atleast one Channel node is required.
Required properties:
- label : Channel name used for sysfs entry.
- reg : AMUX channel number.
- qcom,channel-num : Channel number associated to the AMUX input.
- 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.
- qcom,calibration-type : Calibration point values vary with temperature.
For improved accuracy fresh gain and offset point values
can be used for calibration. Reading fresh values for ever
read affects the reading time. Application can use the historic
values used from the trim register values.
Select from the following strings.
"absolute" : Uses TRIM gain and offset values for calibration.
"ratiometric" : Calculate the gain and offset calibration value when an ADC
request is issued.
- 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 the following unsigned int.
0 : 1
1 : 2
2 : 4
3 : 8
4 : 16
5 : 32
6 : 64
7 : 128
8 : 256
Example:
/* Main Node */
qcom,iadc@3200 {
compatible = "qcom,qpnp-iadc";
reg = <0x3200 0x100>;
#address-cells = <1>;
#size-cells = <0>;
interrupts = <0 0x36 0>;
interrupt-names = "eoc-int-en-set";
qcom,adc-bit-resolution = <16>;
qcom,adc-vdd-reference = <1800>;
qcom,rsense = <1500>;
/* Channel Node */
chan@0 = {
label = "rsense";
reg = <0>;
qcom,decimation = <0>;
qcom,pre-div-channel-scaling = <20>;
qcom,calibration-type = "fresh";
qcom,scale-function = <0>;
qcom,hw-settle-time = <0>;
qcom,fast-avg-setup = <0>;
};
};
@@ -0,0 +1,146 @@
Qualcomm's QPNP PMIC Voltage ADC Arbiter
QPNP PMIC Voltage ADC (VADC) provides interface to clients to read
Voltage. A 15 bit ADC is used for Voltage measurements. There are multiple
peripherals to the VADC and the scope of the driver is to provide interface
for the USR peripheral of the VADC.
VADC node
Required properties:
- compatible : should be "qcom,qpnp-vadc" for Voltage ADC driver.
- reg : offset and length of the PMIC Aribter register map.
- address-cells : Must be one.
- size-cells : Must be zero.
- interrupts : The USR bank peripheral VADC interrupt.
- interrupt-names : Should contain "eoc-int-en-set".
- qcom,adc-bit-resolution : Bit resolution of the ADC.
- qcom,adc-vdd-reference : Voltage reference used by the ADC.
Channel nodes
NOTE: Atleast one Channel node is required.
Optional properties:
- qcom,vadc-poll-eoc: Use polling instead of interrupts for End of Conversion completion.
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 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. Some of the AMUX channels
support dividing the signal from a predetermined
ratio. The configuration for this node is to know
the pre-determined ratio and use it for post scaling.
Select from the following unsinged int.
0 : {1, 1}
1 : {1, 3}
2 : {1, 4}
3 : {1, 6}
4 : {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 function 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 degC for 100k pull-up.
3 : Returns current across 0.1 ohm resistor.
4 : Returns XO thermistor voltage in degree's Centigrade.
5 : Returns result in degC for 150k pull-up.
- 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 the following unsigned int.
0 : 1
1 : 2
2 : 4
3 : 8
4 : 16
5 : 32
6 : 64
7 : 128
8 : 256
Example:
/* Main Node */
qcom,vadc@3100 {
compatible = "qcom,qpnp-vadc";
reg = <0x3100 0x100>;
#address-cells = <1>;
#size-cells = <0>;
interrupts = <0x0 0x31 0x0>;
interrupt-names = "eoc-int-en-set";
qcom,adc-bit-resolution = <15>;
qcom,adc-vdd-reference = <1800>;
/* Channel Node */
chan@0 {
label = "usb_in";
reg = <0>;
qcom,decimation = <0>;
qcom,pre-div-channel-scaling = <4>;
qcom,calibration-type = "absolute";
qcom,scale-function = <0>;
qcom,hw-settle-time = <0>;
qcom,fast-avg-setup = <0>;
};
};
/* Clients have an option of measuring an analog signal through an MPP.
MPP block is not part of the VADC block but is an individual PMIC
block that has an option to support clients to configure an MPP as
an analog input which can be routed through one of the VADC pre-mux
inputs. Here is an example of how to configure an MPP as an analog
input */
/* Configure MPP4 as an Analog input to AMUX8 and read from channel 0x23 */
/* MPP DT configuration in the platform DT file*/
mpp@a300 { /* MPP 4 */
qcom,mode = <4>; /* AIN input */
qcom,invert = <1>; /* Enable MPP */
qcom,ain-route = <3>; /* AMUX 8 */
qcom,master-en = <1>;
qcom,src-sel = <0>; /* Function constant */
};
/* VADC Channel configuration */
chan@23 {
label = "mpp4_div3";
reg = <0x23>;
qcom,decimation = <0>;
qcom,pre-div-channel-scaling = <1>;
qcom,calibration-type = "absolute";
qcom,scale-function = <0>;
qcom,hw-settle-time = <0>;
qcom,fast-avg-setup = <0>;
};