summaryrefslogtreecommitdiffstats
path: root/kernel/drivers/iio/dac
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/drivers/iio/dac')
-rw-r--r--kernel/drivers/iio/dac/ad5624r_spi.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/kernel/drivers/iio/dac/ad5624r_spi.c b/kernel/drivers/iio/dac/ad5624r_spi.c
index 61bb9d423..e98428df0 100644
--- a/kernel/drivers/iio/dac/ad5624r_spi.c
+++ b/kernel/drivers/iio/dac/ad5624r_spi.c
@@ -22,7 +22,7 @@
#include "ad5624r.h"
static int ad5624r_spi_write(struct spi_device *spi,
- u8 cmd, u8 addr, u16 val, u8 len)
+ u8 cmd, u8 addr, u16 val, u8 shift)
{
u32 data;
u8 msg[3];
@@ -35,7 +35,7 @@ static int ad5624r_spi_write(struct spi_device *spi,
* 14-, 12-bit input code followed by 0, 2, or 4 don't care bits,
* for the AD5664R, AD5644R, and AD5624R, respectively.
*/
- data = (0 << 22) | (cmd << 19) | (addr << 16) | (val << (16 - len));
+ data = (0 << 22) | (cmd << 19) | (addr << 16) | (val << shift);
msg[0] = data >> 16;
msg[1] = data >> 8;
msg[2] = data;