Linux IIO development
 help / color / mirror / Atom feed
* AD7192 driver mess
@ 2023-03-29 10:46 Paul Cercueil
  2023-03-30  8:44 ` Jonathan Cameron
  0 siblings, 1 reply; 2+ messages in thread
From: Paul Cercueil @ 2023-03-29 10:46 UTC (permalink / raw)
  To: Jonathan Cameron; +Cc: linux-iio

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

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

end of thread, other threads:[~2023-03-30  8:45 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-03-29 10:46 AD7192 driver mess Paul Cercueil
2023-03-30  8:44 ` Jonathan Cameron

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox