···11+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)22+%YAML 1.233+---44+$id: http://devicetree.org/schemas/iio/adc/qcom,spmi-adc5-gen3.yaml#55+$schema: http://devicetree.org/meta-schemas/core.yaml#66+77+title: Qualcomm's SPMI PMIC ADC5 Gen388+99+maintainers:1010+ - Jishnu Prakash <jishnu.prakash@oss.qualcomm.com>1111+1212+description: |1313+ SPMI PMIC5 Gen3 voltage ADC (ADC) provides interface to clients to read1414+ voltage. It is a 16-bit sigma-delta ADC. It also performs the same thermal1515+ monitoring function as the existing ADC_TM devices.1616+1717+ The interface is implemented on SDAM (Shared Direct Access Memory) peripherals1818+ on the master PMIC rather than a dedicated ADC peripheral. The number of PMIC1919+ SDAM peripherals allocated for ADC is not correlated with the PMIC used, it is2020+ programmed in FW (PBS) and is fixed per SOC, based on the SOC requirements.2121+ All boards using a particular (SOC + master PMIC) combination will have the2222+ same number of ADC SDAMs supported on that PMIC.2323+2424+properties:2525+ compatible:2626+ const: qcom,spmi-adc5-gen32727+2828+ reg:2929+ items:3030+ - description: SDAM0 base address in the SPMI PMIC register map3131+ - description: SDAM1 base address3232+ minItems: 13333+3434+ "#address-cells":3535+ const: 13636+3737+ "#size-cells":3838+ const: 03939+4040+ "#io-channel-cells":4141+ const: 14242+4343+ "#thermal-sensor-cells":4444+ const: 14545+4646+ interrupts:4747+ items:4848+ - description: SDAM0 end of conversion (EOC) interrupt4949+ - description: SDAM1 EOC interrupt5050+ minItems: 15151+5252+patternProperties:5353+ "^channel@[0-9a-f]+$":5454+ type: object5555+ unevaluatedProperties: false5656+ $ref: /schemas/iio/adc/qcom,spmi-vadc-common.yaml5757+ description:5858+ Represents the external channels which are connected to the ADC.5959+6060+ properties:6161+ qcom,decimation:6262+ enum: [ 85, 340, 1360 ]6363+ default: 13606464+6565+ qcom,hw-settle-time:6666+ enum: [ 15, 100, 200, 300, 400, 500, 600, 700,6767+ 1000, 2000, 4000, 8000, 16000, 32000, 64000, 128000 ]6868+ default: 156969+7070+ qcom,avg-samples:7171+ enum: [ 1, 2, 4, 8, 16 ]7272+ default: 17373+7474+ qcom,adc-tm:7575+ description:7676+ ADC_TM is a threshold monitoring feature in HW which can be enabled7777+ on any ADC channel, to trigger an IRQ for threshold violation. In7878+ earlier ADC generations, it was implemented in a separate device7979+ (documented in Documentation/devicetree/bindings/thermal/qcom-spmi-adc-tm5.yaml.)8080+ In Gen3, this feature can be enabled in the same ADC device for any8181+ channel and threshold monitoring and IRQ triggering are handled in FW8282+ (PBS) instead of another dedicated HW block.8383+ This property indicates ADC_TM monitoring is done on this channel.8484+ type: boolean8585+8686+required:8787+ - compatible8888+ - reg8989+ - "#address-cells"9090+ - "#size-cells"9191+ - "#io-channel-cells"9292+ - interrupts9393+9494+additionalProperties: false9595+9696+examples:9797+ - |9898+ #include <dt-bindings/interrupt-controller/irq.h>9999+100100+ pmic {101101+ #address-cells = <1>;102102+ #size-cells = <0>;103103+104104+ adc@9000 {105105+ compatible = "qcom,spmi-adc5-gen3";106106+ reg = <0x9000>, <0x9100>;107107+ interrupts = <0x0 0x90 0x1 IRQ_TYPE_EDGE_RISING>,108108+ <0x0 0x91 0x1 IRQ_TYPE_EDGE_RISING>;109109+ #address-cells = <1>;110110+ #size-cells = <0>;111111+ #io-channel-cells = <1>;112112+ #thermal-sensor-cells = <1>;113113+114114+ /* PMK8550 Channel nodes */115115+ channel@3 {116116+ reg = <0x3>;117117+ label = "pmk8550_die_temp";118118+ qcom,pre-scaling = <1 1>;119119+ };120120+121121+ channel@44 {122122+ reg = <0x44>;123123+ label = "pmk8550_xo_therm";124124+ qcom,pre-scaling = <1 1>;125125+ qcom,ratiometric;126126+ qcom,hw-settle-time = <200>;127127+ qcom,adc-tm;128128+ };129129+130130+ /* PM8550 Channel nodes */131131+ channel@103 {132132+ reg = <0x103>;133133+ label = "pm8550_die_temp";134134+ qcom,pre-scaling = <1 1>;135135+ };136136+137137+ /* PM8550B Channel nodes */138138+ channel@78f {139139+ reg = <0x78f>;140140+ label = "pm8550b_vbat_sns_qbg";141141+ qcom,pre-scaling = <1 3>;142142+ };143143+144144+ /* PM8550VS_C Channel nodes */145145+ channel@203 {146146+ reg = <0x203>;147147+ label = "pm8550vs_c_die_temp";148148+ qcom,pre-scaling = <1 1>;149149+ };150150+ };151151+ };
···11+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)22+%YAML 1.233+---44+$id: http://devicetree.org/schemas/iio/adc/qcom,spmi-vadc-common.yaml#55+$schema: http://devicetree.org/meta-schemas/core.yaml#66+77+title: Qualcomm Technologies, Inc. SPMI PMIC ADC channels88+99+maintainers:1010+ - Jishnu Prakash <jishnu.prakash@oss.qualcomm.com>1111+1212+description:1313+ This defines the common properties used to define Qualcomm VADC channels.1414+1515+properties:1616+ reg:1717+ description:1818+ ADC channel number (PMIC-specific for versions after PMIC5 ADC).1919+ maxItems: 12020+2121+ label:2222+ description:2323+ ADC input of the platform as seen in the schematics.2424+ For thermistor inputs connected to generic AMUX or GPIO inputs2525+ these can vary across platform for the same pins. Hence select2626+ the platform schematics name for this channel.2727+2828+ qcom,decimation:2929+ $ref: /schemas/types.yaml#/definitions/uint323030+ description:3131+ This parameter is used to decrease ADC sampling rate.3232+ Quicker measurements can be made by reducing decimation ratio.3333+3434+ qcom,pre-scaling:3535+ $ref: /schemas/types.yaml#/definitions/uint32-array3636+ description:3737+ Used for scaling the channel input signal before the signal is3838+ fed to VADC. The configuration for this node is to know the3939+ pre-determined ratio and use it for post scaling. It is a pair of4040+ integers, denoting the numerator and denominator of the fraction by which4141+ input signal is multiplied. For example, <1 3> indicates the signal is scaled4242+ down to 1/3 of its value before ADC measurement.4343+ If property is not found default value depending on chip will be used.4444+ oneOf:4545+ - items:4646+ - const: 14747+ - enum: [ 1, 3, 4, 6, 20, 8, 10, 16 ]4848+ - items:4949+ - const: 105050+ - const: 815151+5252+ qcom,ratiometric:5353+ type: boolean5454+ description: |5555+ Channel calibration type.5656+ - For compatible property "qcom,spmi-vadc", if this property is5757+ specified VADC will use the VDD reference (1.8V) and GND for5858+ channel calibration. If property is not found, channel will be5959+ calibrated with 0.625V and 1.25V reference channels, also6060+ known as absolute calibration.6161+ - For other compatible properties, if this property is specified6262+ VADC will use the VDD reference (1.875V) and GND for channel6363+ calibration. If property is not found, channel will be calibrated6464+ with 0V and 1.25V reference channels, also known as absolute calibration.6565+6666+ qcom,hw-settle-time:6767+ $ref: /schemas/types.yaml#/definitions/uint326868+ description: |6969+ Time between AMUX getting configured and the ADC starting7070+ conversion. The 'hw_settle_time' is an index used from valid values7171+ and programmed in hardware to achieve the hardware settling delay.7272+7373+ qcom,avg-samples:7474+ $ref: /schemas/types.yaml#/definitions/uint327575+ description: |7676+ Number of samples to be used for measurement.7777+ Averaging provides the option to obtain a single measurement7878+ from the ADC that is an average of multiple samples. The value7979+ selected is 2^(value).8080+8181+required:8282+ - reg8383+8484+additionalProperties: true
···1515 voltage. The VADC is a 15-bit sigma-delta ADC.1616 SPMI PMIC5/PMIC7 voltage ADC (ADC) provides interface to clients to read1717 voltage. The VADC is a 16-bit sigma-delta ADC.1818+ Note that PMIC7 ADC is the generation between PMIC5 and PMIC5 Gen3 ADC,1919+ it can be considered like PMIC5 Gen2.18201921properties:2022 compatible:···5856patternProperties:5957 "^channel@[0-9a-f]+$":6058 type: object6161- additionalProperties: false5959+ unevaluatedProperties: false6260 description: |6361 Represents the external channels which are connected to the ADC.6462 For compatible property "qcom,spmi-vadc" following channels, also known as···6664 configuration nodes should be defined:6765 VADC_REF_625MV and/or VADC_SPARE1(based on PMIC version) VADC_REF_1250MV,6866 VADC_GND_REF and VADC_VDD_VADC.6969-7070- properties:7171- reg:7272- maxItems: 17373- description: |7474- ADC channel number.7575- See include/dt-bindings/iio/qcom,spmi-vadc.h7676- For PMIC7 ADC, the channel numbers are specified separately per PMIC7777- in the PMIC-specific files in include/dt-bindings/iio/.7878-7979- label:8080- description: |8181- ADC input of the platform as seen in the schematics.8282- For thermistor inputs connected to generic AMUX or GPIO inputs8383- these can vary across platform for the same pins. Hence select8484- the platform schematics name for this channel.8585-8686- qcom,decimation:8787- $ref: /schemas/types.yaml#/definitions/uint328888- description: |8989- This parameter is used to decrease ADC sampling rate.9090- Quicker measurements can be made by reducing decimation ratio.9191-9292- qcom,pre-scaling:9393- description: |9494- Used for scaling the channel input signal before the signal is9595- fed to VADC. The configuration for this node is to know the9696- pre-determined ratio and use it for post scaling. It is a pair of9797- integers, denoting the numerator and denominator of the fraction by which9898- input signal is multiplied. For example, <1 3> indicates the signal is scaled9999- down to 1/3 of its value before ADC measurement.100100- If property is not found default value depending on chip will be used.101101- $ref: /schemas/types.yaml#/definitions/uint32-array102102- oneOf:103103- - items:104104- - const: 1105105- - enum: [ 1, 3, 4, 6, 20, 8, 10, 16 ]106106- - items:107107- - const: 10108108- - const: 81109109-110110- qcom,ratiometric:111111- description: |112112- Channel calibration type.113113- - For compatible property "qcom,spmi-vadc", if this property is114114- specified VADC will use the VDD reference (1.8V) and GND for115115- channel calibration. If property is not found, channel will be116116- calibrated with 0.625V and 1.25V reference channels, also117117- known as absolute calibration.118118- - For compatible property "qcom,spmi-adc5", "qcom,spmi-adc7" and119119- "qcom,spmi-adc-rev2", if this property is specified VADC will use120120- the VDD reference (1.875V) and GND for channel calibration. If121121- property is not found, channel will be calibrated with 0V and 1.25V122122- reference channels, also known as absolute calibration.123123- type: boolean124124-125125- qcom,hw-settle-time:126126- $ref: /schemas/types.yaml#/definitions/uint32127127- description: |128128- Time between AMUX getting configured and the ADC starting129129- conversion. The 'hw_settle_time' is an index used from valid values130130- and programmed in hardware to achieve the hardware settling delay.131131-132132- qcom,avg-samples:133133- $ref: /schemas/types.yaml#/definitions/uint32134134- description: |135135- Number of samples to be used for measurement.136136- Averaging provides the option to obtain a single measurement137137- from the ADC that is an average of multiple samples. The value138138- selected is 2^(value).139139-140140- required:141141- - reg6767+ $ref: /schemas/iio/adc/qcom,spmi-vadc-common.yaml1426814369allOf:14470 - if:
···13661366 To compile this driver as a module, choose M here: the module will13671367 be called qcom-spmi-adc5.1368136813691369+config QCOM_SPMI_ADC5_GEN313701370+ tristate "Qualcomm Technologies Inc. SPMI PMIC5 GEN3 ADC"13711371+ depends on SPMI && THERMAL13721372+ select REGMAP_SPMI13731373+ select QCOM_VADC_COMMON13741374+ select AUXILIARY_BUS13751375+ help13761376+ IIO Voltage PMIC5 Gen3 ADC driver for Qualcomm Technologies Inc.13771377+13781378+ The driver supports reading multiple channels. The ADC is a 16-bit13791379+ sigma-delta ADC. The hardware supports calibrated results for13801380+ conversion requests and clients include reading phone power supply13811381+ voltage, on board system thermistors connected to the PMIC ADC,13821382+ PMIC die temperature, charger temperature, battery current, USB13831383+ voltage input and voltage signals connected to supported PMIC GPIO13841384+ pins. The hardware supports internal pull-up for thermistors and can13851385+ choose between a 30k, 100k or 400k ohm pull up using the ADC channels.13861386+13871387+ In addition, the same driver supports ADC thermal monitoring devices13881388+ too. They appear as thermal zones with multiple trip points. A thermal13891389+ client sets threshold temperature for both warm and cool trips and13901390+ gets updated when a threshold is reached.13911391+13921392+ To compile this driver as a module, choose M here: the module will13931393+ be called qcom-spmi-adc5-gen3.13941394+13691395config RCAR_GYRO_ADC13701396 tristate "Renesas R-Car GyroADC driver"13711397 depends on ARCH_RCAR_GEN2 || COMPILE_TEST