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: Re: Reading ADC that comes from a multiplexer
Date: Wed, 22 Sep 2021 11:50:14 -0300	[thread overview]
Message-ID: <CAOMZO5AQk4zkgwk9ALkaasFv6t68K-bO6roki1tcdgnyk0wuTg@mail.gmail.com> (raw)
In-Reply-To: <ee5d8cf0-591f-7296-28a8-d78159f5d6a2@axentia.se>

Hi Peter,

On Wed, Sep 22, 2021 at 11:28 AM Peter Rosin <peda@axentia.se> wrote:

> Nice!
>
> While I don't completely understand that iio-device node in the beaglebone
> dts that didn't work for you, it looks like it's just a renumbering thing?

The beaglebone dts uses some undocumented properties such as:
iio-channels and iio-channel-names.

> However, your version only remapped 4 channels, and in that case your new
> iio-device only had those, i.e. 0-3. But the iio-mux was looking for the
> missing channel 4. Maybe that was why that variant didn't work?

Yes, this is where I got confused.

The stmpe811 has 8 channels. On the apalis board, the first four channels
(0 to 3) are used for touchscreen. The other 4 channels are for general purpose.

The ADC that is connected to the MUX is channel 4 (which is the first
one that is
free for general usage), so I had to pass:

io-channels = <&adc0 0>;

in the mux, instead of  io-channels = <&adc0 4> that I was originally trying.

and now the mapping is correct and I can read proper voltages when I
switch the mux.

Thanks!

  reply	other threads:[~2021-09-22 14:52 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
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=CAOMZO5AQk4zkgwk9ALkaasFv6t68K-bO6roki1tcdgnyk0wuTg@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.