Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 281389
b: refs/heads/master
c: 90b9b22
h: refs/heads/master
i:
  281387: 3e6e502
v: v3
  • Loading branch information
Michael Hennerich authored and Greg Kroah-Hartman committed Dec 16, 2011
1 parent 5ced2bf commit 4d9b190
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 70fe742c94d4d5e7763c3f864f13c0e907ac3d48
refs/heads/master: 90b9b2276bdc1a3cdff881a71a652683f6a5d58f
24 changes: 20 additions & 4 deletions trunk/drivers/staging/iio/gyro/adxrs450_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ static int adxrs450_read_raw(struct iio_dev *indio_dev,
{
int ret;
s16 t;
u16 ut;

switch (mask) {
case 0:
switch (chan->type) {
Expand All @@ -276,17 +276,31 @@ static int adxrs450_read_raw(struct iio_dev *indio_dev,
break;
case IIO_TEMP:
ret = adxrs450_spi_read_reg_16(indio_dev,
ADXRS450_TEMP1, &ut);
ADXRS450_TEMP1, &t);
if (ret)
break;
*val = ut;
*val = (t >> 6) + 225;
ret = IIO_VAL_INT;
break;
default:
ret = -EINVAL;
break;
}
break;
case IIO_CHAN_INFO_SCALE:
switch (chan->type) {
case IIO_ANGL_VEL:
*val = 0;
*val2 = 218166;
return IIO_VAL_INT_PLUS_NANO;
case IIO_TEMP:
*val = 200;
*val2 = 0;
return IIO_VAL_INT;
default:
return -EINVAL;
}
break;
case IIO_CHAN_INFO_QUADRATURE_CORRECTION_RAW:
ret = adxrs450_spi_read_reg_16(indio_dev, ADXRS450_QUAD1, &t);
if (ret)
Expand All @@ -308,11 +322,13 @@ static const struct iio_chan_spec adxrs450_channels[] = {
.modified = 1,
.channel2 = IIO_MOD_Z,
.info_mask = IIO_CHAN_INFO_CALIBBIAS_SEPARATE_BIT |
IIO_CHAN_INFO_QUADRATURE_CORRECTION_RAW_SEPARATE_BIT,
IIO_CHAN_INFO_QUADRATURE_CORRECTION_RAW_SEPARATE_BIT |
IIO_CHAN_INFO_SCALE_SEPARATE_BIT,
}, {
.type = IIO_TEMP,
.indexed = 1,
.channel = 0,
.info_mask = IIO_CHAN_INFO_SCALE_SEPARATE_BIT,
}
};

Expand Down

0 comments on commit 4d9b190

Please sign in to comment.