All of lore.kernel.org
 help / color / mirror / Atom feed
From: Fabio Estevam <festevam@gmail.com>
To: Peter Rosin <peda@axentia.se>
Cc: linux-iio@vger.kernel.org
Subject: Reading ADC that comes from a multiplexer
Date: Tue, 21 Sep 2021 23:18:02 -0300	[thread overview]
Message-ID: <CAOMZO5Cwdn_-to8G+RvVUbG+UkYM7+budUsvWVLeY7PutoO2Mw@mail.gmail.com> (raw)

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

             reply	other threads:[~2021-09-22  2:18 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-22  2:18 Fabio Estevam [this message]
2021-09-22  7:27 ` Reading ADC that comes from a multiplexer 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAOMZO5Cwdn_-to8G+RvVUbG+UkYM7+budUsvWVLeY7PutoO2Mw@mail.gmail.com \
    --to=festevam@gmail.com \
    --cc=linux-iio@vger.kernel.org \
    --cc=peda@axentia.se \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.