Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 363970
b: refs/heads/master
c: ff3fc8e
h: refs/heads/master
v: v3
  • Loading branch information
Jin Feng authored and Jonathan Cameron committed Apr 9, 2013
1 parent d055642 commit c969abc
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 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: 9f16778c5d0a32f264812a9bf1602b71613720b8
refs/heads/master: ff3fc8eb470ff0e47466c291148a30f958d6691d
11 changes: 9 additions & 2 deletions trunk/drivers/staging/iio/iio_simple_dummy.c
Original file line number Diff line number Diff line change
Expand Up @@ -166,11 +166,12 @@ static const struct iio_chan_spec iio_dummy_channels[] = {
.channel2 = IIO_MOD_X,
.info_mask_separate = BIT(IIO_CHAN_INFO_RAW) |
/*
* Internal bias correction value. Applied
* Internal bias and gain correction values. Applied
* by the hardware or driver prior to userspace
* seeing the readings. Typically part of hardware
* calibration.
*/
BIT(IIO_CHAN_INFO_CALIBSCALE) |
BIT(IIO_CHAN_INFO_CALIBBIAS),
.scan_index = accelx,
.scan_type = { /* Description of storage in buffer */
Expand Down Expand Up @@ -311,7 +312,7 @@ static int iio_dummy_write_raw(struct iio_dev *indio_dev,
st->dac_val = val;
mutex_unlock(&st->lock);
return 0;
case IIO_CHAN_INFO_CALIBBIAS:
case IIO_CHAN_INFO_CALIBSCALE:
mutex_lock(&st->lock);
/* Compare against table - hard matching here */
for (i = 0; i < ARRAY_SIZE(dummy_scales); i++)
Expand All @@ -324,6 +325,12 @@ static int iio_dummy_write_raw(struct iio_dev *indio_dev,
st->accel_calibscale = &dummy_scales[i];
mutex_unlock(&st->lock);
return ret;
case IIO_CHAN_INFO_CALIBBIAS:
mutex_lock(&st->lock);
st->accel_calibbias = val;
mutex_unlock(&st->lock);
return 0;

default:
return -EINVAL;
}
Expand Down

0 comments on commit c969abc

Please sign in to comment.