AD7192 driver mess

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

 



Hi Jonathan,

I noticed that the upstream AD7192 driver (drivers/iio/adc/ad7192.c) we
have two IIO channels with the same identifier:

AD719x_SHORTED_CHANNEL(3, 2, AD7192_CH_AIN2P_AIN2M)

and:
AD719x_CHANNEL(5, 2, AD7192_CH_AIN2)

Both macros create a iio_chan_spec with .channel = 2.

This results in having this mess in sysfs:
in_voltage2_en
in_voltage2_index
in_voltage2_shorted_en
in_voltage2_shorted_index

In turn, this causes Libiio to detect it as a single IIO channel whose
identifier is "in_voltage2", with attributes "en", "index",
"shorted_en" and "shorted_index".

My question is, is it okay for the driver to do this? I would expect
the .channel field to contain an identifier, and it would be invalid
for two channels to have the same identifier.

Cheers,
-Paul




[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