Skip to content

Commit

Permalink
staging:iio:magnetometer Add IIO_CHAN_INFO_RAW entries to all drivers.
Browse files Browse the repository at this point in the history
Precursor to making value read / write attribute optional.
No processed values for magnetometers.

Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Acked-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Jonathan Cameron authored and Greg Kroah-Hartman committed Apr 18, 2012
1 parent 90354d0 commit 4d9948b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
5 changes: 3 additions & 2 deletions drivers/staging/iio/magnetometer/ak8975.c
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,7 @@ static int ak8975_read_raw(struct iio_dev *indio_dev,
struct ak8975_data *data = iio_priv(indio_dev);

switch (mask) {
case 0:
case IIO_CHAN_INFO_RAW:
return ak8975_read_axis(indio_dev, chan->address, val);
case IIO_CHAN_INFO_SCALE:
*val = data->raw_to_gauss[chan->address];
Expand All @@ -443,7 +443,8 @@ static int ak8975_read_raw(struct iio_dev *indio_dev,
.type = IIO_MAGN, \
.modified = 1, \
.channel2 = IIO_MOD_##axis, \
.info_mask = IIO_CHAN_INFO_SCALE_SEPARATE_BIT, \
.info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT | \
IIO_CHAN_INFO_SCALE_SEPARATE_BIT, \
.address = index, \
}

Expand Down
5 changes: 3 additions & 2 deletions drivers/staging/iio/magnetometer/hmc5843.c
Original file line number Diff line number Diff line change
Expand Up @@ -459,7 +459,7 @@ static int hmc5843_read_raw(struct iio_dev *indio_dev,
struct hmc5843_data *data = iio_priv(indio_dev);

switch (mask) {
case 0:
case IIO_CHAN_INFO_RAW:
return hmc5843_read_measurement(indio_dev,
chan->address,
val);
Expand All @@ -476,7 +476,8 @@ static int hmc5843_read_raw(struct iio_dev *indio_dev,
.type = IIO_MAGN, \
.modified = 1, \
.channel2 = IIO_MOD_##axis, \
.info_mask = IIO_CHAN_INFO_SCALE_SHARED_BIT, \
.info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT | \
IIO_CHAN_INFO_SCALE_SHARED_BIT, \
.address = add \
}

Expand Down

0 comments on commit 4d9948b

Please sign in to comment.