All of lore.kernel.org
 help / color / mirror / Atom feed
* Reading ADC that comes from a multiplexer
@ 2021-09-22  2:18 Fabio Estevam
  2021-09-22  7:27 ` Peter Rosin
  0 siblings, 1 reply; 13+ messages in thread
From: Fabio Estevam @ 2021-09-22  2:18 UTC (permalink / raw)
  To: Peter Rosin; +Cc: linux-iio

Hi Peter,

I have a SN74LV4051 multiplexer that is controlled by 3 GPIOs and I
described like this in DT:

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 = <&adc 4>;
       io-channel-names = "parent";
       mux-controls = <&adcmux>;
       channels = "chan0", "chan1", "chan2", "chan3",
                         "chan4", "chan5", "chan6", "chan7";
};

/sys/class/mux/muxchip0/ is created:

# ls /sys/class/mux/muxchip0/
device  of_node  power  subsystem  uevent

Sorry for the trivial question, but I haven't found any examples.

What is the userspace command if I want to expose "chan3" to be read
by the ADC 4 channel?

Thanks,

Fabio Estevam

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2021-09-25 14:29 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-22  2:18 Reading ADC that comes from a multiplexer Fabio Estevam
2021-09-22  7:27 ` Peter Rosin
2021-09-22 11:37   ` Fabio Estevam
2021-09-22 12:44     ` Fabio Estevam
2021-09-22 12:53       ` Peter Rosin
2021-09-22 13:41         ` Fabio Estevam
2021-09-22 14:20           ` Fabio Estevam
2021-09-22 14:28             ` Peter Rosin
2021-09-22 14:50               ` Fabio Estevam
2021-09-23 10:28                 ` Jonathan Cameron
2021-09-24 14:41                   ` Fabio Estevam
2021-09-25 14:32                     ` Jonathan Cameron
2021-09-22 12:44     ` Peter Rosin

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.