staging:iio:dac:ad5446: Fix 24bit transfers
authorLars-Peter Clausen <lars@metafoo.de>
Wed, 25 Apr 2012 07:44:54 +0000 (09:44 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 25 Apr 2012 17:57:19 +0000 (10:57 -0700)
commitaf836d9a38aec16a99c9c9bee114111db8b9e8df
treea49cd57a77090802404f2f12bf110fcf6f6a3041
parent5ff6a99d7c6c804c3b58608e8a476f4d7fd2dfd8
staging:iio:dac:ad5446: Fix 24bit transfers

We currently only write 16 bit in case where we should write 24 bit. The spi message
length is calculated from the channel storage_size, but since the storage size
is only 16 bit we end up with the wrong value for devices which have power down
bits and thus a register with 24 bit. Since each store function knows how many
bytes it has to write just use the spi_write function from there instead of
going through the hassle of manually preparing a spi_message and keeping buffers
in the state struct.

Another advantage of this patch is that it will make implementing support for
similar I2C based DACs much easier.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/iio/dac/ad5446.c
drivers/staging/iio/dac/ad5446.h