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

Commit 9f00f5ec authored by Siddartha Mohanadoss's avatar Siddartha Mohanadoss
Browse files

iio: adc: Add RRADC driver snapshot



Round robin ADC (RRADC) driver is used on PMI
to read ADC for supported channels such as
battery ID, thermistors.

This snapshot is taken as of msm-4.4
'commit <4f1f60e00d6a> ("Merge "ARM: dts:
msm: add nt35597 sharp panel node for sdm660"")'.

Change-Id: I9d28a58a2f4f1a05d8e99d54d73f33c3542f5a86
Signed-off-by: default avatarSiddartha Mohanadoss <smohanad@codeaurora.org>
parent 4311e981
Loading
Loading
Loading
Loading
+63 −0
Original line number Diff line number Diff line
Qualcomm Technologies Inc., PMIC Round Robin ADC (RRADC)

PMIC RRADC provides an interface to the clients to read
the voltage, current and temperature for supported channels
such as battery ID, battery thermistor, die temperature,
charger temperature, USB_IN and DC_IN voltage and current.

Main node properties:

- compatible:
    Usage: required
    Value type: <string>
    Definition: Should contain "qcom,rradc".

- reg:
    Usage: required
    Value type: <prop-encoded-array>
    Definition: RRADC base address and length in the PMIC register map.

- #address-cells:
    Usage: required
    Value type: <u32>
    Definition: Must be one. Child node 'channel' property should define ADC
            channel number. For details about IIO bindings see:
            Documentation/devicetree/bindings/iio/iio-bindings.txt

- #size-cells:
    Usage: required
    Value type: <u32>
    Definition: Must be zero. For details about IIO bindings see:
            Documentation/devicetree/bindings/iio/iio-bindings.txt

- #io-channel-cells:
    Usage: required
    Value type: <u32>
    Definition: Must be one. For details about IIO bindings see:
            Documentation/devicetree/bindings/iio/iio-bindings.txt

IIO client nodes need to specify the RRADC channel number while requesting ADC reads.
The channel list supported by the RRADC driver is available in the enum rradc_channel_id
located at at drivers/iio/adc/qcom-rradc.c. Clients can use this index from the enum
as the channel number while requesting ADC reads.

Optional property:
- qcom,pmic-revid : Phandle pointing to the revision peripheral node. Use it to query the
		    PMIC fabrication ID for applying the appropriate temperature
		    compensation parameters.
Example:

	/* RRADC node */
	pmic_rradc: rradc@4500 {
		compatible = "qcom,rradc";
		reg = <0x4500 0x100>;
		#address-cells = <1>;
		#size-cells = <0>;
		#io-channel-cells = <1>;
	};

	/* IIO client node */
	charger {
		io-channels = <&pmic_rradc 0>;
		io-channel-names = "rradc_batt_id";
	};
+15 −0
Original line number Diff line number Diff line
@@ -417,6 +417,21 @@ config QCOM_TADC
	  die temperature, battery voltage, battery current, input voltage,
	  input current, and OTG current.

config QCOM_RRADC
	tristate "Qualcomm Technologies Inc. PMIC Round robin ADC"
	depends on SPMI
	select REGMAP_SPMI
	help
	  This is the PMIC Round Robin ADC driver.

	  The driver supports multiple channels read used for telemetry
	  and supports clients to read batt_id, batt_therm, PMIC die
	  temperature, USB_IN and DC_IN voltage and current.
	  The RRADC is a 10-bit ADC.

	  To compile this driver as a module, choose M here: the module will
	  be called qcom-rradc.

config ROCKCHIP_SARADC
	tristate "Rockchip SARADC driver"
	depends on ARCH_ROCKCHIP || (ARM && COMPILE_TEST)
+1 −0
Original line number Diff line number Diff line
@@ -40,6 +40,7 @@ obj-$(CONFIG_PALMAS_GPADC) += palmas_gpadc.o
obj-$(CONFIG_QCOM_SPMI_IADC) += qcom-spmi-iadc.o
obj-$(CONFIG_QCOM_SPMI_VADC) += qcom-spmi-vadc.o
obj-$(CONFIG_QCOM_TADC) += qcom-tadc.o
obj-$(CONFIG_QCOM_RRADC) += qcom-rradc.o
obj-$(CONFIG_ROCKCHIP_SARADC) += rockchip_saradc.o
obj-$(CONFIG_STX104) += stx104.o
obj-$(CONFIG_TI_ADC081C) += ti-adc081c.o
+998 −0

File added.

Preview size limit exceeded, changes collapsed.