Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b86f8e4e authored by Jishnu Prakash's avatar Jishnu Prakash
Browse files

dt-bindings: thermal: Add ADC_TM documentation for PMIC7

ADC_TM is used by clients to set voltage or temperature thresholds
on channels supported by VADC peripheral. Clients can receive
notification once set thresholds are crossed.

Change-Id: Iff8f897600acb087ec0718f53134c8570a5a440f
parent 376fb74e
Loading
Loading
Loading
Loading
+159 −0
Original line number Original line Diff line number Diff line
Qualcomm Technologies, Inc. PMIC thermal monitor ADC device (ADC_TM)

PMIC thermal monitoring (TM) provides interface to kernel clients (mostly
thermal) to set voltage/temperature thresholds and receive notification
when the thresholds are crossed. A 16 bit ADC is used for measurements.

ADC_TM node

- compatible:
    Usage: required
    Value type: <string>
    Definition: Should contain "qcom,adc-tm5" or "qcom,adc-tm5-iio" for PMIC5 ADC TM device.
            Should contain "qcom,adc-tm7" or "qcom,adc-tm5-iio" for PMIC7 ADC TM device.

- reg:
    Usage: required
    Value type: <u32>
    Definition: ADC_TM base address in the SPMI PMIC register map.

- #address-cells:
    Usage: required
    Value type: <u32>
    Definition: Must be one. Child node 'reg' property should define ADC
            channel number.

- #size-cells:
    Usage: required
    Value type: <u32>
    Definition: Must be zero.

- interrupts:
    Usage: required
    Value type: <prop-encoded-array>
    Definition: Threshold violation interrupt.

- interrupt-names:
    Usage: required
    Value type: <string>
    Definition: Should contain "threshold".

- #thermal-sensor-cells:
    Usage: optional
    Value type: <u32>
    Definition: Should be 1. See thermal.txt for a description.

- io-channels:
    Usage: Required
    Value type: <phandle u32>
    Definition: Array of tuples of VADC phandle and ADC channel number,
            one for each ADC_TM channel node defined.

Channel node properties:

- reg:
    Usage: required
    Value type: <u32>
    Definition: ADC virtual channel number, made by combining SID of
            PMIC having the channel and actual ADC channel number.
            See files in include/dt-bindings/iio/.

- qcom,decimation:
    Usage: optional
    Value type: <u32>
    Definition: This parameter is used to decrease ADC sampling rate.
            Quicker measurements can be made by reducing decimation ratio.
            For PMIC7 ADC, combined two step decimation values are 85, 340 and 1360.
            If property is not found, default value of 1360 will be used.

- qcom,avg-samples:
    Usage: optional
    Value type: <u32>
    Definition: Number of samples to be used for measurement.
            Averaging provides the option to obtain a single measurement
            from the ADC that is an average of multiple samples.
            Valid values are: 1, 2, 4, 8, 16
            If property is not found, 1 sample will be used.

- qcom,prescaling:
    Usage: optional
    Value type: <u32>
    Definition: Used for non-thermal clients, to indicate the factor by which
            the channel input signal has been scaled down before the signal is
            fed to VADC. The configuration for this node is to know the
            pre-determined ratio and use it to calculate ADC raw code for the
            threshold specified by the client.
            Valid values are: 1, 3, 6, 16
            If property is not found default value of 1 will be used.

- qcom,kernel-client:
    Usage: optional
    Value type: <empty>
    Definition: Used to indicate if the client for this channel is not the
            thermal framework. Non-thermal clients use a different set of
            APIs to configure their channels. In addition, the reverse scaling function
            needs to be specified for them. If property is not found, channel will be
            considered as thermal by default.

- qcom,scale-type:
    Usage: optional
    Value type: <u32>
    Definition: Reverse scaling function used to convert raw ADC code to units
            specific to a given channel.
            Select from the following unsigned int.
            0 : Scaling to convert voltage in uV to raw adc code.

- qcom,ratiometric:
    Usage: optional
    Value type: <empty>
    Definition: Channel calibration type. If this property is specified
            VADC will use the VDD reference (1.875V) and GND for channel
            calibration. If property is not found, channel will be
            calibrated with 0V and 1.25V reference channels, also
            known as absolute calibration.

- qcom,hw-settle-time:
    Usage: optional
    Value type: <u32>
    Definition: Time in microseconds between AMUX getting configured and the ADC
            starting conversion.
            Valid values are: 15, 100, 200, 300, 400, 500, 600, 700, 1000,
            2000, 4000, 8000, 16000, 32000, 64000, 128000 us.
            If property is not found, channel will use 15us.

Example:

        pmic_adc_tm: adc_tm@3400 {
                compatible = "qcom,adc-tm7";
                reg = <0x3400>;
                interrupts = <0x0 0x34 0x0 IRQ_TYPE_EDGE_RISING>;
                interrupt-names = "threshold";
                #address-cells = <1>;
                #size-cells = <0>;
                #thermal-sensor-cells = <1>;
                io-channels = <&pmic_vadc PMK8350_ADC7_AMUX_THM1_100K_PU>;

                /* Channel node */
                skin_msm_therm {
                        reg = <PMK8350_ADC7_AMUX_THM1_100K_PU>;
                        qcom,ratiometric;
                        qcom,hw-settle-time = <200>;
                };
        };

        /* Thermal zone corresponding to the ADC_TM channel */
        &thermal_zones {
                skin-msm-therm-usr {
                        polling-delay-passive = <0>;
                        polling-delay = <0>;
                        thermal-governor = "user_space";
                        thermal-sensors = <&pmic_adc_tm PMK8350_ADC7_AMUX_THM1_100K_PU>;
                        trips {
                                active-config0 {
                                        temperature = <125000>;
                                        hysteresis = <1000>;
                                        type = "passive";
                                };
                        };
                };
        };