Re: Reading ADC that comes from a multiplexer

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

 



On Wed, Sep 22, 2021 at 8:37 AM Fabio Estevam <festevam@xxxxxxxxx> wrote:
>
> Hi Peter,
>
> On Wed, Sep 22, 2021 at 4:27 AM Peter Rosin <peda@xxxxxxxxxx> wrote:
>
> > Basically, the whole point is that you simply don't. The iio-mux exposes
> > the channels as 8 new ADCs, and whenever you read a value from one of
> > them, the iio-mux operates the gpios for you, giving you the impression
> > that you have 8 independet ADCs. They are of course not independent, but...
>
> Thanks for the clarification. It was helpful.
>
> > That's exposed to user-space as:
> >
> > $ ls "/sys/bus/iio/devices/iio:device3"
> > in_altvoltage2_compare_interval  in_altvoltage5_scale
> > in_altvoltage2_invert            in_altvoltage6_compare_interval
> > in_altvoltage2_raw               in_altvoltage6_invert
> > in_altvoltage2_scale             in_altvoltage6_raw
> > in_altvoltage3_compare_interval  in_altvoltage6_scale
> > in_altvoltage3_invert            in_altvoltage7_compare_interval
> > in_altvoltage3_raw               in_altvoltage7_invert
> > in_altvoltage3_scale             in_altvoltage7_raw
> > in_altvoltage4_compare_interval  in_altvoltage7_scale
> > in_altvoltage4_invert            name
> > in_altvoltage4_raw               of_node
> > in_altvoltage4_scale             power
> > in_altvoltage5_compare_interval  subsystem
> > in_altvoltage5_invert            uevent
> > in_altvoltage5_raw
> > $ cat "/sys/bus/iio/devices/iio:device3/name"
> > envelope-detector-mux
>
> Ah, so that's my issue then. I don't see a new device inside
> /sys/bus/iio/devices/.
>
> I only see the original stmpe ADC:
>
> ls "/sys/bus/iio/devices/iio:device0"
> dev              in_voltage5_raw  in_voltage_scale  power
> in_temp8_input   in_voltage6_raw  name              subsystem
> in_voltage4_raw  in_voltage7_raw  of_node           uevent
>
> Maybe my dts is not correct to make the mux appear under
> /sys/bus/iio/devices/iio:device1.

Just realized that iio-mux.c does not get probed.

In mux_probe():

parent = devm_iio_channel_get(dev, "parent");

is always returning -EPROBE_DEFER, even though I passed:

        io-channel-names = "parent";



[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