AnsweredAssumed Answered

AD5669-1 "Invalid argument" when reading/writing _scale sysfs attributes

Question asked by beOn on Jul 5, 2015
Latest reply on Jul 22, 2015 by beOn

I'm using an AD5669 DAC (AD5669RARUZ-1), and am having an issue reading/writing some of the sysfs attributes. I can read and write all of the _powerdown and _powerdown_mode attributes, but can only read the _raw attributes (and they're always int16 max), and can neither read nor write the _scale attributes. See below.

root@benpi1:/sys/bus/i2c/devices/0-0056/iio:device0# ls -l

total 0

-r--r--r-- 1 root root 4096 Jul  5 18:19 dev

-r--r--r-- 1 root root 4096 Jul  5 18:19 name

-rw-r--r-- 1 root root 4096 Jul  5 18:19 out_voltage0_powerdown

-rw-r--r-- 1 root root 4096 Jul  5 18:19 out_voltage0_powerdown_mode

-rw-r--r-- 1 root root 4096 Jul  5 18:19 out_voltage0_raw

-rw-r--r-- 1 root root 4096 Jul  5 18:19 out_voltage0_scale

-rw-r--r-- 1 root root 4096 Jul  5 18:19 out_voltage1_powerdown

-rw-r--r-- 1 root root 4096 Jul  5 18:19 out_voltage1_powerdown_mode

-rw-r--r-- 1 root root 4096 Jul  5 18:19 out_voltage1_raw

-rw-r--r-- 1 root root 4096 Jul  5 18:19 out_voltage1_scale

-rw-r--r-- 1 root root 4096 Jul  5 18:19 out_voltage2_powerdown

-rw-r--r-- 1 root root 4096 Jul  5 18:19 out_voltage2_powerdown_mode

-rw-r--r-- 1 root root 4096 Jul  5 18:19 out_voltage2_raw

-rw-r--r-- 1 root root 4096 Jul  5 18:19 out_voltage2_scale

-rw-r--r-- 1 root root 4096 Jul  5 18:19 out_voltage3_powerdown

-rw-r--r-- 1 root root 4096 Jul  5 18:19 out_voltage3_powerdown_mode

-rw-r--r-- 1 root root 4096 Jul  5 18:19 out_voltage3_raw

-rw-r--r-- 1 root root 4096 Jul  5 18:19 out_voltage3_scale

-rw-r--r-- 1 root root 4096 Jul  5 18:19 out_voltage4_powerdown

-rw-r--r-- 1 root root 4096 Jul  5 18:19 out_voltage4_powerdown_mode

-rw-r--r-- 1 root root 4096 Jul  5 18:19 out_voltage4_raw

-rw-r--r-- 1 root root 4096 Jul  5 18:19 out_voltage4_scale

-rw-r--r-- 1 root root 4096 Jul  5 18:19 out_voltage5_powerdown

-rw-r--r-- 1 root root 4096 Jul  5 18:19 out_voltage5_powerdown_mode

-rw-r--r-- 1 root root 4096 Jul  5 18:19 out_voltage5_raw

-rw-r--r-- 1 root root 4096 Jul  5 18:19 out_voltage5_scale

-rw-r--r-- 1 root root 4096 Jul  5 18:19 out_voltage6_powerdown

-rw-r--r-- 1 root root 4096 Jul  5 18:19 out_voltage6_powerdown_mode

-rw-r--r-- 1 root root 4096 Jul  5 18:19 out_voltage6_raw

-rw-r--r-- 1 root root 4096 Jul  5 18:19 out_voltage6_scale

-rw-r--r-- 1 root root 4096 Jul  5 18:19 out_voltage7_powerdown

-rw-r--r-- 1 root root 4096 Jul  5 18:19 out_voltage7_powerdown_mode

-rw-r--r-- 1 root root 4096 Jul  5 18:19 out_voltage7_raw

-rw-r--r-- 1 root root 4096 Jul  5 18:19 out_voltage7_scale

-r--r--r-- 1 root root 4096 Jul  5 18:19 out_voltage_powerdown_mode_available

lrwxrwxrwx 1 root root    0 Jul  5 18:19 subsystem -> ../../../../../../bus/iio

-rw-r--r-- 1 root root 4096 Jul  5 18:19 uevent

root@benpi1:/sys/bus/i2c/devices/0-0056/iio:device0# cat out_voltage0_powerdown

0

root@benpi1:/sys/bus/i2c/devices/0-0056/iio:device0# echo 1 > out_voltage0_powerdown

root@benpi1:/sys/bus/i2c/devices/0-0056/iio:device0# cat out_voltage0_powerdown

1

root@benpi1:/sys/bus/i2c/devices/0-0056/iio:device0# echo 0 > out_voltage0_powerdown

root@benpi1:/sys/bus/i2c/devices/0-0056/iio:device0# cat out_voltage0_powerdown

0

root@benpi1:/sys/bus/i2c/devices/0-0056/iio:device0# cat out_voltage0_raw

32768

root@benpi1:/sys/bus/i2c/devices/0-0056/iio:device0# echo 0 > out_voltage0_raw

root@benpi1:/sys/bus/i2c/devices/0-0056/iio:device0# cat out_voltage0_raw

32768

root@benpi1:/sys/bus/i2c/devices/0-0056/iio:device0# cat out_voltage0_scale

cat: out_voltage0_scale: Invalid argument

root@benpi1:/sys/bus/i2c/devices/0-0056/iio:device0# echo '.01' > out_voltage0_scale

bash: echo: write error: Invalid argument

 

Anyone seen this before, or have any immediate suspicions?

 

LDAC is tied to GND, CLR is not connected to anything.

 

The kernel was checked out on 3/30/2015. libiio was checkout out and rebuilt last night.

 

If if import iio in python and instantiate a context, I can find the device and its channels. Oddly, each of the channels has 'enabled'==False, and while setting enabled = True doesn't thrown an error, it also doesn't change the property value. Not sure if this actually reflects useful information.

 

Ben

Outcomes