mirror of
https://github.com/armbian/linux.git
synced 2026-01-06 10:13:00 -08:00
iio: iadc: Qualcomm SPMI PMIC current ADC driver
The current ADC is peripheral of Qualcomm SPMI PMIC chips. It has 16 bits resolution and register space inside PMIC accessible across SPMI bus. The driver registers itself through IIO interface. Signed-off-by: Ivan T. Ivanov <iivanov@mm-sol.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
This commit is contained in:
committed by
Jonathan Cameron
parent
e0922e5e3c
commit
ce0694841e
46
Documentation/devicetree/bindings/iio/adc/qcom,spmi-iadc.txt
Normal file
46
Documentation/devicetree/bindings/iio/adc/qcom,spmi-iadc.txt
Normal file
@@ -0,0 +1,46 @@
|
||||
Qualcomm's SPMI PMIC current ADC
|
||||
|
||||
QPNP PMIC current ADC (IADC) provides interface to clients to read current.
|
||||
A 16 bit ADC is used for current measurements. IADC can measure the current
|
||||
through an external resistor (channel 1) or internal (built-in) resistor
|
||||
(channel 0). When using an external resistor it is to be described by
|
||||
qcom,external-resistor-micro-ohms property.
|
||||
|
||||
IADC node:
|
||||
|
||||
- compatible:
|
||||
Usage: required
|
||||
Value type: <string>
|
||||
Definition: Should contain "qcom,spmi-iadc".
|
||||
|
||||
- reg:
|
||||
Usage: required
|
||||
Value type: <prop-encoded-array>
|
||||
Definition: IADC base address and length in the SPMI PMIC register map
|
||||
|
||||
- interrupts:
|
||||
Usage: optional
|
||||
Value type: <prop-encoded-array>
|
||||
Definition: End of ADC conversion.
|
||||
|
||||
- qcom,external-resistor-micro-ohms:
|
||||
Usage: optional
|
||||
Value type: <u32>
|
||||
Definition: Sense resister value in micro Ohm.
|
||||
If not defined value of 10000 micro Ohms will be used.
|
||||
|
||||
Example:
|
||||
/* IADC node */
|
||||
pmic_iadc: iadc@3600 {
|
||||
compatible = "qcom,spmi-iadc";
|
||||
reg = <0x3600 0x100>;
|
||||
interrupts = <0x0 0x36 0x0 IRQ_TYPE_EDGE_RISING>;
|
||||
qcom,external-resistor-micro-ohms = <10000>;
|
||||
#io-channel-cells = <1>;
|
||||
};
|
||||
|
||||
/* IIO client node */
|
||||
bat {
|
||||
io-channels = <&pmic_iadc 0>;
|
||||
io-channel-names = "iadc";
|
||||
};
|
||||
@@ -206,6 +206,20 @@ config NAU7802
|
||||
To compile this driver as a module, choose M here: the
|
||||
module will be called nau7802.
|
||||
|
||||
config QCOM_SPMI_IADC
|
||||
tristate "Qualcomm SPMI PMIC current ADC"
|
||||
depends on SPMI
|
||||
select REGMAP_SPMI
|
||||
help
|
||||
This is the IIO Current ADC driver for Qualcomm QPNP IADC Chip.
|
||||
|
||||
The driver supports single mode operation to read from one of two
|
||||
channels (external or internal). Hardware have additional
|
||||
channels internally used for gain and offset calibration.
|
||||
|
||||
To compile this driver as a module, choose M here: the module will
|
||||
be called qcom-spmi-iadc.
|
||||
|
||||
config ROCKCHIP_SARADC
|
||||
tristate "Rockchip SARADC driver"
|
||||
depends on ARCH_ROCKCHIP || (ARM && COMPILE_TEST)
|
||||
|
||||
@@ -22,6 +22,7 @@ obj-$(CONFIG_MCP320X) += mcp320x.o
|
||||
obj-$(CONFIG_MCP3422) += mcp3422.o
|
||||
obj-$(CONFIG_MEN_Z188_ADC) += men_z188_adc.o
|
||||
obj-$(CONFIG_NAU7802) += nau7802.o
|
||||
obj-$(CONFIG_QCOM_SPMI_IADC) += qcom-spmi-iadc.o
|
||||
obj-$(CONFIG_ROCKCHIP_SARADC) += rockchip_saradc.o
|
||||
obj-$(CONFIG_TI_ADC081C) += ti-adc081c.o
|
||||
obj-$(CONFIG_TI_ADC128S052) += ti-adc128s052.o
|
||||
|
||||
595
drivers/iio/adc/qcom-spmi-iadc.c
Normal file
595
drivers/iio/adc/qcom-spmi-iadc.c
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user