Re: Reading ADC that comes from a multiplexer

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Peter,

On Wed, Sep 22, 2021 at 9:53 AM Peter Rosin <peda@xxxxxxxxxx> wrote:

> I think that's because the "parent" channel (i.e. <&adc 4> in your case)
> is referring to a node that is not providing any iio channels at all.
>
> Just because you added "#io-channel-cells = <1>;" to that node, does not
> make it so. The driver has to support it as well.

I tried to use the same approach as in arch/arm/boot/dts/am5729-beagleboneai.dts
as per your suggestion:

--- a/arch/arm/boot/dts/imx6qdl-apalis.dtsi
+++ b/arch/arm/boot/dts/imx6qdl-apalis.dtsi
@@ -139,6 +139,23 @@
                spdif-out;
                status = "disabled";
        };
+
+       adcmux: mux-controller {
+               compatible = "gpio-mux";
+               #mux-control-cells = <0>;
+               mux-gpios = <&gpio3 31 GPIO_ACTIVE_HIGH>,
+                           <&gpio3 30 GPIO_ACTIVE_HIGH>,
+                           <&gpio3 26 GPIO_ACTIVE_HIGH>;
+       };
+
+       adc-mux {
+               compatible = "io-channel-mux";
+               io-channels = <&adc0 4>;
+               io-channel-names = "parent";
+               mux-controls = <&adcmux>;
+               channels = "chan0", "chan1", "chan2", "chan3",
+                           "chan4", "chan5", "chan6", "chan7";
+       };
 };

 &audmux {
@@ -362,6 +379,11 @@
                        compatible = "st,stmpe-adc";
                        /* forbid to use ADC channels 3-0 (touch) */
                        st,norequest-mask = <0x0F>;
+                       adc0: iio-device {
+                               #io-channel-cells = <1>;
+                               iio-channels = <&adc0 4>, <&adc0 5>,
<&adc0 6>, <&adc0 7>;
+                               iio-channel-names = "adc4", "adc5",
"adc6", "adc7";
+                       };
                };
        };
 };

but still the parent channel cannot be found.

So I don't have the DT properly describing the ADC to the mux relationship yet.

Thanks for your patience,

Fabio Estevam



[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Input]     [Linux Kernel]     [Linux SCSI]     [X.org]

  Powered by Linux