staging:iio:dac:ad5638: Fix channel address
authorLars-Peter Clausen <lars@metafoo.de>
Fri, 7 Oct 2011 08:31:42 +0000 (10:31 +0200)
committerGreg Kroah-Hartman <gregkh@suse.de>
Tue, 11 Oct 2011 15:58:59 +0000 (09:58 -0600)
commita45186c0cdd35e6b79aeeff6e535c5d5c20ac93d
tree3902d0fd669938c79ceafaf5f82b13f2ee06f5c4
parent638e59fc8c867b44dfbe20c235df00384814cb5e
staging:iio:dac:ad5638: Fix channel address

Commit c6fc806247 ("staging:iio: ABI rework - add in_ or out_ prefix to
channnels") added the AD5868_CHANNEL macro to simplify channel initialization.
Unfortunately the macro hardcodes the channel's address to AD5686_ADDR_DAC0. As
a result writing to any of the channels will change the value of the first
channel.

This patch fixes the issue by calculating the channel address based on the
channel number.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/staging/iio/dac/ad5686.c