diff options
author | Ziyuan Xu <xzy.xu@rock-chips.com> | 2018-12-24 21:25:26 +0800 |
---|---|---|
committer | Tao Huang <huangtao@rock-chips.com> | 2018-12-27 12:03:53 +0800 |
commit | 6df92b2b23603a772cb7e586ee1525ed291ee23b (patch) | |
tree | 598f6389da3e537ade3727b0d3bfb4de6108edf1 /Documentation | |
parent | 94cb450ab0816524eda3de58c80a157a29679771 (diff) |
iio: adc: support GPIO-controlled Multiplexers ADC
The rockchip saradc controller is too scanty for some products that is
requires at least x10 channels ADC. Generally, we can use a CMOS analog
switch to extend a multi-channel ADC, eg.sgm3699. It's a quad,
bidirectional, single-pole/double-throw (SPDT) CMOS analog siwtch.
This patch implements a multiplexer ADC controller using a number of
gpio pins and parent ADC channel. It's compatible with most of CMOS
analog switch. And it provides a direct mode to get a raw data of each
muxadc channel.
/sys/bus/iio/devices/iio:device1/
|-- in_voltage_adc_brush_raw
|-- in_voltage_adc_mid_brush_raw
|-- in_voltage_adc_move_l_raw
|-- in_voltage_adc_move_r_raw
|-- in_voltage_qyxs_raw
|-- in_voltage_qzxs_raw
|-- in_voltage_yxs_raw
|-- in_voltage_zxs_raw
Change-Id: If71636d45543430e616299e6a6b91084f4f315e6
Signed-off-by: Ziyuan Xu <xzy.xu@rock-chips.com>
Diffstat (limited to 'Documentation')
-rw-r--r-- | Documentation/devicetree/bindings/iio/adc/gpio-muxadc.txt | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/Documentation/devicetree/bindings/iio/adc/gpio-muxadc.txt b/Documentation/devicetree/bindings/iio/adc/gpio-muxadc.txt new file mode 100644 index 000000000000..f02502f8ab39 --- /dev/null +++ b/Documentation/devicetree/bindings/iio/adc/gpio-muxadc.txt @@ -0,0 +1,24 @@ +GPIO-controlled Multiplexers (MUX) A/D Converter bindings + +Required properties: +- compatible: should be "gpio-muxadc" or others like below + - "sgm3699": for a quad, bidirectional, single-pole/double-throw (SPDT) CMOS analog switch. + - "sgm48752": for a dual, bidirectional, double-pole/double-throw (DPDT) CMOS analog switch. +- io-channels: Channel node of the parent channel that has multiplexed input. +- switch-gpios: Digital control pins to connect the parent adc channel(saradc) to the input adc channel(muxadc). +- labels: The string list for each muxadc channel that should be placed in order. + +Example: + muxadc { + compatible = "sgm48752"; + io-channels = <&saradc 4>, <&saradc 5>; + switch-gpios = <&gpio1 RK_PA0 GPIO_ACTIVE_HIGH>, + <&gpio1 RK_PA1 GPIO_ACTIVE_HIGH>; + labels = "wheel_vpropi_r_adc", "wheel_vpropi_l_adc", + "fan_opa_adc", "mid_opa_adc", + "pump_opa_adc", "side_opa_adc", + "dc24vdet_adc", "collision_det_adc_lidar"; + pinctrl-names = "default"; + pinctrl-0 = <&switch_gpios>; + status = "okay"; + }; |